OPNsense Forum

Archive => 15.7 Legacy Series => Topic started by: BrianLloyd on November 06, 2015, 12:48:31 am

Title: [SOLVED] Bootstrapping a PCEngines APU1D4
Post by: BrianLloyd on November 06, 2015, 12:48:31 am
I apologize for asking what has undoubtedly been answered before but after half a day of searching the forum and other resources, I haven't yet found an answer. That having been said ...

I am trying to bootstrap a new, bare PCEngines APU1D4 to run OPNsense. I have equipped the APU with a 16GB SD card and I have copied the installer onto an 8GB USB flash drive and plugged that into the upper USB port. The startup messages show that the BIOS/bootstrap is seeing both drives. In fact, here is the console output:

PC Engines APU BIOS build date: Sep  8 2014
Total memory 4096 MB
AMD G-T40E Processor
CPU MHz=1000
USB MSC blksize=512 sectors=31116288
USB MSC blksize=512 sectors=15240576
Press F10 key now for boot menu:
drive 0x000f2a80: PCHS=0/0/0 translation=lba LCHS=1024/255/63 s=31116288
drive 0x000f2ab0: PCHS=0/0/0 translation=lba LCHS=948/255/63 s=15240576
Booting from Hard Disk...

At this point nothing further happens.

Now, part of my problem is with the BIOS/bootstrap. I suspect that pressing the F10 key (what that might correspond to on a serial ASCII terminal keyboard I haven't a clue) might let me select the boot drive. (I have a query in to PCEngines but haven't heard back yet.) It certainly doesn't appear to be finding the install image on the USB flash drive. (OPNsense-15.7.11-OpenSSL-serial-amd64.img)

But it would be helpful if there existed a clearly described path from zero to running OPNsense on a an SBC appliance such as the PCE APU. I know it is possible but, so far, I have been unsuccessful.

Help?

Thanks!
Title: Re: Bootstrapping a PCEngines APU1D4
Post by: HrvojeS on November 06, 2015, 01:12:56 am
Hello Brian,

While I don't own one of these yet, I did some research on the when they came out a while back and noticed bunch of people had similar boot problems, albeit on different but similar OS.

Did you by chance try doing any of these:
http://www.yawarra.com.au/tutorials/how-to-install-pfsense-on-an-apu
https://forum.pfsense.org/index.php?topic=59555.msg406438#msg406438

Both seem to indicate that there are specific kernel parameters that need to be passed as well as serial baud rate that needs to be changed during boot time.

Hope this helps. Best regards,

Hrv
Title: Re: Bootstrapping a PCEngines APU1D4
Post by: BrianLloyd on November 06, 2015, 04:55:35 am
Thanks. It gave me some hints.

I was finally successful by removing the SD card, letting it boot from the USB flash drive, and then reinserting the SD card after the boot was underway. After that installation proceeded normally.

So, to install on a PCEngines APU1D:

1. Copy OPNsense-15.7.11-OpenSSL-serial-amd64.img to a USB flash drive.
2. Boot from the flash drive with no SD card in the APU board.
3. Once booting from the flash drive is underway, insert the SD card.
4. Proceed with the normal installation.

