simple-cdd is a lovely piece of software that builds a custom D-I image with the package selection and preseeding of your choice.
Today I was asked to build a bootable USB key with the simple-cdd image. Here is how; the general case is described in the d-i manual:
General USB key preparation:
- download
vmlinuz
andinitrd.img
from hd-media apt-get install syslinux mtools mbr
- Partition the USB key as needed (from now on, I'll assume the usb key is in the device
/dev/sdb1
) - Format it as FAT:
mkdosfs /dev/sdb1
- Put the boot loader in it:
syslinux /dev/sdb1
- Put the MBR in it:
install-mbr /dev/sdb
- Mount it:
mount /dev/sdb1 /mnt
- Copy kernel and initrd:
cp vmlinuz initrd.img /mnt/
simple-cdd specific part:
- Run
build-simple-cdd
as usual - Copy the ISO file generated by
build-simple-cdd
in the USB key. Any name will do, as long as it ends in.iso
the installer will find it - Configure the boot loader, fetching the kernel command line out of the
cdrom boot loader generated by simple-cdd:
echo default vmlinuz > /mnt/syslinux.cfg
grep append tmp/cd-build/etch/boot1/isolinux/isolinux.cfg | head -1 | sed -e 's/^\t//' -e 's/ initrd=[^ ]*/ initrd=initrd.gz/' >> /mnt/syslinux.cfg
This is it, it works nicely, perfectly scriptable, tested today.