OPNsense Forum

Archive => 21.1 Legacy Series => Topic started by: eponymous on April 05, 2021, 09:47:25 pm

Title: [SOLVED] OPNsense 21.1 hanging at /boot/defaults/loader.conf
Post by: eponymous on April 05, 2021, 09:47:25 pm
Hi all,

I've encountered a similar issue as described in this forum post: https://forum.opnsense.org/index.php?topic=15221.0

I'm trying to install OPNsense 21.1 (serial image) (for the first time - new user) on a Netgate SG-2440 which is Intel Atom C2358 based using an ADI based board and firmware/BIOS. I can't past the "Loading /boot/defaults/loader.conf" message - the spinner just stops.

Since this looks to be hanging on the stage2 boot sequence I've been looking to see what debug is available (https://docs.freebsd.org/en/books/handbook/boot-introduction.html).

I've also been checking to ensure the serial configuration is correct (https://docs.freebsd.org/en/books/handbook/serialconsole-setup.html).

I've been trying loads of different combinations of console="comconsole" and setting the rate to 115200 but I don't know if this is actually the problem since I can get to this screen - I'd assume serial comms are fine:

Code: [Select]
>> FreeBSD/x86 BOOT
Default: 0:ad(0,a)/boot/loader
boot:

I've also tried the kern.vty="vt" / kern.vty="sc" change that was mentioned in the other forum post but no success.

There was one combination of options I tried that did get me once to the main menu to boot the kernel but when I tried it said "can't load 'kernel'; I've no idea what's happening here.

Can anyone point me in the right direction or suggest how I can get more debug?

Thanks.
Title: Re: OPNsense 21.1 hanging at /boot/defaults/loader.conf
Post by: eponymous on April 05, 2021, 09:56:33 pm
As is always the case, I totally missed this promising lead from Franco :)

https://forum.opnsense.org/index.php?topic=3198.msg10393#msg10393

Hopefully, it may just be a case of modifying the boot device with the options mentioned there and it may work.
Title: Re: OPNsense 21.1 hanging at /boot/defaults/loader.conf
Post by: eponymous on April 05, 2021, 10:13:39 pm
Success!  :D

Modify these files on the installer disk and all is well:

From Franco (https://forum.opnsense.org/index.php?topic=3198.msg10393#msg10393):

Quote
/etc/ttys:


Code: [Select]
ttyu0 "/usr/libexec/getty al.115200" cons25 onifconsole secure
ttyu1 "/usr/libexec/getty al.115200" cons25 onifconsole secure
ttyu2 "/usr/libexec/getty al.115200" cons25 onifconsole secure
ttyu3 "/usr/libexec/getty al.115200" cons25 onifconsole secure

/boot/loader.conf:

Code: [Select]
console="comconsole"
comconsole_speed="115200"
comconsole_port="0x2F8"
hint.uart.0.flags="0x00"
hint.uart.1.flags="0x10"


One question I did have: can I make these settings at boot time without having to edit the files on the installer disk?
Title: Re: OPNsense 21.1 hanging at /boot/defaults/loader.conf
Post by: ZPrime on April 06, 2021, 01:54:08 am
I think you'd be able to feed the various loader.conf variables to the "loader" prompt, but you wouldn't be able to edit /etc/ttys from there (AFAIK).

So I think it would boot and give you all of the kernel boot output at that point, but the second it passed to userland and where you'd normally get a screen or login prompt, you'd have nothing (if /etc/ttys isn't setup correctly).

I could be wrong though...
Title: Re: OPNsense 21.1 hanging at /boot/defaults/loader.conf
Post by: eponymous on April 07, 2021, 08:12:29 pm
Thanks for the suggestion.

I've been looking at: https://www.freebsd.org/cgi/man.cgi?boot(8)

I can't seem to find any way to specify the second UART device and the address (0x2F8) at the stage2 prompt. I could do it if I can get to the stage3 prompt though.

I'm really stuck now as I don't have a BSD environment on the unit anymore (I used this to edit the files originally) and I don't have the edited installer disk anymore.

Surely there has to be another way other than booting into a FreeBSD environment and modifying the files to be able to get some output? Would adding another USB-Serial converter on one of the ports work, or is there a way to get some VGA output via a USB VGA adapter? I'm reaching now..
Title: Re: OPNsense 21.1 hanging at /boot/defaults/loader.conf
Post by: eponymous on April 09, 2021, 06:21:43 pm
Ok so managed to get further with this.

Since the installer boots up I'm able to install over SSH which works great. Then once rebooted, I can add the few lines that are needed for the console to work (normally put in /boot/loader.conf) to the Tuneables page in the WebGUI - which is better than modifying /boot/loader.conf.local

It looks like I can't make the changes above to /etc/ttys as the file is overwritten at reboot. So my final question is: are these changes still needed? Perhaps this is one for the devs to chime in on.

As it happens, if I check my console I'm connected to it's listed as "ttyu1" - and that seems to be working great without any changes to /etc/ttys. Maybe I answered my own question?  :)


Aside: For those interested, you can actually connect an mPCIe VGA card to Netgate appliances and get VGA output or install the VGA version of OPNsense. I tested this and it works (Innodisk EMPV-1201).