Live data from Hacker News

No more boot loader: Please use the kernel instead

pretalx.com

311–320 of 460 posts

Re: No more boot loader: Please use the kernel instead

#311

It’s a pity we aren’t really there yet with boot loading. In 2024 if I install an OS it places a boot loader in my EFI System Partition but in a way that still feels only partially complete. What I want is for each OS to install its loader in a unique directory to that OS instance, not unique to the OS vendor. Multiple Debians etc will argue over who controls /debian. You also have to bless UEFI with magic NVRAM vari…

FYI: In my experience, modern UEFI Firmware/BIOSes will scan every FAT32 partition found on attached storage devices for bootable EFI binaries, they don't even appear to care about the GUID/type marking, just that it is FAT32. I never let OSes share an ESP, each install gets its own.

Re: No more boot loader: Please use the kernel instead

#312
post #118

Earlier quoted context omitted.

Does Windows not ensure that the UEFI boots back into Windows when it does an auto-reboot for updates? There's a UEFI variable called BootNext which Windows already knows how to use since the advanced startup options must be setting it to allow rebooting directly to the UEFI settings. Given that Windows tries to restore open windows to make it look like it didn't even reboot, I'm surprised they wouldn't make sure tha…

Not in my experience. For my typical dual boot situation where Grub is installed as the bootloader, I have to update the Grub settings like so to allow Windows updates to go smoothly: GRUB_DEFAULT=saved GRUB_SAVEDEFAULT=true

I am not certain about this, but I think that these options no longer work on UEFI machines. GRUB does not have control over what options are presented if GRUB isn't the selected bootloader. This stuff is BIOS-only.

Re: No more boot loader: Please use the kernel instead

#313

It's something you can do since a lot of years. I used to do so 10 years ago, when I've got the first motherboard with UEFI. But is it useful? It saves a minimal time in the boot sequence, but at what cost? The bootloader (being it grub, or something more simple as systemd-boot) is useful to me for a couple of reasons: - it allows to dual-boot with Windows easily: motherboard boot menu is often not easy to access, yo…

Maybe it is time to re-think the entire hardware boot process and ditch the BIOS altogether.

It probably was, but UEFI was not a good answer.

I'd have preferred CoreBoot or OpenFirmware, but the PC industry was too slow to move and let Intel -- still smarting from Microsoft forcing it to adopt AMD's 64-bit x86 extensions -- take control of the firmware.

Re: No more boot loader: Please use the kernel instead

#314
post #170

Earlier quoted context omitted.

>and if decides that it is, then it never calls ExitBootServices That's unlikely, I think that would mean you cannot use native drivers, at which point you're just writing another bootloader. I suspect they only planning to kexec into target kernel, not chainloading other EFI bootloaders.

You're right (as I saw another comment cite the primary-source for); but I'm still curious now, whether there'd be a way to pull this off. > I think that would mean you cannot use native drivers Yes, that's right. > at which point you're just writing another bootloader But that's not necessarily true. Even if you could only use EFI boot+runtime services until you call ExitBootServices, in theory, an OS kernel could h…

Giving "the control of hardware back" is going to be extremely difficult. Just look at the mess that ACPI is: there are lots of notebooks that Linux can not put into/back from hibernation, and here we're talking simply about pausing/resuming devices themselves. What you are proposing means that an OS would have to revert the hardware back to the state that would be compatible with its state at the moment of booting, so that UEFI could manage it correctly. I don't think that's gonna happen.

Re: No more boot loader: Please use the kernel instead

#315

Earlier quoted context omitted.

> - it allows to dual-boot with Windows easily: motherboard boot menu is often not easy to access, you need to perform some key combination in a short window, also modern bootloader save the last boot option such that if Windows reboots for an update Linux does not start Do people really dual boot a lot in 2024? It was a good use case when virtualization was slow but decades after the CPU started shipping with virtua…

Yes, people dual boot. Particularly people who are contemplating a move from Windows. I'd hate to see Linux take the "my way or the highway" attitude of Windows.

My experience when I had a dual boot in the late 90's was that rebooting is such an interruption that you never become fully comfortable on one of the OS. You just stick to the OS you are used to and never really do the switch.

While if don't dual boot you can switch completely to another OS and only use VM or remote desktop for the handful of use cases when you aren't ready yet (and then end ip abandoning them completely as well).

Re: No more boot loader: Please use the kernel instead

#316
post #81

Earlier quoted context omitted.

Given the reason why "out-of-tree modules" exist, there's really no way to eliminate initramfs or something like it entirely in the general case. It might be possible to speed up the process of building the image (as long as the results are not "redistributed"), but this is a licensing and legal problem, not a technical one. FreeBSD is under a much more permissive non-copyleft license and so can legally bundle things…

You're talking about something like ZFS, and I get that they can't just compile it in, but a distro can still ship the module, if I'm not mistaken. ...But to load it at boot time it absolutely must be done through an initramfs. Is that right?

> ...But to load it at boot time it absolutely must be done through an initramfs. Is that right?

No, not AFAICS; it is incorrect.

On UEFI the system boots from a FAT32 partition. Put the kernel directly on that FAT32 partition, and any necessary modules such as ZFS, and the kernel can load the ZFS module from FAT32 and then mount root directly without any need for an initramfs.

This is how systemd-boot works.

I am not advocating systemd-boot -- I found it a pain to work with -- but the point is that it's perfectly possible and doable. The initramfs is a bodge and it's time we did away with it. It should only be needed for installation and rescue media.

Re: No more boot loader: Please use the kernel instead

#317
post #7

Earlier quoted context omitted.

The Linux kernel does not require an initramfs. You can build a kernel with everything compiled in; with no modules needed at all. Initramfs is used for generic kernels where you don't know beforehand which features will be required. This allows you to avoid wasting RAM on features you don't use. But it is optional.

Is anyone really wanting to get back into the business of building their own kernels? I started using Linux heavily in '92, and I've built a lot of kernels, and am quite happy to not be building them anymore.

> am quite happy to not be building them anymore.

Me too. I go back to within about 3 years of that.

But I expect my distro to handle this for me now.

If the distro compiled and updated the kernel for my hardware then there's be no need for an initramfs.

While initramfs was a simplistic kludge, the UKI idea does not fix it, it wraps a kludge inside a fugly ball of lack of understanding.

Re: No more boot loader: Please use the kernel instead

#318

Does anyone still remember when you could just dd the Linux kernel to a floppy and it would be its own bootloader? https://yosemitefoothills.com/LinuxBoot/BD-1Disk.htm Here's some more documentation on this: https://www.kernel.org/doc/Documentation/x86/boot.txt What's old is new again... except 100x more complex and likely more than necessary.

That is exactly what I thought of when I read this post, yes.

Re: No more boot loader: Please use the kernel instead

#320

I recently moved to sdboot and prefer its simplicity compared to grub. However they still missed the mark a bit, its folder tree on the ESP is a mess. I’ll look into this but prefer kernels managed automatically by apt/dnf etc.

You are not clear; by "sdboot" do you mean systemd-boot?

The abbreviation is ambiguous. There are other bootloaders called "sdboot" such as this one:

https://sourceforge.net/projects/sdboot/

And this one:

https://www.reddit.com/r/WiiHacks/comments/glx4dt/sdboot_eve...

Please try to avoid ambiguous abbreviations. If you do mean systemd-boot you only saved 5 letters and could mean at least 3 different tools, or maybe more.

Post reply on HN