Slightly off-topic, but those of you willing to experiment a little might be able to go a tad quicker from power-on to GUI+network (while learning stuff about Linux).
I’ve just compiled the new mainline kernel 5.7.7 a few hours ago, with some tweaks. My result …
Startup finished in 505ms (kernel) + 423ms (userspace) = 929ms
(Mind you, my 6 years old BIOS needs about a second to do its POST thing, then GRUB2 flickers its welcome message for a split-second despite me having set »set timeout_style=hidden« and »set timeout=0«; after that, my new kernel starts without any initrd — don’t need one anymore — using above 929ms of time, and then the display manager auto-logins my user into KDE/Plasma, which itself needs about a second to set itself up. So it takes three to four seconds from pressing the power button to opening a GUI program. Still, not too shabby for a comparatively ancient Haswell i5.)
Some of my userland tweaks (YMMV, take this with a few grains of salt):
- one fast SATA SSD, and one ext4
root partition, properly aligned (no swap, and certainly no btrfs)
- unthemed KDM for display manager; sadly way past its prime, but faster startup than any other DM (according to some tests I did in 2015)
- no wicked
, no NetworkManager; all my stuff is on IPv4-only static networking using systemd-networkd
- disabled any eye-candy: no Plymouth, no animations, it’s quiet and text-based until systemd launches KDM
- used exim instead of postfix for a while (again, startup time), then nothing because of permanently emtpy mail queues
- no cups (I only »print« to PDF), no NTP, no Samba, no unneeded stuff in general
As for the kernel sources, I…
- started playing with existing vs minimal vs automatic kernel configs (»make oldconfig
« vs »make x86_64_defconfig« vs »make localyesconfig«); the automatic one ended up close enough to what I want
- disabled all filesystems except for »ext4« (statically, necessary for booting) and »exfat« (as a module, just in case)
- disabled IPv6
, most crypto stuff, most server-class drivers; no Nouveau, no Intel iGPU stuff
- disabled swap
support (my 2 cents: if several gigabytes of RAM is not enough, all is lost)
- disabled initrd
support because I’m all for self-contained kernels
- disabled all sorts of wireless technology: no infrared, no WiFi, no Bluetooth, no HAM radio
- disabled excessive quota/monitoring/profiling stuff (might be fine for servers), unneeded for a desktop system
- enabled SND_HDA_CODEC_REALTEK — despite Intel chipset, the sound chip vendor for my Asus board seems to be Realtek, and without kernel support it won’t make a peep
- enabled FW_LOADER=y, EXTRA_FIRMWARE_DIR="/lib/firmware" and most importantly for my old Core-i5: EXTRA_FIRMWARE=“intel-ucode/06-3c-03” (without it, the kernel will complain)
- set »root=/dev/sda1« as the kernel parameter (again, YMMV)
- after compilation and installation, leave the kernel source as is; don’t do
a »make mrproper« too soon (to save storage space as I did), because subsequent installs (Nvidia drivers) may need those compiled kernel object files.
Along the way, I learned so much about early booting with and without initial RAM disks. For example, dracut packs those microcode and firmware patches right into the initrd by default; without it, you have to give those patches to the kernel at compile-time as I did.
Finally, I had to apply a tiny patch to the binary-blob-proprietary Nvidia driver, following Isaak Aleksandrov’s instructions over at Gitlab. After that, your standard GTX card will play nicely with the 5.x kernel ABI like mine does. If you do Steam gaming with that Nvidia card, then please be sure to say »YES« to the 32-bit drivers when the Nvidia installer asks you. Oh well. You live, you learn.
So I’ve learned stuff, I’m booting faster than ever, but I also have a nice and small footprint for backing up and virtualizing my system:
v:~ ▶ **lsmod**
Module Size Used by
nvidia_drm 45056 5
nvidia_modeset 1077248 13 nvidia_drm
nvidia_uvm 946176 0
snd_hda_codec_realtek 98304 1
snd_hda_codec_generic 73728 2 snd_hda_codec_realtek
nvidia 19972096 693 nvidia_uvm,nvidia_modeset
snd_hda_intel 28672 3
snd_intel_dspcfg 16384 1 snd_hda_intel
snd_hda_codec 98304 3 snd_hda_codec_generic,snd_hda_intel,snd_hda_codec_realtek
snd_hwdep 16384 1 snd_hda_codec
snd_hda_core 61440 4 snd_hda_codec_generic,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
snd_pcm 90112 3 snd_hda_intel,snd_hda_codec,snd_hda_core
snd_timer 32768 1 snd_pcm
snd 65536 12 snd_hda_codec_generic,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_timer,snd_pcm
ipmi_devintf 20480 0
ipmi_msghandler 53248 2 ipmi_devintf,nvidia
v:~ ▶ **l /boot/**
total 7008
drwxr-xr-x 4 root root 4096 2020-07-02 14:59 ./
drwxr-xr-x 20 root root 4096 2020-04-19 11:31 ../
-rw-r--r-- 1 root root 1725 2018-12-19 10:14 boot.readme
-rw-r--r-- 1 root root 85173 2020-07-02 13:15 config-5.7.7
drwxr-xr-x 2 root root 4096 2019-10-31 14:04 dracut/
drwxr-xr-x 6 root root 4096 2020-07-02 15:01 grub2/
-rw-r--r-- 1 root root 362 2020-07-02 13:35 sysctl.conf-5.7.7
-rw-r--r-- 1 root root 2648167 2020-07-02 13:22 System.map-5.7.7
-rw-r--r-- 1 root root 4411552 2020-07-02 13:22 vmlinuz-5.7.7
v:~ ▶ **du -sh /lib/modules/**
31M /lib/modules/
v:~ ▶ _
There are many more things I’ve tried for fun over the years, but maybe this will be of use to some. Cheers!