From: Alexey Gladkov <gladkov.alexey@gmail.com> To: make-initrd@lists.altlinux.org Subject: [make-initrd] Two words about initramfs size Date: Thu, 3 Jun 2021 18:17:17 +0200 Message-ID: <20210603161717.vszsijncigxqfpwp@example.org> (raw) Привет! Я попробовал посмотреть на самые тяжёлые компоненты, которые попадают в initramfs. Я сделал initramfs для системы с корнем на разделе. Так что никаких дополнительных фичей не нужно для такой системы. $ find initramfs/ -type f -printf '%s\t%p\n' |sort -k1,1 -g |tail -20 237896 initramfs/lib64/ld-2.32.so 280896 initramfs/lib64/libpcre.so.3.15.12 308856 initramfs/lib64/libreadline.so.7.0 321792 initramfs/lib/firmware/i915/tgl_guc_49.0.1.bin 324160 initramfs/lib/firmware/i915/ehl_guc_49.0.1.bin 324160 initramfs/lib/firmware/i915/icl_guc_49.0.1.bin 324560 initramfs/lib64/libblkid.so.1.1.0 329596 initramfs/lib/modules/5.12.0/kernel/drivers/gpu/drm/drm.ko.xz 383088 initramfs/lib64/libmount.so.1.1.0 433276 initramfs/lib/modules/5.12.0/kernel/net/ipv6/ipv6.ko.xz 498880 initramfs/lib/firmware/i915/ehl_huc_9.0.0.bin 498880 initramfs/lib/firmware/i915/icl_huc_9.0.0.bin 542912 initramfs/bin/busybox 580736 initramfs/lib/firmware/i915/tgl_huc_7.5.0.bin 644952 initramfs/bin/sh4 766656 initramfs/bin/bash4 1061928 initramfs/sbin/udevadm 1780956 initramfs/lib/modules/5.12.0/kernel/drivers/gpu/drm/i915/i915.ko.xz 1851568 initramfs/lib64/libc-2.32.so 2971824 initramfs/lib64/libcrypto.so.1.1 Тут видно сразу несколько проблем в контексте размера. * guess-drm положил i915 модуль, который является очень тяжёлым и тянет за собой много жирных firmware. * В образ попали sh4 и bash4. Это произошло из-за того, что на этой системе /bin/sh -> sh4. * В образ пролез openssl. $ for f in initramfs{,/usr}/{,s}bin/*; do ldd "$f" 2>/dev/null |grep -Fqs lib64/libcrypto.so && echo $f; done initramfs/bin/kmod initramfs/sbin/depmod initramfs/sbin/lsmod initramfs/sbin/modprobe initramfs/sbin/udevadm initramfs/sbin/udevd -- Rgrds, legion
next reply other threads:[~2021-06-03 16:17 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-03 16:17 Alexey Gladkov [this message] 2021-06-04 7:46 ` Konstantin Lepikhov 2021-06-04 8:15 ` Alexey Gladkov 2021-06-04 8:27 ` Konstantin Lepikhov 2021-06-04 8:44 ` Alexey Gladkov 2021-06-04 12:21 ` Konstantin Lepikhov 2021-06-04 12:44 ` Alexey Gladkov 2021-06-04 13:54 ` Alexey Gladkov 2021-06-04 15:21 ` Konstantin Lepikhov 2021-06-04 15:43 ` Alexey Gladkov
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210603161717.vszsijncigxqfpwp@example.org \ --to=gladkov.alexey@gmail.com \ --cc=make-initrd@lists.altlinux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Make-initrd development discussion This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/make-initrd/0 make-initrd/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 make-initrd make-initrd/ http://lore.altlinux.org/make-initrd \ make-initrd@lists.altlinux.org make-initrd@lists.altlinux.ru make-initrd@lists.altlinux.com public-inbox-index make-initrd Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.make-initrd AGPL code for this site: git clone https://public-inbox.org/public-inbox.git