The GENDIST Toolkit


Examples

All examples are in the examples-subdirectory of the GENDIST distribution. Two types of examples are available: examples of packages (in subdirectories of examples/packages), and installable examples, which show how the build-system generated by GENDIST works.

You will find a README in each example directory with some more detailed information on how to install and use it.

  1. ShellLinux
  2. HAL91
  3. IsoLinux
  4. Busybox
  5. TwoStageLinux

ShellLinux

This is a very simplistic example. It creates a Linux distribution which only contains a shell (/bin/bash) and some support files. This example has no additional prereqs (except for a kernel), so it should work out of the box on every development system. This example is discussed in detail in the tutorial.

Top


HAL91

HAL91 is an existing single-disk Linux distribution. This example shows how you could use GENDIST to repackage it. HAL91 is currently distributed as a floppy-image, with GENDIST it is just a matter of calling make to create an ISO-image.

Top


IsoLinux

IsoLinux will generate an isolinux-based bootable CD-Rom from an existing distribution. It uses the isolinux.bin bootloader which is part of the syslinux-package from H.P.Anvin (see: http://syslinux.zytor.com).

The CD-Rom will contain a huge initial ramdisk created from the directories /bin, /dev, /etc, /home, /lib, /root, /sbin and /var. The CD itself will contain the directories /usr/bin and /usr/lib, so you can mount the CD after booting on /usr. Of course, all of this is configurable.

Prerequisites

To build an isolinux-based CD, you need a current version of mkisofs and enough diskspace in the build-directory (normally <path-to-IsoLinux>/build) to hold about twice the size of the CD.

To run the CD, your BIOS must support booting in no-emulation mode and you need a huge amount of RAM. To find out about the first prereq, the best thing is to just try it.

The amount of RAM needed depends on your configuration. The default setup will generate an initial ramdisk about 60MB large (tested with Red-Hat and SuSE), but if your /home-directory is large, it can be much larger.

Configuration

There is one central configuration file, config.inc, in the root-directory of the IsoLinux-distribution. Read this file carefully and change the configuration variables if necessary. Important variables:

Building

To build an ISO-image, just run

# make iso KERNEL=<path-to-your-kernel>

You can also define the KERNEL-variable in the config.inc file.

Known Problems

The size and number of I-nodes of the initial ramdisk is calculated automatically. This sometimes failes. Building will then stop with

      error: no space left on root-disk!

To check if it is a space or an I-node problem run the following commands:

# mount -o loop <path-to-IsoLinux>/build/initrd /mnt
# df
# umount /mnt

The df-command will give you a hint if it is a space problem.

To increase the size, change the value of RD_SIZE_INC in config.inc. To increase the number of I-nodes, set RD_NODES_INC. Run "make clean" before rebuilding the image.

Top


Busybox

This example shows how you can use the GENDIST-generated build-system to create you distribution from source. The Busybox-source is just plugged into the system as an additional GENDIST-package. The example uses the pristine-setup feature of Busybox.

To try this example, you basically only need the Busybox-source in addition to the normal development tools (make, compiler, lilo, syslinux etc).

Note that there is a more generic way of creating packages from source. The Busybox-example here assumes that the package is downloaded and unpacked already. If you also want to automate these tasks, you can use the built-in features of package.inc, which will download, unpack and patch the source automatically. The alternate example is available in the examples/packages/busybox-from-source-subdirectory of the GENDIST-distribution.

Top


TwoStageLinux

If a rescue system is too large to fit onto a floppy, you typically create a rescue-CD. The filesystem is then copied to RAM during the boot-process. There are two alternatives for this approach. The first uses the isolinux-loader (see IsoLinux), the second uses a two-stage strategy: the CD boots a minimalistic first-stage system. This system mounts the CD and loads the compressed filesystem of the second-stage system into RAM. Afterwards, it changes the root filesystem to the seconde-stage system and starts init.

This example will create a CD with exactly the described behaviour. It only works with a 2.4-kernel, since it uses the pivot_root(8) utility (which in turns relies on the pivot_root(2) systemcall).

Systems using isolinux are simpler, but not every BIOS supports booting in the "no-emulation-mode" used by the isolinux-loader. So if you don't know your hardware or you know your hardware does not work with isolinux, you are stuck with the two-stage approach.

You will find detailed instructions about prereqs and configuration in the file README within the examples/TwoStageLinux-directory.

Top


My Homepage
Bernhard Bablok (mail @ bablokb.de)