
# dd if=zImage of=/dev/fd0 bs=8192
|
However, Alan Cox told in a linux-kernel thread that this feature of the linux kernel will be removed sooner or later, you thus will have to use a bootloader even on floppies some day. I know this still works with 2.4.11 kernels, but support seems to have been removed in the 2.4.13 version. See the sixth chapter of the boot-disk-HOWTO for this topic.
For a list of EPROM burner manufacturers visit the Yahoo site and go to economy->company->Hardware->Peripherals->Device programmers or check out the old Diskless-HOWTO List of EPROM burner manufacturers section.
If you choose to create your own ROMS, you will have to load a BOOTP or DHCP capable software in the ROM, and then, you will be in the case of BOOTP or DHCP capable NICs described above.
You will also need to find the proper EPROM size and speed for your NIC. Some methods to do so are provided in appendix, because the NICs manufacturers often do not provide this information.
Bwimage package: ftp://ftp.ipp.mpg.de/pub/ipp/wls/linux/bwimage-0.1.tgz
LanWorks BootWare Boot ROMs: http://www.3com.com/lanworks
Refer to the README file for installation details. Currently, only "zImage"-type kernels are supported. Unfortunately, kernel parameters are ignored.
This section was initially written by Jochen Kmietsch for the Diskless-HOWTO, email to: <jochen.kmietsch@tu-clausthal.de> for any questions.
This section was originally written by Hans de Goede <j.w.r.degoede@et.tudelft.nl> for the Diskless-root-NFS-HOWTO. I modified it slightly in order to reflect some differences between this document and the Diskless-root-NFS-HOWTO.
Much of the above also goes for booting from cdrom. Why would one want to boot a machine from cdrom? Booting from cdrom is interesting everywhere one wants to run a very specific application, like a kiosk, a library database program or an internet cafe, and one doesn't have a network or a server to use a root over nfs setup.
Now that we know what we want to do and how, it's time to create a test setup:
For starters just take one of the machines which you want to use and put in a big disk and a cd burner.
Install your linux of choice on this machine, and leave a 650 MB partition free for the test setup. This install will be used to make the iso image and to burn the cd's from, so install the necessary tools. It will also be used to restore any booboo's which leave the test setup unbootable.
On the 650 mb partition install your linux of choice with the setup you want to have on the cd, this will be the test setup.
Boot the test setup.
Compile a kernel with isofs and cdrom support compiled in.
Configure the test setup as described above with the root filesystem mounted read only.
Verify that the test setup automagically boots and everything works.
Boot the main install and mount the 650 MB partition on /test of the main install.
Put the following in a file called /test/etc/rc.d/rc.iso, this file will be sourced at the beginning of rc.sysinit to create /var:
#/var
echo Creating /var ...
mke2fs -q -i 1024 /dev/ram1 16384
mount /dev/ram1 /var -o defaults,rw
cp -a /lib/var /
|
Edit /test/etc/rc.sysinit, comment the lines where the root is remounted rw, and add the following 2 lines directly after setting the PATH:
#to boot from cdrom
. /etc/rc.d/rc.iso
|
Copy the following to a script and execute it to make a template for /var and create /tmp and /etc/mtab links.
#!/bin/sh
echo tmp
rm -fR /test/tmp
ln -s var/tmp /test/tmp
###
echo mtab
touch /test/proc/mounts
rm /test/etc/mtab
ln -s /proc/mounts /test/etc/mtab
###
echo var
mv /test/var/lib /test/lib/var-lib
mv /test/var /test/lib
mkdir /test/var
ln -s /lib/var-lib /test/lib/var/lib
rm -fR /test/lib/var/catman
rm -fR /test/lib/var/log/httpd
rm -f /test/lib/var/log/samba/*
for i in `find /test/lib/var/log -type f`; do
cat /dev/null > $i;
done
rm `find /test/lib/var/lock -type f`
rm `find /test/lib/var/run -type f`
|
Remove the creation of /etc/issue* from /test/etc/rc.local: it will only fail.
Now boot the test partition again, it will be read only just like a cdrom. If something doesn't work reboot to the working partition fix it, try again etc. Or you could remount / rw, fix it, then reboot straight into to test partition again. To remount / rw type:
# mount -o remount,rw /
|
If you need more information than you can find below, please refer to the CD-Writing-HOWTO.
Get boot.img from a redhat cd.
Mount boot.img somewhere through loopback by typing:
# mount boot.img somewhere -o loop -t vfat
|
Remove everything from boot.img except for ldlinux.sys and syslinux.cfg.
Cp the kernel-image from the test partition to boot.img.
Edit syslinux.cfg so that it contains the following, of course replace zImage by the appropriate image name:
default linux
label linux
kernel zImage
append root=/dev/<insert your cdrom device here>
|
Umount boot.img:
# umount somewhere
|
If your /etc/mtab is a link to /proc/mounts, umount won't automagically free /dev/loop0 so free it by typing:
# losetup -d /dev/loop0
|
Copy boot.img to /test
Cd to the directory where you want to store the image and make sure it's on a partition with enough free space.
Now generate the image by typing:
# mkisofs -R -b boot.img -c boot.catalog -o boot.iso /test
|
Mounting the image through the loopbackdevice by typing:
# mount boot.iso somewhere -o loop -t iso9660
|
Umount boot.iso:
# umount somewhere
|
If your /etc/mtab is a link to /proc/mounts umount won't automagically free /dev/loop0 so free it by typing:
# losetup -d /dev/loop0
|
Assuming that you've got cdrecord installed and configured for your cd-writer type:
# cdrecord -v speed=<desired writing speed> dev=<path to your writers generic scsi device> boot.iso
|