January 8, 2015

PC Engines APU: Installing debian

Until now, I only ran pfSense on my PC Engines APU boards. But I now wanted to get one of them running under Debian Linux.

The first challenge is creating a live Linux that starts a serial terminal on boot. I found that this was the easiest using Grml2Usb. I booted Grml on my normal PC and plugged in a USB stick. Then, using a Grml ISO image, I did the following:

grml2usb --fat16 --bootoptions="vga=off" --bootoptions="fb=false" --bootoptions="console=ttyS0,115200n8" grml96-full.iso /dev/sdz1

This formats /dev/sdz1 and creates a Grml stick that automatically starts a serial console.

Then, boot from that stick. Using the awesome grml-debootstrap you can debootstrap a Debian installation on your APU. After that, you have to chroot into your new installation:

mount /dev/sda1 /mnt
mount -t sysfs sys /mnt/sys
mount -t proc proc /mnt/proc
mount -o bind /dev /mnt/dev
chroot /mnt /bin/bash

First, edit /etc/default/grub to make Grub aware of your serial port. To do that, set the following variables there (replacing them if they already exist):

GRUB_CMDLINE_LINUX_DEFAULT="gfxpayload=text fb=false console=ttyS0,115200n8"
GRUB_TERMINAL="serial"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

Then, make Debian spawn a shell on your serial port. Edit /etc/inittab and uncomment the following line:

T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100

Afterwards run update-grub and reboot. You should see Grub and then your Debian booting!

Powered by Hugo & Kiss.