Udpcast boot image generator

This section describes how to generate boot images yourself.

If you have installed the Udpcast image generator .deb (or RPM), the boot image generator is located in /usr/lib/udpcast/makeImage, and needs the following additional packages to be installed:

These additional packages are already supplied with most major distributions (Redhat, Kubuntu, Debian, SuSE, ...)

The image generator supports the following parameters:

Syntax Explanation
-k kernel Specifies the location of the kernel to include on the bootimage. The kernel must be in bzImage format (i.e. the usual format). This parameter is mandatory
-f floppyImage Specifies the name of the floppy image to be generated (optional)
-c cdImage Specifies the name of the CD image to be generated (optional)
-n etherbootImage Specifies the name of the Etherboot ELF to be generated (optional)
-i initRd Keep the initrd image under this name (usually it is erased after floppy image, CD image and etherboot image have been generated). The initrd image is useful if you want to set up a PXE based network boot.
-m moduleList

Space-separated list of modules to include. If not specified, all modules that are present in /lib/modules/kernelVersion are included (CD and net images). For floppy images, the default module list is the following: e100 3c59x via-rhine 8139too sis900 ata_piix 8139cp tg3 ahci e1000 sata_sx4 ne2k-pci sata_via sata_uli b44 sata_sis sata_mv sata_nv winbond-840 pcnet32 sata_sil sata_promise.

Dependancies are managed automatically. For instance, if you include pcnet32, the image maker automatically also includes mii, which is needed by pcnet32

Module list parameter is mostly useful when makeing floppy images, where space is very tough. For CD's and network images, it doesn't make sense (and for these, all modules are included by default_.

If you have an USB keyboard, be sure to include the following modules usbkbd uhci-hcd ohci-hcd.

--bzip Compress initrd image using bzip2 rather than gzip. Only works if the kernel supports bzip2 compression for initrd. Kernel since 2.6.30-rc1 do support this
--lzma

Compress initrd image using LZMA rather than gzip. Only works if the kernel supports bzip2 compression for initrd. Kernels since 2.6.30-rc1 do support this.

LZMA is a new compression scheme which compresses even better than Bzip2 (on a sample initrd file, LZMA shrinks the file to 32.7%, versus 39.8% for bzip2 and 42.5% for gzip).

The decompressor (which runs at each boot) is faster than bzip2, but slower than gzip. The compressor is much slower than bzip2, but only needs to run during image generation.

--cpio Packages the initrd using cpio (initramfs) rather than mkromfs. This has the advantage of generating a writable and slightly smaller root filesystem. This is the default behavior for 2.6 kernels. For older kernels, the ramdisk was packaged as ROMFS
-t tarFile Makes a tar file of those network modules present in /lib/modules/kernelVersion, but which were not included in the main image. This tar file can then be optionnally stored on a second floppy, and read by the launcher.
-C configFile Optional udpcast config file to include.
-a kernel parameters Parameters to pass to the kernel. You may also include udpcast parameters in here
--fullbox Includes a more fully-featured version of busbox on the disk (which includes a shell with command-line completion, vi, a telnet client, wget, tftp, ...). This is default behaviour for CD and network images.
--nofullbox Includes lightweight busybox on the disk, which only contains the bare minimum to get udpcast working. This is the default behavior for floppy images.
-d ipMac-db

Includes an ip-mac database, which allows the bootloader to automatically pick an address without a DHCP server. This "database" is just a text file with one Mac to IP mapping per line. Lines starting with hash (#) are ignored. Example:

# Udpcast IP/Mac association file
00:5B:56:4b:42:9a  10.0.0.176
00:50:56:40:42:97  10.0.0.177
00:50:56:40:42:98  10.0.0.178
--prescript scriptName Include a script to be executed before the receiver or sender starts
--postscript scriptName Include a script to be executed after the receiver or sender starts
--merge target=src Include the file or directory located at src in the initrd, under the name target. Example: makeImage ... --merge /udpreceiver.post=my-udpreceiver.post includes the file my-udpreceiver.post as /udpreceiver.post into the initrd (this file will then be executed when udpreceiver is done). Note: When including dynamically linked executables into your udpcast boot disk, make sure to include all needed libraries as well, even trivial stuff such as libc, libm, etc. Indeed, by default, udpcast's own programs are linked statically, and thus no shared library is included by default. Use the ldd command to determine which libraries are needed by your program.

Examples:

Make a floppy image of kernel linux-3.1.6:

/usr/lib/udpcast/makeImage -t net-mod.tar.gz -k /usr/src/linux-3.1.6/arch/i386/boot/bzImage  -f /dev/fd0

Make an Etherboot image:

/usr/lib/udpcast/makeImage -k /usr/src/linux-3.1.6/arch/i386/boot/bzImage  -n /tftpboot/udpcast/etherboot.img

Make a floppy image containing support for the Pcnet32 card, and the acenic:

/usr/lib/udpcast/makeImage -m "pcnet32 acenic" -k /usr/src/linux-3.1.6/arch/i386/boot/bzImage  -f /dev/fd0

Post and pre scripts

It is possible to have custom code executed before or after the transfer:

/udpreceiver.pre
This script is invoked before starting udpreceiver
/udpreceiver.post
This script is invoked after udpreceiver has finished. It gets called with a single parameter, which is the exit status of udpreceiver
/udpsender.pre
This script is invoked before starting udpsender.
/udpsender.post
This script is invoked after udpsender has finished. It gets called with a single parameter, which is the exit status of udpsender
These scripts can easily be put into the initrd image by using the --merge option. If you call any custom binaries, don't forget to include the necessary libraries (or else, merge your binaries into busybox...)