All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Jansa <martin.jansa@gmail.com>
To: "Guenzel, Robert" <Robert.Guenzel@windriver.com>
Cc: "yocto@yoctoproject.org" <yocto@yoctoproject.org>
Subject: Re: Documentation on WORKDIR
Date: Fri, 29 Nov 2013 14:41:27 +0100	[thread overview]
Message-ID: <20131129134127.GA2860@jama> (raw)
In-Reply-To: <D6170FF7C32A6B4A895BCD8D281C7934A6D74693@ALA-MBA.corp.ad.wrs.com>

[-- Attachment #1: Type: text/plain, Size: 2903 bytes --]

On Fri, Nov 29, 2013 at 09:02:47AM +0000, Guenzel, Robert wrote:
> Hello,
> 
> I am currently starting to work with Yocto and I am having a bit of a hard time to figure out how the two documented versions of WORKDIR come into existence.
> 
> The doc states:
> """
> For packages that are not dependent on a particular machine, WORKDIR is defined as follows:
>    ${TMPDIR}/work/${PACKAGE_ARCH}-poky-${TARGET_OS}/${PN}/${PV}-${PR}
> [...]
> For packages that are dependent on a particular machine, WORKDIR is defined slightly different:
>   ${TMPDIR}/work/${MACHINE}-poky-${TARGET_OS}/${PN}/${PV}-${PR}
> """
> 
> Now I tried to figure out how a package becomes machine dependent, and I could not find this.
> After poking around in already existing layers and recipes, I think that the doc is misleading.
> 
> It appears to me that only one version exists, which is:
>   ${TMPDIR}/work/${PACKAGE_ARCH}-poky-${TARGET_OS}/${PN}/${PV}-${PR}

The correct definition is:
bitbake.conf:BASE_WORKDIR ?= "${TMPDIR}/work"
bitbake.conf:WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}"
bitbake.conf:MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}"


> 
> And in case a package is machine specific, one overrides the default PACKAGE_ARCH with (the undocumented)
> variable MACHINE_ARCH like this:
>   PACKAGE_ARCH="${MACHINE_ARCH}"
> (where I believe that MACHINE_ARCH is equal to MACHINE??)

For machines with '-' it isn't.
bitbake.conf:MACHINE_ARCH = "${@[d.getVar('TUNE_PKGARCH', True), d.getVar('MACHINE', True)][bool(d.getVar('MACHINE', True))].replace('-', '_')}"

> Which will then lead to a WORKDIR that looks like ${TMPDIR}/work/${MACHINE}-poky-${TARGET_OS}/${PN}/${PV}-${PR}
> (but still is ${TMPDIR}/work/${PACKAGE_ARCH}-poky-${TARGET_OS}/${PN}/${PV}-${PR}).
> 
> (there are some bbclasses that do this, and there are some recipes that do it).

When the recipe is something MACHINE-specific or depends on something
MACHINE-specific it assigns to PACKAGE_ARCH

PACKAGE_ARCH = "${MACHINE_ARCH}"

In some cases it's done automagically, when you have file://foo in
SRC_URI and foo file is taken from path which contains MACHINE, e.g.
when building pointercal recipe for qemux86, this file will be used:
./recipes-bsp/pointercal/pointercal/qemux86/pointercal
and base.bbclass will detect it and change PACKAGE_ARCH to MACHINE_ARCH
if it isn't already MACHINE_ARCH.

> Being pretty new to Yocto, I have the feeling that I simply got it all wrong, so before posting bugs or something, I'd wanted to know
> if anybody could shed light on this.
> 
> thanks and best regards
>   Robert
> 

> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto


-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

      reply	other threads:[~2013-11-29 13:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-29  9:02 Documentation on WORKDIR Guenzel, Robert
2013-11-29 13:41 ` Martin Jansa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131129134127.GA2860@jama \
    --to=martin.jansa@gmail.com \
    --cc=Robert.Guenzel@windriver.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.