Network Bootloader using Linux ...

Hello,

I want to find out the best route for setting up a network bootloader where I can have a custom listing of programmable options. Some of the desired options include:

  • Setting up a linux or windows system via the network
  • Troubleshooting utilities (like Knoppix) load via the network
  • Network Disk cloning utilities

I know that linux supports many types of network booting but has anyone done anything like what I am referring to?

Thanks for your time.

Regards,
Christopher Koeber

I never did figure out how to boot or install windows over a network, but the other thing I have done. You need a few things:

  • Your own DHCP server -- PXE network boot starts by looking for special values provided by a DHCP server. I use dnsmasq, with this extra line in the config file:
    text dhcp-boot=pxelinux.0,mecgentoo,192.168.0.126
  • Your own tftp server -- These DHCP values tell PXE what file to load from what tftp server, in this case, to load pxelinux.0 from the tftp server at 192.168.0.126. I use atftp, which(on my system at least) expects the files it serves to be in /tftproot/.
  • pxelinux -- This is the bootloader, and actually just one part from a small suite of bootloader tools. You might've heard of its brother, isolinux. They're capable of printing a greeting message and a menu of options, then booting what the user chooses. In my system PXE grabs and runs /pxelinux.0, which the tftp server finds in /tftproot/pxelinux.0, then pxelinux itself connects to the tftp server to grab its config file, /pxelinux.cfg/default, which the tftp server will find in /tftproot/pxelinux.cfg/default . Here's what mine looks like(substitute tabs where applicable):
    text # Ask which to boot PROMPT 1 # Default to local boot when user enters blank DEFAULT local # Wait 1 minute TIMEOUT 600 # Default to local on timeout ONTIMEOUT local # Download /message from tftp and display it DISPLAY message # Loads a DOS boot disk image, then boots it with the memdisk program. # Expects /dos/dos.img.gz and /memdisk from tftp. # memdisk is a part of pxelinux. LABEL dos KERNEL memdisk APPEND initrd=dos/dos.img.gz # Our P3's all had dead floppy drives, so we imaged the BIOS upgrade # then put it on PXE label deskpro-p3-sff KERNEL memdisk APPEND initrd=dos/deskpro-p3-sff.img.gz # Not a disk image, just a tiny program capable of running by itself LABEL memtest86 KERNEL memtest86 # Since udpcast operates PURELY inside an initrd, it works inside PXE too. # It expects /udpcast/linux and /udpcast/initrd from the tftp server, # which you can just grab off the official udpcast cdrom. LABEL udpcast KERNEL udpcast/linux APPEND load_ramdisk=1 initrd=udpcast/initrd root=/dev/ram0 IPAPPEND 1 # The Windows password reset disk also works over PXE. LABEL reset KERNEL pwd/vmlinuz append rw vga=1 init=/linuxrc initrd=pwd/initrd.cgz,pwd/scsi.cgz # This option just exits PXE and boots from local disk. LABEL local LOCALBOOT 0

You will notice one thing in common about all the different boot options: They are small and self-contained. pxelinux comes with a program to boot disk images, so nothing special needed there. The UDPcast and XP password reset CD's both used isolinux to boot them into ramdisks, making the move to PXE easy -- pxelinux and isolinux are part of the same software set, config and plugin-compatible.
And memtest86 was designed to run from a raw bootloader. pxelinux can just dump any of these into RAM and let them take over.

A 700mb boot cdrom like Gentoo is kind of opposite. (I explain Gentoo since that's the one I tried to make work over PXE.) It does use isolinux to boot a small ramdisk, and that part works over PXE, but it stops when it can't find the CD.

The gentoo disc actually did have the ability to load its files over NFS instead of from a local CD, but I never got that to work due to version incompatibilities. So it's possible in principle but the CD has to support it, and you need to install and configure yet ANOTHER daemon.

As for booting Windows over PXE? Ahah. Ahahahaha no. It's not flexible enough to boot from USB, let alone diskless. I do vaguely recall something about special-purpose Microsoft PXE installer tools demanding Server 2003 running MS DHCP Server, maybe someone somewhere has figured out how to make it a touch more tractable to the non-windows world.

Your question inspired me to try again, this time with a fedora 8 install/rescue disk, the software of which is very flexible if poorly documented. It works.

You need vmlinuz, initrd.img, and stage2.img from the fedora 8 install disk. vmlinuz and initrd.img go under /tftproot/fedora-8/ , while stage2.img needs to be on an http or ftp server you have access to. This done, the following addition to pxelinux.cfg lets it boot the fedora 8 rescue system diskless, auto-downloading the 100mb stage file from your local web server.

LABEL fedora-8
        KERNEL fedora-8/vmlinuz
        APPEND initrd=fedora-8/initrd.img rescue method=http://mywebsite/fedora-8/

Note that fedora will expect http://mywebsite/fedora-8/images/stage2.img, not http://mywebsite/fedora-8/stage2.img . It still asks a few annoying questions but all in all I think that's as automated as it's going to get, I'm happy I don't have to type in the URL every time.

Of course, a diskless OS that needs to download a 100mb file is going to need a decent chunk of RAM, but since 256mb is considered small these days...