<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 5, 2023 at 9:53 AM Steffen Nurpmeso <<a href="mailto:steffen@sdaoden.eu">steffen@sdaoden.eu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Steffen Nurpmeso wrote in<br>
 <<a href="mailto:20230904221059.sF2G0%25steffen@sdaoden.eu" target="_blank">20230904221059.sF2G0%steffen@sdaoden.eu</a>>:<br>
 |Norman Wilson wrote in<br>
 | <<a href="mailto:9A989054DE79CE5059CBA74797391E39.for-standards-violators@oclsc.org" target="_blank">9A989054DE79CE5059CBA74797391E39.for-standards-violators@oclsc.org</a>>:<br>
 ...<br>
 ||Perhaps the question to ask is why such a magic program is<br>
 ||needed at all.  Is it just because programs like the shell<br>
 ||have become so large and unwieldy that they won't fit in<br>
 ||a small environment suitable for loading into an initramfs?<br>
 ...<br>
 |For my laptop it allows me easy boot management.<br>
 ...<br>
 |  -rwxr-xr-x  1 root root     4596 Feb  4  2023  linux-init-s1.sh*<br>
 |  -rwxr-xr-x  1 root root     3646 Feb  4  2023  linux-init-lib.sh*<br>
 |  -rwxr-xr-x  1 root root  5480120 Feb 11  2023  cryptsetup.static*<br>
 |  -rwxr-xr-x  1 root root  1978368 Aug 15 18:51  busybox.static*<br>
 |  -rwxr-xr-x  1 root root 10112672 Aug 26 18:44  ideapad-stage1.efi*<br>
<br>
Only to add that this is because of Linux and the way it is doing<br>
things.  If i would use FreeBSD on bare metal, then i would have<br>
an EFI boot loader on EFI that knows (only) enough to ask for<br>
passphrase (correct me if i am wrong), and can then boot the<br>
kernel from FFS or ZFS.  (You have to choose dedicated ZFS boot<br>
loader iirc, but despite that...)<br></blockquote><div><br></div><div>No, you don't have to choose the dedicated ZFS boot loader, at least not</div><div>anymore.</div><div><br></div><div>Also, you can use boot1.efi to load loader.efi from the root filesystem to</div><div>load the kernel, or you could use loader.efi directly on the ESP to load</div><div>the kernel. boot1 barely knows anything (and has only one choice of</div><div>what to boot). loader.efi is the full deal, and can do rather a lot of</div><div>sophisticated things.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I know GRUB (and maybe other) Linux bootloaders can do all that,<br>
but they are huge, are badly maintained, or under-documented, let<br>
alone with local manuals, and i am too stupid to configure them<br>
(due to all that).  refind is ok, however.  But.. be aware of<br>
typos in the configuration..<br>
<br>
But anyhow.  With an EFI_STUB Linux kernel i can save me all that,<br>
with busybox i get a complete environment (i then even create an<br>
initrd in /boot/ on the fly so i do not have to type the password<br>
a second time, that can (optionally) be cached, and is, actually<br>
<br>
  -rw------- 1 root root  4495987 May 29 16:29 .kent.initrd.0<br>
<br>
Unfortunately cryptsetup is needed even though, i think, the<br>
kernel has anything needed; you just cannot access it.  cryptsetup<br>
is only needed for "$cs open $PART_ROOT p_root --key-file -".<br>
Of course i am no real Linux expert but only a do-it-yourself guy.<br>
busybox allows me to manage this easily, to answer your question.<br></blockquote><div><br></div><div>You could do that on FreeBSD with a loader.efi that has a ram disk</div><div>built into it as well, including a 'beastie box' thing that's akin to busybox.</div><div>It will boot in one step and no no further I/O to get a running system.</div><div>Others have used this for secure boot and to boot a small ram disk that's</div><div>later discarded as userland decides what root should be. But it's much less</div><div>automated than in Linux...</div><div><br></div><div>Warner</div></div></div>