build_library/toolchain_util: Fix setting a profile

Setting a profile in a newly created sysroot when building native
toolchains broke after an eselect update. Apparently eselect gets the
path to the coreos-overlay repository and then prefixes it with
ROOT. Since ROOT was set to /build/<arch>-usr, the resulting patch was
wrong. Fix this by telling eselect where to find our make.profile
symlink in new sysroot by setting PORTAGE_CONFIGROOT to
/build/<arch>-usr and where to find our profiles by setting ROOT (and
SYSROOT, because it must match ROOT) to /.
This commit is contained in:
Krzesimir Nowak 2025-03-21 10:26:28 +01:00
parent 2c15410552
commit b1220b6e4e

View File

@ -284,7 +284,11 @@ _configure_sysroot() {
"${sudo[@]}" mkdir -p "${ROOT}/etc/portage/"{profile,repos.conf} "${sudo[@]}" mkdir -p "${ROOT}/etc/portage/"{profile,repos.conf}
"${sudo[@]}" cp /etc/portage/repos.conf/* "${ROOT}/etc/portage/repos.conf/" "${sudo[@]}" cp /etc/portage/repos.conf/* "${ROOT}/etc/portage/repos.conf/"
"${sudo[@]}" eselect profile set --force "$profile" # set PORTAGE_CONFIGROOT to tell eselect to modify the profile
# inside /build/<arch>-usr, but set ROOT to /, so eselect will
# actually find the profile which is outside /build/<arch>-usr,
# set SYSROOT to / as well, because it must match ROOT
"${sudo[@]}" PORTAGE_CONFIGROOT=${ROOT} SYSROOT=/ ROOT=/ eselect profile set --force "$profile"
local coreos_path local coreos_path
coreos_path=$(portageq get_repo_path "${ROOT}" coreos-overlay) coreos_path=$(portageq get_repo_path "${ROOT}" coreos-overlay)