Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 415697 - >=sys-kernel/genkernel-3.4.30 creates a buggy initramfs w/o lvm/dmsetup binaries
Summary: >=sys-kernel/genkernel-3.4.30 creates a buggy initramfs w/o lvm/dmsetup binaries
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-13 05:53 UTC by Alex Turbov
Modified: 2012-05-20 03:34 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Turbov 2012-05-13 05:53:34 UTC
I have lvm2 in my system compiled w/o USE=static, so when genkernel create an initramfs for me it compiles lvm2 from sources and then uses cached binary.
Recently I've discovered the following lines in /usr/share/genkernel/gen_initramfs.sh:

   290                  mv ${TEMP}/initramfs-lvm-temp/sbin/lvm.static ${TEMP}/initramfs-lvm-temp/bin/lvm ||
   291                          gen_die 'LVM error: Could not move lvm.static to lvm!'
   292                  # See bug 382555
   293                  mv ${TEMP}/initramfs-lvm-temp/sbin/dmsetup.static ${TEMP}/initramfs-lvm-temp/bin/dmsetup ||
   294                          gen_die 'LVM error: Could not move dmsetup.static to dmsetup!'
   295                  rm -rf  ${TEMP}/initramfs-lvm-temp/{lib,share,man,include,{s,}bin/{lvm,dmsetup}}

i.e. at line 295 lvm and dmsetup binaries (just moved from ${TEMP}/initramfs-lvm-temp/sbin/*.static) *would be removed* from ${TEMP}/initramfs-lvm-temp/bin/ directory!! so, final initramfs wouldn't contains that binaries at all and we'll get a unbootable system finally...

The correct line should be:

   295                  rm -rf  ${TEMP}/initramfs-lvm-temp/{lib,share,man,include,sbin/{lvm,dmsetup}}

as it was in genkernel 3.4.30


Reproducible: Always

Steps to Reproduce:
1.genkernel initramfs
2.
3.
Actual Results:  
final initramfs have no /bin/lvm

Expected Results:  
it must be there!
Comment 1 Marc Schiffbauer gentoo-dev 2012-05-13 23:12:49 UTC
Confirmed.

I am really lucky to always have a previous kernel+initrd around because current genkernel created an initrd for me that complains about missing vgscan and vgchange and results in an unbootable system.
Comment 3 Sebastian Pipping gentoo-dev 2012-05-14 00:21:13 UTC
This should help:
http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commitdiff;h=9743f8b39c6050746d7ff1949fc98999a847c4f9


+*genkernel-3.4.32 (14 May 2012)
+
+  14 May 2012; Sebastian Pipping <sping@gentoo.org> -genkernel-3.4.30.ebuild,
+  -genkernel-3.4.31.ebuild, +genkernel-3.4.32.ebuild:
+  Bump to 3.4.32 (bug #415697), remove broken 3.4.30 and 3.4.31
+

Sorry for the trouble.  Please re-open as needed.
Comment 4 Livid 2012-05-17 12:00:04 UTC
Problem persists, since helper symlinks (i.e. vgscan and vgchange) actually end up in /sbin, and those symlinks link to 'lvm', without path.
Solutions might include:
a) copy/symlink /bin/lvm to /sbin/lvm
b) move /sbin/* lvm symlinks to /bin
c) update symlinks to link to /bin/lvm

To check that, build initramfs and then mount image somewhere.
Comment 5 Sebastian Pipping gentoo-dev 2012-05-17 15:42:02 UTC
(In reply to comment #4)
> Problem persists, since helper symlinks (i.e. vgscan and vgchange) actually
> end up in /sbin, and those symlinks link to 'lvm', without path.

I don't see any symlinks for vgscan/vgchange nor any use of these in latest genkernel.  Please let me know how and where you found it.  Also, you can find me as "sping" on freenode IRC right now if you like.
Comment 6 Livid 2012-05-20 03:34:06 UTC
Forget that, my mistake. Seems like I had to clean /var/cache/genkernel before assuming a bug.