Code: Select all
#!/bin/bash
# Fiordland.sh
# Copyright 2007
# Distributed under the terms of the GNU General Public License v2
# Protect /etc/make.conf as it will be overwritten
cp -f /etc/make.conf /etc/make.conf.build
# Feel free to change CHOST, CFLAGS, and CXXFLAGS to match your arch
# Use -O2 -pipe and, depending on arch -fomit-frame-pointer for this part of the build
# where CHOST and various tool chain (gcc, glibc, binutiils, linux-headers) items will
# likely change from what is on the stage 1 tarball
# ACCEPT_KEYWORDS setting [i]arch[/i] or [i]~arch[/i] depending on your preference
# Everything else should be as showen
cat > /etc/make.conf << "EOF"
CHOST="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe"
CXXFLAGS=${CFLAGS}
ACCEPT_KEYWORDS="~x86"
MAKEOPTS="-j2"
PORTAGE_NICENESS=3
AUTOCLEAN="yes"
FEATURES="distlocks sandbox userpriv usersandbox"
USE="nptl nptlonly bootstrap -fortran"
EOF
emerge --oneshot portage &&
emerge --oneshot --nodeps binutils gcc-config libstdc++-v3 gcc &&
# Make sure that we will be using the correct gcc for the rest of the build
gcc-config -l
echo "Please select the correct compiler for your system. "
read opt
gcc-config $opt
emerge --prune gcc &&
env-update
source /etc/profile
emerge --oneshot --nodeps linux-headers unifdef glibc &&
emerge timezone-data &&
# Set your timezone setting here, this listing show my timezone
rm /etc/localtime
ln -s /usr/share/zoneinfo/CST6CDT /etc/localtime
# Here your CFLAGS and CXXFLAGS should be set to match those in your /etc/make.conf file
cat > /etc/make.conf << "EOF"
CHOST="i686-pc-linux-gnu"
CFLAGS="-O3 -march=pentium4 -fforce-addr -fomit-frame-pointer -ftracer -pipe"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
ACCEPT_KEYWORDS="~x86"
MAKEOPTS="-j2"
PORTAGE_NICENESS=3
AUTOCLEAN="yes"
FEATURES="distlocks sandbox userpriv usersandbox"
USE="nptl nptlonly -fortran -X -tk"
EOF
emerge --oneshot --nodeps =sys-devel/autoconf-2.13 autoconf autoconf-wrapper automake gcc binutils gawk bzip2 gzip diffutils findutils make grep sed gettext gpm ncurses patch tar sys-apps/texinfo bash bash-completion m4 bison flex util-linux gdbm perl &&
emerge --oneshot --nodeps linux-headers unifdef glibc binutils gcc &&
emerge -e --oneshot man-pages coreutils zlib findutils gawk ncurses sys-libs/readline m4 bison less groff sed flex gettext perl sys-apps/texinfo autoconf automake bash file libtool bzip2 diffutils kbd e2fsprogs grep gzip hotplug man make module-init-tools patch procps psmisc shadow sysvinit tar udev util-linux &&
# Restore original /etc/make.conf
cp -f /etc/make.conf.build /etc/make.conf

Code: Select all
emerge list of packagesCode: Select all
emerge -1 list of packagesActually I hadslycordinator wrote:For the packages that are already gonna be in the system profile, shouldn't you change the command fromtoCode: Select all
emerge list of packages
?Code: Select all
emerge -1 list of packages
Because if I put a bunch of packages into my world file that are already in the system profile, I'd end up calculating dependencies for the whole system profile (which would include the packages in question) and then calculate the dependencies of those packages again. Essentially, that would clutter up your world file.
Code: Select all
emerge --oneshot list of packagesCode: Select all
emerge -e systemCode: Select all
emerge -e list of packagesCode: Select all
emerge -e system.
Code: Select all
emerge -1 list of packagesCode: Select all
emerge -e systemCode: Select all
emerge -e system
Yeah, it's not worth enabling global, when it is already applied to the applications that will use it.slycordinator wrote:And this is kinda debatable but some devs (both gentoo and non-gentoo ones) said "-fvisibility-inlines-hidden" shouldn't be in your CXXFLAGS. It's enabled automatically on the packages that actually support that functionality. Then again, you'd be relying on the dev to enable an option you want to support.
Code: Select all
emerge -e systemCode: Select all
emerge -e system
How about adding it to the first post as well since that'll be the first one people will see?warrens wrote:I have put the --oneshot flag back into the script. Now your world file will be clean until you start building your "world".
I am typing this from a fresh install using the script in its current configuration.

