cmd/mkinitfs: Exclude initramfs files from initramfs-extra (MR 34)

When testing on pmOS with qemu/x86_64, this results in some nice
reduction in size of the initramfs-extra (gzip'd, default compression):

Before:
        /mkinitfs # ls -la /boot/initramfs-extra
        -rw-r--r--    1 root     root       3544429 Mar 19 23:06 /boot/initramfs-extra

After:
        /mkinitfs # ls -la /boot/initramfs-extra
        -rw-r--r--    1 root     root       2234020 Mar 19 23:08 /boot/initramfs-extra

Fixes #23
This commit is contained in:
Clayton Craft
2023-03-19 23:07:15 -07:00
parent dceef20121
commit 0054fde90d

View File

@@ -141,7 +141,7 @@ func main() {
modules.New([]string{}, "/etc/mkinitfs/modules-extra"),
osksdl.New(devinfo.MesaDriver),
})
initramfsExtraAr.AddItems(initfsExtra)
initramfsExtraAr.AddItemsExclude(initfsExtra, initfs)
if err := initramfsExtraAr.Write(filepath.Join(workDir, "initramfs-extra"), os.FileMode(0644)); err != nil {
log.Println(err)
log.Println("failed to generate: ", "initramfs-extra")