Last modified: "2020-04-13 10:27:33 jurjen"
How to set preseed values inside an Ubuntu installer iso. This is useful when using DHCP/PXE is not feasible.
This page leans heavily on https://wiki.debian.org/DebianInstaller/Preseed/EditIso.
sudo apt-get install xorriso isolinux
wget http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/installer-amd64/current/images/netboot/mini.iso
Be careful not to use too old an iso.
7z x -oDESTINATION mini.iso
If you don't know which file to edit, you could create this fancy graph, where an arrow from A to B means A may include B, and a diamond arrow means A might cause syslinux to restart using B as a config file.
using this ad-hoc command:
(cd DESTINATION && \
TF=$(tempfile) ; \
for f in $(ls -1 *.cfg) ; do \
grep -i ${f} *.cfg ; \
done| \
sed -E \
'1 s/^/strict digraph {\n/ ;
/[[:space:]]config[[:space:]]/ s/[\n\r]/ [arrowhead = diamond]/ ;
s/:[[:space:]]*(include|config)/ -> / ;
s/\./_/g ; $ s/$/\n}\n/' >${TF} ; \
dot -Tsvg ${TF} > ../syslinux_menucfg_dep_graph.svg ;\
rm -f ${TF} \
)
Consider DESTINATION/txt.cfg
(line numbers added):
1 default install 2 label install 3 menu label ^Install 4 menu default 5 kernel linux 6 append vga=788 initrd=initrd.gz --- quiet 7 label cli 8 menu label ^Command-line install 9 kernel linux 10 append tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false vga=788 initrd=initrd.gz --- quiet
We changed line 6 (this time without line number) into:
append vga=788 initrd=initrd.gz auto=true ipv6.disable=1 priority=high locale=en_US hostname=myhost domain=mydomain.com console-setup/layoutcode=us console-setup/ask_detect=false keyboard-configuration/layoutcode=us url=http://path/to/preseed.txt pkgsel:pkgsel/update-policy="Install security updates automatically" postfix:postfix/mailname="host.mydomain.com" --- quiet
We also tried to change the timeout. But that failed, and in hindsight it wouldn't even have served our purpose. So we stopped trying.
xorriso -as mkisofs -o lwp.iso -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -c boot.cat -b isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table DESTINATION
[1] Pkgsel and postfix are examples of how to preseed using kernel boot parameters. Find out what those parameters are by querying debconf.