Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 692264 - sys-kernel/genkernel-4.0.0_beta12 installs too many libraries (in initrd?)
Summary: sys-kernel/genkernel-4.0.0_beta12 installs too many libraries (in initrd?)
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-16 00:59 UTC by Denis Kaganovich
Modified: 2019-10-04 13:04 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
check libnss_dns.so.2 requirement for busybox (libnss.patch,653 bytes, patch)
2019-10-03 23:30 UTC, Denis Kaganovich
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Kaganovich 2019-08-16 00:59:28 UTC
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.
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2019-08-16 19:01:03 UTC
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...
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2019-08-16 19:01:44 UTC
I meant dracut's lsinitrd.
Comment 3 Denis Kaganovich 2019-10-03 23:30:49 UTC
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
Comment 4 Denis Kaganovich 2019-10-04 00:06:01 UTC
Sorry again, I see - this libs silently required for DNS resolving anymore.
Comment 5 Thomas Deutschmann (RETIRED) gentoo-dev 2019-10-04 13:04:22 UTC
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.