# October 19, 2011
# This has been tested only in chroot, bringing 2006.1-i686-stage3 upto
# a stable x86 system
###########################################################################
# Between the first tar command and the success of 'emerge -uDN system', the
# true state of the system, and the state according to portage are different.
# This is rather unsafe, so be sure you understand what you are doing.
# Consider this your big red warning to backup important files before attempting
# an update, and consider a re-install if possible.
###########################################################################
# First, start with an emerge --sync (assumed)
# Update the symlink to an existing profile
unlink /etc/make.profile
ln -s ../usr/portage/profiles/default/linux/x86/10.0 /etc/make.profile
# Fetch and forcefully upgrade python, bash, gcc, glibc, and portage with
# prebuilt sources
cd /
wget http://tinderbox.dev.gentoo.org/default-linux/x86/app-shells/bash-4.1_p9.tbz2
wget http://tinderbox.dev.gentoo.org/default-linux/x86/dev-lang/python-2.7.1-r1.tbz2
wget http://tinderbox.dev.gentoo.org/default-linux/x86/sys-apps/portage-2.1.10.11.tbz2
wget http://tinderbox.dev.gentoo.org/default-linux/x86/sys-libs/glibc-2.12.2.tbz2
wget http://tinderbox.dev.gentoo.org/default-linux/x86/sys-devel/gcc-4.4.5.tbz2
tar -xf bash-4.1_p9.tbz2
tar -xf python-2.7.1-r1.tbz2
tar -xf portage-2.1.10.11.tbz2
tar -xf glibc-2.12.2.tbz2
tar -xf gcc-4.4.5.tbz2
# Since those links won't work forever, I have downloaded copies of the binpkgs
# and placed them: http://dev.gentoo.org/~darkside/perm/
# manually set python symlink
unlink /usr/bin/python
ln -s python2.7 /usr/bin/python
# See what will be upgraded.
emerge -puDNv system
# Notice the circular deps with gcc/glibc because portage's state is not right.
# turn off sandbox, collision protection, news for now.
export FEATURES="-sandbox -collision-protect -news"
# start getting the portage state consistent again
emerge -v1O gmp mpfr mpc gcc:4.4 # issues with 4.5 for me
gcc-config i686-pc-linux-gnu-4.4.5
source /etc/profile
emerge -v1O glibc
emerge -v1O portage
# Perform the update, this command will likely make good progress, and then fail
emerge -uDN system
############
# Known failures and solutions
############
# Perl-5.12 fails to build because of too old findtuils
emerge -v1O findutils
# continue the upgrade
emerge -uDN system
# Python updater and python split, creating a confilct, resolve by removing
# the old file
rm /usr/sbin/python-updater
emerge -1 python-updater
# continue the upgrade
emerge -uDN system
# setuptools fails to build due to python, but python fails due to libtool
# collision
emerge -C libtool
emerge -v1 libtool
emerge -v1 python
# continue the upgrade
emerge -uDN system
# Cracklib wants -unmerge-orphans but coreutils needs to be upgraded first
# needs acl and attr too
emerge -v1O attr acl coreutils
FEATURES='-unmerge-orphans' emerge -1 cracklib
# continue the upgrade
emerge -uDN system
# continue the upgrade
#emerge -uDN system --skip-first
############
#Cleanup
############
#Update the current terminal
env-update
source /etc/profile
dispatch-conf
# or etc-update
#At this point, the toolchain has been rebuilt, which likely involved an upgrade
#of gcc. Follow http://www.gentoo.org/doc/en/gcc-upgrading.xml to finish the
#upgrade. A lot of what is requested there has likely been done automatically,
#so in summary:
#Check that gcc-config is using the correct compiler, if not, follow the above
#guide
gcc-config -l
#Replace your make.conf/update to whatever profile you choose/etc.
#Rebuild the system with the new toolchain, and custom settings
emerge -eav system
#Rebuild and update world with new toolchain and settings
emerge -eav world
#Finally, remove any old packages which still survived the process
emerge --depclean -a