public inbox for gentoo-embedded@lists.gentoo.org
 help / color / mirror / Atom feed
From: Joe Harvell <joe.harvell.x@gmail.com>
To: gentoo-embedded@lists.gentoo.org
Subject: [gentoo-embedded] crossdev ROOT and SYSROOT directory confusion
Date: Thu, 9 May 2019 17:24:54 -0600	[thread overview]
Message-ID: <CACG_sdHozqM5amFAdB5=qyGO=LqtZE+ZiRX2JSC9tFK1d4LRFg@mail.gmail.com> (raw)

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

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?

[-- Attachment #2: Type: text/html, Size: 3650 bytes --]

                 reply	other threads:[~2019-05-09 23:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CACG_sdHozqM5amFAdB5=qyGO=LqtZE+ZiRX2JSC9tFK1d4LRFg@mail.gmail.com' \
    --to=joe.harvell.x@gmail.com \
    --cc=gentoo-embedded@lists.gentoo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox