From 3c4a728f6d23bce2b2f7a523b01c6b88f3ced2f9 Mon Sep 17 00:00:00 2001 From: Aaron Ball Date: Sun, 5 Mar 2023 11:07:22 -0700 Subject: mkinitramfs:Reduce terminfo and kernel modules This reduces the terminfo directory, which is currently over 40 MB uncompressed, to just copy in the `l` directory, as the bootup tty is a `linux` terminal, so we only need terminfo for that. This also adds additional removals from the kernel device drivers directory for modules that are not required during the boot process. --- mkinitramfs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mkinitramfs b/mkinitramfs index 70802a2..d38111d 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -131,9 +131,9 @@ function cache_dir_setup { mkdir -p ${cache}/${i} done - # Copy in terminals database - mkdir -p "${cache}/usr/share" - cp -r /usr/share/terminfo "${cache}/usr/share/terminfo" + # Copy in terminals database for `l` (linux - stock tty) + mkdir -p "${cache}/usr/share/terminfo" + cp -r /usr/share/terminfo/l "${cache}/usr/share/terminfo/l" } @@ -154,7 +154,7 @@ function check_crypto_support { cp -vr "/lib/modules/${version}/" "${cache}/lib/modules/${version}" # Strip out kernel modules not required for bootstrapping - for i in virt net sound drivers/gpu drivers/bluetooth drivers/video; do + for i in virt sound drivers/{bluetooth,gpu,hid,media,mmc,net,video,virtio}; do buf="${cache}/lib/modules/${version}/kernel/${i}" if [ -d "${buf}" ]; then printf 'Stripping %s from initramfs\n' "${buf}" -- cgit v1.2.3