[oe] $prefix and the $layout_* variables

Richard Purdie richard at openedhand.com
Fri Sep 11 15:59:50 UTC 2009


Going back a while I tried to fix a number of path issues in OE at a
time when we changed the layout of staging. This was when the layout_*
variables came into being, they seemed a good idea at the time and
cleaned up a lot of cruft. They are now however effectively useless.

I think it unlikely OE will ever switch to having a different layout of
staging to that of the target system again due to sysroot so lets
discount that.

These groups of variables define a filesystem layout. We have at least
four areas in OE which may or may not have different layouts:

* native staging
* target staging
* cross staging
* sdk staging

At the moment native == target. sdk is special, not used by many
packages and does insane workarounds and is basically broken (hence a
number of my current problems trying to extend sdk). cross is special
and just hardcoded.

To illustrate the problem consider an SDK installing into SDKPATH which
should be $layout_prefix. When we change $layout_prefix we totally break
PATH since PATH uses $layout_bindir to find native binaries. We
therefore leak path layout information between the different
filesystems.

Very little cross filesystem knowledge is actually needed and I'm
thinking something semi hardcoded but simpler and working would be
better.

The way I'm thinking things could go is:

bitbake.conf:

Set all layout_* variables to * (layout_bindir = "{bindir}")
Remove all layout_ variables ultimately
Change $prefix and friends to the values in $layout_*
Add:

base_bindir_native = "/bin"
base_sbindir_native = "/bin"
bindir_native = "/usr/bin"
sbindir_native = "/usr/sbin"
libdir_native = "/usr/lib"
bindir_cross = "/bin"
includedir_native = "/usr/include"
sysconfdir_native = "/etc"
datadir_native = "/usr/share"

(which are used to remove certain references to layout_* in things like
PATH)

native.bbclass can then become:

# Path prefixes
export base_prefix = "${STAGING_DIR_NATIVE}"
export prefix = "${STAGING_DIR_NATIVE}/usr"
export exec_prefix = "${STAGING_DIR_NATIVE}/usr"

cross and sdk classes similarly.

I'm still experimenting with this but does anyone have any comments?

Yes, it hardcodes some information and native.bbclass needs to match the
*_native definitions but I think we can live with that for the benefits
it brings?

Cheers,

Richard






More information about the Openembedded-devel mailing list