Bootloader

The bootloader of udpcast version uses busybox.

The boot loader can be started in 4 different ways:

Udpcast also has a boot image generator, which should make it easy to upgrade to new kernels, when new cards, drivers, etc. come out.

The bootloader has a menu system that guides you through the various choices, and finally launched udcpast.

The menu system may be preconfigured (default choices, automatic starting) using a file on the boot media.

Downloadable boot images

The floppy images

Install them on floppy as follows:

The first image contains support for most common PCI cards (or PCMCIA cards). If you have one of those cards, you don't need the extra modules.

The XDF floppy image

XDF is a special floppy `format', which allows to cram up to 1840K on a single floppy disk. Alexander van Heukelum recently wrote a boot loader that makes it possible to boot from such a floppy.

The following files are needed:

Usage:


xdfcopy xdf-udpc.img /dev/fd0

Xdfcopy is also included in fdutils.

After booting is done, press enter.

Note

If you want to use a different kernel or initrd than the one shipped: you can replace them using mcopy: just specify the use_xdf flag in your mtools.conf file. However, be aware that this is a very early version of XDFLOAD, which is not yet able to fully parse a FAT filesystem, and needs stuff to be placed in a certain way:

In order to achieve this:

The XDF filesystem is actually a double filesystem: there is the main filesystem containing XDFLOAD, LINUX and INITRD, and there is a small stub filesystem, which contains just a handful of sectors, which may be read even by a non-XDF aware OS. The Udpcast save file will be saved on the small stub filesystem. In order to access this, use an mtools drive definition without the use_xdf flag:


 drive a: file="/dev/fd0"   use_xdf=1
 drive b: file="/dev/fd0"

With this configuration, mdir a: shows the contents of the "big" filesystem, whereas mdir b: shows the contents of the small (stub) filesystem.

The XXDF floppy image

XXDF is a special floppy `format', which allows to cram up to 1920K on a single floppy disk. Alexander van Heukelum recently wrote a boot loader that makes it possible to boot from such a floppy.

The following files are needed:

Usage:


xdfcopy xdf-udpc4.img /dev/fd0

Xdfcopy is also included in fdutils.

After booting is done, press enter.

The following figure shows the net modules that are included:


# ls /mnt/lib/modules/2.6.16-udpcast/kernel/drivers/net/
.          aironet4500_card.ko eepro100.ko  lp486e.ko   smc9194.o
..         aironet4500_core.ko eepro.ko     mii.ko      starfire.o
3c501.ko   at1700.ko           eexpress.ko  natsemi.ko  tg3.o
3c503.ko   atp.ko              epic100.ko   ne2k-pci.ko tlan.o
3c507.ko   de600.ko            eth16i.ko    ne.ko       tulip
3c515.ko   de620.ko            fealnx.ko    ni5010.ko   typhoon.o
3c59x.ko   depca.ko            forcedeth.ko ni52.ko     via-rhine.o
8139cp.ko  dl2k.ko             hamachi.ko   ns83820.ko  wd.o
8139too.ko dmfe.ko             hp100.ko     pcmcia      winbond-840.o
82596.ko   e100                hp.ko        pcnet32.ko  wireless
8390.ko    e1000               hp-plus.ko   r8169.o
ac3200.ko  e2100.ko            lance.ko     sis900.o

Same precautions apply if you want to replace the kernel or initrd

The CD image

Burn is on CD as follows:

cdrecord dev=1,0,0 speed=4 udpcd.iso

The Etherboot image

Make a /tftpboot/udpcast directory on the boot server, and store the file in there. Then include the following text into your Dhcp configuration (either directly into the subnet section, or in the section for the specific workstation):


   filename "udpcast/udpetherbt.img";
   option vendor-encapsulated-options 3c:09:45:74:68:65:72:62:6f:6f:74:ff;
   next-server 10.0.0.1;
(replace 10.0.0.1 with the IP of your TFTP server).

PXE images

Make a /tftpboot/udpcast directory on your TFTP server, and place the following files in there (with the exception of the config file, which goes into a pxelinux.cfg subdirectory).

