Udpcast boot image generator
This section describes how to generate boot images yourself.
- mknbi (only needed for generating etherboot images), can be downloaded from Etherboot's site
- syslinux (for PXE, and CD-Rom. For floppy, the relevant files are already included with the image generator itself)
These additional packages are already supplied with most major distributions (Redhat, Kubuntu, Debian, SuSE, ...)
The image generator supports the following parameters:
|-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.|
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|
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.|
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:
|--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.|
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:
- This script is invoked before starting udpreceiver
- This script is invoked after udpreceiver has finished. It gets called with a single parameter, which is the exit status of udpreceiver
- This script is invoked before starting udpsender.
- This script is invoked after udpsender has finished. It gets called with a single parameter, which is the exit status of udpsender