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: PMS/EAPI
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-16 03:01 UTC by David Carlos Manuelda
Modified: 2019-08-11 08:03 UTC (History)
3 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 JetDog 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.