Then, add the following to your dhcp.conf:


   filename "udpcast/pxelinux.0";
   next-server 10.0.0.1;

The menu system

During the whole process alert boxes may pop up. If they are grey, they contain informational messages only, if they are red, they mean an error or abnormal condition.

For expert users, it's possible to press Alt+F2, Alt+F3, Alt+F4 to get a shell. There are unfortunately not many commands installed on the floppy version, except gzip, tar, mount, umount, modprobe and insmod. Sorry, space constraints on the floppy version.

The CD and netbootable versions are more fully featured, and include a shell with command line completion, a telnet client, wget, tftp, vi, as well as many common shell tools (cp, mv, ...). With these, the udpcast disk may double as a rescue disk.

The following virtual consoles are available:

The configuration file

The easyest way to obtain a configuration file is to boot from floppy, save the config when asked for, and then just copy the config file (udpcfg.txt) over to the other media.

However, you can also make it manually.

parameter explanation
auto If this is set to yes, everything happens automatically. The dialog only stops if an error occurs, or if a parameter is missing. If on the other hand auto is set to no, the user is prompted for all choice, but the choice from this file is pre-selected.
lang The language. Supported are US (English), DA (Danish), DE (German) and FR (France).
kbmap The keyboard map. Supported are US, SG (Swiss German), BE (Belgian), FR (French) and DE (German). Sorry for these "weird" choices, those are just the keyboard types that are popular here in Luxembourg (Luxembourg doesn't have an own mapping...)
netmodule The name of the network module chosen. If this is AUTO, use the first autodetected PCI module
netmodparm Network module parameters
dhcp If yes, configure IP with DHCP. If no, the config file should also contain an ip and netmask parameter
ip Ip address of client. Ignored if dhcp is yes
netmask Netmask. Ignored if dhcp is yes
port TCP port that udpcast should use
enableDiskmodule if yes, enable disk module (SCSI or SATA driver), if no disable it. If not set, prompt user
diskmodule The name of an optional disk module (for SCSI or SATA).
diskmodparm Disk module parameters
disk disk to be cloned
compr none for no compression, gz for compressed operation using gzip, lzop for compressed operation using lzop
umode rcv for receiver, and snd for sender
udpcparam any free-form command line parameters for udpcast

Example:


auto=yes
lang=US
kbmap=US
netmodule=pcnet32
netmodparm=
dhcp=yes
port=9000
disk=/dev/hda
mode=0
udpcparam=

Editing the config file manually allows to do interesting things. For instance, if you just delete the mode parameter, and leave everything else, you get a disk which does everything automatic, except to ask whether to send or receive.

Note: you can also pass the parameters that would normally go into the config file as kernel parameters. This is especially handy in the case of a boot via PXE, where the kernel parameters are in an easily accessible text file.

The config file may be either:

You may of course also use cast-o-matic which does all of this automatically for you.

Sources

In order to compile the menu system, first get the following software, and put them into one directory:

To compile, download a virgin 1.16.0 busybox tar file (or later) from http://www.busybox.net/, and proceed as follows:


tar xfjv busybox-1.16.0.tar.bz2
cd busybox-1.16.0
tar xfzv ../udpcast-20100130.tar.gz
(cd udpcast-20100130  && ./configure)
tar xfzv ../udpbusybox-20100131.tar.gz
../addBbApp.pl udpcdialog udpcast-20100130
cp ../busybox-config-mini-1.16.0.txt .config
sed -i 's/\(LDLIBS[ \t]*:=\)/\1 pthread lzo2 ncurses/g' Makefile
make

Note: depending on your glibc version, you'll get warning messages after compilation such as the following:


./networking/udhcp/udhcp.a(files.o)(.text+0x1f): In function `read_ip':
: Using 'gethostbyname' in statically linked applications requires at runtime
the shared libraries from the glibc version used for linking

However, the resulting busybox executable still works with no ill effect. Thus, you can safely ignore these messages.

Copy .config.maxi to .config and compile again to get the "fullbox" version (for CD and netboot images).

If you need to patch udpcast or udpcdialog with your own modifications, you may do so before make.

Undulatus Asperatus Clouds