#!/bin/sh # Shell script to build the ISO. # We use simple-cdd, but then need to patch the resulting # ISO to avoid GRUB/isolinux prompting for the installation # method and to avoid the Debian installer from asking questions # about the language (which it does before reading the preseed # file with the configuration, so those MUST be passed via # kernel parameters. Badly documented!). # What does not yet work: # - Debian installer asks for the 'wootaler' profile. # (not sure which option to set in profiles/wootaler.preseed, # or if using 'profiles' is the wrong approach entirely here) set -eu ISO=installer.iso if [ -f $ISO ] then echo "Confirm removal of existing '$ISO' by pressing 'y':" rm -i $ISO if [ -f $ISO ] then echo "'$ISO' already exists, exiting..." exit 0 fi fi # Will create images/debian-10-amd64-CD-1.iso export KERNEL_PARAMS="preseed/file=/cdrom/simple-cdd/default.preseed locale=en_US.UTF-8 keymap=us language=en country=US" build-simple-cdd --force-root --verbose --profiles wootaler --auto-profiles wootaler --dist buster # Use shell variable, in case the above changes in the future... IMG=images/debian-10-amd64-CD-1.iso # Create directory for unpacking the ISO rm -rf cd/ mkdir cd/ bsdtar -C cd/ -xf $IMG chmod -R +w cd/ # Modify ISO # This may seem to have no effect, as GRUB is usually not used to boot the ISO. # But, just better be safe. # Make sure to also adjust kernel parameters here! cp iso/grub.cfg cd/boot/grub/ # Change 'timeout' to 2 to ensure we boot non-interactively cp iso/isolinux.cfg cd/isolinux/ # Remove graphical installer option from menu, so text-based is first cp iso/menu.cfg cd/isolinux/ # Adds kernel parameters to setup language in Debian installer cp iso/txt.cfg cd/isolinux/ # Finally, pack the ISO # Extract header from original ISO dd if=$IMG bs=1 count=432 of=isohdpfx.bin xorriso -as mkisofs -o $ISO -isohybrid-mbr isohdpfx.bin -c isolinux/boot.cat -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table ./cd # Delete temporary files rm isohdpfx.bin -r cd/