0

For the retrofit of some older embedded (Intel, x86) PCs I would like to install a customized Debian image with as little as possible user interaction.

Normally I would create a Debian installation, customize it (install packages, configuration files, etc) then remove all device-specific configuration (SSH Host keys etc) create an image file, and flash that image to the destination hard disk.

But for my new use case I want to automate the flashing process: Create a bootable USB thumb drive with a kind of live system. As soon as the USB boots it runs some checks and then uses dd to transfer the image to the hard drive. The OS then waits for the USB drive to be removed and reboots the PC.

Is this a best practice for headless Linux installation? Are there better alternative approaches?

Signaling the user the installation progress (when to remove the USB drive etc.) can be done using fairly prominent status LEDs on the front of the device.

1
  • "preeseed.cfg" is the correct keyword for this. A configuration that contains "answers" to all installer-tasks.
    – ppuschmann
    Commented Mar 26, 2021 at 15:44

1 Answer 1

0

The common approach is preseeding the Debian installer, which allows you to answer any questions the installer normally asks and select additional packages to install.

If you have special configuration files, you can put them into packages as well.

The big advantage over dd is that this method generates different UUIDs for harddisks on every machine, which seems unimportant until you ever have two disks with the same UUID in the same box.

This will also handle bootloader installation correctly for you, which you'd have to hack yourself with the dd method, and you can use standard Debian installer images.

2
  • Thanks for your answer. Do you know if it is possible to hook into the installer process directly? For example to signal the user that the installation is ongoing or completed via the onboard LEDs?
    – c3ntry
    Commented Mar 19, 2021 at 8:43
  • The installer itself consists of packages that hook into the menu structure, and you can add your own, reference them from the preseed file as additional installer modules (udebs) to load. This allows you to run arbitrary programs in basically every stage of the installer (but for the stages before "installer media detection" you need to change the installer image. Commented Mar 19, 2021 at 9:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .