Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    loader.conf.local setting efi_com_speed not taking effect at boot

    Scheduled Pinned Locked Moved General pfSense Questions
    12 Posts 3 Posters 490 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      ctminime @patient0
      last edited by

      @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/11

      No, 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.

      patient0P 1 Reply Last reply Reply Quote 0
      • patient0P
        patient0 @ctminime
        last edited by

        @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"?
        Screenshot 2025-02-20 at 15.00.31.png

        1 Reply Last reply Reply Quote 0
        • stephenw10S
          stephenw10 Netgate Administrator
          last edited by stephenw10

          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?

          1 Reply Last reply Reply Quote 0
          • C
            ctminime
            last edited by

            @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.

            1 Reply Last reply Reply Quote 0
            • stephenw10S
              stephenw10 Netgate Administrator
              last edited by

              Odd. Can you see it actually loading the loader.conf files before the loader menu is shown?

              1 Reply Last reply Reply Quote 0
              • C
                ctminime
                last edited by

                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!

                1 Reply Last reply Reply Quote 0
                • stephenw10S
                  stephenw10 Netgate Administrator
                  last edited by

                  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?

                  C 1 Reply Last reply Reply Quote 0
                  • C
                    ctminime @stephenw10
                    last edited by

                    @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.

                    1 Reply Last reply Reply Quote 0
                    • stephenw10S
                      stephenw10 Netgate Administrator
                      last edited by

                      Could also try a FreeBSD15 snapshot. That would include any recent EFI console fixes.

                      C 1 Reply Last reply Reply Quote 0
                      • C
                        ctminime @stephenw10
                        last edited by

                        @stephenw10 Tried the FreeBSD 15 snapshot 20250227 and it behaves the same way.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.