Debian-Installer: How to modify an existing CD image to preseed d-i
If you want to preseed DebianInstaller right from booting the installer CD, you can modify it to use an initrd which has your preseed.cfg file.
Create copy of image
You need one of the already built ISO images, which will be used as the basis that we modify. Because you can't modify an ?ISO9660 image, you've to copy it first:
... as root ...
# mkdir loopdir # mount -o loop your-image.iso loopdir # mkdir cd # rsync -a -H --exclude=TRANS.TBL loopdir/ cd # umount loopdir
If the above "mount -o loop" step produces errors you may need to load the loop module using # modprobe loop
Hack the initrd
... as root ...
# mkdir irmod # cd irmod # gzip -d < ../cd/install/2.6/initrd.gz | \ cpio --extract --verbose --make-directories --no-absolute-filenames # cp ../my_preseed.cfg preseed.cfg # find . | cpio -H newc --create --verbose | \ gzip -9 > ../cd/install/2.6/initrd.gz # cd ../ # rm -fr irmod/
I think it to be easier to just put the preseed.cfg on the CD Filesystem and mention it in isolinux.cfg (just add a new label and append preseed/file=/cdrom/preseed.cfg to the kernel command line). This approach doesn't require root. -- ?HelmutGrohne
Unless the preseed file is in the initrd image you cannot preseed the first three questions. --GuyHulbert
Sigh ... wrong again (for etch anyway ;-). See http://hands.com/d-i/, second paragraph. There is also a link to the appropriate part of the new d-i manual, for lazy folks like myself. However, I still need to do some sarge installs (disaster recovery testing) so only half wrong, I guess. --GuyHulbert
# cd cd # md5sum `find -follow -type f` > md5sum.txt # cd ..
Create new image
To make the cdrom bootable, you need to run genisoimage with appropriate parameters. Here is how to do it for x86/amd64, using isolinux.
Change to the top of the cd directory then:
To create the cdrom image using the isolinux boot image:
# genisoimage -o test.iso -r -J -no-emul-boot -boot-load-size 4 \ -boot-info-table -b isolinux/isolinux.bin -c isolinux/boot.cat ./cd
If you want you can do a quick test of the iso using qemu:
# qemu -net user -cdrom test.iso
Burn the image to cdrom
# cdrecord -dev /dev/hd? test.iso
Much of this information was gleaned from the wiki document DebianInstaller/Modify.