Over the last few months of 2005 a meme was floated out to the Gentoo community, that installing Gentoo from a pre-packaged stage3 tarball is "better" than the previously supported method of bootstrapping from a stage1 tarball. In spite of the fact that many Gentoo users still prefer (1) the stage1 installation method, support for this installation method has been abandoned (2). The primary reasons for dropping support of the stage1 bootstrapping installation method appear to be that users are too stupid to comprehend it, there is no advantage to using it, it is too buggy, and that it is a waste of time (3).
What is most interesting to me about this discussion is the fact than no one has bothered to offer any facts to back up these assertions. I have never installed gentoo any other way than bootstrapping from a stage1 tarball, so I was very interested in investigating the issues further. I decided to reach my own conclusions by putting it to a test, and quite frankly, I am astonished at just how broken the stage3 install process is. How Gentoo developers can justify stage3 installs as "better" in any way is beyond me. Perhaps they don't eat their own dog food?
To test the claims that there were no advantages to using stage1 installs, I created some automated test scripts. The scripts do a simple task, start with a 2005.1-r1 official release tarball and get it updated to the portage snapshot dated 2006-01-16, utilizing USE flags suitable for a typical Linux/Apache/Mysql/PHP server. The scripts test the two different methods to achieve this - bootstrapping from a stage1 and merely updating a stage3. The scripts automate the steps described in the handbook to perform each installation type.
| Stage1 | Stage3 |
|---|---|
|
|
|
(1)
/etc/{resolv.conf,localtime} and from the host is used in the chroot build
environment, /proc/mounts is copied to the chroot build /etc/mtab, /dev is
bind mounted, proc is mounted within the chroot build environment.
The following settings are created with the chroot build /etc/make.conf: USE="-X -alsa -apm -arts -avi -cups -doc -eds -emboss -gnome -gpm -gstreamer -gtk -gtk2 -imlib -info -ipv6 -kde -mad -man -mikmod -motif -mp3 -mpeg -nls -ogg -oggvorbis -opengl -oss -pam -qt -quicktime -sdl -vorbis -xmms -xv apache2 mysql nptl nptlonly php userlocales" CHOST="i686-pc-linux-gnu" CFLAGS="-O2 -march=pentiumX -pipe -fomit-frame-pointer" FEATURES="-ccache -distcc nodoc noman noinfo"The following /etc/locales.build is created in the chroot build: en_US/ISO-8859-1 en_US.UTF-8/UTF-8(2) A patch is applied to bootstrap.sh which splits the bootstrap into two parts, part 1 installs up to gcc, part 2 resumes after gcc. This allows the user to manully run gcc-config to verify the latest gcc profile is being used, then purge the old gcc. The patch also removes STAGE1_USE from the ENV_EXPORTS on line 273, a bug which prevents the nptl, -nls, and userlocales USE flags from consideration during the bootstrap. (3) The Gentoo Handbook does not mention that a gcc migration is required, nor is there a link on the documentation pages to the gcc migration guide. There are no specific instructions on how to proceed when you have changed USE flags that require the system to be completely rebuilt while simultaneously there is a gcc upgrade in portage. The author experienced an undocumented feature that automatically switched him over to a new binary incompatible gcc during a previous emerge -Du world, in spite of what the published documentation stated. For this reason it is assumed that the new user magically discern the need for the gcc upgrade, divine the location of the migration guide, and correctly follow the "safe" migration procedures. (4) As a result of the -pam USE flag, an emerge -e system shows pam-login as a blocker. For this reason pam-login and pam have to removed before the emerge -e system (undocumented feature). (5) Due to the -gpm and -nls USE flags, Locale-gettext and gpm are reported by emerge --depclean as being unneeded packages. During testing the author purged these before running the emerge -e system and ended up with an unusable build - the ls command quit functioning without libgpm and certain ebuilds/autoconfig/automake requires a functioning ls (undocumented feature). |
|
I ran the stage1/stage3 test builds on several different servers. A side by side
summary of results is listed below. The total build time does not include the
time required to actually fetch package source files, it is the actual time taken
to compile the packages.
| CPU(s) | Memory | Total Emerges | Total Unmerges | Total Build Time | Full Reports |
|---|---|---|---|---|---|
| Intel P4 3GHz (ht) | 2G | 99/226 | 25/50 | 2h 32m 31s/4h 48m 31s | stage1 stage3 |
| Intel P3 1GHz | 256M | 99/226 | 25/50 | 5h 50m 52s/11h 56m 0s | stage1 stage3 |
| PowerMac 7455 1GHz | 128M | 100/225 | 27/54 | 6h 14m 56s/12h 30m 22s | stage1 stage3 |
| Intel PIII 600MHz x 2 | 2G | 99/226 | 25/50 | 10h 11m 17s/20h 45m 19s | stage1 stage3 |
Anyone who claims that there is no advantage to the stage1 bootstrapping method, that it is a waste of time, or that it is too difficult to comprehend is downright delusional.
One developer posted about the real problem in this post to the gentoo-doc mailing list:
NOTE: No Gentoo documentation exists to shed light on modifying the bootstrap.sh script.
3)