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)
- Connect the null-modem (serial) cable to the APU2
- Open a terminal and connect with these settings:
115200 8N1
- prepare a usb stick with openwrt to boot
- Plug in the usb stick to the APU2
- Plug in the power to the APU2 and watch the terminal
- 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: - Now press 1 (the key 1 on your keyboard) to boot from the USB Stick
- Wait until the device is booted, this can take up to 3 minutes (most time it’s faster) it should look something like this:
if the openwrt ascii logo doesn’t appear, just press enter one time and it should be visible - 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
- now enter
ifconfig eth0
, you should get a output like this: - 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 - 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
- unzip the img file:
gunzip openwrt-18.06.1-x86-64-combined-squashfs.img.gz
- 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 - 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!) - now its time to reboot, type
reboot
and remove the usb stick - it should now boot from the internal SSD
install and access the webui (LuCi)
- 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
- use a terminal and connect via ssh:
ssh root@192.168.1.1
(or use the existing serial connection instead) - install luci, the webui:
opkg install luci
- access webui: point your browser to http://192.168.1.1