diff options
authorFabian Groffen <>2024-02-24 10:49:39 +0100
committerFabian Groffen <>2024-02-24 10:55:40 +0100
commitca158662df56bb58d15a876ba1141dd7e808a628 (patch)
parentscripts/bootstrap-prefix: add identification in stageX.log files (diff)
scripts/bootstrap-prefix: avoid final emerge -e @systemHEADmaster
Long time ago, when we started bootstraps, all stages were done straight into the destination Prefix, which meant tools could link to the host and/or configured in an odd way where packages would refer to (config) files from the host. To make sure all of that was set straight, the blunt tool emerge -e @system was run as last step to make sure everything came from Portage proper. Today, we bootstrap in early stages in EPREFIX/tmp and even set up a Portage instance there that will use tools that may or may not come from host or be configured to use it. However, it cleanly pulls itself out of the mud by letting Portage install @system in the destination Prefix, thus it compiles every package it needs with the requirements as set out by the ebuilds. Thus there is no need to really recompile everything all over again. It should be fine with a simple recompile of all packages for which USE-flags changed after we lifted some overrides to avoid circular or unnecessary deps. Signed-off-by: Fabian Groffen <>
1 files changed, 12 insertions, 10 deletions
diff --git a/scripts/ b/scripts/
index 349a81876d..0612b7af5d 100755
--- a/scripts/
+++ b/scripts/
@@ -1734,8 +1734,8 @@ do_emerge_pkgs() {
# Disable the STALE warning because the snapshot frequently gets stale.
- # Need need to spam the user about news until the emerge -e system
- # because the tools aren't available to read the news item yet anyway.
+ # No need to spam the user about news until the final emerge @world
+ # because the tools aren't available to read the news items yet anyway.
# Avoid circular deps caused by the default profiles (and IUSE
# defaults).
@@ -2279,9 +2279,10 @@ bootstrap_stage3() {
export USE="-git -crypt -http2"
# Portage should figure out itself what it needs to do, if anything.
- einfo "running emerge -uDNv system"
- estatus "stage3: emerge -uDNv system"
- emerge --color n -uDNv system || return 1
+ eflags="--deep --update --changed-use @system"
+ einfo "running emerge ${eflags}"
+ estatus "stage3: emerge ${eflags}"
+ emerge --color n -v ${eflags} || return 1
# Remove anything that we don't need (compilers most likely)
einfo "running emerge --depclean"
@@ -2931,8 +2932,9 @@ OK! I'm going to give it a try, this is what I have collected sofar:
I'm now going to make an awful lot of noise going through a sequence of
stages to make your box as groovy as I am myself, setting up your
Prefix. In short, I'm going to run stage1, stage2, stage3, followed by
-emerge -e system. If any of these stages fail, both you and me are in
-deep trouble. So let's hope that doesn't happen.
+an emerge to do a finel update to your system. If any of these stages
+fail, both you and me are in deep trouble. So let's hope that doesn't
[[ ${TODO} == 'noninteractive' ]] && ans="" ||
@@ -3088,7 +3090,7 @@ EOF
[[ ${STOP_BOOTSTRAP_AFTER} == stage3 ]] && exit 0
- local cmd="emerge -v -e system"
+ local cmd="emerge -v --deep --update --changed-use @world"
if [[ -e ${EPREFIX}/var/cache/edb/mtimedb ]] && \
grep -q resume "${EPREFIX}"/var/cache/edb/mtimedb ;
@@ -3096,7 +3098,7 @@ EOF
einfo "running ${cmd}"
if ${cmd} ; then
- # Now, after 'emerge -e system', we can get rid of the temporary tools.
+ # Now, we've got everything in $ROOT, we can get rid of /tmp
if [[ -d ${EPREFIX}/tmp/var/tmp ]] ; then
rm -Rf "${EPREFIX}"/tmp || return 1
mkdir -p "${EPREFIX}"/tmp || return 1
@@ -3104,7 +3106,7 @@ EOF
hash -r # tmp/* stuff is removed in stage3
- # emerge -e system fail
+ # emerge @world fail
cat << EOF
Oh yeah, I thought I was almost there, and then this! I did