Things needed to get started
Connect the APU board with the NUC using the Serial cable.
Connect the APU and NUC with the Switch using the Network cables.
For this setup we used Ubuntu 16.04 LTS.
First off, configure the network interface to have a static IP.
$ sudo vim /etc/network/interfaces ... iface eno1 inet static address 192.168.111.1/24 ...
Start the interface with sudo ifup eno1
, you should get a link-up on the switch.
You can get output via the Serial cable by using screen
:
$ sudo apt-get install screen $ sudo screen /dev/ttyUSB0 115200
$ sudo apt-get update && sudo apt-get install maas
$ sudo maas createadmin
$ sudo apt-get install etherwake
$ git clone https://github.com/yosefrow/MAAS-WoL-driver
maas-etherwake.diff
and driver/etherwake.py
, so the query functions return 'unknown'
A power state lookup is coming up and still TODO
subprocess.call(["sudo", "etherwake", "-i", "eno1", context.get("power_mac")])
$ sudo visudo
and add the line maas ALL= NOPASSWD: /usr/sbin/etherwake
, where /usr/sbin/etherwake is the result of which etherwake
.$ PATCH_DIR="/usr/lib/python3/dist-packages/provisioningserver/" $ sudo patch -p1 -d ${PATCH_DIR} < maas-etherwake.diff $ sudo systemctl restart maas-rackd.service maas-regiond.service
Important facts on the APU2c4 Board:
net2
, next to the USB ports.[payload]setup
, where you can also make changes to the bootorder.
Since the manufacturer default BIOS settings do not fit our purpose and we want more automation, we create our own coreboot.rom
with the right default settings. Therefore, we use Docker as our build environment.
apt
package index:$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
, by searching for the last 8 characters of the fingerprint:$ sudo apt-key fingerprint 0EBFCD88
stable
repository:$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
$ sudo apt-get update
$ sudo apt-get install docker-ce
Now we are ready to create our build image.
$ mkdir apu2-docker && cd apu2-docker $ wget https://raw.githubusercontent.com/pcengines/apu2-documentation/master/Dockerfile
$ sudo docker build -t pc-engines/apu2 .
Now we have an image, which we can create containers with as our build environment.
$ mkdir apu_coreboot && cd apu_coreboot
$ git clone -b coreboot-4.6.x https://github.com/pcengines/coreboot.git $ git clone https://github.com/pcengines/apu2-documentation.git
$ docker run --rm -v ${PWD}:/workdir -t -i pc-engines/apu2 bash
$ cd /workdir/coreboot $ make menuconfig
1. select Mainboard
> Mainboard vendor
= PC Engines
2. select Mainboard
> Mainboard model
= APU2
/workdir/coreboot/src/mainboard/pcengines/apu2/variants/apu2/bootorder
: # Boot from harddisk first, PXE second 1 /pci@i0cf8/*@11/drive@0/disk@0 2 /rom@genroms/pxe.rom ... # Enable PXE boot by default pxen1
2. Edit /workdir/coreboot/src/mainboard/pcengines/apu2/bootorder_def
as in 1.
3. Edit /workdir/coreboot/src/mainboard/pcengines/apu2/bootorder_map
accordingly:
1 c mSATA 2 f iPXE
/workdir/coreboot/payloads/external/iPXE/ipxe/src/menu.ipxe
to autoboot from net2:make crossgcc-i386
make
The finished coreboot.rom
should now be located /workdir/coreboot/build .
Create a bootable USB stick (preferred: version 2.0) with TinyCore Linux
Note
: You might need to edit the provided label of the USB stick according to the /takemehome.sh on the booted TinyCore image. Ours pointed to the wrong label and thus couldn't find the proper folder (on the USB stick) for autostart.sh execution.
Also
: You might need to create a empty takemehome.txt file on the USB stick, so the takemehome script works properly. Therefore check the takemehome.sh again and edit accordingly.
Edit the autostart.sh on the USB stick to execute the flash command:
flashrom -w coreboot.rom -p internal
You can also edit in beep commands, to check for proper execution of the flash command. Then simply plug the USB stick into the APU Board, let it boot from it and wait for the flash to finish.