containers / initoverlayfs

GNU General Public License v2.0
35 stars 9 forks source link

initramfs image generated is bigger than dracut -f #2

Closed dougsland closed 8 months ago

dougsland commented 8 months ago

The initramfs generated by dracut -f is smaller than the one generated by initoverlayfs.

Info:

# cat /etc/fedora-release
Fedora release 39 (Thirty Nine)

# rpm -qa | grep -i initoverlayfs
initoverlayfs-0.96-1.fc39.x86_64

Generating the image and comparing the size

Generating using raw dracut:

# dracut -f
# du -sh /boot/initramfs-6.5.5-300.fc39.x86_64.img
34M /boot/initramfs-6.5.5-300.fc39.x86_64.img

Generating using initoverlayfs:

#  /usr/bin/initoverlayfs-install
# du -sh /boot/initramfs-6.5.5-300.fc39.x86_64.img
42M /boot/initramfs-6.5.5-300.fc39.x86_64.img
dougsland commented 8 months ago

I will start comparing the two images:

# sudo lsinitrd ./42M-initramfs-6.5.5-300.fc39.x86_64.img &> 42m.txt
# sudo lsinitrd ./34M-initramfs-6.5.5-300.fc39.x86_64.img &> 34m.txt
#  diff -ruN 34m.txt 42m.txt
dougsland commented 8 months ago

In the diff for example I noticed it included AuthenticAMD.bin which in dracut -f is not included:

+-rw-r--r--   1 root     root        77182 Oct  4 20:00 kernel/x86/microcode/AuthenticAMD.bin

Just for reference, here is the intel cpu:

[root@dell730 initoverlayfs]# cat /proc/cpuinfo  | grep -i intel|more
vendor_id   : GenuineIntel
model name  : Intel(R) Xeon(R) CPU E5-2687W v3 @ 3.10GHz
vendor_id   : GenuineIntel
ericcurtin commented 8 months ago

Fix submitted:

https://github.com/containers/initoverlayfs/pull/3

Feel free to test, review, etc.

We can test by copying this change into:

/usr/bin/initoverlayfs-install

doing a:

rm -f /etc/initoverlayfs.conf

and it should be smaller again.

Re-running:

initoverlayfs-install

dougsland commented 8 months ago

For me it worked, I would just merge it.

ericcurtin commented 8 months ago

Thanks for looking at this!

dougsland commented 8 months ago

resolved via #3