[systemd-devel] Minimize systemd for kdump's initramfs
Robbie Harwood
rharwood at redhat.com
Thu Jan 2 20:29:26 UTC 2020
Kairui Song <kasong at redhat.com> writes:
> What I'm trying to do is reduce the initramfs size used for kdump.
> Kdump loads a crash kernel and kdump initramfs image in a prereseved
> memory region, which get booted when current kernel crashed and
> perform crash dump. The prereserved memory is limited, so initramfs
> shouldn't go too big.
>
> Kdump in Fedora use Dracut to create bootable initramfs, just hook the
> final step to do kdump things instead of switch root. And to reduce
> the size only the binaries and drivers required to boot and perform
> kdump on current machine is installed. So long it have been working
> very well.
>
> But problem is Dracut works by reusing binaries and libraries from the
> currently running system, and many userspace binaries and libraries is
> keep growing and using more space. So the initramfs is also growing.
>
> /root/image/bin/bash
> 4.8M .
> /root/image/bin/sh
> 4.8M .
So it's not a direct comparison, but:
$ du -sh /bin/bash /bin/dash
1.2M /bin/bash
132K /bin/dash
This suggests to me that 1-3 MB could be reduced by using dash as the
shell. (dash's library dependencies are also smaller since it drops
requirements on libtinfo (200K) and libdl (36K); whether this matters I
don't know.)
Thanks,
--Robbie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20200102/145731af/attachment-0001.sig>
More information about the systemd-devel
mailing list