loader.conf.local setting efi_com_speed not taking effect at boot
-
I am working on trying to get pfSense 2.7.2 CE running on a piece of OEM hardware with dual Intel NICs and an Atom processor. I have nearly everything figured out however, for some reason the EFI is setting 9600 baud instead of 115200.
OK efi-show -v ConIn global NV,BS,RS ConIn = Serial(0x0)/Uart(9600,8,N,1)/UartFlowCtrl(None)/VenPcAnsi() OK efi-show -v ConOut global NV,BS,RS ConOut = Serial(0x0)/Uart(9600,8,N,1)/UartFlowCtrl(None)/VenPcAnsi()
Every time I boot, I need to interrupt the boot up at the pfSense splash screen and put in "set efi_com_speed=115200" or my console doesn't work.
I have added 2 lines into the /boot/loader.conf.local and the console port setting persists but the efi_com_speed setting will not.
Contents of /boot/loader.conf.local:
comconsole_port=0x2f8 efi_com_speed=115200
I have tried duplicating other EFI settings in the loader.conf.local file but nothing has made a difference.
Anyone have any suggestions to try?
Here is the contents of "show" when interrupting the bootup at the pfSense splash screen before I manually set the efi_com_speed:
COLUMNS=80 LINES=25 acpi_dsdt_load=NO acpi_dsdt_name=/boot/acpi_dsdt.aml acpi_dsdt_type=acpi_dsdt acpi_video_load=NO audit_event_load=NO audit_event_name=/etc/security/audit_event audit_event_type=etc_security_audit_event autoboot_delay=NO bitmap_load=NO bitmap_name=splash.bmp bitmap_type=splash_image_data boot_serial=YES bootenv_autolist=YES bootfile=kernel comconsole_pcidev= comconsole_port=0x2f8 comconsole_speed=115200 console=efi cpu_microcode_load=NO cpu_microcode_name=/boot/firmware/ucode.bin cpu_microcode_type=cpu_microcode currdev=disk0p2: efi-version=2.31 efi_8250_uid=0 efi_com_speed=9600 efi_max_resolution=1x1 entropy_cache_load=YES entropy_cache_name=/boot/entropy entropy_cache_type=boot_entropy_cache entropy_efi_seed=YES hint.acpi_throttle.0.disabled=1 hint.atkbd.0.at=atkbdc hint.atkbd.0.irq=1 hint.atkbdc.0.at=isa hint.atkbdc.0.port=0x060 hint.atrtc.0.at=isa hint.atrtc.0.irq=8 hint.atrtc.0.port=0x70 hint.attimer.0.at=isa hint.attimer.0.irq=0 hint.attimer.0.port=0x40 hint.fd.0.at=fdc0 hint.fd.0.drive=0 hint.fd.1.at=fdc0 hint.fd.1.drive=1 hint.fdc.0.at=isa hint.fdc.0.drq=2 hint.fdc.0.irq=6 hint.fdc.0.port=0x3F0 hint.p4tcc.0.disabled=1 hint.ppc.0.at=isa hint.ppc.0.irq=7 hint.psm.0.at=atkbdc hint.psm.0.irq=12 hint.sc.0.at=isa hint.sc.0.flags=0x100 hint.smbios.0.mem=0xf04d0 hint.uart.0.at=isa hint.uart.0.flags=0x10 hint.uart.0.irq=4 hint.uart.0.port=0x3F8 hint.uart.1.at=isa hint.uart.1.irq=3 hint.uart.1.port=0x2F8 hostuuid_load=YES hostuuid_name=/etc/hostid hostuuid_type=hostuuid hw.usb.no_pf=1 interpret=OK kernel=kernel kernel_options= kernels_autodetect=YES loaddev=disk0p2: loader_brand=pfSense loader_color=NO loader_conf_dirs=/boot/loader.conf.d loader_logo=pfSensebw loader_menu_title=Welcome to pfSense module_blacklist=drm drm2 radeonkms i915kms amdgpu module_path=/boot/modules;/boot/dtb;/boot/dtb/overlays module_verbose=2 net.isr.maxthreads=-1 net.pf.request_maxcount=400000 nextboot_conf=/boot/nextboot.conf prompt=${interpret} ram_blacklist_load=NO ram_blacklist_name=/boot/blacklist.txt ram_blacklist_type=ram_blacklist screensave_load=NO screensave_name=green_saver script.lang=lua smbios.bios.reldate=12/02/2014 smbios.bios.revision=0.20 smbios.bios.vendor=American Megatrends Inc. smbios.bios.version=0ACFJ020 smbios.chassis.maker=WDC_NCS_SX smbios.chassis.serial=To Be Filled By O.E.M. smbios.chassis.tag=To Be Filled By O.E.M. smbios.chassis.type=Expansion Chassis smbios.chassis.version=To Be Filled By O.E.M. smbios.memory.enabled=2097152 smbios.planar.location=To be filled by O.E.M. smbios.planar.maker=To be filled by O.E.M. smbios.planar.product=To be filled by O.E.M. smbios.planar.serial=To be filled by O.E.M. smbios.planar.tag=To be filled by O.E.M. smbios.planar.version=To be filled by O.E.M. smbios.socket.enabled=1 smbios.socket.populated=1 smbios.system.family=To be filled by O.E.M. smbios.system.maker=To be filled by O.E.M. smbios.system.product=WDBBAZ0000NBK-00 smbios.system.serial={redacted} smbios.system.sku=To be filled by O.E.M. smbios.system.uuid={redacted} smbios.system.version=To be filled by O.E.M. smbios.version=2.7 splash_bmp_load=NO splash_pcx_load=NO splash_txt_load=NO twiddle_divisor=16 verbose_loading=NO vesa_load=NO
-
@ctminime I didn't have to use the speed setting but you may try setting the following in the loader.conf.local:
console="efi" comconsole_port=0x2f8 comconsole_speed=115200
the
comconsole_speed
should do the same job and it's supported for sure.but the efi_com_speed setting will not
Does it get removed from the loader.conf.local?
-
@patient0 I already tried console=efi to no effect. I found that here before I posted:
https://forum.netgate.com/topic/185268/where-to-put-hw-uart-console-setting-so-it-sticks-after-reboot/11No, the settings are not being removed from the loader.conf.local file.
I hadn't tried adding the comconsole_speed setting since I wasn't having an issue with that. But I tried it anyways since you suggested it and still no change. This is the file contents now:
console=efi comconsole_port=0x2f8 comconsole_speed=115200 efi_com_speed=115200
I am open for anything else to try.
-
@ctminime I see, that not it then :/ ... I assume if you set your serial console app speed to 9600 it does work, albeit slowly?
If you stop the boot menu "Cons" is set to "Serial"?
-
Are you sure that's not set in the BIOS and it's just reading it in at boot?
The efi console is generally a video console. How are you seeing the loader output here?
-
@patient0, I am a little bit leery of trying to set anything at 9600 and I will explain why below. Yes, Cons is set to Serial at the pfSense boot screen
@stephenw10, as I mentioned in my 1st post, this is an OEM device. More specifically a Western Digital MyCloud DL2100 with an Intel Atom C2350 CPU. You may ask, why would I by trying to make a pfSense Firewall out of this? Well just to see if I can, really. I have just had this thing laying around forever not being used and I figured since it has dual Intel NIC's, why not?
So, this piece of hardware doesn't have any video out on it. Nor does it have any kind of console port on it. What it does have though, is proprietary UART connector on it to which I have soldered on wires and connected it to a USB UART adapter. With the UART adapter, I discovered that the BIOS (accessible with Putty via the UART adapter) has built in console redirection. But how this is actually working under the hood, I am not sure. There are 3 different console redirection setting in the bios that are all set to 115200, although 1 is disabled:
COM0 Console Redirection [Enabled] Console Redirection Settings COM1 Console Redirection [Disabled] Console Redirection Settings Serial Port for Out-of-Band Management/ Windows Emergency Management Services (EMS) Console Redirection [Enabled] Console Redirection Settings
The strange part is, the UART port runs on COM2.
From the BIOS, I am able to do a boot override to boot into the "Built-in EFI Shell". I have tried messing around in the EFI shell trying to change things, but they always revert. For example, I tried using "sermode" to change the setting of one of the devices like this:
Shell> sermode (this without anything following it, just displays the current settings) 10E(741C1798) - (115200, N, 8, 1) 11E(737C7A18) - (9600, N, 8, 1) Shell> sermode 11E 115200 N 8 1 (this changes the setting) sermode: Mode set on handle 737C7A18 Shell> sermode 10E(741C1798) - (115200, N, 8, 1) 11E(737C7A18) - (115200, N, 8, 1) <--- changed but will revert. Has no impact on the "efi_com_speed" setting,
Another thing I found while messing around in the EFI console is that there is a command "devices" that lists everything. Here are some relevant lines:
C T D T Y C I R P F A L E G G #P #D #C Device Name == = = = == == == ============================================================= 10E B - - 1 1 1 Serial(0x0)/Uart(115200,8,N,1) 10F B - - 1 1 1 Serial(0x0)/Uart(9600,8,N,1)/UartFlowCtrl(None)/VenPcAnsi() 11E D - - 1 - - Serial(0x1)/Uart(9600,8,N,1)/UartFlowCtrl(None)
I would guess that somehow 10F is linked to 11E but, 10F isn't available for modification with the "sermode" command. As far as I can tell, the only way to change that would be with the builtin HEX editor. That isn't something I am keen on trying.
Regardless of the entries that have 9600 in them, the device appears to be always operating at 115200. My best guess for what is going on here, is that the boot loader is erroneously picking out the 9600 and setting "efi_com_speed=9600" and the "efi_com_speed=115200" setting I put in the loader.conf.local is being ignored or overridden. But interrupting the bootup at the pfSense boot screen and doing "set efi_com_speed=115200" at the OK prompt works just fine.
While typing this I also tried adding "efi_com_speed=115200" directly into "loader.conf". I tried to creating my own conf file in "/boot/loader.conf.d/". And I even tried putting it directly into "/boot/defaults/loader.conf" (even though you are not supposed to) and none of those are making the setting persist on reboot.
-
Odd. Can you see it actually loading the loader.conf files before the loader menu is shown?
-
Yes, I have been able to confirm that that the loader.conf and loader.conf.local files are indeed being loaded.
Nothing I have tried gets the "efi_com_speed" setting to take effect from the loader files on the WD DL2100 and it only works when interrupting the boot process.
However, this situation is now worked around. Somewhere in my countless hours of tinkering with this, at one point I set "console="comconsole,efi". Without interrupting the boot process, I ended up with some doubling up with characters at the beginning, but then displayed normally once the boot process fully started. So, after changing to "console="comconsole", it will now boot up normally and show the menu without interrupting the boot process.
At one point I decided to do a fresh install again. Come to find out, I think my original install had gotten corrupted from too many hard shutdowns. This did NOT have any affect on the behavior of the "efi_com_speed" setting though. However, I had a very irritating issue that I struggled with for hours... That was that the pfSense menu just would NOT show up after displaying "Bootup complete". During all of this testing, I never bothered to go into the WebUI. I then went into the WebUI at one point and under "Advanced > Admin Access", the "Serial Terminal" option was not checked. Once I checked that, the menu started coming up. I must have done 3 or 4 clean installs before I figured that out. No idea why that wasn't setting even when I installed via a Serial Console.
Anyway, I would happily submit a bug report on the "efi_com_speed" setting, but unless there is a less obscure piece of hardware that can also replicate this behavior, the bug report would be kind of worthless. I tried on a laptop, but pfSense did not pick up any setting from the UEFI and I think that is key to replicating this. On the laptop (I moved the USB that had pfSense on it) I did notice that the setting would take effect, but it wasn't trying to change a setting that already existed like it does on my WD DL2100.
Thanks for the help!
-
Mmm, I'm not sure that is a bug. I've never seen anything setting that loader value before so I don't know if that's expected to be writable. I can confirm I cannot set it either.
Can you test it in FreeBSD?
-
@stephenw10 Tested with FreeBSD 14.1 and it behaves the same way.
Setting currdev to disk1p2: Loading /boot/defaults/loader.conf Loading /boot/defaults/loader.conf Loading /boot/device.hints Loading /boot/loader.conf Loading /boot/loader.conf.local \ ______ ____ _____ _____ | ____| | _ \ / ____| __ \ | |___ _ __ ___ ___ | |_) | (___ | | | | | ___| '__/ _ \/ _ \| _ < \___ \| | | | | | | | | __/ __/| |_) |____) | |__| | | | | | | | || | | | |_| |_| \___|\___||____/|_____/|_____/ ``` ` s` `.....---.......--.``` -/ +---------- Welcome to FreeBSD -----------+ +o .--` /y:` +. | | yo`:. :o `+- | 1. Boot Multi user [Enter] | y/ -/` -o/ | 2. Boot Single user | .- ::/sy+:. | 3. Escape to loader prompt | / `-- / | 4. Reboot | `: :` | 5. Cons: Serial | `: :` | | / / | Options: | .- -. | 6. Kernel: default/kernel (1 of 1) | -- -. | 7. Boot Options | `:` `:` | | .-- `--. | | .---.....----. +-----------------------------------------+ Exiting menu! Type '?' for a list of commands, 'help' for more detailed help. OK show COLUMNS=80 LINES=25 acpi.oem=WDCorp {removed some lines for brevity} boot_serial=YES bootenv_autolist=YES bootfile=kernel comconsole_pcidev= comconsole_port=760 comconsole_speed=115200 console=comconsole {removed some lines for brevity} efi_com_speed=9600 ...
Contents of the /boot/loader.conf.local file:
comconsole_port=760 efi_com_speed=115200 console="comconsole" boot_serial=YES
I can tell that the loader.conf.local file is taking effect because of "comconsole_port=760". That isn't default.
I could always try 14.2 as well.
-
Could also try a FreeBSD15 snapshot. That would include any recent EFI console fixes.
-
@stephenw10 Tried the FreeBSD 15 snapshot 20250227 and it behaves the same way.