Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 909202 - sys-fs/zfs-kmod: ebuild requires build kernel before building module into kernel source tree
Summary: sys-fs/zfs-kmod: ebuild requires build kernel before building module into ker...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Sam James
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-26 17:15 UTC by lekto
Modified: 2024-02-14 10:35 UTC (History)
3 users (show)

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


Attachments
emerge --info (emerge.info,6.32 KB, text/plain)
2023-06-26 17:15 UTC, lekto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lekto 2023-06-26 17:15:50 UTC
Created attachment 864662 [details]
emerge --info

Hi, I'm investigating my script for automatically updating kernel with ZFS build into source tree, that broke some time ago. Part of my building process is:
>make oldconfig
>make modules_prepare
>env EXTRA_ECONF='--enable-linux-builtin' ebuild …
>make all install modules_install
Right now this isn't working any more (testing with zfs-kmod-9999), during pkg_setup I get:
> *'/usr/src/linux/Module.symvers' was not found implying that the
> * linux-6.4.0-gentoo tree at that location has not been built.
> *
> * Please verify that this is the intended kernel version, then perform
> * a full build[1] (i.e. make && make modules_install && make install).

Which implying that I need to build and install kernel, then build ZFS into it, and then again build and install it. Which doesn't make sense and also building kernel for the second time doesn't do anything:
>lapek ~ # make all -j6 -C /usr/src/linux
>  DESCEND objtool
>  CALL    scripts/checksyscalls.sh
>make[3]: 'install_headers' is up to date.
>Kernel: arch/x86/boot/bzImage is ready  (#1)
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-26 17:17:17 UTC
You can set EXTRA_ECONF via /etc/portage/env, fwiw.
Comment 2 Ionen Wolkens gentoo-dev 2023-06-27 01:01:25 UTC
For some backstory on the check... Without Module.symvers, it cannot verify if symbols used by the modules are available in the kernel and then it could fail at runtime (which I feel is especially unsafe with zfs). Furthermore, without that file the kernel will typically also abort the build unless the user sets KBUILD_MODPOST_WARN=1 to change errors into warnings making this a predictable failure that the eclass is trying to explain. Some packages also probe that file for their configuration and could be misconfigured without it (nvidia for one).

zfs-kmod would *also* normally fail given it looks for Module.symvers *unless* --enable-linux-builtin

In other words I see this as an unsupported configuration using EXTRA_ECONF, but that aside there's two possible solutions I see to this without removing the IMO justified check:

1. touch Module.symvers at the top of the linux tree (hack)

2. Unsure how many people need this, but I could consider adding a variable to cleanly bypass the check in the eclass and inform about it in the error message.
Comment 3 Ionen Wolkens gentoo-dev 2023-06-27 01:05:11 UTC
(In reply to Ionen Wolkens from comment #2)
> 1. touch Module.symvers at the top of the linux tree (hack)
> 
> 2. Unsure how many people need this, but I could consider adding a variable
> to cleanly bypass the check in the eclass and inform about it in the error
> message.
Guess you could also consider:

3. don't use the ebuild

I'm not sure if using the ebuild to add builtin modules to the kernel make much sense.
Comment 4 lekto 2023-06-27 13:59:39 UTC
>Without Module.symvers, it cannot verify if symbols used by the modules are available in the kernel and then it could fail at runtime
Wouldn't it fail at build time?

>2. Unsure how many people need this, but I could consider adding a variable to cleanly bypass the check in the eclass and inform about it in the error message.
Sounds okay, but would be possible to bypass check if sys-fs/zfs has kernel-builtin flag set?