Booting from the Ether
I wanted to have a completely open-source solution to this problem. Unfortunately, I couldn't make the GRUB software work, and I sure didn't want to write my own boot-loader software from scratch. The Etherboot package allows you to create your own boot ROM. If you have a network board that has a ROM socket on it, you can use the Etherboot package to create a ROM image that can then be burned into an EPROM for use on your network board. In our case, we already have a boot ROM, and it can't be replaced with a new one.
Fortunately, the Etherboot package allows you to make a ROM image that has a boot sector, so you can test the package from a floppy. This also means you can take this boot image and put it on a bootable CD-ROM. This doesn't use the boot ROM in the system so it would work on systems without boot ROMs.
You can download the source code to the Etherboot package and compile the code yourself, or you can use the ROM-o-matic web page setup by Marty Connor at http://rom-o-matic.net/. I tried both and the ROM-o-matic web page was by far the easiest. Select the SiS900 NIC and choose the Floppy Bootable ROM Image. In a few seconds, you'll have a 40K ROM image that you can use on your bootable CD-ROM.
When you make a bootable El Torito CD image, you need to provide a floppy boot image that is exactly 1.2, 1.44 or 2.88 megabytes. I used the following command to take the ROM image and append enough bytes to make it a 1.44MB file. Make sure your downloaded ROM image is in the file eb.img:
dd if=/dev/zero of=eb.img bs=512 seek=72 count=2808
This will increase the size of the file to 1.44MB. I used the following command to make the CD image:
mkisofs -b eb.img -o /tmp/cd.iso .You can then burn to a CD-ROM the ISO9960 CD image in the file /tmp/cd.iso. Don't tell anyone, but I used Adaptec's Easy CD Creator software on Windows. If your CD writer happens to be in a Linux box, you can feel free to use one of the fine CD-writing programs for Linux.
There is a utility in the Etherboot package called mknbi. This file will take a Linux kernel and put it in the proper format needed to load via the Etherboot loader. Install this utility package, change to the /tftpboot/bpbatch directory, then run the following command:
/usr/local/bin/mknbi-linux bzImage --output bzImage.out --param="rw root=/dev/nfs nfsroot=192.168.1.5:/nfsboot/nicroot ip=192.168.1.12:192.168.1.5:192.168.1.1 :255.255.255.0::eth0"
This will take the kernel we generated earlier, convert it to the proper format and add all the parameters required for it to find its root filesystem.
You need to change one line in the /etc/dhcpd.conf for this new method to work. The existing file contains the line
Change this line to
filename "/bpbatch/bzImage.out";Restart your DHCP server so it reads your changes. Put your bootable CD-ROM into your ThinkNIC and turn it on. If all goes well, it will start up as it did using the BpBatch software. This time though, you are using a completely open-source solution.
It does take a little time to get all the components set up properly, but booting your ThinkNIC computer from the network is the first step to making it do new and exciting things. You did enter your exciting idea in the Embedded Linux Journal ThinkNIC contest didn't you?
Jay Sissom (firstname.lastname@example.org) is a systems analyst in the Computing Department at Indiana University in Bloomington, Indiana. His amateur radio callsign is KA9OKT, and he enjoys playing the piano. He wishes there were 36 hours in the day so he had more time to try out some of his crazy ideas.
Practical books for the most technical people on the planet. Newly available books include:
- Agile Product Development by Ted Schmidt
- Improve Business Processes with an Enterprise Job Scheduler by Mike Diehl
- Finding Your Way: Mapping Your Network to Improve Manageability by Bill Childers
- DIY Commerce Site by Reven Lerner
Plus many more.
- Building a Multisourced Infrastructure Using OpenVPN
- Handheld Emulation: Achievement Unlocked!
- Unikernels, Docker, and Why You Should Care
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Happy GPL Birthday VLC!
- New Products
- diff -u: What's New in Kernel Development
- Controversy at the Linux Foundation
- Giving Silos Their Due
- Non-Linux FOSS: Snk