xand

Debian netboot install with serial console

The Debian GNU/Linux netboot installer does not support serial consoles by default. This is problematic when installing onto hardware which does not have video output, e.g. a PC Engines apu1d. In the configuration below the serial port is set to 115200, you may need to adjust this to suit.

Setup DHCP/TFTP servers

I assume these have already been setup and are working.

Obtain netboot installer

Download the netboot installer e.g. https://www.mirrorservice.org/sites/ftp.uk.debian.org/debian/dists/stable/main/installer-amd64/current/images/netboot/netboot.tar.gz and extract the contents to your tftpboot directory.

Enable serial console for the boot menu

Edit tftpboot/debian-installer/amd64/boot-screens/syslinux.cfg so it looks like this:

# D-I config version 2.0
# search path for the c32 support libraries (libcom32, libutil etc.)
serial 0 115200
path debian-installer/amd64/boot-screens/
include debian-installer/amd64/boot-screens/menu.cfg
default debian-installer/amd64/boot-screens/vesamenu.c32
prompt 0
timeout 0

Enable serial console for actual installer

This assumes you are using the expert mode installer. You should make /storage/tftpboot/debian-installer/amd64/boot-screens/adtxt.cfg resemble this:

label expert
    menu label ^Expert install
    kernel debian-installer/amd64/linux
    append priority=low vga=788 initrd=debian-installer/amd64/initrd.gz --- 
label expertserial
    menu label ^Expert install with serial console
    kernel debian-installer/amd64/linux
    append priority=low console=ttyS0,115200n8r initrd=debian-installer/amd64/initrd.gz --- 
include debian-installer/amd64/boot-screens/rqtxt.cfg
label auto
    menu label ^Automated install
    kernel debian-installer/amd64/linux
    append auto=true priority=critical vga=788 initrd=debian-installer/amd64/initrd.gz --- quiet 

Boot the installer

With a serial (null-modem) cable connected from your device to another PC you can use a program such GNU Screen to connect to the console:

screen /dev/ttyUSB0 115200

where ttyUSB0 is the first USB serial port.

Turn the device on and you should see it booting within that screen session. You may need to press a key e.g. F12 to bring up a boot menu and choose PXE or network boot. Assuming all works you'll see the following:

debian installer boot screen

Choose Advanced options and then Expert install with serial console as that is the option we have enabled for serial console.

Post-install tasks

After installing and rebooting, ssh to the new installation and then:

Firstly, edit /etc/default/grub and set the following line (edit the existing entry):

GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0,115200n8r"

Next, run update-grub.

When you reboot, you should see kernel messages when booting, and a login prompt, on the serial console.

© 2019 xand