Skip to content

Commit b1220b6

Browse files
committed
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 /.
1 parent 2c15410 commit b1220b6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

build_library/toolchain_util.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,11 @@ _configure_sysroot() {
284284

285285
"${sudo[@]}" mkdir -p "${ROOT}/etc/portage/"{profile,repos.conf}
286286
"${sudo[@]}" cp /etc/portage/repos.conf/* "${ROOT}/etc/portage/repos.conf/"
287-
"${sudo[@]}" eselect profile set --force "$profile"
287+
# set PORTAGE_CONFIGROOT to tell eselect to modify the profile
288+
# inside /build/<arch>-usr, but set ROOT to /, so eselect will
289+
# actually find the profile which is outside /build/<arch>-usr,
290+
# set SYSROOT to / as well, because it must match ROOT
291+
"${sudo[@]}" PORTAGE_CONFIGROOT=${ROOT} SYSROOT=/ ROOT=/ eselect profile set --force "$profile"
288292

289293
local coreos_path
290294
coreos_path=$(portageq get_repo_path "${ROOT}" coreos-overlay)

0 commit comments

Comments
 (0)