To check what libraries used by binaries, you can use "ldd" (glibc) or "lddtree" (app-misc/pax-utils, cross). Just try "ldd /bin/bash" or "lddtree /bin/bash". (I use https://raw.githubusercontent.com/mahatma-kaganovich/raw/master/sys-kernel/genpnprd/files/genpkgrd script to copy all). Currently, generating image with just static busybox & blkid - I have tons of /lib/*.so.* and ld.so.cache (ldconfig run). Need nothing of them.
Tons of .so? Please show us your initramfs content. You can use dracut's lsinitrd. In my initramfs with "--lvm --luks --mdadm --ssh", the initramfs contains only the following libs: > -rwxr-xr-x 1 root root 165288 Aug 16 20:51 lib/ld-linux-x86-64.so.2 > -rwxr-xr-x 1 root root 1902144 Aug 16 20:51 lib/libc.so.6 > -rwxr-xr-x 1 root root 26800 Aug 16 20:51 lib/libnss_dns.so.2 > -rwxr-xr-x 1 root root 51536 Aug 16 20:51 lib/libnss_files.so.2 > -rwxr-xr-x 1 root root 88736 Aug 16 20:51 lib/libresolv.so.2 We are always adding libnss-dns.so.2 to provide DNS support (which will pull in libc.so.6 and ld-linux-x86-64.so.2). --ssh will require libnss_files.so.2. Genkernel's v4 initramfs is smaller than latest genkernel v3 initramfs. So I am not sure about what we are talking here. But maybe your initramfs content will reveal a problem...
I meant dracut's lsinitrd.
Created attachment 591770 [details, diff] check libnss_dns.so.2 requirement for busybox Sorry for waiting. In short: see patch. Depending to --busybox-config, libnss_dns.so.2 (+etc) is optional for append_busybox(). So, with my config, busybox is pure static. PS If you want to know how to do so - some of them: ... PAM=n STATIC=y DEBUG=n NO_DEBUG_LIB=y DMALLOC=n EFENCE=n FEATURE_MOUNT_NFS=n FEATURE_MOUNT_CIFS=y MODPROBE_SMALL=n INSMOD=y RMMOD=y MODPROBE=y LSMOD=n FEATURE_MODPROBE_BLACKLIST=y TELNETD=y MKFS_EXT2=n
Sorry again, I see - this libs silently required for DNS resolving anymore.
So what do you expect us to do here? Your patch doesn't work. Default busybox binary created by genkernel: $ file busybox busybox: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.2.0, stripped $ lddtree busybox busybox (interpreter => None) Even if this would work, we are talking about saving 88736 + 26800 bytes at best. That's not really worth to talk about.