[bitbake-devel] How to identify WORKDIR?

Martin Jansa martin.jansa at gmail.com
Thu Mar 15 09:21:22 UTC 2012


On Thu, Mar 15, 2012 at 05:09:36PM +0800, Kang Kai wrote:
> On 2012年03月15日 16:03, Martin Jansa wrote:
> > On Thu, Mar 15, 2012 at 03:40:04PM +0800, Kang Kai wrote:
> >> On 2012年03月15日 14:55, Kang Kai wrote:
> >>> On 2012年03月14日 17:42, Richard Purdie wrote:
> >>>> On Wed, 2012-03-14 at 17:01 +0800, Kang Kai wrote:
> >>>>> Hi All,
> >>>>>
> >>>>> I write a script to clean up WORKDIR that remove the obsoleted
> >>>>> packages' build directories.
> >>>>> The script accept a argument as BUILDDIR and I use this clause to
> >>>>> identify the WORKDIR:
> >>>>>
> >>>>>        workdir = os.path.join(builddir, 'tmp/work')
> >>>>>
> >>>>> Then validate the workdir exists or not. It works for me but hardcode
> >>>>> here as Richard point out.
> >>>>> So is there  a better way to get the WORKDIR here? Thanks.
> >>>> I was thinking of something like:
> >>>>
> >>>> bitbake -e | grep ^WORKDIR
> >> And the result is something like that:
> >> WORKDIR="/mnt/sda10/poky-all-platform/build-qemux86_64/tmp/work/x86_64-poky-linux/bblayers-1.0-r0"
> >>
> >> Is it ok to remove 2 items seperated by slash at the end of string?
> >> Right now is:
> >> "/mnt/sda10/poky-all-platform/build-qemux86_64/tmp/work/"
> > Aren't you looking for ^TMPDIR ?
> 
> If use WORKDIR = TMPDIR/"work", it is still hard coding.

Assuming 2 items at the end won't work for people using rm_old_work:
http://git.openembedded.org/meta-micro/commit/?id=fcf525654915edb9650f1a6c2852f336366f8b2f
or slightly different version:
http://git.shr-project.org/git/?p=meta-smartphone.git;a=blob;f=meta-shr/classes/rm_old_work.bbclass

And I think more people have different "tmp/" part e.g. default would be
"tmp-eglibc/" (thanks to TCLIBCAPPEND
meta/conf/distro/defaultsetup.conf:TMPDIR .= "${TCLIBCAPPEND}"), but "work" is 
quite common.

meta/conf/bitbake.conf:
WORKDIR = "${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PF}"
meta-shr/classes/rm_old_work.bbclass:
WORKDIR = "${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${PF}"
meta-micro/classes/rm_old_work.bbclass:
WORKDIR = "${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}"

Cheers,

> 
> >> Regards,
> >> Kai
> >>
> >>> If get WORKDIR in this way, I'll update the script with no argument
> >>> because the argument is useless to identify the WORKDIR.
> >>>
> >>> Regards,
> >>> Kai
> >>>> since you already call into bitbake in the script in question.
> >>>>
> >>>> Cheers,
> >>>>
> >>>> Richard
> >>>>
> >>>>
> >>>
> >>> _______________________________________________
> >>> bitbake-devel mailing list
> >>> bitbake-devel at lists.openembedded.org
> >>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel
> >>
> >> _______________________________________________
> >> bitbake-devel mailing list
> >> bitbake-devel at lists.openembedded.org
> >> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel
> 

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20120315/d9733105/attachment-0001.sig>


More information about the bitbake-devel mailing list