Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 532674 - Idea: Run kernel checks from all packages?
Summary: Idea: Run kernel checks from all packages?
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal enhancement with 1 vote (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 705806 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-12-16 03:01 UTC by David Carlos Manuelda
Modified: 2021-09-16 12:15 UTC (History)
6 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 David Carlos Manuelda 2014-12-16 03:01:51 UTC
Many packages have some kernel option checks and give warnings if some of them are not correct (I think in pkg_setup phase)

When kernel is updated and/or config is updated, it could be very useful a tool, or an emerge option to run all of these checks from all installed packages with that support.

For example:

emerge world --<<option_name_here>>

Currently, an emulation to do that is to run an emerge -e world, with more jobs than 1, and halting it once it starts compiling, because the first thing it does is run checks for everything.

Reproducible: Always
Comment 1 Zac Medico gentoo-dev 2014-12-16 03:07:12 UTC
We would need PMS to specify some metadata for this.
Comment 2 Patrick Lauer gentoo-dev 2014-12-16 03:13:15 UTC
What do you check against?

* Running kernel? That's kinda wrong, next reboot might not match anyway

* Currently selected kernel? That's kinda wrong too, you're still running 'old'
Comment 3 David Carlos Manuelda 2014-12-16 03:15:05 UTC
Usually I run checks against current /usr/src/linux/.config, because that is where the kernel is located once rebooted (that is the purpose of the symlink)

That way, it is easier to detect config errors, or CONFIG_XXX symbols some packages needs but you changed
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-12-16 05:17:54 UTC
We could solve this partially via allowing to run pkg_pretend() of all installed packages.
Comment 5 Yuri Sevatz 2019-08-10 15:19:35 UTC
I realize this is an old bug, but this got me so far:

for pkg in $(equery list '*' -F '$category $name $fullversion' | pcre2grep -O '$1/$2/$2-$3.ebuild' -e '([^ ]+) ([^ ]+) (.+)'); do echo "${pkg}:"; ebuild "/usr/portage/${pkg}" clean setup --skip-manifest; done

... I'm just having a tiny bit of trouble locating the ebuild amidst overlays, but it seems to get you 90% of the way there.
Comment 6 Larry the Git Cow gentoo-dev 2019-08-10 19:12:32 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=03b441713d299a04c6bdba10e0fbd5ba2340a68d

commit 03b441713d299a04c6bdba10e0fbd5ba2340a68d
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2019-08-10 18:44:11 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-08-10 18:51:11 +0000

    bin/ebuild: Fix to work with installed package
    
    Fix the following AttributeError error:
    
    # ebuild /var/db/pkg/sys-apps/portage-2.3.71/portage-2.3.71.ebuild clean pretend clean
    Traceback (most recent call last):
      File "/usr/lib/python-exec/python3.6/ebuild", line 318, in <module>
        type_name=pkg_type)
      File "/usr/lib64/python3.6/site-packages/_emerge/Package.py", line 72, in __init__
        db = self.cpv._db
    AttributeError: 'str' object has no attribute '_db'
    
    Bug: https://bugs.gentoo.org/532674
    Fixes: bfe7892202b8 ("_pkg_str: add _db attribute (bug 640318)")
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 bin/ebuild | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Comment 7 Fab 2019-08-11 08:03:26 UTC
(In reply to Patrick Lauer from comment #2)
> What do you check against?
> 
> * Running kernel? That's kinda wrong, next reboot might not match anyway
> 
> * Currently selected kernel? That's kinda wrong too, you're still running
> 'old'

Choice may also be left to the administrator of the system.
The tool may list installed/configured kernels trees versions, so the adminstrator could choose on which version it want to run the checks.
Comment 8 David Carlos Manuelda 2019-09-04 12:23:29 UTC
(In reply to Fab from comment #7)
> (In reply to Patrick Lauer from comment #2)
> > What do you check against?
> > 
> > * Running kernel? That's kinda wrong, next reboot might not match anyway
> > 
> > * Currently selected kernel? That's kinda wrong too, you're still running
> > 'old'
> 
> Choice may also be left to the administrator of the system.
> The tool may list installed/configured kernels trees versions, so the
> adminstrator could choose on which version it want to run the checks.

About this, I just thought, that it can be configured via parameter, i.e. like in genkernel --kernel-config=xxxx, having its default current /usr/src/linux/.config (what's current behavior I think)
Comment 9 Zac Medico gentoo-dev 2020-01-19 05:16:03 UTC
*** Bug 705806 has been marked as a duplicate of this bug. ***
Comment 10 Vince C. 2020-10-08 20:11:13 UTC
(In reply to Patrick Lauer from comment #2)
> What do you check against?
> 
> * Running kernel? That's kinda wrong, next reboot might not match anyway
> 
> * Currently selected kernel? That's kinda wrong too, you're still running
> 'old'

That reasoning is flawed as portage — as of now — has no idea whether rebooting will be relevant to the checks that have just been run when the emerge process ran, so why care? You don't have to change the existing logic, just allow dry-runs at will. Not saying it's easy though...
Comment 11 Anton Bolshakov 2020-10-09 02:08:59 UTC
Found the following script (just 20 lines only) which is a good start:

kernel-config-check.py
https://gist.github.com/mrueg/cd19a20d2e712f61d2ea
Comment 12 Ulrich Müller gentoo-dev 2020-10-25 17:13:07 UTC
(In reply to Zac Medico from comment #1)
> We would need PMS to specify some metadata for this.

I think this is one of the cases where we first should have at least a rough idea how to implement it, and only then the spec can follow.

Reassigning to dev-portage.