How to install Openwrt on a APU2 (by pcengines)

What you need for this howto:

  • A APU2 device, like a APU2D4
  • a working serial connection to the APU2 how to connect to serial
  • a usb stick
  • a installed mini PCIe ssd

remark:

this is a howto install openwrt on a internal mini PCIe SSD of the APU2. It would be much easier to just boot openwrt from the usb stick (without installing it)


  1. Connect the null-modem (serial) cable to the APU2
  2. Open a terminal and connect with these settings: 115200 8N1
  3. prepare a usb stick with openwrt to boot
  4. Plug in the usb stick to the APU2
  5. Plug in the power to the APU2 and watch the terminal
  6. be ready to press the F10 key as soon as you see Press F10 key now for boot menu it should look something like this:
    Press F10 Screenshot
  7. Now press 1 (the key 1 on your keyboard) to boot from the USB Stick
  8. Wait until the device is booted, this can take up to 3 minutes (most time it’s faster) it should look something like this:
    Wait for boot if the openwrt ascii logo doesn’t appear, just press enter one time and it should be visible
  9. connect a ethernet cable to the WAN Port (its the the port on the left side, right alongside the serial port on the APU2), connect the other side of the cable to your LAN network
  10. now enter ifconfig eth0, you should get a output like this:
    ifconfig output
  11. now type opkg update && opkg install lsblk wget ca-certificates gzip into the terminal, press enter and wait for the installation to be done. this will install the the tools we need to install openwrt on the internal SSD
  12. to download openwrt, type: wget https://downloads.openwrt.org/releases/18.06.1/targets/x86/64/openwrt-18.06.1-x86-64-combined-squashfs.img.gz
  13. unzip the img file: gunzip openwrt-18.06.1-x86-64-combined-squashfs.img.gz
  14. now we need to find out which device is the internal SSD (most time it is /dev/sda, but always check first), we use the lsblk command for that. lsblk will list any recognized (block)storage device on the system. it should be /dev/sda
  15. warning: you loose all data on the device /dev/sda!
    now we use dd to write the openwrt image to the internal SSD: dd if=openwrt-18.06.1-x86-64-combined-squashfs.img of=/dev/sda (read the warning above!)
  16. now its time to reboot, type reboot and remove the usb stick
  17. it should now boot from the internal SSD

install and access the webui (LuCi)

  1. connect your Mac/PC to the LAN Port of the APU2 (should be the middle one) you should get a ip address like 192.168.1.2
  2. use a terminal and connect via ssh: ssh root@192.168.1.1 (or use the existing serial connection instead)
  3. install luci, the webui: opkg install luci
  4. access webui: point your browser to http://192.168.1.1