Here is the promised hard drive installation script for Thinstation. The scripts should be fairly self-explanatory, but here’s a quick rundown of what they do:
On boot, a script (/etc/init.d/should_prepare_hd) sees if the first hard drive is partitioned the way we want it to be. If it isn’t, the script creates an icon on the desktop to install to hard drive.
The script to install to hard drive zeros out the first 30MB or so of the disk, then partitions it, copies in an MBR, and installs Etherboot, booted via Syslinux, onto the first partition. The script then creates swap on the second partition, and activates it.
To use this package, just extract it into the Thinstation root, like any other Thinstation package. To make so that it is included in the build, add a “package hd-install” line to your build.conf. Unfortunately, I haven’t figured out a way to make it specify that it needs the vfat module, so you’ll need to uncomment the “module vfat” line in the build.conf file as well.
A couple of notes:
* The partition comparison is made more convoluted by a bug in the busybox version of sed that makes it impossible to escape backslash characters. I’ve worked around it, but it’s annoying.
* Theoretically, the script should be able to support SCSI disks, but my version of sfdisk can’t see them. I’ll need to research whether this is a limitation of sfdisk or Thinstation (hopefully the former).
One improvement that I hope to make at some point is adding the ability to install another bootable image (e.g. Thinstation) instead of Etherboot, possibly pulling down from a TFTP server.