Our guide to building your own online distro

7th Dec 2008 | 12:00

Our guide to building your own online distro

You don't have to put up with someone else's vision of Linux

Wouldn't it be great if you could just click your way to a custom distro?

After all, most of the packages you will need are sitting on a well-connected web server somewhere, so it makes sense to build ISO images and repositories directly on that server. And since that server has a HTTP interface, why not make the distro building software into a web application?

This is the principle behind www.instalinux.com, created by Chris Slater. It's based on the SystemDesigner CGI scripts from the Linux Common Operating Environment project, originally developed as a tool for internal use at HP, and now released under the GNU GPL.

According to HP's Jeffrey Wade, quoted last year at the time of the LinuxCOE 4.0 release, the company has installed over 15,000 of its own desktops and servers using LinuxCOE. It also uses the software to install Linux on the servers it sells, and as part of its services offering too.

For the new distro creator, it certainly beats having to download all the source code over a domestic broadband connection, then figure out how to build it. The setup is very straightforward, and it supports a range of base distros. The only questions you have to answer in SystemDesigner are the same ones you would have to in a standard install.

It's also very useful for a more experienced system administrator who has to apply an identical, pre-seeded configuration to a large number of machines. In the following example, we're going to take a look at creating a 64-bit Ubuntu Hardy desktop distro with additional educational packages from Edubuntu and support for Japanese – just because we can.

To create your custom distro, click on the Designer link on the Instalinux homepage and select your base distro. You currently have a choice of CentOS 4 or 5, Debian Etch, Fedora up to version 8, OpenSUSE up to 10.3, Scientific Linux up to 5.0, SUSE 9.3 or Ubuntu up to Hardy Heron.

All base distros are available in both 32-bit and 64-bit Intel/AMD versions. Apart from these considerations, your only other option on the first page of the System Designer is to set the hostname, or set the target machine to grab a hostname via DHCP.

Check your sums

There's also an MD5SUM provided, which you should take a note of now – it's best to save the web page to your local machine, along with the preseed.txt file offered.

Once your image download is complete, test it with the md5sum command. You should have the md5sum package already installed in any decent Linux distro, but if not, it's a standard package and should certainly be available from your current distro's online repository. Simply type md5sum in a terminal and append the name of the ISO image, like so:

daniel@64studio: $ md5sum iso8574.iso 41a0b070302bae85ec8d5a0159969eb6 iso8574.iso

The output of the md5sum command should be exactly the same as the one shown on the final Instalinux page. Your check sum will almost certainly be different from mine, unless you specified exactly the same options.

Having verified that your download is OK (because it would be really embarrassing to distribute a corrupted install image), you can burn it to CD using your preferred application.

Remember to back up any personal data before testing the disc on a PC or laptop, especially if you specified automatic hard disc formatting during the setup process; as the boot screen warns, the contents of some or all drives may be erased.

Despite the preseed file containing language settings, in manual mode, the LinuxCOE version of the Ubuntu installer still asked us to set the install language and dialect. The rest of the install wasn't exactly bug-free either – at one point, the install halted with a 'Loading apt-mirror-setup failed for unknown reasons' message. We had to select Continue with the Tab and Enter keys before the downloading of packages from the Ubuntu apt mirror could continue.

Once the installation was complete and the test laptop rebooted into GDM, we found the Japanese language support packages had not been fully installed, and so when changing the language setting in Gnome, additional packages had to be downloaded. But considering the breadth of Linux distros that SystemDesigner attempts to support, it's still an impressive tool. The other system settings were correctly preseeded, including the user and network details.


If you're now happy with your custom Ubuntu install, then it's worth having a look at that preseed.txt file to understand how automated installs work. Although Ubuntu is normally installed with a GUI from a Live CD, automated installs are usually done with Debian's text-mode installer, known as d-i, because it's much more scriptable than a point and click environment.

The preseed file is all commented in English, so it's easy to understand. For example, here's the part about the base distro's package repository:

# Where are we pulling bits from?
d-i mirror/http/hostname string us.archive.ubuntu.com
d-i mirror/http/directory string /ubuntu/

And here's the part about our initial user account:

# Mortal User
d-i passwd/user-fullname string Dave Smith
d-i passwd/username string dave
d-i passwd/user-password-crypted passwd $1$QOimuo6b$4/wHzeVqXbQjpclCYDtbK/

No need to attempt to decrypt that user's password; we can save you the bother, and tell you that it's just 'dave'. Of course, in real life, you would never set such an easily guessed default password, would you? In fact, Ubuntu's user and groups tool wouldn't let you.

If you find the Instalinux site useful, you have the option to create and manage your profiles for SystemDesigner. Just click Profiles on the Instalinux web page, select your base distro, version and architecture of choice, then the 'Create a new LinuxCOE profile' button to get started. By using the Display button, you can recall profiles that you, or other Instalinux users, have already created.

Re-spinning Fedora and Debian Live

If you're a fan of the Fedora Project, you'll be pleased to discover that the Fedora Unity team has created a GUI application for making 'Re-Spins' of install and live media. Known as Revisor, it's a front-end to programs including Pungi and live-cdtools.

On Fedora 7 or later, simply type in a terminal (as root):

# yum install revisor

Using Revisor is similar to running SystemDesigner, except that the action is taking place on the local machine. Revisor has the advantage over the online tool in that it can also make Live CDs, or images for live booting from USB sticks, but it's very much a Fedora-only affair.

The nearest equivalent to Revisor for Debianbased distros is live-magic which is a GUI front-end for the live-helper scripts. As the names of these packages suggest, the Debian tools were originally meant just for the creation of Live images.

Having said that, there is now support for including the Debian installer as an alternative entry in the bootloader of the Debian Live CD, which copies the live filesystem to the target hard disk. See http://alioth.debian.org/ lamby-guest/live-manual/html/commontasks.html for details.

Implications for support The major limitations of SystemDesigner, Revisor or live-magic are that you can only select packages and meta-packages that are already featured in the base distro, and that there isn't any mechanism for tweaking those packages (beyond pre-seeding installation options, or running a post-install script).

These limitations are actually helpful, if you want to ensure that commercial support services for all the packages in the custom distro will be available from the organisation behind the parent distro, such as Novell or Canonical. Most service agreements for Linux offerings indicate that you are perfectly free to modify the code, but if you do so, you cannot expect support for the modified packages. That's fair enough, because you might have screwed them up royally.

Even if the packages in question still work, it's a bit much to expect the parent distro to support an indeterminate number of modifications are floating around deployment sites.

If you're not constrained by the need to keep individual packages unmodified from the base distro, and you want more customisation than that afforded by SystemDesigner, then there is a tool that can help: PDK. More on that soon!

Now read The pain-free guide to switching Linux distros

First published in Linux Format, Issue 113

Linux Software Operating system Linux
Share this Article

Apps you might like:

Most Popular

Edition: UK
TopView classic version