Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 482504 - sys-kernel/genkernel-next - boot from LVM thin provisoined volume doesn't work
Summary: sys-kernel/genkernel-next - boot from LVM thin provisoined volume doesn't work
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Fabio Erculiani (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-26 04:12 UTC by Christopher Byrne
Modified: 2013-09-09 09:55 UTC (History)
0 users

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


Attachments
/etc/ld.so.cache from the initramfs (ld.so.cache,1.36 KB, application/octet-stream)
2013-08-30 17:44 UTC, Christopher Byrne
Details
genkernel --loglevel=5 output (gk.log,14.67 KB, text/x-log)
2013-08-31 15:35 UTC, Christopher Byrne
Details
genkernel --lvm --loglevel=5 | tee output (gk-out.log,59.07 KB, text/x-log)
2013-09-04 03:53 UTC, Christopher Byrne
Details
lddtree output (stable) (lddtree.out.txt,1.89 KB, text/plain)
2013-09-08 19:15 UTC, Christopher Byrne
Details
filter lddtree output (stable) (lddtree.filtered.txt,485 bytes, text/plain)
2013-09-08 19:16 UTC, Christopher Byrne
Details
lddtree output (unstable) (lddtree.unstable.txt,1000 bytes, text/plain)
2013-09-08 19:16 UTC, Christopher Byrne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Byrne 2013-08-26 04:12:25 UTC
sys-kernel/genkernel-next fails to boot from the thinly provisoined root due to missing libraries. While genkernel-next includes and compiles thin support (or copies an existing lvm with thin support) and copies the supporting binaries from sys-block/thin-provisioning-tools, it doesn't work, becasue the binaries in sys-block/thin-provisioning-tools are dynamically linked, but the shared libraries aren't copied into the initramfs.

However, sys-block/thin-provisioning-tools neither a command line option in its ./configure to build static binaries (like LVM), nor does its ./configure respect any CFLAGS/LDFLAGS passed to it. Futhermore, even if it did, it also links expat, and static expat binaries are not created by default.

But as udev-205+ systemd (and therefore udev) doesn't support building static libaries (libudev,a) anyway its probably just to copy the needed libraries into the initramfs as well, as LVM will start having the same problem.

By comparison, sys-kernel/genkernel has no support whatsoever for thin volumes (sys-kernel/dracut does but only includes it in the initramfs if its generated on a host with a thin root)
Comment 1 Fabio Erculiani (RETIRED) gentoo-dev 2013-08-26 10:41:58 UTC
The libraries should be copied as per copy_binaries(), which is the function used to do the magic.
Please provide more info (boot logs, lddtree output, etc).
Simply stating that something "does not work" is not really helpful :-(
Comment 2 Christopher Byrne 2013-08-28 07:22:54 UTC
Running thin_check from the initramfs return the following:

/sbin/thin_check: error while loading shared libraries: libstdc++.so.6: Cannot open shared object file: No such file or directory

I copied ldd into the initramfs, and it shows there 2 is missing libraries: libstdc++.so.6 and libgcc_s.so.1. Both are present in the initramfs, under the /usr/lib/gcc/x84_64-pc-linux-gnu/4.6.3/32 directory, but i think those are the 32-bit ones.
Comment 3 Fabio Erculiani (RETIRED) gentoo-dev 2013-08-28 07:46:49 UTC
What version of genkernel-next did you use to build that initramfs?
Comment 4 Christopher Byrne 2013-08-28 13:46:24 UTC
version 23
Comment 5 Fabio Erculiani (RETIRED) gentoo-dev 2013-08-29 12:35:02 UTC
Could you post the whole initramfs file somewhere so that I can download and inspect it?
Comment 6 Fabio Erculiani (RETIRED) gentoo-dev 2013-08-29 12:52:00 UTC
Also, in the meantime, can you:

- paste the output of ldd /sbin/thin_check
- paste the output of emerge --info
- paste the content of /etc/ld.so.conf and /etc/ld.so.conf.d/*

There is something wrong with genkernel and your particular configuration. I am unable to reproduce the problem here.
Comment 7 Christopher Byrne 2013-08-30 03:58:41 UTC
This was done in a qemu/kvm, booted from a Fedora 19 Live CD (amd64), as the Gentoo live CD do not have thin-provisoing-tools. I'm using virtio-scsi drivers, however genkernel doesn't copy that one in the modulem so modified /usr/share/genkernel/arch/x86_64/modules_load to include it. 

Otherwsie jsut a stage3, with only 4 packagse in the world file: sys-boot/grub:2
,sys-fs/lvm2, sys-kernel/genkernel-next, sys-kernel/gentoo-sources.

From the initramfs:

# /bin/sh /usr/bin/ldd /sbin/thin_check 
	linux-vdso.so.1 (0x00007fff31ffe000)
	libstdc++.so.6 => not found
	libgcc_s.so.1 => not found
	libc.so.6 => /lib64/libc.so.6 (0x00007f0ca80ff000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f0ca84a7000)

from the build host:
# ldd /sbin/thin_check
	linux-vdso.so.1 (0x00007fff919fe000)
	libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libstdc++.so.6 (0x00007f49773f1000)
	libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libgcc_s.so.1 (0x00007f49771db000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f4976e33000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f4976b3d000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f49776f5000)

/etc/ld.so.conf:
# ld.so.conf autogenerated by env-update; make all changes to
# contents of /etc/env.d directory
/lib64
/usr/lib64
/usr/local/lib64
/lib32
/usr/lib32
/usr/local/lib32
/lib
/usr/lib
/usr/local/lib
include ld.so.conf.d/*.conf
/usr/x86_64-pc-linux-gnu/lib

ls /etc/ld.so.conf.d/*:
/etc/ld.so.conf.d/05gcc-x86_64-pc-linux-gnu.conf

/etc/ld.so.conf.d/05gcc-x86_64-pc-linux-gnu.conf:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/32
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3

emerge --info:

Portage 2.1.12.2 (default/linux/amd64/13.0, gcc-4.6.3, glibc-2.15-r3, 3.9.5-301.fc19.x86_64 x86_64)
=================================================================
System uname: Linux-3.9.5-301.fc19.x86_64-x86_64-QEMU_Virtual_CPU_version_1.4.2-with-gentoo-2.2
KiB Mem:     1019684 total,     83244 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Fri, 23 Aug 2013 01:00:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5, 3.2.5-r1
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.12.6
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.7 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl amd64 berkdb bindist bzip2 cli cracklib crypt cxx dri fortran gdbm iconv ipv6 mmx modules mudflap multilib ncurses nls nptl openmp pam pcre readline session sse sse2 ssl tcpd unicode zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 8 Fabio Erculiani (RETIRED) gentoo-dev 2013-08-30 12:08:17 UTC
is /etc/ld.so.cache available in the initramfs? Could you attach it here? (it's a binary file).
Comment 9 Christopher Byrne 2013-08-30 17:44:56 UTC
Created attachment 357440 [details]
/etc/ld.so.cache from the initramfs
Comment 10 Fabio Erculiani (RETIRED) gentoo-dev 2013-08-30 18:16:30 UTC
Sorry, I need the full initramfs archive in order to figure out what's going on. There's something wrong somewhere.
Comment 11 Christopher Byrne 2013-08-30 18:38:00 UTC
The initramfs is too large to post via bugzilla, so i've sent a link via e-mail to download it.
Comment 12 Fabio Erculiani (RETIRED) gentoo-dev 2013-08-30 19:47:22 UTC
Thanks for the initramfs. I'm trying to figure out why some libraries haven't been copied to the initramfs by copy_binaries(). It might be due to lddtree.
What version of pax-utils are you using?
Comment 13 Christopher Byrne 2013-08-30 21:49:46 UTC
The current stable - app-misc/pax-utils-0.4
Comment 14 Fabio Erculiani (RETIRED) gentoo-dev 2013-08-31 10:06:21 UTC
Sorry if I keep asking you questions.
Hopefully this is the last one.

Can you paste the output of your genkernel call adding --loglevel=5 --logfile=/tmp/gk.log ?
Then also attach the /tmp/gk.log file.
Comment 15 Christopher Byrne 2013-08-31 15:35:57 UTC
Created attachment 357520 [details]
genkernel --loglevel=5 output
Comment 16 Fabio Erculiani (RETIRED) gentoo-dev 2013-09-03 09:25:11 UTC
I said: "Can you *paste the output* of your genkernel ..."
Comment 17 Christopher Byrne 2013-09-04 03:53:45 UTC
Created attachment 357814 [details]
genkernel --lvm --loglevel=5 | tee output

Whoops. Here's the output of the command (via tee).
Comment 18 Fabio Erculiani (RETIRED) gentoo-dev 2013-09-08 09:30:42 UTC
Thanks.
It looks like copy_binaries() is doing something wrong there.
What is the output of:

# lddtree /sbin/lvm /sbin/dmsetup /sbin/thin_check /sbin/thin_restore /sbin/thin_dump > /tmp/lddtree.out.txt 2> /tmp/lddtree.err.txt

(please attach both files, don't paste the output here)

Then do this:

# lddtree /sbin/lvm /sbin/dmsetup /sbin/thin_check /sbin/thin_restore /sbin/thin_dump | tr ')(' '\n' | awk  '/=>/{ if($3 ~ /^\//){print $3}}' | sort | uniq > /tmp/lddtree.filtered.txt

(please attach /tmp/lddtree.filtered.txt to this bug)

Finally, try to upgrade to the latest unstable pax-utils and run:

# lddtree -l /sbin/lvm /sbin/dmsetup /sbin/thin_check /sbin/thin_restore /sbin/thin_dump > /tmp/lddtree.unstable.txt

(please attach /tmp/lddtree.unstable.txt to this bug).


Thanks for your time.
Comment 19 Christopher Byrne 2013-09-08 19:15:49 UTC
Created attachment 358308 [details]
lddtree output (stable)

/tmp/lddtree.err.txt is an empty file so I didn't incliude it
Comment 20 Christopher Byrne 2013-09-08 19:16:18 UTC
Created attachment 358310 [details]
filter lddtree output (stable)
Comment 21 Christopher Byrne 2013-09-08 19:16:48 UTC
Created attachment 358312 [details]
lddtree output (unstable)
Comment 22 Christopher Byrne 2013-09-09 00:01:32 UTC
With app-misc/pax-utils-0.7 it boots noramlly (with the current stable, app-misc/pax-utils-0.4 it does not)
Comment 23 Fabio Erculiani (RETIRED) gentoo-dev 2013-09-09 09:55:09 UTC
+  09 Sep 2013; Fabio Erculiani <lxnay@gentoo.org> genkernel-next-24.ebuild:
+  bump the minimum dmraid and pax-utils version requirements, fix bugs #482504,
+  #472670
+