When I try to use genkernel to build linux-5.8.1-gentoo with BCACHE="yes" in genkernel.conf, genkernel fails to build the initramfs. I suspect that util-linux isn't being correctly included by genkernel when building bcache-tools. Relevant part of the build log: ================================================================= * >> Appending bcache cpio data ... * Checking for binpkg(s) required for bcache-tools-1.0.8_p20141204 (L0) ... * > util-linux-2.36 has no dependencies. (L1) * > GKBUILD '/usr/share/genkernel/gkbuilds/util-linux-2.36.gkbuild' does NOT exist; Skipping ... * > Existing util-linux-2.36 binpkg is newer than '/usr/share/genkernel/gkbuilds/util-linux.gkbuild'; Skipping ... * > Can keep using existing util-linux-2.36 binpkg from '/var/cache/genkernel/4.1.0/util-linux-2.36-x86_64.tar.xz'! * > Binpkg of util-linux-2.36 is ready; Adding to list 'CHECK_L0_REQUIRED_BINPKGS' ... * > Checking for binpkg(s) required for eudev-3.2.9 (L1) ... * >> util-linux-2.36 has no dependencies. (L2) * >> GKBUILD '/usr/share/genkernel/gkbuilds/util-linux-2.36.gkbuild' does NOT exist; Skipping ... * >> Existing util-linux-2.36 binpkg is newer than '/usr/share/genkernel/gkbuilds/util-linux.gkbuild'; Skipping ... * >> Can keep using existing util-linux-2.36 binpkg from '/var/cache/genkernel/4.1.0/util-linux-2.36-x86_64.tar.xz'! * >> Binpkg of util-linux-2.36 is ready; Adding to list 'CHECK_L1_REQUIRED_BINPKGS' ... * > GKBUILD '/usr/share/genkernel/gkbuilds/eudev-3.2.9.gkbuild' does NOT exist; Skipping ... * > Existing eudev-3.2.9 binpkg is newer than '/usr/share/genkernel/gkbuilds/eudev.gkbuild'; Skipping ... * > Existing eudev-3.2.9 binpkg is newer than 'util-linux-2.36-x86_64.tar.xz'; Skipping ... * > Existing eudev-3.2.9 binpkg is newer than '/usr/share/genkernel/patches/eudev/3.2.9/eudev-3.2.9-static.patch'; Skipping ... * > Can keep using existing eudev-3.2.9 binpkg from '/var/cache/genkernel/4.1.0/eudev-3.2.9-x86_64.tar.xz'! * > Binpkg of eudev-3.2.9 is ready; Adding to list 'CHECK_L0_REQUIRED_BINPKGS' ... * Binpkg '/var/cache/genkernel/4.1.0/bcache-tools-1.0.8_p20141204-x86_64.tar.xz' does NOT exist; Need to build bcache-tools-1.0.8_p20141204 ... * Trying to determine gkbuild for bcache-tools-1.0.8_p20141204 ... * '/usr/share/genkernel/gkbuilds/bcache-tools-1.0.8_p20141204.gkbuild' not found; Skipping ... * Will use '/usr/share/genkernel/gkbuilds/bcache-tools.gkbuild' to build bcache-tools-1.0.8_p20141204 ... * SYSROOT set to '/'! * bcache-tools-1.0.8_p20141204: >> Unpacking required binpkg '/var/cache/genkernel/4.1.0/util-linux-2.36-x86_64.tar.xz' ... * bcache-tools-1.0.8_p20141204: >> Unpacking required binpkg '/var/cache/genkernel/4.1.0/eudev-3.2.9-x86_64.tar.xz' ... * bcache-tools-1.0.8_p20141204: >> Unpacking source ... * bcache-tools-1.0.8_p20141204: >> Preparing source ... * bcache-tools-1.0.8_p20141204: >> Applying patches ... patching file Makefile * - bcache-tools-1.0.8_p20141204-build.patch patching file bcache.c patching file bcache.h * - bcache-tools-1.0.8_p20141204-crc64.patch patching file 69-bcache.rules * - bcache-tools-1.0.8_p20141204-modprobe.patch COMMAND: ELT_LOGDIR='/var/tmp/genkernel/gk_kKRtcPFC/bcache-tools/temp' LD='x86_64-pc-linux-gnu-ld' eltpatch * bcache-tools-1.0.8_p20141204: >> Configuring source ... * bcache-tools-1.0.8_p20141204: >> Compiling source ... COMMAND: nice -n10 make -j3 V=1 /usr/lib/ccache/bin/gcc -c -Os -pipe -fomit-frame-pointer -I/var/tmp/genkernel/gk_kKRtcPFC/bcache-tools/buildroot/usr/include bcache.c -o bcache.o Unknown option -static /usr/lib/ccache/bin/gcc -c -Os -pipe -fomit-frame-pointer -I/var/tmp/genkernel/gk_kKRtcPFC/bcache-tools/buildroot/usr/include make-bcache.c -o make-bcache.o Unknown option -static /usr/lib/ccache/bin/gcc -c -Os -pipe -fomit-frame-pointer -I/var/tmp/genkernel/gk_kKRtcPFC/bcache-tools/buildroot/usr/include probe-bcache.c -o probe-bcache.o make-bcache.c:11:10: fatal error: blkid.h: No such file or directory 11 | #include <blkid.h> | ^~~~~~~~~ compilation terminated. Unknown option -static make: *** [Makefile:45: make-bcache.o] Error 1 make: *** Waiting for unfinished jobs.... probe-bcache.c:11:10: fatal error: blkid.h: No such file or directory 11 | #include <blkid.h> | ^~~~~~~~~ compilation terminated. make: *** [Makefile:51: probe-bcache.o] Error 1 * ERROR: Command 'nice -n10 make -j3 V=1' failed! * ERROR: create_initramfs(): append_data(): append_bcache(): populate_binpkg(): gkbuild(): Failed to create binpkg of bcache-tools-1.0.8_p20141204! * Please consult '/var/log/genkernel.log' for more information and any * errors that were reported above. * * Report any genkernel bugs to bugs.gentoo.org and * assign your bug to genkernel@gentoo.org. Please include * as much information as you can in your bug report; attaching * '/var/log/genkernel.log' so that your issue can be dealt with effectively. * * Please do *not* report kernel compilation failures as genkernel bugs! *
Can we have the full build.log please and emerge --info?
Created attachment 655340 [details] emerge --info Output from emerge --info.
Created attachment 655342 [details] /var/log/genkernel.log Copy of /var/log/genkernel.log.
I'm assuming you mean /var/log/genkernel.log, instead of build.log? If not - let me know where to find the log file you're interested in and I'll grab it.
Created attachment 655358 [details] genkernel.log (working) I cannot reproduce, see my attached log. I see you are using ccache. Please try without ccache to rule out any issue caused by ccache.
And please tell us used virtual/pkgconfig provider.
Created attachment 655430 [details] genkernel.log (broken, no ccache)
I re-ran again with ccache disabled; and got the same error. genkernel.log is attached. > And please tell us used virtual/pkgconfig provider. I don't understand - how do I look this up? (Also happy to try any other suggestions any of you might have for debugging.) I just realized this is on `sys-kernel/genkernel-4.1.0-r1` in case that's relevant; I have been looking at `genkernel --version`. I'll update the bug title if I can figure out how.
$ qfile $(which pkg-config) You could run genkernel with --no-cleanup. After the failure, call "tree" (app-text/tree) on bcache-tools' buildroot (which is mentioned in genkernel.log, something like /var/tmp/genkernel/gk_*/bcache-tools/buildroot).
Created attachment 655432 [details] tree
(In reply to Thomas Deutschmann from comment #9) > $ qfile $(which pkg-config) > > You could run genkernel with --no-cleanup. After the failure, call "tree" > (app-text/tree) on bcache-tools' buildroot (which is mentioned in > genkernel.log, something like > /var/tmp/genkernel/gk_*/bcache-tools/buildroot). ❯ qfile $(which pkg-config) dev-util/pkgconfig: /usr/bin/pkg-config ❯ pkg-config --cflags uuid blkid -I/usr/include/uuid -I/usr/include/blkid I've attached the output from tree in the buildroot. When I try to run the same command that fails from the build directory as root, I get the same failure. When I add `-I/var/tmp/genkernel/gk_6dgUS7cU/bcache-tools/buildroot/usr/include/blkid` to the gcc command line it works. Does genkernel use some kind of chroot environment with some kind of custom pkg-config? Because the Makefile uses `$(shell $(PKG_CONFIG) --cflags uuid blkid)` to look up the arguments to gcc; and when I run make from the build directory it succeeds.
It's a dev-util/pkgconfig issue again -- dev-util/pkgconf works. Note that your manual test with pkg-config doesn't help because it's using real system, not genkernel's build environment.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=d1f25b7d50dffbff5ddbf63fba6294309a5a19b5 commit d1f25b7d50dffbff5ddbf63fba6294309a5a19b5 Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2020-08-19 01:13:19 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2020-08-19 01:13:19 +0000 bcache: Fix pkg-config call Bug: https://bugs.gentoo.org/737894 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> gkbuilds/bcache-tools.gkbuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=739d9c4c3635ed4536ef385dc4475a3f15d9f6ab commit 739d9c4c3635ed4536ef385dc4475a3f15d9f6ab Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2020-08-19 01:17:23 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2020-08-19 01:18:21 +0000 sys-kernel/genkernel: fix --bcache option Closes: https://bugs.gentoo.org/737894 Package-Manager: Portage-3.0.3, Repoman-3.0.0 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> ...itramfs.patch => genkernel-4.1.0-post-release-fixes.patch} | 11 +++++++++++ .../{genkernel-4.1.0-r1.ebuild => genkernel-4.1.0-r2.ebuild} | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-)
Thank you for the report!
Thank you for the fix! (I have confirmed that `sys-kernel/genkernel-4.1.0-r2` resolves this issue for me.)