From 3230e6a050163d9b8aebdbfcff76b785a9d862d1 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Wed, 6 Apr 2022 12:37:20 -0500 Subject: [PATCH] initramfs: Only include necessary drivers *dracut* includes a ton of kernel modules in the initramfs by default. These are totally unnecessary and make the image file huge, which makes it take forever to load via TFTP. We can save a lot of space and time by only including the specific drivers we need to mount the root filesystem. --- mkinitramfs.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mkinitramfs.sh b/mkinitramfs.sh index 5bef67f..d5b79b9 100644 --- a/mkinitramfs.sh +++ b/mkinitramfs.sh @@ -22,8 +22,9 @@ chroot "${destdir}" depmod -a "${kver}" echo 'Building initramfs image ...' 2>&1 chroot "${destdir}" dracut \ --no-hostonly \ - --add 'nbd' \ - --add-drivers 'genet nbd squashfs' \ + --modules 'nbd udev-rules dracut-systemd shutdown' \ + --drivers 'genet nbd squashfs' \ + --force-drivers 'bcm2835_wdt' \ --force \ /boot/initramfs.img \ "${kver}"