Table of Contents
The GNU/Linux System Architect Toolkit is designed to help people create their own distributions built from source code. Users of the Architect Toolkit decide which packages they need for their distribution. After downloading the source code onto a development system Architect takes care of turning the source into binary packages. Once all of the binary packages are created they need to be installed onto the target system. And that is the task of the installation media.
The installation media is a bootable system that contains just enough functionality to get packages installed onto the target media. Such a limited system can be made small enough to fit on a couple of floppy disks or a CD-ROM. Floppy-based installation disks have the advantage of being easy to build and make changes to, but they are severely limited on storage capacity. CD-ROM's have plenty of storage space, but are more tedious to build and, in the case of non-rewritable disks, less forgiving of mistakes. We will explore both types of installation media starting with floppy disks and then moving into bootable CD-ROMs.
Once the installation media has booted it really does not matter if it is a floppy diskset or a CD-ROM, it will have the same funcationality.
To install a new system we need to:
Partition disks - fdisk, sfdisk
Mirror partitions - mdadm
Create filesytems - mke2fs
Mount filesystems - mount
Fetch packages - ifconfig, tftp
Install packages - tar, gz
Install a boot loader - grub
In addition we need a shell and any required library files.
We will need to build the following packages:
bash-mini
coreutils
e2fsprogs
glibc
grub (or grub-serial0)
gzip
mdadm (optional)
net-tools (optional)
netkit-tftp (optional)
tar
util-linux
bash-mini - (extract all)
coreutils - bin/cat, bin/chmod, bin/chown, bin/cp, bin/ln, bin/ls, bin/mkdir, bin/mknod, bin/mv, bin/rm, bin/stty, bin/sync
e2fsprogs - sbin/mke2fs
glibc - lib/ld-linux.so.2, lib/libc.so.6, lib/libdl.so.2, lib/librt.so.1, lib/libpthread.so.0
grub (or grub-serial0) - boot, sbin/grub
gzip - bin/gzip, bin/gunzip
mdadm (optional) - sbin/mdadm
net-tools (optional) - sbin/ifconfig sbin/route
netkit-tftp (optional) - bin/tftp
tar - bin/tar
util-linux - bin/mount, bin/umount, sbin/fdisk, sbin/sfdisk
We need an a blank mtab and an fstab that looks like this:
/dev/ram0 / ext2 defaults 0 0 proc /proc proc defaults 0 0
We need an /sbin/init.sh that looks like this:
#!/bin/sh PATH=/sbin:/bin export PATH mount -o remount,rw / mount -a
Decide if the boot disk will be used on a machine that is set up with a serial console or if it will have a monitor and keyboard.
Choose either the grub-serial0 package or the grub package depending on the decision made in the previous step.
Extract the chosen package to a temporary location.
bash# cd /var/tmp bash# tar -zxf grub-serial0-0.95.i386.tar.gz
Create a second extended filesystem on a floppy disk and mount it on /media/floppy.
bash# mke2fs -m0 /dev/fd0 bash# mount /dev/fd0 /media/floppy
Copy the entire /boot directory from the grub package onto the floppy.
bash# cp -R /var/tmp/grub-serial0-0.95/boot /media/floppy
Copy a Linux kernel to the diskette.
bash# cp /usr/src/linux/arch/i386/boot/zImage /media/floppy/boot/vmlinuz
Create an appropriate menu.lst file if desired.
bash# cat <<"END-OF-FILE" >/media/floppy/boot/grub/menu.lst > # GRUB configuration file for serial console operation > serial --unit=0 --speed=9600 > terminal serial > default 0 > timeout 3 > title Serial Console Boot Disk > kernel (fd0)/boot/vmlinuz root=/dev/fd0 load_ramdisk=1 prompt_ramdisk=1 console=ttyS0 > END-OF-FILE
Unmount the floppy.
bash# umount /dev/fd0
Run the grub binary from the recently extracted grub package.
bash# /var/tmp/grub-serial0-0.95/sbin/grub
Exectute the grub commands to set up the bootloader code on the floppy.
grub> root (fd0) grub> setup (fd0)