You are not logged in.
My /boot/ size is 1GB and I installed linux-lts kernel to try it to see if it improves battery life on my laptop. However, mkinitcpio generates very big initramfs images. Is there any way to shrink the images so I can use linux-lts kernel along with default linux kernel?
Here's the current size of images:
initramfs-linux.img (192.1 MB)
initramfs-linux-fallback.img (291.9 MB)
initramfs-linux-lts.img (192.6 MB)
initramfs-linux-lts-fallback.img (264.0 MB)
Here are the HOOKS and MODULES:
HOOKS=(base udev microcode autodetect modconf kms keyboard keymap consolefont block filesystems fsck)
MODULES=(i915 nvidia nvidia_modeset nvidia_uvm nvidia_drm)
I'm on a laptop with intel integrated and discreet nvidia GPU, However I disable nvidia using envycontrol when not in use to save power.
I've checked on the forum that removing kms hook shrinks the image by around 50MB however I'm using both integrated and discreet nvidia gpus, so I don't know if it applies to my system. I also don't have my disk encrypted.
Offline
First thing to realize is that kms and those modules will still work, it doesn't have to be done in early userspace. This is usually done just to avoid a race condition where the graphics system (usually in the form of a DM) tries to load before the driver is ready. If you don't have that issue, there's no need to load them early.
Also, microcode can be done after audodetect, which will shrink it by only including microcode for your processor instead of all Intel processors.
Last edited by Scimmia (2025-06-21 16:58:16)
Offline
First thing to realize is that kms and those modules will still work, it doesn't have to be done in early userspace. This is usually done just to avoid a race condition where the graphics system (usually in the form of a DM) tries to load before the driver is ready. If you don't have that issue, there's no need to load them early.
Also, microcode can be done after audodetect, which will shrink it by only including microcode for your processor instead of all Intel processors.
Thank you! The fallback images are still the same sized, but now at least I have 39mb space left in boot partition(earlier it was 0mb) and initramfs generated without running out of space. Here are the new sizes after moving microcode after autodetect and kms further back:
initramfs-linux.img (177.9 MB)
initramfs-linux-fallback.img (291.9 MB)
initramfs-linux-lts.img (178.4 MB)
initramfs-linux-lts-fallback.img (292.6 MB)
Now I can safely switch the kernel.
Offline
With that modules= line you don't need the kms hook.
If you add the module(s) for the filesystem(s) where /boot and / are on (and remove the filesystems hook) you can reduce the size even further .
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Arguably, you won't need *two* fallback images. You could edit the linux.preset and skip it there.
Offline
Adding to all the solid suggestions above would be to purge the fallback from your /etc/mkinitcpio.d/linux.preset and delete that initramfs-linux-fallback.img file.
In the odd/rare circumstance you actually require those extra modules for whatever reason, booting the LTS fallback should be plenty of "fallback" insurance.
That'll buy you a bunch of space. I have 4 kernels on my 1GB ESP.
-rwx------ 1 root root 175M Jun 18 18:57 initramfs-linux.img
-rwx------ 1 root root 175M Jun 20 05:46 initramfs-linux-lts.img
-rwx------ 1 root root 175M Jun 19 17:56 initramfs-linux-stable-mfm.img
-rwx------ 1 root root 77M Jun 20 13:27 initrd.img-6.1.0-37-amd64Filesystem Size Used Avail Use% Mounted on
/dev/nvme0n1p1 999M 695M 304M 70% /bootOnline
With that modules= line you don't need the kms hook.
If you add the module(s) for the filesystem(s) where /boot and / are on (and remove the filesystems hook) you can reduce the size even further .
Thanks I will try it.
I gotta say though, moving kms further back has increase my boot time into sddm, it now shows "dev/sda2 block..." kinda text for around 10-15 seconds and then goes into sddm login screen.
For clarification, I'm using sddm with hyprland
Offline
Arguably, you won't need *two* fallback images. You could edit the linux.preset and skip it there.
Thanks, I have skipped the fallback for default linux kernel by editing the linux.preset. Will be deleting the fallback image now.
Offline