Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


pc_engines_apu_debian_bookworm

PC Engines APU/APU2 - Debian 12, Bookworm

2023-09-14 - This is a manual install guide for installing Debian 12 Bookworm on the PC Engines APU/APU2 board. It is a network based installation, you'll need to have a working internet connection using one of the Ethernet ports.

Documentation sources

Required hardware

  • APU board
  • Power supply
  • Internet over Ethernet
  • Serial (via Serial↔USB adapter)
  • mSATA SSD

Install Debian 12, Bookworm

  • Download the amd64 netinst ISO (a DVD image for offline install might work, not tested)
  • Copy syslinux image to USB:
    zcat boot.img.gz | sudo dd bs=4M iflag=fullblock of=/dev/sdX oflag=direct status=progress
  • Re-insert and then mount the USB drive:
    sudo mount /dev/sdX1 /mnt
  • Configure a serial console, edit /mnt/syslinux.cfg and add the 'serial' line:
    # D-I config version 2.0
    # search path for the c32 support libraries (libcom32, libutil etc.)
    path 
    prompt 0
    timeout 0
    serial 0 115200
    include menu.cfg
    default vesamenu.c32
  • Copy the netinst ISO image to the USB drive:
    cp debian-12.1.0-amd64-netinst.iso /mnt
  • Unmount the USB drive:
    umount /mnt
  • Boot the APU board from the USB drive (APU Boot menu = F12, APU2 = F10):
    Build date: Apr  5 2014
    System memory size: 4592 MB
    
    Press F12 for boot menu.
    
    Select boot device:
    
    1. AHCI/0: KINGSTON SMS200S330G ATA-8 Hard-Disk (28626 MiBytes
    2. USB MSC Drive SanDisk Ultra 1.00
    3. iPXE (PCI 00:00.0)
    4. Payload [setup]
    5. Payload [memtest]
  • Press i and <TAB>
  • Then change the command into the following:
    linux initrd=initrd.gz qfxpayload=text console=ttyS0,115200n8
  • Press <ENTER> to start install.
  • During installation, deselect any desktop environment and select the SSH server and standard system utilities.
  • If the console setting is not saved during next boot, i.e. no output to serial console, follow the next steps.
  • Edit the grub entry (press e in grub menu) and add console=ttyS0,115200n8 to the linux command-line parameters
  • Press Ctrl-x to boot
  • Log in and edit /etc/default/grub:
    GRUB_CMDLINE_LINUX="console=ttyS0,115200n8"
  • Update grub:
    update-grub
  • Reboot

Post-install

Firewall

  • Configure default firewall
    cp /usr/share/doc/nftables/examples/workstation.nft /etc/nftables.conf
    vi /etc/nftables.conf  # accept port 22 for example
    systemctl enable --now nftables

APU2 LEDs

Configure front LEDs to blink on network and disk activity.

  • Add ledtrig modules to /etc/modules.
    cat >> /etc/modules <<EOF
    ledtrig-default-on
    ledtrig-netdev
    ledtrig-heartbeat
    EOF
  • Load the modules with modprobe
  • Add settings to sysfs.conf:
    # Install sysfs utils
    apt install sysfsutils
    
    # Append config to /etc/sysfs.conf
    cat >> /etc/sysfs.conf <<EOF
    class/leds/apu2:green:led1/brightness = 1
    class/leds/apu2:green:led2/trigger = disk-activity
    class/leds/apu2:green:led3/trigger = netdev
    class/leds/apu2:green:led3/rx = 1
    class/leds/apu2:green:led3/tx = 1
    class/leds/apu2:green:led3/device_name = enp1s0
    EOF
  • Enable sysfs:
    systemctl enable sysfsutils
  • Reboot

Watchdog

  • Enable watchdog in BIOS, set timeout for example to 300 seconds.
  • Disable i2c_piix4 https://pcengines.github.io/apu2-documentation/theory-of-operation/
    cat > /etc/modprobe.d/noi2c.conf <<EOF
    # Disable i2c_piix4, see https://pcengines.github.io/apu2-documentation/theory-of-operation/
    blacklist i2c_piix4
    EOF
  • Update initramfs.
    update-initramfs -u
  • Edit /etc/systemd/system.conf and enable watchdog.
    RuntimeWatchdogSec=60
  • Reboot
  • Test the watchdog by pausing the init process. It should reboot after the configured timeout.
    apt install gdb
    gdb -p 1
pc_engines_apu_debian_bookworm.txt · Last modified: 2023/09/20 20:30 by admin