Thanks for your response.
Title: Re: Bootstrapping a PCEngines APU1D4
Post by: jstrebel on November 06, 2015, 08:48:52 am
Brian,
I do it the following way for the APU.
1) Download the OPNsense-15.7.11-OpenSSL-nano-amd64.img.bz2.
2) Decompress this Image
3) do a "dd" if you use a Unix based PC or phydiskwrite .exe on a windows
4) Insert the Card into the Box
5) Connect a a PC to the LAN Interface. (Its the first interface) Since DHCP is enabled you will get the IP address for your PC.
Connect with to the APU. If I remember right the default address of the OPNsense is 192.168.1.1
Take care if you connect the WAN Interface. (It's the IF in the middle) That you do not have your home network with the 192.168.1.0 address.
Thats all. Good luck J
Title: Re: Bootstrapping a PCEngines APU1D4
Post by: franco on November 06, 2015, 12:47:48 pm
Hi Brian,

Indeed it looks like your board picks the SD card for booting. You may want to hit F10 at early boot to select the USB device directly if releasing the SD card is not an option.


Cheers,
Franco
Title: Re: [SOLVED] Bootstrapping a PCEngines APU1D4
Post by: BrianLloyd on November 06, 2015, 03:00:29 pm
Thank you for your response Franco.

I tried pressing the F10 key. Given that there is no standard for what the F10 key would send from an ASCII serial terminal, I have no idea what my F10 key actually sends. Whatever it sends, it is NOT what the BIOS/boot code is expecting. I am using ZTerm on MacOS and I have it configured as an ANSI standard terminal. I have also tried VT100 emulation. Neither works for me. It seems strange to me that they would choose a multi-byte sequence over a single byte given they have to parse a serial data stream.

I did receive a reply from PCEngines this morning but it was not helpful, i.e. "Press F10 and make sure your terminal is working." I have asked them to clarify what character sequence constitutes their interpretation for "F10".

Hmm, maybe I should have plugged a keyboard into the remaining USB connector and just used the serial port for display. But that assumes that the BIOS code would interpret a directly-connected USB keyboard as the console keyboard instead of, or in addition to, the serial port.

In any case, I did get past that point and I now have OPNsense running. I now need to figure out how to make OPNsense replace M0n0wall.

Has anyone written a manual for OPNsense that is similar to the doc that cisco produces for their IOS-based devices? I have poked through the wiki but not found anything like that. But I guess that is for another thread.

Thanks again for the response.
Title: Re: [SOLVED] Bootstrapping a PCEngines APU1D4
Post by: franco on November 06, 2015, 05:17:46 pm
Hi Brian,

On Mac it should be required to press [ fn ] + [ F10 ]. At least that is what I have to do to get the screen terminal to properly register the keystroke through the USB serial line. :)

You could send me an email for general workflow questions if you want (franco@) or split off smaller topics and try your luck here in the forum.

Welcome!

Franco
Title: Re: [SOLVED] Bootstrapping a PCEngines APU1D4
Post by: BrianLloyd on November 06, 2015, 06:07:45 pm
I tried <fn><F10> on the Mac for "F10" but it didn't work, at least not with ZTerm. So you are suggesting <fn><F11> for ansi "F10"? I never would have guessed on that. Alternatively, I can probably try to manually generate the escape sequence <esc>0 for "F10". In any case, I have some things to try but now that I have the new box actually running OPNsense, changing the boot process is of lower priority.

I will shoot you off an email and you can tell me whether it would be better to post my questions on the forum.

Thanks.
Title: Re: Bootstrapping a PCEngines APU1D4
Post by: BrianLloyd on November 06, 2015, 06:14:00 pm
Brian,
I do it the following way for the APU.
1) Download the OPNsense-15.7.11-OpenSSL-nano-amd64.img.bz2.
2) Decompress this Image
3) do a "dd" if you use a Unix based PC or phydiskwrite .exe on a windows
4) Insert the Card into the Box


OK, what is the difference between OPNsense-15.7.11-OpenSSL-nano-amd64.img and OPNsense-15.7.11-OpenSSL-amd64.img? I used the latter and it worked fine. What does the "nano" imply in the image? I notice it is a much larger file but other than that I don't know. I do know I want serial console and AMD64 but beyond that, not sure.

FWIW, my APU seems to have full OPNsense running using the non-nano image.

Thank you.
Title: Re: [SOLVED] Bootstrapping a PCEngines APU1D4
Post by: franco on November 06, 2015, 06:24:22 pm
That's strange with the F10 key. I use screen in the vanilla OSX terminal. Do you have a USB device node? If so, try this:

# screen /dev/tty.xxxx 115200

(Screen exits via [ctrl] + [ a ], [ k ], [ y ])

The nano image is a preinstalled image for SD/CF cards, most commonly used when you e.g. can't install via USB. It's based on FreeBSD's NanoBSD and has a second partition slice for redundancy, although with OPNsense it is dormant due to extensive code cleanups. This image is serial-enabled by default.
Title: Re: [SOLVED] Bootstrapping a PCEngines APU1D4
Post by: BrianLloyd on November 07, 2015, 11:47:58 pm
Thank you everyone for your help.

I know you guys have spent a lot of time working on this and for that I am grateful. But it did chew up the better part of a day for me, trying to get through stuff that is undoubtedly obvious to you. I really could have used a couple of pages on, "Getting started on various embedded platforms". That would really help people who are migrating from other open router platforms.

If there is an obvious place on the wiki for such a thing, I would be willing to write it. (I was a tech writer who developed user manuals for routers back in a previous life.)