1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
#+TITLE: Installing OpenBSD on a PC Engines APU2
#+DATE: 2020-07-07T21:21:18-04:00
#+DRAFT: false
#+DESCRIPTION: How I installed OpenBSD ob my new PC Engines APU2
#+TAGS[]: openbsd pcengines
#+KEYWORDS[]: openbsd pcengines
#+SLUG:
#+SUMMARY:
#+ATTR_HTML: :tag OpenBSD APU2
#+ATTR_HTML: :title OpenBSD APU2
[[file:OpenBSD%20APU2.jpg]]
I recently purchased a new [[https://www.pcengines.ch/apu2e4.htm][PC Engines APU2E4]] to use as a home
router. I purchased the kit, which includes the board, case, and power
supply from [[https://corpshadow.biz/][CorpShadow]]. I also ordered the DB9F to USB adapter
(Silicon Labs CP2104), so I don't need to get a separate null modem
connector. They're the only PC Engines distributor in Canada listed
on the PC Engines website. I had a great experience with CorpShadow,
they also sell a lot of other small single board PCs, so check them
out if you live in Canada.
I also ordered a 128 GB mSATA SSD, as it significantly out-performs
any SD card you might put in the machine. While it's not necessary,
and an SD card would be much cheaper, I find the improved read and
write speeds are worth it. I got it from Canada Computers, as they
seemed to have the best price on one. mSATA SSDs are surprisingly not
as common as one might think on PC parts websites. And even when they
have one, I've found most sites will only carry one brand.
The first step was to install the heat sync onto the CPU. This is
described on the PC Engines website. The heat sync is effectively just
a block of aluminum that you use to thermally bridge the CPU to the
enclosure. They're connected with, what I assume is, thermally
conductive double sided tape, which they provide for you.
After the CPU is stuck to the enclosure using the tape and the board
is screwed in place, I installed the mSATA SSD into the first
expansion slot labelled =mSATA=. Then I screwed the top of the case
on, plugged the antenna holes with the provided rubber stoppers, and
screwed the bolts back on the RS232 port. These things are really easy
to put together!
I downloaded the AMD64 =installXX.fs= image from the OpenBSD [[https://www.openbsd.org/faq/faq4.html#Download][download
page]] and burned it onto a spare USB drive I had lying around using
=dd=. After that I inserted the drive into the USB port on the APU2.
I then plugged one end of the DB9F end of the serial adapter into the
APU2, and the USB end into my PC. My desktop runs Fedora, so I had to
install the =cu= utility using
#+BEGIN_SRC shell
sudo dnf install cu
#+END_SRC
I then dialed it up using the serial adapter with the command
#+BEGIN_SRC shell
sudo cu -s 115200 -l /dev/ttyUSB0
#+END_SRC
I plugged in the power connector into the APU2, and I saw the boot
info in my terminal! It's really cool that these things use SeaBIOS
and Coreboot.
It automatically booted from the USB device, and I got dropped into
the OpenBSD =boot>= prompt. Instead of pressing enter like normal, I
entered
#+BEGIN_SRC
boot> stty com0 115200
boot> set tty com0
#+END_SRC
The first command sets the baud rate for the serial connection. The
second command tells the OpenBSD installer to set the default TTY to
the serial port =COM0=. Without these, the machine will start to boot,
fail to find an output, and reboot.
After that the installation went along as a normal install would. I
wasn't connected to the internet, but I already knew what IP was
assigning it, so I entered that manually when asked. I also installed
the sets from the USB. To do that, when prompted for the location of
the sets, type =disk=, when asked if it's already mounted type =no=,
then select the default partition and path, and continue without
signature. The signature isn't required since it's part of the install
media (assuming you verified the signature of the install media).
After the install was done, I moved it to where I will be leaving it
to run, plugged in the power and ethernet, and SSH'd in. At that point
I ran [[https://man.openbsd.org/fw_update][=fw_update(1)=]] to pull in any extra firmware I might need, and
[[https://man.openbsd.org/syspatch][=syspatch(8)=]] to keep myself up to date with security patches. I was also
sure to add my user to the [[https://man.openbsd.org/doas.conf][=doas.conf(5)=]] config file.
I kept the serial adapter connected and plugged it into another
OpenBSD machine I have right next to it, so if I ever have any trouble
booting, I can always SSH into the other machine and dial into the
serial connector to work things out without having to physically plug
the APU2 into my laptop.
To connect to the serial device through the other OpenBSD machine, I
just run
#+BEGIN_SRC shell
doas cu -s 115200 -l /dev/cuaU0
#+END_SRC
You can always find the serial device through plugging the adapter in
and checking =dmesg=. You can also allow non-root users to dial into
serial devices by adding your user to the =dialer= group.
#+BEGIN_SRC shell
doas usermod -G dialer <user>
#+END_SRC
Finally to complete the build, I added the OpenBSD sticker!
|