Code: Select all
#!/bin/bash
cp -f /etc/make.conf /etc/make.conf.build
cat > /etc/make.conf << "EOF"
CHOST="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe"
CXXFLAGS=${CFLAGS}
ACCEPT_KEYWORDS="~x86"
MAKEOPTS="-j2"
PORTAGE_NICENESS=3
AUTOCLEAN="yes"
FEATURES="distlocks sandbox userpriv usersandbox"
USE="nptl nptlonly bootstrap -fortran"
EOF
emerge --oneshot portage &&
emerge --oneshot --nodeps binutils gcc-config libstdc++-v3 gcc &&
gcc-config -l
echo "Please select the correct compiler for your system. "
read opt
gcc-config $opt
emerge --prune gcc &&
env-update &&
source /etc/profile
emerge --oneshot --nodeps linux-headers unifdef glibc &&
emerge timezone-data &&
rm /etc/localtime
ln -s /usr/share/zoneinfo/CST6CDT /etc/localtime
cat > /etc/make.conf << "EOF"
CHOST="i686-pc-linux-gnu"
CFLAGS="-O3 -march=pentium4 -fforce-addr -fomit-frame-pointer -ftracer -pipe"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
ACCEPT_KEYWORDS="~x86"
MAKEOPTS="-j2"
PORTAGE_NICENESS=3
AUTOCLEAN="yes"
FEATURES="distlocks sandbox userpriv usersandbox"
USE="nptl nptlonly -fortran -X -tk"
EOF
emerge --oneshot --nodeps =sys-devel/autoconf-2.13 autoconf autoconf-wrapper automake gcc binutils gawk bzip2 gzip diffutils findutils make grep sed gettext gpm ncurses patch tar sys-apps/texinfo bash bash-completion m4 bison flex util-linux gdbm perl &&
emerge --oneshot --nodeps linux-headers unifdef glibc binutils gcc &&
emerge -e --oneshot man-pages coreutils zlib findutils gawk ncurses sys-libs/readline m4 bison less groff sed flex gettext perl sys-apps/texinfo autoconf automake bash file libtool bzip2 diffutils kbd e2fsprogs grep gzip hotplug man make module-init-tools patch procps psmisc shadow sysvinit tar udev util-linux &&
cp -f /etc/make.conf.build /etc/make.conf

1) There is no mention of --oneshot in the guide.Koreth wrote:I did see the part about using distcc to boostrap. I did have a concern about it though, because the offical guide has one run the emerge with --oneshot and --nodeps. Since distcc normally pulls in a few deps, I was worried that emerging distcc in such a manner could cause distcc to break and in turn break the stuff it compiles in the later stages of the install. That was all speculation though. I suppose the only way to really find out would be to actually try it and post the results.
Code: Select all
USE="-*" emerge --nodeps distccCode: Select all
emerge distccActually, you are correct, --oneshot isn't used, just --nodeps. I'm not sure why I thought the initial emerge of distcc used --oneshot.slycordinator wrote:1) There is no mention of --oneshot in the guide.Koreth wrote:I did see the part about using distcc to boostrap. I did have a concern about it though, because the offical guide has one run the emerge with --oneshot and --nodeps. Since distcc normally pulls in a few deps, I was worried that emerging distcc in such a manner could cause distcc to break and in turn break the stuff it compiles in the later stages of the install. That was all speculation though. I suppose the only way to really find out would be to actually try it and post the results.
2) The only way installing distcc in the manner mentioned in the guide would cause it to break is the possibility of the package failing to build. And the reason --nodeps is used is because you want to install the whole system using distcc. If I did "emerge distcc", all of its dependencies would get built (without using distcc as it's not installed), thus defeating the purpose of installing distcc.
3) If you're really worried about it, replacewithCode: Select all
USE="-*" emerge --nodeps distccand then continue with the guide as mentioned. This method, though, will take more time as you'll be installing some of the same packages twice (though the second time they get installed will most likely be quicker as you're using the newly-installed distcc)Code: Select all
emerge distcc

Of course those flags are ignored! The stage1 tarball is a generic x86 tarball. Generic x86 means that it is built to do anything that a 386 can do. And you have to have AT LEAST A 486 to do nptl.Koreth wrote:I've got a new question regarding Use flags and /etc/make.profile. The install guide for the Fiordland install uses the nptl and nptlonly USE flags. However, it looks like the curent stage1 tarball defaults /etc/make.profile to /usr/portage/profiles/default-linux/x86/no-nptl. Looking at the guide to USE flags at http://www.gentoo.org/doc/en/handbook/h ... t=2&chap=2, the make.profile is not mentioned in the section on flag precedence. If I am understanding profiles correctly (probably not), wouldn't this mean that even though the nptl and nptlonly flags were set in make.conf, the flags are masked and thus disregarded when set in make.conf?
You could actually just download a different tarball that is for your CHOST. A stage2 or stage3 would work. Even if you download a stage3 tarball you can still run this install guide just fine.Since the current stage 1 tarball defaults to the no-nptl profile, shouldn't the Fiordland guide include a section on selecting a profile as well?
I've heard this before and I don't quite understand. On a stage3 build there is always an i386 gcc build left over in the /usr directory that never unmerges when GCC is pruned. And all sorts of binutils related symlinks won't unmerge. There are all sorts of old gcc binaries left in the /usr/bin directory that also don't unmerge.slycordinator wrote:And an advantage of using the method I described is that if you download a tarball that's for your CHOST it won't have random crap sitting around for the old CHOST. If you download the stage1 tarball and make the CHOST be i686-pc-linux-gnu there will be files left over from the i386-pc-linux-gnu.

Assuming you're using a 2006.1 tarball isn't make.profile already set to that?Nsane457 wrote:Between Step 7 and Step 8 there should be the following:
cd /etc
rm make.profile
ln -s ../usr/portage/profiles/default-linux/x86/2006.1 make.profile
cd ..

All that's in my /usr/i386-pc-linux-gnu is a directory called i686-pc-linux-gnu (which just contains the 686 libraries).Nsane457 wrote:I've heard this before and I don't quite understand. On a stage3 build there is always an i386 gcc build left over in the /usr directory that never unmerges when GCC is pruned. And all sorts of binutils related symlinks won't unmerge. There are all sorts of old gcc binaries left in the /usr/bin directory that also don't unmerge.slycordinator wrote:And an advantage of using the method I described is that if you download a tarball that's for your CHOST it won't have random crap sitting around for the old CHOST. If you download the stage1 tarball and make the CHOST be i686-pc-linux-gnu there will be files left over from the i386-pc-linux-gnu.