Something I’ve been working on …

This is our new student lab, in beta-testing since Friday. The machines run Windows XP and Ubuntu Linux.

Ubuntu Lab Photo

Installation of Ubuntu is fully-automated through Debian installer preseeding. Its partitioner is replaced with a custom udeb that provides formatting for the Linux partitions, while preserving the complex partitioning scheme that Windows/Norton Ghost needs.

Updates and patches get distributed using a custom toolkit written in Python (originally designed by Fabi for RedHat-based systems). It consists of an NFS mount with directories for different classes of machines, and a script (run by cron or on-demand) that checks for new updates to the machine classes a system belongs to. Updates are represented by numbered symbolic links to files, tars, text files with package names to be installed through apt, debs, patches and shell scripts. The on-demand updating and other administrative tasks are initiated through SSH Forced Commands. The postinstall process is also done using the same system, through rc-style numbered scripts.

Each machine has a separate installation partition, containing a netboot kernel, initrd, and the machines’s boot loader (Grub) installed into its boot sector along with the associated configuration files. The installation partition is distributed by Norton Ghost (which is used by the Windows guys anyway to distribute their images), and has the “bootable” flag set. This enables Ghost to install Windows and reboot it multiple times by simply removing the flag and restoring it after installation is complete. By providing a Grub configuration file that will boot into the installation kernel with appropriate kernel parameters for preseeding, any machine running Linux can be re-installed at any time by simply mounting the installation partition and copying the special installation configuration over the normal menu.lst (of course it will have to be reset before the installation reboots for the first time, or we’ll end up in an endless cycle of base installs).

I’ll probably have more to say on this later, but here’s a random collection of “lessons learned” while setting up this lab:

  • FAI and other 3rd party tools are not the only solution, plain Debian installer preseeding works too — or even better than FAI in Ubuntu’s case.
  • Expert recipes for use with partman in Debian installer are unable to deal with complex partitioning setups. We use our own tiny udeb to accomplish this, and radically eliminate partman from the installation process.
  • Debconf does not export DEBIAN_FRONTEND, so when using “noninteractive” as the frontend, make sure the variable is set to “noninteractive” before running anything that might use debconf (such as installing packages). Otherwise some postinstall scripts fail miserably.
  • NIS password changes are broken in pam_unix in every version whose source code I’ve seen so far. I’ve modified 0.76 to make it work, but it’s hardly a good solution (otoh NIS isn’t either, and there’s a chance we won’t have to use it much longer).
  • Python rocks 🙂