From: erc@unislc.uucp (Ed Carp) Subject: How to make a bootable Linux floppy Date: 30 Dec 1992 08:05:41 GMT
Here's a script I hacked to make a bootable floppy. It requires lilo 0.7,
as well as the new mount (0.97) and init (the one that will do singleuser
mode). Have fun, kids... :)
================================= cut here ===================================
#
# This script makes a Linux boot floppy in $FLOPPY.
#
# Written 12/29/92 by Ed Carp (erc@apple.com)
#
# This works on my system (Linux 0.99p1) - check to make sure that
# stuff is being snarfed from the correct place on your system.
# This script also requires that you have the latest mount (0.97) command,
# as well as an init that will boot to singleuser mode. It also requires
# that /usr/src/linux/Image exist.
#
FLOPPY=/dev/fd0
RFLOPPY=/dev/fd0H1440
# Set BLOCKS to be the number of blocks on $FLOPPY
BLOCKS=1440
# Set TZONE to be your timezone, AS DEFINED IN /usr/lib/zoneinfo!!
TZONE=UTC
fdformat $RFLOPPY
mkfs $FLOPPY $BLOCKS
mount $FLOPPY /mnt
(cd /mnt;mkdir bin dev etc lib tmp usr usr/tmp usr/lib usr/lib/zoneinfo)
tar cf - /dev|(cd /mnt;tar xf -) > /dev/null
(cd /bin;cp getty login sh /mnt/bin)
cp /bin/ls /bin/fsck /bin/fdisk /bin/rdev /bin/cp /bin/date /mnt/bin
cp /bin/sync /bin/rm /bin/reboot /bin/cat /bin/df /bin/mkdir /mnt/bin
cp /usr/bin/tar /bin/ps /mnt/bin
(cd /mnt/usr/lib/zoneinfo;cp /usr/lib/zoneinfo/$TZONE localtime;ln -s localtime posixrules)
tar cf - /lib/libc* /lib/libm*|(cd /mnt;tar xf -) > /dev/null
cp /usr/src/linux/Image /mnt/unix
rdev /mnt/unix $FLOPPY
(cd /etc;cp TZ clock fstab gettydefs group init* issue magic mount passwd profile securetty shadow swapon termcap umount update /mnt/etc)
# We want to boot to singleuser
touch /mnt/etc/singleboot
echo "mount -t proc /proc /proc" > /mnt/etc/rc
touch /mnt/etc/utmp
touch /mnt/etc/wtmp
/bin/rm -f /mnt/etc/inittab
# This works with getty/uugetty - with other gettys, swap "tty$i" and "9600"
for i in 1 2 3 4 5 6 7 8
do
echo "tty$i:console:/bin/getty tty$i 9600" >> /mnt/etc/inittab
done
echo "$FLOPPY /" > /mnt/etc/mtab
mkdir /mnt/etc/lilo
cp /etc/lilo/* /mnt/etc/lilo
cd /mnt/etc/lilo
./lilo -r /mnt -i /etc/lilo/boot.b -b $FLOPPY -v -v -v /unix
/bin/rm -f /mnt/etc/lilo/boot.???? /mnt/etc/lilo/*.old
cd /
umount $FLOPPY
fsck -av $RFLOPPY
-- Ed Carp erc@apple.com, erc@saturn.upl.com 801/538-0177Who and what would you be if you went beyond your deepest fears?