crossdev ROOT and SYSROOT directory confusion

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

crossdev ROOT and SYSROOT directory confusion

Joe Harvell
I have created a toolchain using crossdev and want to use that to create multiple *different* roots for two different hosts of the same target.  Both of these systems (A and B) are going to netboot and mount their root directory read-write from a directory on the build machine.

I want to use only 1 toolchain since both systems are the same architecture.  But they will have different packages installed.  Also, since they are mounting read-write, their root filesystems inlcude system configuration for the respective host.

I do not want build dependencies for any packages installed.  I want any build dependencies installed in the root filesystem of the build machine.

So I want the following different directories:
  1. toolchain directory /usr/<chost>
  2. build machine root (/).  I want DEPEND and BDEPEND packages for both systems A and B to go here
  3. system A PORTAGE_CONFIGROOT
  4. system A  root directory.  System A will mount this read-write over NFS.  I want packages I emerge for system A and their RDEPEND and PDEPEND packages to go here
  5. system B PORTAGE_CONFIGROOT
  6. system B root directory.  System B will mount this read-write over NFS.  I want packages I emerge for system B and their RDEPEND and PDEPEND packages to go here
I have read the documentation for crossdev, portage and also looked at the contents of cross-emerge, cross-pkg-config and many of the ebuilds.  But I am unclear on the correct settings for ROOT and SYSROOT when building for each system.

Based on the documentation, I think I should be setting env variables as follows when building for system A:

  • EPREFIX=
  • PORTAGE_CONFIGROOT=<directory #3 above>
  • CHOST=value used as --target when building toolchain with crossdev
  • CBUILD=x86_64-pc-linux-gnu
  • ROOT=<directory #4 above>
  • SYSROOT=/
  • BROOT=/
and the following when building for system B
  • EPREFIX=
  • PORTAGE_CONFIGROOT=<directory #5 above>
  • CHOST=value used as --target when building toolchain with crossdev
  • CBUILD=x86_64-pc-linux-gnu
  • ROOT=<directory #6 above>
  • SYSROOT=/
  • BROOT=/
I am able to accomplish this with no modifications to cross-emerge by setting environment variables appropriately when envoking <chost>-emerge.

However, I notice a problem with this.  When I look at the contents of cross-pkg-config, I see that it sets PKG_CONFIG_SYSROOT_DIR="${SYSROOT}".  This means if the ebuild invokes <chost>-pkg-config, it will look for their headers and libraries for their rdeps there, which is wrong in my case.  Also, I see there is no way to override the value of this for cross-pkg-config like you can for variables set by cross-emerge.

So it looks like crossdev does not support SYSROOT=/.  Is this intentional? 

Also, what is the difference between DEPEND and BDEPEND?  The descriptions for them in the portage documentation seem like they are describing the same thing.

The embedded handbook mentions a need to run emerge-wrapper --init but it does not say what it does.  Is this documented somewhere?

Do crossdev and the Gentoo ebuilds support what I am trying to accomplish here?