I'm installing Gentoo on a fully encrypted hard disk with lvm, so I need an initramfs which supports lvm and luks. I'm using genkernel to try and build an initramfs, however, it fails to compile the lvm step of the initramfs.
Code: Select all
(chroot) livecd ~ # genkernel --install --no-ramdisk-modules --lvm --luks initramfs
* Gentoo Linux Genkernel; Version 3.4.52.4
* Running with options: --install --no-ramdisk-modules --lvm --luks initramfs
* Using genkernel.conf from /etc/genkernel.conf
* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh ..
* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load ..
* Linux Kernel 4.9.95-gentoo for x86_64...
* .. with config file /usr/share/genkernel/arch/x86_64/generated-config
* busybox: >> Using cache
* initramfs: >> Initializing...
* >> Appending base_layout cpio data...
* >> Appending auxilary cpio data...
* >> Copying keymaps
* >> Appending busybox cpio data...
* >> Appending lvm cpio data...
* LVM: Adding support (compiling binaries)...
* lvm: >> Applying patches...
* - lvm2-2.02.72-no-export-dynamic.patch
* lvm: >> Configuring...
* lvm: >> Compiling...
* ERROR: Failed to compile the "" target...
*
* -- Grepping log... --
*
*DEPS=`echo ../make.tmpl ../VERSION ../Makefile ../include/.symlinks_created | sed -e 's/\\//\\\\\\//g'`; \
*gcc -MM -I. -I../include -DLVM_SHARED_PATH=\"//sbin/lvm\" -DHAVE_CONFIG_H -DDM_IOCTLS -fPIC -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -Wpointer-arith -O2 -o lvchange.d lvchange.c; \
*sed -i "s/\(.*\)\.o[ :]*/$FILE.o $FILE.d $FILE.pot: $DEPS /g" lvchange.d; \
*[ -s lvchange.d ] || rm -f lvchange.d
*dmeventd.o: In function `_register_for_event':
*dmeventd.c:(.text+0x1bc1): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
*--
*gcc -c -I. -I../include -DHAVE_CONFIG_H -DDM_IOCTLS -fPIC -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -Wpointer-arith -O2 filters/filter-persistent.c -o filters/filter-persistent.o
*gcc -c -I. -I../include -DHAVE_CONFIG_H -DDM_IOCTLS -fPIC -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -Wpointer-arith -O2 filters/filter-regex.c -o filters/filter-regex.o
*gcc -c -I. -I../include -DHAVE_CONFIG_H -DDM_IOCTLS -fPIC -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -Wpointer-arith -O2 filters/filter-sysfs.c -o filters/filter-sysfs.o
*gcc -c -I. -I../include -DHAVE_CONFIG_H -DDM_IOCTLS -fPIC -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -Wpointer-arith -O2 filters/filter-md.c -o filters/filter-md.o
*filters/filter-sysfs.c: In function ‘_hash_dev’:
*filters/filter-sysfs.c:125:10: warning: implicit declaration of function ‘major’ [-Wimplicit-function-declaration]
* return (major(dev) ^ minor(dev)) & (SET_BUCKETS - 1);
* ^~~~~
*filters/filter-sysfs.c:125:2: warning: nested extern declaration of ‘major’ [-Wnested-externs]
* return (major(dev) ^ minor(dev)) & (SET_BUCKETS - 1);
* ^~~~~~
*filters/filter-sysfs.c:125:23: warning: implicit declaration of function ‘minor’ [-Wimplicit-function-declaration]
* return (major(dev) ^ minor(dev)) & (SET_BUCKETS - 1);
* ^~~~~
*filters/filter-sysfs.c:125:2: warning: nested extern declaration of ‘minor’ [-Wnested-externs]
* return (major(dev) ^ minor(dev)) & (SET_BUCKETS - 1);
* ^~~~~~
*filters/filter-sysfs.c: In function ‘_parse_dev’:
*filters/filter-sysfs.c:176:12: warning: implicit declaration of function ‘makedev’ [-Wimplicit-function-declaration]
* *result = makedev(major, minor);
* ^~~~~~~
*filters/filter-sysfs.c:176:2: warning: nested extern declaration of ‘makedev’ [-Wnested-externs]
*--
*gcc -c -I. -I../include -DLVM_SHARED_PATH=\"//sbin/lvm\" -DHAVE_CONFIG_H -DDM_IOCTLS -fPIC -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -Wpointer-arith -O2 lvremove.c -o lvremove.o
*gcc -c -I. -I../include -DLVM_SHARED_PATH=\"//sbin/lvm\" -DHAVE_CONFIG_H -DDM_IOCTLS -fPIC -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -Wpointer-arith -O2 lvrename.c -o lvrename.o
*gcc -c -I. -I../include -DLVM_SHARED_PATH=\"//sbin/lvm\" -DHAVE_CONFIG_H -DDM_IOCTLS -fPIC -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -Wpointer-arith -O2 lvresize.c -o lvresize.o
*gcc -c -I. -I../include -DLVM_SHARED_PATH=\"//sbin/lvm\" -DHAVE_CONFIG_H -DDM_IOCTLS -fPIC -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -Wpointer-arith -O2 lvscan.c -o lvscan.o
*lvconvert.c: In function ‘_lvconvert_single’:
*lvconvert.c:1450:10: warning: ‘image_count’ may be used uninitialized in this function [-Wmaybe-uninitialized]
*--
*filter-sysfs.c:(.text+0x31e): undefined reference to `major'
*filter-sysfs.c:(.text+0x32d): undefined reference to `minor'
*../lib/liblvm-internal.a(filter-sysfs.o): In function `_accept_p':
*filter-sysfs.c:(.text+0x4b9): undefined reference to `major'
*filter-sysfs.c:(.text+0x4c6): undefined reference to `minor'
*collect2: error: ld returned 1 exit status
*make[1]: *** [Makefile:135: lvm] Error 1
*make[1]: *** Waiting for unfinished jobs....
*../lib/liblvm-internal.a(sharedlib.o): In function `load_shared_library':
*sharedlib.c:(.text+0x153): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
*--
*filter-sysfs.c:(.text+0x31e): undefined reference to `major'
*filter-sysfs.c:(.text+0x32d): undefined reference to `minor'
*../lib/liblvm-internal.a(filter-sysfs.o): In function `_accept_p':
*filter-sysfs.c:(.text+0x4b9): undefined reference to `major'
*filter-sysfs.c:(.text+0x4c6): undefined reference to `minor'
*collect2: error: ld returned 1 exit status
*make[1]: *** [Makefile:139: lvm.static] Error 1
*make[1]: Leaving directory '/var/tmp/genkernel/32442.6921.31635.14956/LVM2.2.02.88/tools'
*make: *** [make.tmpl:214: tools] Error 2
*--
* Running with options: --install --no-ramdisk-modules --lvm --luks initramfs
* Using genkernel.conf from /etc/genkernel.conf
* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh ..
* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load ..
*
* ERROR: Failed to compile the "" target...
Thanks in advance!



