Thin Clients Pay More
For our project, we use the LILO (Linux Loader) bootloader because all we are interested in is booting Linux. The version of LILO to use is important. We discovered that the latest version of LILO by default insists on using lba32 to manage disk geometry and that gave us problems configuring our Flash drive. Fortunately, we found that older versions of LILO don't impose that option. We copied the LILO we used for our Flash drives from Andy Rabagliati's wizzy package. For convenience, we also copied the boot.b file from Andy's package. To configure old hard drives, we relied on Ubuntu and SUSE's prebundled LILO packages. (See the Configuring Old Hard Drives section for a brief mention on using the GRUB bootloader.)
We also need the relevant boot-ROM images for the different network cards that our boot-ROM disk may end up working with. Our network cards are either 3Com 905, Realtek 8139 or Via-Rhine. We got these image files from ROM-o-matic. It took a certain amount of trial and error to get the images that worked. ROM-o-matic updates its releases regularly. All the releases have similar options, and ROM-o-matic helps keep the trial-and-error process to a minimum by offering a button that gives a list of the cards that particular images will work for.
Once you have selected the card image that is probably the right one, you need to select the image type. Because we are using LILO, we chose the current zlilo image type as well as the older type called lzlilo. We used lzlilo on our Flash drive because we found the newer zlilo images seemed to work only on the hard drives. We have yet to figure out why. It's worth emphasizing that experiment yields invaluable information. Here I summarise only the results of our own experimentation. Other people will certainly get different and very likely better results as they try out their own equipment.
ROM-o-matic offers a Get Rom button to download the image files it produces. That option leads to a prompt allowing you to save the image files in your local directory system. We downloaded the various .lzlilo and .zlilo images we thought we would need for our three types of network card. With those files and the LILO files, we had all we needed to make our boot-ROM disks using either a Flash drive or an old hard disk. So we copied them all to one place in a directory we decided to call /flashlilo. Then we needed to put them onto our boot-ROM disk.
For newer machines that don't boot from LAN but that do have a BIOS option allowing boot from USB hard drive, a Flash drive that imitates boot-ROM is a handier alternative than an old hard drive. Once one client is booted, the Flash drive can be removed and used to boot another client. We found that we could treat the USB Flash drive as if it were a SCSI hard drive. Plugging the Flash drive in to a convenient USB socket we powered up, although thanks to hotplug, we could have just plugged the USB drive in while the machine was already running. This machine ran SUSE, so the YaST configuration tool recognised the new device and asked whether to configure it. We said no.
To ensure the drive we wanted to use for our boot-ROM was clear of any formatting or partitioning problems, we deleted the existing partitions, as the root superuser, using fdisk, and installed a new bootable partition. (If there is anything on those disks that you need, make copies. Partitioning afresh destroys everything on the disk!) We then used fdisk to partition the Flash drive by typing:
# fdisk /dev/sda
Something very important to note for later use when configuring the bootloader is the number of heads, sectors and cylinders fdisk discovers on the drive. Make a note of these. After using fdisk to set up a bootable partition free of any potentially bothersome history, we were ready to put a filesystem on it. We took the easy option and typed:
# mke2fs /dev/sda1
to put on an ext2 filesystem on the Flash drive. In order to tell Linux what device to mount and where, we used the traditional directory /mnt as our mountpoint, checking first that it was empty. For the Flash drive, we typed:
# mount /dev/sda1 /mnt
Then we copied all the files in /flashlilo to /mnt:
# cp /flashlilo/* /mnt
At this point, we needed to write a configuration file for LILO. Being frightened of vi and emacs, we used pico:
boot = /dev/sda disk = /dev/sda bios = 0x80 sectors = 62 heads = 4 cylinders = 1015 install = /mnt/boot.b map = /mnt/map root = /dev/sda1 vga = normal read-only delay = 30 pROMpt image = /mnt/viarhine6102.lzlilo label=viarhine2 read-only image = /mnt/3c905b.lzlilo label=3Com905b read-only image = /mnt/rt8139.lzlilo label=RTL8139 read-only
We saved that file to /mnt with the standard name lilo.conf.
The main part of that configuration file applies to the overall boot process before the user selects an option from the final menu. In this part, the first line tells the client machine to boot from the Flash drive. The second line and its sub-lines tells it about the disk geometry so it knows where to put things. (This is where you need that disk information you noted from fdisk!) The install line tells it to use boot.b to install the boot stages.
The map line tells the thin client where to find stuff in a file created by the LILO program. The root line tells it where to find the filesystem. The vga line explains how to output information to the monitor. The read-only option keeps everything from getting interfered with. The delay line tells the machine how long to wait before displaying the prompt.
The image sections of the configuration file offer the client user different boot options. So when the client starts up, LILO offers these image options to the user via a menu with three choices of network card from which to boot: Via-RhineII, Realtek 8139 or 3Com905.
Why are boot.b, map and LILO images referred to as residing in the /mnt directory? The reason is that now we have written the configuration file for LILO, we have to tell LILO to use that configuration file. We can do that only in the directory where we are working, which is where the drive we are working on is mounted. In our case, this is /mnt. The command to tell the LILO version we want to work with to update the lilo.conf file is therefore:
# /mnt/lilo -C lilo.conf
This is fine for the moment because we are in /mnt. But what happens when we unmount the Flash drive, remove it and insert in the machine we hope it will boot? Won't we need to change references in the lilo.conf file? And won't we then get into a manic circle of eternally having to run LILO to reconfigure lilo.conf? No, as it turns out. When we tried booting this in our client machines, it all ran smoothly. So, now that we have our boot-ROM drive, we move out of the /mnt directory and type:
# umount /dev/sda1
Special Reports: DevOps
Have projects in development that need help? Have a great development operation in place that can ALWAYS be better? Regardless of where you are in your DevOps process, Linux Journal can help!
With deep focus on Collaborative Development, Continuous Testing and Release & Deployment, we offer here the DEFINITIVE DevOps for Dummies, a mobile Application Development Primer, advice & help from the experts, plus a host of other books, videos, podcasts and more. All free with a quick, one-time registration. Start browsing now...
- The Ubuntu Conspiracy
- A First Look at IBM's New Linux Servers
- Vigilante Malware
- Disney's Linux Light Bulbs (Not a "Luxo Jr." Reboot)
- Libreboot on an X60, Part I: the Setup
- System Status as SMS Text Messages
- Vagrant Simplified
- Dealing with Boundary Issues
- Bluetooth Hacks
- Non-Linux FOSS: Code Your Way To Victory!