thebigslide l33t
Joined: 23 Dec 2004 Posts: 792 Location: under a car or on top of a keyboard
|
Posted: Sun Jul 10, 2005 11:56 pm Post subject: Script builds AMD64 system with up to date toolchain |
|
|
A lot of people are going to look at this and say "holy crap, that's a lot of recompiling!" but it's really necessary to make sure the build system works. Let me know what your experiences are. Make sure you read the script first, and customize the make.conf and the package and rc service bits. I take NO responsibility for messing anything up on your system or conneted devices. If you're installing in a chroot (you must be running a 64-bit kernel irregardless), you can change the 'emerge sync' to 'emerge metadata'; just add a line like 'mount -o bind /usr/portage usr/portage' near the beginning of the script. These changes will allow you to skip downloading a whole new portage tree and all the distfiles you might already have downloaded. Let me know your experiences.
Code: |
##Licensed under the GNU GENERAL PUBLIC LICENSE Version 2, June 1991
mkdir /mnt/newgentoo
cd /mnt/newgentoo
tar xvjpf /incoming/stage3-amd64-2005.0.tar.bz2
cp /etc/resolv.conf etc/
cp /etc/conf.d/net etc/conf.d/
cp /etc/rc.conf etc/
cat <<- EOF >> etc/make.conf
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
#ACCEPT_KEYWORDS="~amd64"
PKGDIR=${PORTDIR}/packages
PORT_LOGDIR=/var/log/portage
PORTDIR_OVERLAY=/usr/local/portage
RSYNC_RETRIES="3"
RSYNC_TIMEOUT=180
MAKEOPTS="-j2"
PORTAGE_NICENESS=3
AUTOCLEAN="yes"
FEATURES="ccache userpriv distlocks"
CCACHE_SIZE="2G"
#RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes
USE="ithreads nptl alsa X -gnome -kde chroot gtk bzip2 gzip pic mng mpeg ldap postgres ffmpeg encode usb kerberos"
EOF
mkdir usr/portage usr/local/portage var/log/portage
chown portage:portage usr/portage usr/local/portage var/log/portage
#mount -o bind /usr/portage usr/portage
cat <<- EOTF >> finishup
source /etc/profile
env-update
emerge sync #metadata
emerge --oneshot --nodeps portage
cp /etc/init.d/net.eth0 /etc/init.d/net.eth1
echo HOSTNAME=\"hostname\" > /etc/conf.d/hostname
echo OVERRIDE=1 > /etc/conf.d/domainname
echo DNSDOMAIN=\"hostname.domain.name\" >> /etc/conf.d/domainname
rc-update add domainname default
USE="symlink" emerge gentoo-sources
mount -t proc none /proc
cd /usr/src/linux
gzcat /proc/config.gz > .config
emerge --oneshot -u binutils linux-headers
emerge --oneshot --nodeps glibc gcc-config gcc
gcc-config 1 && source /etc/profile && env-update
emerge --oneshot --nodeps glibc gcc-config binutils gcc ccache
source /etc/profile && env-update
emerge -Du system
gcc-config 1
emerge -e system && emerge -e system
emerge syslog-ng vixie-cron slocate reiserfsprogs grub sysfsutils udev hotplug gentoolkit esearch
emerge --nodeps acpid ntp
for x in syslog-ng net.eth0 net.eth1 vixie-cron sshd hotplug acpid ntp-client ; do rc-update add $x default ; done
make oldconfig && make menuconfig && make && make modules_install
#emerge emul-linux-x86-baselibs emul-linux-x86-xlibs emul-linux-x86-gtklibs emul-linux-x86-qtlibs
updatedb && eupdatedb
EOTF
chmod +x finishup
chroot . /finishup && rm finishup && echo Done.
|
|
|