Slackware 10.2 Install Log


# Settings !!!*** PLEASE MODIFY THESE ***!!!
export MIRROR="http://anorien.csc.warwick.ac.uk/mirrors/Slackware/"
export SLAPTGET="http://ftp.scarlet.be/pub/linuxpackages/Slackware-10.2/jasorg/slapt-get/slapt-get-0.9.10e-i386-1.tgz"
export TMPDIR="./tmp"
export PKGHOME="/uml/filesystems/Slackware-10.2/"

# Making the filesystem
dd if=/dev/zero of=./Slackware-10.2-root_fs bs=1024 count=1 seek=1572864
mkfs.reiserfs -f ./Slackware-10.2-root_fs
mkdir $TMPDIR
mount -o loop ./Slackware-10.2-root_fs $TMPDIR

# Preparing some tools
mkdir tools
wget $MIRROR/slackware-10.2/slackware/a/pkgtools-10.2.0-i486-5.tgz
wget $MIRROR/slackware-9.0/slackware/a/tar-1.13.25-i386-1.tgz
tar -C tools -zxf ./pkgtools-10.2.0-i486-5.tgz
tar -C tools -zxf ./tar-1.13.25-i386-1.tgz
export PATH=$PATH:`pwd`/tools/bin/
export PATH=$PATH:`pwd`/tools/sbin/

# Installing the packages from the 'a' series (base)
for package in "aaa_base-10.2.0-noarch-2 aaa_elflibs-10.2.0-i486-3 bash-3.0-i486-3 bin-10.2-i486-1 bzip2-1.0.3-i486-1 coreutils-5.2.1-i486-1 cpio-2.5-i386-1 cxxlibs-5.0.7-i486-1 dcron-2.3.3-i486-5 e2fsprogs-1.38-i486-2 etc-5.1-noarch-10 findutils-4.1.7-i386-1 gawk-3.1.5-i486-1 gettext-0.14.3-i486-1 getty-ps-2.1.0b-i486-1 glibc-solibs-2.3.5-i486-5 glibc-zoneinfo-2.3.5-noarch-5 grep-2.5-i386-2 gzip-1.3.3-i386-2 infozip-5.52-i486-1 jfsutils-1.1.8-i486-1 kbd-1.12-i486-2 less-382-i486-1 logrotate-3.6.8-i486-1 openssl-solibs-0.9.7g-i486-1 module-init-tools-3.1-i486-1 pkgtools-10.2.0-i486-5 procps-3.2.5-i486-1 reiserfsprogs-3.6.19-i486-1 sed-4.0.9-i486-2 shadow-4.0.3-i486-11 slocate-2.7-i486-3 sysklogd-1.4.1-i486-9 sysvinit-2.84-i486-56 tar-1.15.1-i486-1 tcsh-6.14.00-i486-1 udev-064-i486-2 umsdos-progs-1.13-i386-1 util-linux-2.12p-i486-2 xfsprogs-2.6.13-i486-1 utempter-1.1.3-i486-1"; do
	installpkg -root ./$TMPDIR/ $PKGHOME/a/${package}.tgz
done

# Installing the packages from the 'l' series (libraries)
for package in "glibc-2.3.5-i486-5 libtermcap-1.2.3-i486-6 ncurses-5.4-i486-2 zlib-1.2.3-i486-1 libidn-0.5.17-i486-1"; do
	installpkg -root ./$TMPDIR/ $PKGHOME/a/${package}.tgz
done

# Installing the packages from the 'n' series (networking)
for package in "dhcpcd-1.3.22pl4-i486-2 links-2.1pre18-i486-1 openssh-4.2p1-i486-1 ppp-2.4.4b1-i486-1 tcpip-0.17-i486-35 wget-1.10.1-i486-3 traceroute-1.4a12-i386-2"; do
	installpkg -root ./$TMPDIR/ $PKGHOME/a/${package}.tgz
done

# Installing the 'slapt-get' package management tool:
wget $SLAPTGET
installpkg -root $TMPDIR/ ./slapt-get-*-i386-1.tgz
# Make new new config from our mirror defined above
cp $TMPDIR/etc/slapt-get/slapt-getrc $TMPDIR/etc/slapt-get/slapt-getrc.save
grep -v "slackware.com" $TMPDIR/etc/slapt-get/slapt-getrc.save > $TMPDIR/etc/slapt-get/slapt-getrc
echo "SOURCE=$MIRROR/slackware-10.2" >> $TMPDIR/etc/slapt-get/slapt-getrc

# ldconfig the newly installed libraries
ldconfig -r $TMPDIR

# copy the fstab (root=/dev/ubda)
cp fstab $TMPDIR/etc/
# create the ubd devices
for ((i=0; i<8; i++))
do
	let=$(echo $i|tr '0-7' 'a-z')
	mknod $TMPDIR/dev/ubd$let b 98 $[16 * $i]
	for ((p=1; p<=16; p++)) do
		mknod $TMPDIR/dev/ubd$let$p b 98 $[16 * $i + $p]
	done
done

# copy current resolv
cp /etc/resolv.conf $TMPDIR/etc

# use slapt-get to update the system
chroot $TMPDIR slapt-get --update
chroot $TMPDIR slapt-get --upgrade

# tweak the inittab to only use tty0 and add it to securetty
cp $TMPDIR/etc/inittab $TMPDIR/etc/inittab.save
grep -v "c[0-9]:" $TMPDIR/etc/inittab.save > $TMPDIR/etc/inittab
echo "# We launch just one console for UML:" >> $TMPDIR/etc/inittab
echo "c1:1235:respawn:/sbin/agetty 38400 tty0 linux" >> $TMPDIR/etc/inittab

echo "# UML modification: use tty0" >> $TMPDIR/etc/securetty
echo "tty0" >> $TMPDIR/etc/securetty

# make the first network interface start with dhcp
cp $TMPDIR/etc/rc.d/rc.inet1.conf $TMPDIR/etc/rc.d/rc.inet1.conf.save
sed 's+USE_DHCP\[0\]=""+USE_DHCP\[0\]="yes"+' < $TMPDIR/etc/rc.d/rc.inet1.conf.save > $TMPDIR/etc/rc.d/rc.inet1.conf

umount $TMPDIR
rmdir $TMPDIR
echo "Done!"