Bootloader
The bootloader of udpcast version uses busybox.
The boot loader can be started in 4 different ways:
- From floppy. Only one single floppy is now needed, unless you need more rarely used modules.
- From an XDF floppy (supersized floppy, with more modules)
- From an XXDF floppy (even larger supersized floppy, with even more modules)
- From CD.
- From Etherboot
- From PXE
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
- Floppy image (non-PCMIA)
- Additional modules (those left out from the non-PCMCIA disk)
- Floppy image (PCMCIA)
- Custom floppy image (Cast-o-matic)
- The first image: Chose either udpcflop.img or udpflop-pcmcia.img:
cat udpflop.img >/dev/fd0
or
cat udpflop-pcmcia.img >/dev/fd0 - The tar file (to another floppy):
mformat -s 18 -h 2 -t 80 a: mcopy net-mod-tar.gz a:
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:
- The disk image.
- The program used for writing/formating the disk: xdfcopy.
Usage:
xdfcopy xdf-udpc.img /dev/fd0
Xdfcopy is also included in fdutils.
After booting is done, press enter.
NoteIf 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:
- LINUX must be the second entry in the root directory
- INITRD must be the third entry in the root directory
- Neither LINUX nor INITRD may be fragmented, and there should be no unused space between them.
In order to achieve this:
- If you replace the kernel (LINUX), first mdel both LINUX and INITRD, then place the new kernel (LINUX), then INITRD (even if it is the same).
- INITRD may be replaced without rewriting the kernel to the disk
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:
- The disk image.
- The program used for writing/formating the disk: xdfcopy.
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
- Etherboot image for 2.6.32.7 kernel
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).
- Pxelinux.0, the first stage (you can also take it from your local syslinux installation)
- default, the PXE Linux configuration file. Store this into /tftpboot/udpcast/pxelinux.cfg/default. This file may contain, in the kernel's append line, config parameters as described below.
- linux the kernel (2.6.32.7)
- initrd the ramdisk (with 2.6.32.7 libraries)
Then, add the following to your dhcp.conf:
filename "udpcast/pxelinux.0";
next-server 10.0.0.1;
The menu system
- You start with chosing your language (English, French, German, Danish or Luxembourgish).
- Then you chose your keyboard map (US, Swiss German, Belgian)
- Then the system proposes you one (or more) network modules that matches any PCI network cards that were autodetected. You can either chose that module, or select OTHER, in which case you will get a complete list of supported drivers. If no PCI cards were detected (for instance, because you have only ISA or PCMCIA cards), it skips directly to the complete list.
- Once you've chosen a network module, you may optionnally add parameters (mostly relevant for ISA cards...)
- Then you are asked whether you want to autoconfigure using Bootp/DHCP, or whether you want to manually enter an IP and netmask.
- After having entered the network configuration, you get to chose the port which Udpcast should use. Usually the default choice (9000) is ok. You only need to chose a different port if another application already uses UDP port 9000 or 9001.
- Then you get to chose the hard disk to clone. You may chose whole disks or partitions. You first get proposed a list of autodetected devices, but if you chose OTHER, you can manually enter a different path.
- Then you may enter additional parameters for udpcast. Usually none are needed. Udpcast's command line parameters are described here.
- Then, you get to chose the compression mode: no compression, gzip or lzop. Under normal circumstances, all participating machines should use the same compression mode. Two compressors are available: gzip (better compression ratio), and lzop (faster compression speed). As the whole point of using a compressed transfer is to speed it up, lzop is the recommended compressor (unless you have a processor fast enough that the difference in speed between gzip and lzop doesn't matter).
- Then, you get to chose the mode: receive data or send data. There may only be one sender, but many receivers.
- Finally, if running from floppy, you get the option to save the answers to your questions. If so, then the next time you boot from this floppy, no questions are asked, and everything happens fully automatically. This configuration is stored in a file named udpcfg.txt. You can copy this file on other floppies, or use it with the -C parameter of makeImage, to include it for the other boot methods (CD or network).
- If you chose to save the config, you get to chose whether you also want to save the send/receive choice. If you do not save that choice, you'll get asked a single question when booting your pre-configured disk: wether to send or to receive. This is useful for having a same preconfigured disk for senders and receivers.
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:
- Alt+F6 shows you the kernel messages.
- Alt+F7 shows you the stderr of udpcdialog.
- Alt+F1 brings you back to the interactive dialog.
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:
- stored directly on the udpcast floppy:
mcopy udpcfg.txt a: - or, for other media, included using the --savefile option:
/usr/lib/udpcast/makeImage -k /usr/lib/udpcast/kernel/vmlinuz-2.6.32.7udpcast -c t.iso --savefile udpcfg.txt
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:- udpcast-20100130.tar.gz udpcast itself
- udpbusybox-20100131.tar.gz the menu system (includes modified dialog library)
- busybox a utility which combines tiny versions of many common UNIX utilities into a single small executable.
- addBbApp.pl script to add a new application to busybox.
- busybox-config-maxi-1.16.0.txt configuration file for compiling "fullbox" format of busybox
- busybox-config-mini-1.16.0.txt configuration file for minimal format of busybox
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.
