Hacker News new | ask | show | jobs
by TkTech 991 days ago
If you turn off quiet boot, you'll see an impressive list of things getting started up, many of which the kernel isn't in full control of. DHCP (sometimes), gpus, NTP, disk decryption, TPM, monitor probing, USB hub enumeration, on and on.
1 comments

But all the stuff that is actually necessary is the same on every boot so no enumeration and probing should be necessary.
This isn't true. All hardware is swappable between boots. I've moved a root disk from one case to an entirely new case before, replacing literally every hardware component except the root volume but keeping the same OS. Not only is enumeration requires at boot, but event handlers for hot-swapping need to be available at all times. Users expect to be able to plug in and out USB devices, network cables, monitors, keyboards, and have it all just work.

Presumably, most faster boot OSes simply don't support as many devices. Amazon was able to get Firecracker to boot Linux damn near instantly by pretty much removing all hardware support from the kernel since they know for sure it's only ever running as a VM on a hypervisor they strictly control and won't change.

If you know for sure the devices you need, you can compile the kernel yourself and remove all the stuff you don't need and possibly even get rid of udev and just hardcode what it normally detects.

Is it? My laptop is only shutoff when switching from a dock at home to a dock at work, changing the GPU and hubs available. The OS I just netbooted off my NAS has no idea what it's booting on. I can plug and unplug USB devices anytime, including while the system is off. Maybe I swapped USB headsets, maybe I plugged in a fingerprint or smartcard reader, which needs to be initialized before the login manager starts. Maybe my time server is no longer reachable, so NTP needs to find a new one from the pool, because if it doesn't sync timing correctly the certificate for LDAP won't validate and my work laptop won't be able to login. Maybe it needs to initialize the networking stack to handle an NFS or Samba mount in my /etc/fstab which has a nowait=0, since I use it as a boot volume.

This could be a very, very long list of hypothetical changes :)

All that USB stuff ought not to be blocking though, right? since those can also be connected or removed at any time.
pxe boot obviously has some constraints that don't usually apply otherwise.

Presumably the dock can be detached while booted, so the kernel should also be able to handle booting and only detect at some point that the dock has disappeared