Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 931213 - sys-fs/zfs-kmod: Binpkg builds dracut for running kernel instead of target
Summary: sys-fs/zfs-kmod: Binpkg builds dracut for running kernel instead of target
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major
Assignee: Sam James
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2024-05-04 19:59 UTC by Luke-Jr
Modified: 2024-05-17 12:07 UTC (History)
5 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 Luke-Jr 2024-05-04 19:59:36 UTC
When zfs-kmod is built from source, it correctly identifies the current target kernel and updates its initramfs using dracut. However, as of some time in the past few months, installing the binary package (generated by the same build that worked previously) now updates the initramfs for the *running* kernel instead. The correct modules get installed of course, it's only the initramfs update that goes wrong.
Comment 1 Luke-Jr 2024-05-04 20:00:24 UTC
(I marked this as "major" because without manual intervention it has caused machines with successful world updates to fail to boot)
Comment 2 Ionen Wolkens gentoo-dev 2024-05-04 20:08:13 UTC
Imagine a side effect of:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f51cd5b64c14
Comment 3 Ionen Wolkens gentoo-dev 2024-05-04 20:11:40 UTC
(that change doesn't affect modules building given linux-mod-r1 intentionally avoids re-running these functions on binary packages, but initramfs works separately from that)
Comment 4 Ionen Wolkens gentoo-dev 2024-05-04 20:13:52 UTC
(In reply to Ionen Wolkens from comment #3)
> (that change doesn't affect modules building given linux-mod-r1
> intentionally avoids re-running these functions on binary packages, but
> initramfs works separately from that)

Or actually no, think it's because this does "kernel_is" which re-runs the functions. Guess this became kind of flaky.
Comment 5 Ionen Wolkens gentoo-dev 2024-05-04 20:17:36 UTC
(In reply to Ionen Wolkens from comment #4)
> (In reply to Ionen Wolkens from comment #3)
> > (that change doesn't affect modules building given linux-mod-r1
> > intentionally avoids re-running these functions on binary packages, but
> > initramfs works separately from that)
> 
> Or actually no, think it's because this does "kernel_is" which re-runs the
> functions. Guess this became kind of flaky.
The ebuild-side fix would be to do the same that linux-mod-r1's own pkg_setup and packages like nvidia-drivers do, aka have a [[ ${MERGE_TYPE} == binary ]] && return at start of pkg_setup
Comment 6 Ionen Wolkens gentoo-dev 2024-05-04 20:18:23 UTC
(In reply to Ionen Wolkens from comment #5)
> The ebuild-side fix would be to do the same that linux-mod-r1's own
> pkg_setup and packages like nvidia-drivers do, aka have a [[ ${MERGE_TYPE}
> == binary ]] && return at start of pkg_setup
(in theory anyway, untested -- could be overlooking something else)
Comment 7 Larry the Git Cow gentoo-dev 2024-05-17 12:07:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ca8ee3261f35705fbe94af7688e41815b42c0e6

commit 7ca8ee3261f35705fbe94af7688e41815b42c0e6
Author:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
AuthorDate: 2024-05-09 17:33:00 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
CommitDate: 2024-05-17 12:06:47 +0000

    linux-mod-r1.eclass: do not reset kernel env vars in binpkgs
    
    Closes: https://bugs.gentoo.org/931213
    Bug: https://bugs.gentoo.org/926063
    Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
    Closes: https://github.com/gentoo/gentoo/pull/36597
    Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>

 eclass/linux-mod-r1.eclass | 5 +++++
 1 file changed, 5 insertions(+)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=05ad18f837f89cfa2b20e01264ef6332c240072c

commit 05ad18f837f89cfa2b20e01264ef6332c240072c
Author:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
AuthorDate: 2024-05-09 17:01:00 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
CommitDate: 2024-05-17 12:06:46 +0000

    linux-info.eclass: respect eselect kernel setting in binpkgs
    
    Commit f51cd5b64c14ddfb83488a12d538c66a4a309376 resets kernel environment
    variables when binpkgs are merged, this makes sense since we care about the
    system that the binpkg will be installed on, not the system the binpkg was
    built on. This introduced Bug 931213 as a side-effect, which will be fixed
    in a separate commit to linux-mod-r1.eclass. In preparation of that, we document
    and rename the LINUX_INFO_BINARY_RESET to SKIP_KERNEL_BINPKG_ENV_RESET.
    
    However, commit f51cd5b64c14ddfb83488a12d538c66a4a309376 also makes binpkgs
    always use the running kernel version. This behaviour is surprising and
    confusing. In principle the 'eselect kernel' setting should still be respected
    when binpkgs are used.
    
    Bug: https://bugs.gentoo.org/926063
    Bug: https://bugs.gentoo.org/931213
    Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>

 eclass/linux-info.eclass | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)