I want to add files that will be used at the end of the install via preseed/late_command. Those will be a script that will get executed as well as some files the script will use.

At the moment, I have a checkout of debian-installer package and can build the netboot iso with make build_netboot (from within build subdirectory).

  • I guess you can mount the iso, add the files you want, and then close up the iso. Are you looking for the details of how to do that, or did I miss the point of your question? – SauceCode Feb 16 '17 at 0:41
  • I would like to avoid taking that hacky path, and rather have it on the iso by the time I run make build_netboot. – tshepang Feb 16 '17 at 10:09

You needn't rebuild anything (at least for this) if you start the installer via Syslinux (or extlinux or isolinux or pxelinux): this family of boot loaders can handle multiple initramfs images and you get the union of them as the installer file system. So just put all the needed files in a directory, enter it and do something like

find -print0 | cpio --create --format=newc --owner 0:0 --null --quiet | gzip -9n >../overlay.cpio.gz

Then copy overlay.cpio.gz next to initrd.gz of the installer and change the relevant APPEND line to contain initrd=initrd.gz,overlay.cpio.gz.

  • Would that be the initrd in build/dest/netboot/debian-installer/amd64? – tshepang Feb 16 '17 at 10:15
  • Probably. But I'd just use the text- or GTK-mode one from the debian-installer-8-netboot-amd64 package (as appropriate). – Ferenc Wágner Feb 16 '17 at 11:09
  • How do I turn it into an iso file? – tshepang Feb 16 '17 at 11:43
  • Use genisoimage or xorriso as detailed at wiki.debian.org/DebianInstaller/Modify/CD. Basically, it all comes down to following the ISOLINUX instructions with modern tools. – Ferenc Wágner Feb 16 '17 at 21:25

Create a local config override file and use EXTRAFILES variable to specify those files, example (assuming you are inside build/ on debian-installer checkout):

echo 'EXTRAFILES = script.sh file1.txt file.json' > config/local

From there on, build the netboot iso:

make build_netboot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.