helloSystem / ISO

helloSystem Live and installation ISO
https://github.com/helloSystem/
BSD 3-Clause "New" or "Revised" License
808 stars 58 forks source link

Silence the bootloader #43

Closed probonopd closed 1 year ago

probonopd commented 3 years ago

I would like to silence the EFI + BIOS bootloaders entirely. console=noconsole does NOT do the trick, still plenty of text. Can rEFInd graphics mode hide that text? I tried but graphics mode exits as soon as FreeBSDloader.efi starts.

Of course it depends on how/where you set it. You can start loader passing it as argument, thats as silent as you can get without code update and rebuild

But how to do that?

https://lists.freebsd.org/pipermail/freebsd-arch/2018-June/019047.html

efibootmgr can set args to use that are passed to main w/o needing to read boot.conf at all

How?

Turns out that FreeBSD 13.0-CURRENT has a new -e option that is mentioned but not explained on the man page.

However, it does not seem to actually set the arguments?

uname -v

FreeBSD 13.0-CURRENT #0 7578a4862f0-c255032(main): Thu Dec 10 11:40:27 UTC 2020     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC

sudo mount -t msdosfs /dev/ada0p1 /mnt

sudo mkdir -p /mnt/EFI/freebsd

sudo cp /boot/loader.efi /mnt/EFI/freebsd

sudo efibootmgr -v -a -c -l /mnt/EFI/freebsd/loader.efi -L FreeBSD -e 'console=nullconsole' 

Boot to FW : false
BootCurrent: 0001
Timeout    : 0 seconds
BootOrder  : 0006, 2001, 0000, 2002, 2003
 Boot0006* FreeBSD HD(1,GPT,2458164c-ae07-4417-b037-3fc2ea10d4ba,0x800,0x47000)/File(\EFI\freebsd\loader.efi)
                      ada0p1:/EFI/freebsd/loader.efi /mnt//EFI/freebsd/loader.efi

No mention of console=nullconsole anywhere...

probonopd commented 3 years ago

Possibly try to set this from a Linux system in the meantime?

probonopd commented 3 years ago

When booting with Clover and handing over console=noconsole as an argument, it still prints Consoles: EFI console and a spinner for a short time but otherwise prints no text. A little bit of progress...

probonopd commented 3 years ago

Consider using the Clover bootloader:

Zero-text boot can be achieved by using Clover and this config.plist (in this example, the EFI System Partition has been created by the helloSystem installer and has the label EFISYS. But only if Type is set to OSX. Apparently this makes Clover to try graphics mode.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
   <dict>
      <key>Boot</key>
      <dict>
         <key>Timeout</key>
         <string>0</string>
         <key>DefaultVolume</key>
         <string>EFISYS</string>
      </dict>
      <key>GUI</key>
      <dict>
         <key>TextOnly</key>
         <false />
         <key>Custom</key>
         <dict>
            <key>Entries</key>
            <array>
               <dict>
                  <key>Disabled</key>
                  <false />
                  <key>Hidden</key>
                  <false />
                  <key>Ignore</key>
                  <false />
                  <key>Path</key>
                  <string>\EFI\boot\BOOTx64.efi</string>
                  <key>Arguments</key>
                  <string>console=nullconsole</string>
                  <key>Title</key>
                  <string>FreeBSD from ESP</string>
                  <key>Type</key>
                  <string>OSX</string>
               </dict>
            </array>
         </dict>
      </dict>
   </dict>
</plist>

This has the following advantages:

Disadvantages:

grahamperrin commented 3 years ago

IIRC there's an old FreeBSD bug for part of this.

Hint: silence as a default can make it more difficult to get feedback from testers …

probonopd commented 3 years ago

Hint: silence as a default can make it more difficult to get feedback from testers …

In case of boot issues, one can always unset boot_mute.

Ideally I would want to have it so that one can just hold down the "v" key during boot for "verbose". But by default, what I consider "debug" messages for developers should be hidden from "mere mortals" view. Doable in Forth/Lua?

kettle-7 commented 3 years ago

Is GNU GrUB Unwelcome technologies?

probonopd commented 3 years ago

Well, it's GNU. Whereas we want to stay close to FreeBSD as much as possible, certainly for such essential components.

probonopd commented 1 year ago

Doing some trickery in local.lua, "almost" does the trick. Silences the bootloader from the point in time at which it is running.

Can't silence the earlier stages though. I think it is fine for now.