| 
						
						
							
								
							
						
						
					 | 
					@ -14,7 +14,7 @@ cd live-bootstrap | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					umount target/dev/shm  # double mounted? | 
					 | 
					 | 
					umount target/dev/shm  # double mounted? | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					umount target/dev/shm target/sys target/proc target/tmp | 
					 | 
					 | 
					umount target/dev/shm target/sys target/proc target/tmp | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					# Optional: back up the system | 
					 | 
					 | 
					# Optional: Back up the system | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					env -i chroot target tar --exclude='/external' --sort=name -cf /target.tar / | 
					 | 
					 | 
					env -i chroot target tar --exclude='/external' --sort=name -cf /target.tar / | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					env -i chroot target bzip2 -9v /target.tar | 
					 | 
					 | 
					env -i chroot target bzip2 -9v /target.tar | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					mv target/external/repo . | 
					 | 
					 | 
					mv target/external/repo . | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -187,7 +187,7 @@ cat > /cross/etc/portage/env/sys-devel/gcc << 'EOF' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					EXTRA_ECONF='--with-sysroot=$EPREFIX/usr/$CTARGET --enable-threads' | 
					 | 
					 | 
					EXTRA_ECONF='--with-sysroot=$EPREFIX/usr/$CTARGET --enable-threads' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					EOF | 
					 | 
					 | 
					EOF | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					# TODO: Build sys-libs/glibc in /gentoo instead, to avoid extra rebuilding | 
					 | 
					 | 
					# TODO: Build sys-libs/glibc in /gentoo instead, to avoid extra rebuilding later | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					PORTAGE_CONFIGROOT=/cross EPREFIX=/cross emerge -O1 sys-devel/binutils | 
					 | 
					 | 
					PORTAGE_CONFIGROOT=/cross EPREFIX=/cross emerge -O1 sys-devel/binutils | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					PORTAGE_CONFIGROOT=/cross EPREFIX=/cross USE='headers-only' emerge -O1 sys-kernel/linux-headers | 
					 | 
					 | 
					PORTAGE_CONFIGROOT=/cross EPREFIX=/cross USE='headers-only' emerge -O1 sys-kernel/linux-headers | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					PORTAGE_CONFIGROOT=/cross EPREFIX=/cross USE='headers-only -multilib' emerge -O1 sys-libs/glibc  | 
					 | 
					 | 
					PORTAGE_CONFIGROOT=/cross EPREFIX=/cross USE='headers-only -multilib' emerge -O1 sys-libs/glibc  | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -228,9 +228,9 @@ FEATURES="-news -sandbox -usersandbox -pid-sandbox -parallel-fetch" | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					BINPKG_COMPRESS="bzip2" | 
					 | 
					 | 
					BINPKG_COMPRESS="bzip2" | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					CBUILD="i386-unknown-linux-musl" | 
					 | 
					 | 
					CBUILD="i386-unknown-linux-musl" | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					CHOST="x86_64-bootstrap-linux-gnu" | 
					 | 
					 | 
					CHOST="x86_64-bootstrap-linux-gnu" | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					CFLAGS_x86="$CFLAGS_x86 -msse"  # bug 937637 | 
					 | 
					 | 
					CFLAGS_x86="$CFLAGS_x86 -msse"  # https://bugs.gentoo.org/937637 | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					USE="-* build $BOOTSTRAP_USE -zstd" | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					CONFIG_SITE="$PORTAGE_CONFIGROOT/etc/portage/config.site" | 
					 | 
					 | 
					CONFIG_SITE="$PORTAGE_CONFIGROOT/etc/portage/config.site" | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					USE="-* build $BOOTSTRAP_USE -zstd" | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					EOF | 
					 | 
					 | 
					EOF | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					cat > /gentoo.cfg/etc/portage/config.site << 'EOF' | 
					 | 
					 | 
					cat > /gentoo.cfg/etc/portage/config.site << 'EOF' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					if [ "${CBUILD:-${CHOST}}" != "${CHOST}" ]; then | 
					 | 
					 | 
					if [ "${CBUILD:-${CHOST}}" != "${CHOST}" ]; then | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -293,10 +293,16 @@ ln -sf ../../var/db/repos/gentoo/profiles/default/linux/amd64/23.0 /gentoo/etc/p | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					echo 'nameserver 1.1.1.1' > /gentoo/etc/resolv.conf | 
					 | 
					 | 
					echo 'nameserver 1.1.1.1' > /gentoo/etc/resolv.conf | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					echo 'C.UTF8 UTF-8' > /gentoo/etc/locale.gen | 
					 | 
					 | 
					echo 'C.UTF8 UTF-8' > /gentoo/etc/locale.gen | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					# Copy ::gentoo repo | 
					 | 
					 | 
					# Optional: Back up the system | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					env -i chroot /gentoo tar --sort=name -cf /gentoo.tar / | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					env -i chroot /gentoo bzip2 -9v /gentoo.tar | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					mv /gentoo/gentoo.tar.bz2 / | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					# Copy ::gentoo repo and distfiles | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					rsync -aP /var/db/repos/ /gentoo/var/db/repos | 
					 | 
					 | 
					rsync -aP /var/db/repos/ /gentoo/var/db/repos | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					rsync -aP /var/cache/distfiles/ /gentoo/var/cache/distfiles | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					# This is the point where you have to move from the x86 system to the x86_64 system. | 
					 | 
					 | 
					# This is the point where you have to move from the x86 system to an x86_64 system. | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					# Make sure that you are running a x86_64 kernel before chrooting, or booting it. | 
					 | 
					 | 
					# Make sure that you are running a x86_64 kernel before chrooting, or booting it. | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					cd /gentoo | 
					 | 
					 | 
					cd /gentoo | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -321,7 +327,7 @@ pkgs_build="$(python3 -c 'import portage | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					print(*portage.util.stack_lists([portage.util.grabfile_package("%s/packages.build" % x) for x in portage.settings.profiles], incremental=1))')" | 
					 | 
					 | 
					print(*portage.util.stack_lists([portage.util.grabfile_package("%s/packages.build" % x) for x in portage.settings.profiles], incremental=1))')" | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					USE="-* build $(portageq envvar BOOTSTRAP_USE)" CHOST="$(gcc -dumpmachine)" \ | 
					 | 
					 | 
					USE="-* build $(portageq envvar BOOTSTRAP_USE)" CHOST="$(gcc -dumpmachine)" \ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    emerge -1Dn $pkgs_build | 
					 | 
					 | 
					    emerge -1Dn $pkgs_build | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					emerge -c | 
					 | 
					 | 
					emerge -c  # Make sure the dependency tree is consistent | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					# Change CHOST and build OpenMP support (stage2-ish) | 
					 | 
					 | 
					# Change CHOST and build OpenMP support (stage2-ish) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					emerge -1 sys-devel/binutils | 
					 | 
					 | 
					emerge -1 sys-devel/binutils | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -332,4 +338,5 @@ emerge -1 dev-lang/perl  # https://bugs.gentoo.org/937918 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					# Rebuild everything (stage3) | 
					 | 
					 | 
					# Rebuild everything (stage3) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					USE='-filecaps -http2' emerge -e @system | 
					 | 
					 | 
					USE='-filecaps -http2' emerge -e @system | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					emerge -DN @system | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					emerge -c | 
					 | 
					 | 
					emerge -c | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
					 | 
					
  |