Udpcast boot image generator

This section describes how to generate boot images yourself.

If you have installed the Udpcast image generator .deb, the boot image generator is located in /usr/lib/udpcast/makeImage, and needs the following additional package 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
-c cdImage Specifies the name of the CD image to be generated (optional)
-i initRd Keep the initrd image under this name (usually it is erased after the CD image has 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).

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

If no kodule list parameter is specified, 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
-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.
-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.

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...)