From b1220b6e4ef6a3bc1db8bb1e908340322028c980 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Fri, 21 Mar 2025 10:26:28 +0100 Subject: [PATCH] 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/-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/-usr and where to find our profiles by setting ROOT (and SYSROOT, because it must match ROOT) to /. --- build_library/toolchain_util.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build_library/toolchain_util.sh b/build_library/toolchain_util.sh index cdab619339..8960a37483 100644 --- a/build_library/toolchain_util.sh +++ b/build_library/toolchain_util.sh @@ -284,7 +284,11 @@ _configure_sysroot() { "${sudo[@]}" mkdir -p "${ROOT}/etc/portage/"{profile,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/-usr, but set ROOT to /, so eselect will + # actually find the profile which is outside /build/-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 coreos_path=$(portageq get_repo_path "${ROOT}" coreos-overlay)