Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 307855 - genkernel: root on lvm gen-initramfs.sh fail
Summary: genkernel: root on lvm gen-initramfs.sh fail
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: InVCS
: 307857 307859 (view as bug list)
Depends on:
Blocks: 351772
  Show dependency tree
 
Reported: 2010-03-05 07:35 UTC by Pavel V Samsonov
Modified: 2011-01-16 17:25 UTC (History)
2 users (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 Pavel V Samsonov 2010-03-05 07:35:50 UTC
I have root fs on LVM. I do:
genkernel --lvm all
and result:
* initramfs: >> Initializing...
*         >> Appending base_layout cpio data...
*         >> Appending auxilary cpio data...
*         >> Appending busybox cpio data...
*         >> Appending lvm cpio data...
*           LVM: Adding support (using local static binaries)...
*         >> Appending modules cpio data..

ls /boot
initramfs-genkernel-x86-2.6.31-gentoo-r10-psn
kernel-genkernel-x86-2.6.31-gentoo-r10-psn

I verify (extract initramfs):
cp /boot/initramfs-genkernel-x86-2.6.31-gentoo-r10-psn /root/initramfs-genkernel-x86-2.6.31-gentoo-r10-psn.gz
mkdir /root/initramfs
cd /root/initramfs
gunzip ../initramfs-genkernel-x86-2.6.31-gentoo-r10-psn.gz
cpio -i < ../initramfs-genkernel-x86-2.6.31-gentoo-r10-psn
cd bin
ls -l
-rwxr-xr-x 9 root root 1093640 Мар  5 10:29 [
-rwxr-xr-x 9 root root 1093640 Мар  5 10:29 ash
-rwxr-xr-x 9 root root 1093640 Мар  5 10:29 busybox
-rwxr-xr-x 9 root root 1093640 Мар  5 10:29 cat
-rwxr-xr-x 9 root root 1093640 Мар  5 10:29 cut
-rwxr-xr-x 9 root root 1093640 Мар  5 10:29 echo
-r-xr-xr-x 1 root root 1271836 Мар  5 10:29 lvm
-rwxr-xr-x 9 root root 1093640 Мар  5 10:29 mount
-rwxr-xr-x 9 root root 1093640 Мар  5 10:29 sh
-rwxr-xr-x 9 root root 1093640 Мар  5 10:29 uname


Static /bin/lvm present, but symlinks vgchange->lvm and vgscan->lvm not present. To do this, I patch /usr/share/genkernel/gen_initramfs.sh (lvm section).



Reproducible: Always
Comment 1 Alex Legler (RETIRED) archtester gentoo-dev Security 2010-03-05 12:17:13 UTC
*** Bug 307859 has been marked as a duplicate of this bug. ***
Comment 2 Alex Legler (RETIRED) archtester gentoo-dev Security 2010-03-05 12:17:23 UTC
*** Bug 307857 has been marked as a duplicate of this bug. ***
Comment 3 Andrew Gaffney (RETIRED) gentoo-dev 2010-03-05 13:54:20 UTC
What version of genkernel? Patch it how?
Comment 4 Kai Dietrich 2010-04-30 13:04:51 UTC
I hit that same bug when switching from my custom initrd to the genkernel initrd.

The /init script inside the initramfs is supposed to generate the vgscan and vgchange symlinks. Here is the code snippet:

if [ "$0" = '/init' ]
then
        [ -e /linuxrc ] && rm /linuxrc

        if [ -e /bin/lvm ]
        then
                ln -s /bin/lvm /bin/vgscan
                ln -s /bin/lvm /bin/vgchange
        fi
fi

as you can see, it only creates them, when it whas called as init and not as linuxrc. So if you use the kernel parameter rdinit=/init instead of the default rdinit=/linuxrc everything works just fine.

Now why that check is there at all, I have no idea ;)
Comment 5 Sebastian Pipping gentoo-dev 2011-01-11 14:45:04 UTC
I have applied this patch to the experimental branch:
http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commitdiff;h=b4f310213ef80357880ba63a93b85922d7b07a44

The genkernel-99999 ebuild (fix nines) exposes that branch.
Please let me know how it works for you.

If I don't hear anything, I may close this bug in two weeks.