Next Previous Contents

2. The steps

  1. Get hold of a rescue floppy like tomsbtrt (www.toms.net). Other rescue floppies or CDs should work also. All you have to be able to do with the rescue disk is mount a DOS/Windows filesystem on the Linux filesystem.

    The next 4 steps are done on a host Linux system.

  2. Get hold of a recent LILO distribution. I used lilo-21.7-5. Edit the Makefile to generate a statically linked lilo executable by adding --static to the link command. Do a make. This will generate a lilo executable. You might want to run strip on this to reduce the size. Also generated will be various boot programs ending in .b.
  3. Create a working directory, say /tmp/lilo and under it mkdir boot/, sbin/ and etc/.
  4. Copy the .b files to /tmp/lilo/boot. cp -p /tmp/lilo/boot-menu.b /tmp/lilo/boot.b. You can also substitute -text for -menu if you prefer a plain text prompt. Copy the lilo executable to /tmp/lilo/sbin. Create /tmp/lilo/etc/lilo.con and add an entry for DOS. Add entries to /tmp/lilo/etc/lilo.con for the Etherboot images.
  5. Generate the Etherboot .lzlilo or .lilo images you want and copy them to /tmp/lilo/boot. Remember to alter the names to 8.3 standard as necessary.
  6. In /tmp/lilo, zip the contents to say /tmp/lilo.zip. Use a floppy or other means to transfer this to the DOS system. To save you work, you can find a copy of this zip archive, minus the Etherboot images and the lilo.con modifications, here.
  7. Alternatively pack the archive with tar and gzip. This will allow you to transfer this to the DOS system using the wget on the rescue floppy, see below.
  8. Unpack the archive in the root directory of the DOS system. If you are using pkunzip, remember to use the option that preserves the paths. You should end up with three new top level directories: \boot, \sbin and \etc.
  9. Reboot the DOS system using the rescue floppy. Mount the DOS filesystem, say on /mnt.
  10. Make a symlink from /mnt/boot to /boot. You can't use the -r /mnt option of lilo because it will chroot to /mnt and look for /mnt/dev/hda, and of course those device files don't exist on a DOS FS.
  11. Run /mnt/sbin/lilo -v -C /mnt/etc/lilo.con This will write LILO into the master boot sector.
  12. Umount /mnt and reboot. Keep the rescue floppy around for future modifications to \etc\lilo.con.
  13. If you made a .tar.gz package instead of a .zip package, then you can streamline all of the above with a couple of commands if you have a web server handy and you can put a shell script and the .tar.gz package there. Once you have booted tomsrtbt, issue a wget for the install shell script, something like this:
            wget http://172.16.2.25/thin/install.sh
    

    install.sh contains:
    #!/bin/sh
    mount -t msdos /dev/hda1 /mnt
    (cd /mnt; wget -O - http://172.16.2.25/thin/lilo2175.tar.gz | gunzip | tar xf - 2>/dev/null)
    rm -f /boot
    ln -s /mnt/boot /boot
    /mnt/sbin/lilo -v -C /mnt/etc/lilo.con
    umount /mnt
    

    Run it with:
            sh install.sh
    

  14. Advanced: If you have several types of network cards on your network, you could provide different install scripts for them which would fetch different images. Or you could parameterise install.sh. Of if you are really cunning, you could try to extract the network card identity out of a lsmod, as tomsrtbt autoprobes for several common NICs.
  15. LILO should take control on boot up and there should be entries for DOS and each Etherboot image. You can even have fancy splash graphics, this is a LILO enhancement in some distributions like SuSE.


Next Previous Contents