Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Identify kernel dependent pkgs? [GOOD TIPS module-rebuild]

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
15 posts • Page 1 of 1
Author
Message
dufeu
l33t
l33t
User avatar
Posts: 927
Joined: Fri Aug 30, 2002 2:59 pm
Location: US-FL-EST

Identify kernel dependent pkgs? [GOOD TIPS module-rebuild]

  • Quote

Post by dufeu » Mon Dec 06, 2010 9:56 pm

I have several packages installed which I know are emerged directly against the current kernel such as 'app-emulation/vmware-workstation', 'app-emulation/virtualbox-ose' and others. I believe the basic issue is that they all install custom kernel modules.

However, I believe but can't point to particular packages, that there are also packages which directly include headers from whichever kernel is running at the time. I remember encountering one in an obscure manner which I didn't make note of and can't remember enough to replicate how I found it.

Then there are also packages which verify kernel settings.

Is there any easy way to identify installed packages which are directly dependent on some aspect of the currently running kernel such as installing custom kernel modules, checking specific kernel settings or specifically including any kernel header files? This is important for testing newer kernel versions prior to release to a production environment. Does anyone have a bash script out there that can provide this kind of info?

Thank you.
Last edited by dufeu on Sun Dec 26, 2010 3:41 pm, edited 2 times in total.
People whom think M$ is mediocre, don't know the half of it.
Top
mikegpitt
Advocate
Advocate
User avatar
Posts: 3224
Joined: Sat May 22, 2004 6:49 pm

  • Quote

Post by mikegpitt » Tue Dec 07, 2010 4:39 am

I'm not aware of a tool that will do all the things you list, but with module-rebuild you can list all modules that have been built against the kernel.
Top
aCOSwt
Bodhisattva
Bodhisattva
Posts: 2537
Joined: Fri Oct 19, 2007 1:48 pm
Location: Hilbert space

  • Quote

Post by aCOSwt » Tue Dec 07, 2010 8:10 am

Well, I believe that any package, which building needs something regarding the current kernel, will necessarily use at least one of the two following pkg_setup global variables :

- KERNEL_DIR
- KV_DIR

in its ebuild

There may be some more clever / readymade tool doing what you are looking for, but I do not know any. => Quick and dirty, I would simply go across the portage tree ebuilds greping for these two variable names.

EDIT : BTW... Of course, you won't necessarily find them as part of the package you wish to or have emerged, but more likely as part of one of its dependency.
To come back to your example of virutalbox-ose, virtualbox-ose does not per se need anything regarding the kernel, however, one of its dependency (virtualbox-modules) does.
The same with vmware-workstation / vmware-modules.
=> A more clever / user-friendly tool would equery --depends the positive results of the first step.
Last edited by aCOSwt on Tue Dec 07, 2010 4:06 pm, edited 1 time in total.
Top
mikegpitt
Advocate
Advocate
User avatar
Posts: 3224
Joined: Sat May 22, 2004 6:49 pm

  • Quote

Post by mikegpitt » Tue Dec 07, 2010 2:34 pm

aCOSwt's post gave me an idea... does this give you what you are looking for?

Code: Select all

qdepends -k DEPEND  .* | grep -i sys-kernel
Top
sera
Retired Dev
Retired Dev
Posts: 1017
Joined: Fri Feb 29, 2008 3:03 pm
Location: CET

  • Quote

Post by sera » Tue Dec 07, 2010 3:08 pm

Code: Select all

grep CONFIG_CHECK /var/db/pkg/ -r
Will give you what I think you are after.
Top
aCOSwt
Bodhisattva
Bodhisattva
Posts: 2537
Joined: Fri Oct 19, 2007 1:48 pm
Location: Hilbert space

  • Quote

Post by aCOSwt » Tue Dec 07, 2010 6:23 pm

mikegpitt wrote:

Code: Select all

qdepends -k DEPEND  .* | grep -i sys-kernel
+1 mikegpitt ! you are even more clever !

However, it only does half the job as, if that outputs correctly all the packages having to do with linux-headers, that does not output packages having to do with kernel-sources.
I suggest an additional command line...

Code: Select all

qdepends -k DEPEND  .* | grep -i virtual/linux-sources
Top
dufeu
l33t
l33t
User avatar
Posts: 927
Joined: Fri Aug 30, 2002 2:59 pm
Location: US-FL-EST

  • Quote

Post by dufeu » Sat Dec 11, 2010 3:35 pm

Woot!

Yes! Those do exactly what I'm looking for.

In addition to 'virtualbox-modules' and 'vmware-modules' for "linux-sources", I now know I need to re-install 'cdfs' each time I change kernels. This was something I didn't realize before.

At the present time, I'm not using either nvidia-drivers nor ati-drivers so that's not a current concern.

As for "sys-kernel", the list of interest is:

Code: Select all

sys-libs/libcap-2.19
sys-libs/glibc-2.12.1-r3
app-emulation/wine-1.3.8
media-video/ffmpeg-0.6_p25767
media-video/transcode-1.1.5-r2
media-gfx/sane-backends-1.0.21-r1
media-libs/libgii-1.0.2
media-libs/libv4l-0.8.1
sys-apps/hal-0.5.14-r3
sys-apps/keyutils-1.4-r1
x11-drivers/xf86-input-evdev-2.5.0
sys-fs/udev-164
sys-kernel/vanilla-sources-2.6.37_rc4
sys-kernel/vanilla-sources-2.6.36.1
sys-kernel/linux-headers-2.6.36.1
Fortunately, portage properly takes care of the inter-relationship of the packages in the above list with "linux-headers" so that doesn't concern me as much. However, I do note the presence of xf86-input-evdev when attempting to diagnose X input issues ...

The search for "CONFIG_CHECK" was revealing as well:

Code: Select all

/var/db/pkg/net-dialup/ppp-2.4.5-r1/ppp-2.4.5-r1.ebuild:                CONFIG_CHECK="~PPP ~PPP_ASYNC ~PPP_SYNC_TTY"
/var/db/pkg/net-dialup/ppp-2.4.5-r1/ppp-2.4.5-r1.ebuild:                        CONFIG_CHECK="${CONFIG_CHECK} ~PPP_FILTER"
/var/db/pkg/net-dialup/ppp-2.4.5-r1/ppp-2.4.5-r1.ebuild:                CONFIG_CHECK="${CONFIG_CHECK} ~PPP_DEFLATE ~PPP_BSDCOMP ~PPP_MPPE"
/var/db/pkg/net-dialup/ppp-2.4.5-r1/ppp-2.4.5-r1.ebuild:                CONFIG_CHECK="${CONFIG_CHECK} ~PPPOE ~PACKET"
/var/db/pkg/net-dialup/ppp-2.4.5-r1/ppp-2.4.5-r1.ebuild:                        CONFIG_CHECK="${CONFIG_CHECK} ~PPPOATM"
/var/db/pkg/sys-auth/consolekit-0.4.3/consolekit-0.4.3.ebuild:          CONFIG_CHECK="~AUDITSYSCALL"
/var/db/pkg/sys-boot/grub-0.97-r10/grub-0.97-r10.ebuild:                amd64) CONFIG_CHECK='~IA32_EMULATION' check_extra_config ;;
/var/db/pkg/net-print/hplip-3.10.9/hplip-3.10.9.ebuild:CONFIG_CHECK="~PARPORT ~PPDEV"
/var/db/pkg/media-libs/libv4l-0.8.1/libv4l-0.8.1.ebuild:CONFIG_CHECK="~SHMEM"
/var/db/pkg/sys-apps/hal-0.5.14-r3/hal-0.5.14-r3.ebuild:        local CONFIG_CHECK="~HOTPLUG ~NET"
/var/db/pkg/sys-apps/hal-0.5.14-r3/hal-0.5.14-r3.ebuild:        local CONFIG_CHECK="~INOTIFY_USER"
/var/db/pkg/sys-apps/hal-0.5.14-r3/hal-0.5.14-r3.ebuild:        local CONFIG_CHECK="~ACPI_PROCFS ~ACPI_PROC_EVENT"
/var/db/pkg/sys-apps/devicekit-power-014/devicekit-power-014.ebuild:    local CONFIG_CHECK="ACPI_SYSFS_POWER"
/var/db/pkg/sys-apps/lm_sensors-3.2.0/lm_sensors-3.2.0.ebuild:CONFIG_CHECK="~HWMON ~I2C_CHARDEV ~I2C"
/var/db/pkg/sys-fs/lvm2-2.02.74/lvm2-2.02.74.ebuild:    local CONFIG_CHECK="~SYSVIPC"
/var/db/pkg/sys-fs/ntfs3g-2010.10.2/ntfs3g-2010.10.2.ebuild:            CONFIG_CHECK="~FUSE_FS"
/var/db/pkg/sys-fs/udev-164/udev-164.ebuild:CONFIG_CHECK="~INOTIFY_USER ~SIGNALFD ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2
/var/db/pkg/sys-fs/cryptsetup-1.1.3-r1/cryptsetup-1.1.3-r1.ebuild:      local CONFIG_CHECK="~DM_CRYPT ~CRYPTO ~CRYPTO_CBC"
/var/db/pkg/sys-fs/fuse-2.8.5/fuse-2.8.5.ebuild:                CONFIG_CHECK="~FUSE_FS"
/var/db/pkg/sys-fs/cdfs-2.6.27/cdfs-2.6.27.ebuild:CONFIG_CHECK="BLK_DEV_LOOP"
/var/db/pkg/sys-fs/udisks-1.0.1-r2/udisks-1.0.1-r2.ebuild:              CONFIG_CHECK="~USB_SUSPEND ~!IDE"
All in all, quite educational. I appreciate the tips!
People whom think M$ is mediocre, don't know the half of it.
Top
ppurka
Advocate
Advocate
Posts: 3257
Joined: Sun Dec 26, 2004 5:05 pm

  • Quote

Post by ppurka » Sat Dec 11, 2010 4:26 pm

dufeu wrote:In addition to 'virtualbox-modules' and 'vmware-modules' for "linux-sources", I now know I need to re-install 'cdfs' each time I change kernels. This was something I didn't realize before.
If cdfs needs to be recompiled each time the kernel changes and portage does not know this then you have stumbled upon a bug.

Usually the command you need to run after installing a new kernel is module-rebuild rebuild. You can check what it is going to build by first doing a module-rebuild list.
[topic=797019]emerge --quiet redefined[/topic] | E17 vids: I, II | Now using kde5 | e is unstable :-/
Top
mikegpitt
Advocate
Advocate
User avatar
Posts: 3224
Joined: Sat May 22, 2004 6:49 pm

  • Quote

Post by mikegpitt » Mon Dec 13, 2010 5:21 pm

ppurka wrote:If cdfs needs to be recompiled each time the kernel changes and portage does not know this then you have stumbled upon a bug.
I think dufeu wants to recompile everything related to the kernel on each update to ensure that he is taking advantage of all the latest updates. The only things you *have* to recompile at each kernel update are the modules, as they will not load due to ABI breakage. Everything else is optional.
Top
dufeu
l33t
l33t
User avatar
Posts: 927
Joined: Fri Aug 30, 2002 2:59 pm
Location: US-FL-EST

  • Quote

Post by dufeu » Sun Dec 26, 2010 12:58 am

ppurka wrote:Usually the command you need to run after installing a new kernel is module-rebuild rebuild. You can check what it is going to build by first doing a module-rebuild list.
I was completely unaware of the existence of the 'sys-kernel/module-rebuild' package. Thank you!!
People whom think M$ is mediocre, don't know the half of it.
Top
Ant P.
Watchman
Watchman
Posts: 6920
Joined: Sat Apr 18, 2009 7:18 pm
Contact:
Contact Ant P.
Website

  • Quote

Post by Ant P. » Sun Dec 26, 2010 3:08 am

Do a pretend uninstall of virtual/linux-sources and it should tell you which packages will be broken by it.
Top
dufeu
l33t
l33t
User avatar
Posts: 927
Joined: Fri Aug 30, 2002 2:59 pm
Location: US-FL-EST

  • Quote

Post by dufeu » Sun Dec 26, 2010 3:40 pm

For those whom are interested, this is what module-rebuild does:

Code: Select all

# module-rebuild
module-rebuild [options] action [category/package]
Version: 0.5

Where options are:
        -X       - Emerge based on package names,
                   not exact versions.
        -C       - Disable all coloured output.
        -P foo   - Specify package manager: portage(default) or paludis

Where action is one of:
        add      - Add package to moduledb.
        del      - Delete a package from moduledb.
        toggle   - Toggle auto-rebuild of Package.
        list     - List packages to auto-rebuild.
        rebuild  - Rebuild packages.
        populate - Populate the database with any
                   packages which currently install
                   drivers into the running kernel.

# module-rebuild populate
# module-rebuild list
** Packages which I will emerge are:
        =/vmware-modules-1.0.0.17
        =sys-fs/cdfs-2.6.27
        =app-emulation/virtualbox-modules-3.2.12
        =app-emulation/vmware-modules-1.0.0.25-r2
# emerge -s module-rebuild
Searching...    
[ Results for search key : module-rebuild ]
[ Applications found : 3 ]

*  module-rebuild
      Description:   Package set which contains all packages that own one or more files.

*  x11-module-rebuild
      Description:   Package set which contains all packages that match specified values of a specified variable.

*  sys-kernel/module-rebuild
      Latest version available: 0.6
      Latest version installed: 0.6
      Size of files: 0 kB
      Homepage:      http://www.gentoo.org/
      Description:   A utility to rebuild any kernel modules which you have installed
      License:       GPL-2
It should be clear from the above that module-rebuild is a gentoo hosted project and that you need to populate it's associated database prior to using it's other functions. Note that there isn't a man page. I'm assuming that it will also pick up packages like 'ati/nvidia-drivers', digicom serial port drivers and wifi drivers not included in the kernel if you have such drivers.
People whom think M$ is mediocre, don't know the half of it.
Top
dol-sen
Retired Dev
Retired Dev
User avatar
Posts: 2805
Joined: Sun Jun 30, 2002 2:44 pm
Location: Richmond, BC, Canada

  • Quote

Post by dol-sen » Sun Dec 26, 2010 4:05 pm

Just to be clear, for those that are using portage-2.2 which has sets support. the module-rebuild package sets are generated at run time. They are also not part of sys-apps/module-rebuild.

Code: Select all

big_daddy boot # emerge -p @x11-module-rebuild

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] x11-drivers/nvidia-drivers-260.19.29 
[ebuild   R   ] x11-drivers/xf86-input-evdev-2.5.0 

big_daddy boot # emerge -p @module-rebuild

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] x11-drivers/nvidia-drivers-260.19.29 

big_daddy boot # emerge --list-sets
dev
downgrade
installed
live-rebuild
module-rebuild
old
preserved-rebuild
rebuilt-binaries
security
selected
system
unavailable
unavailable-binaries
world
x11-module-rebuild
big_daddy boot # 
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Top
ppurka
Advocate
Advocate
Posts: 3257
Joined: Sun Dec 26, 2004 5:05 pm

  • Quote

Post by ppurka » Sun Dec 26, 2010 5:05 pm

dol-sen wrote:Just to be clear, for those that are using portage-2.2 which has sets support. the module-rebuild package sets are generated at run time. They are also not part of sys-apps/module-rebuild.
Very nice! Thanks. I didn't know about this set. :)
The x11-module-rebuild set also seems very interesting. No need to do qlist* magic anymore!
[topic=797019]emerge --quiet redefined[/topic] | E17 vids: I, II | Now using kde5 | e is unstable :-/
Top
Joseph K.
Guru
Guru
User avatar
Posts: 436
Joined: Wed Jun 07, 2006 1:02 pm
Location: Sydney, Australia

  • Quote

Post by Joseph K. » Fri Mar 25, 2011 5:47 am

Someone mentioned "linux-sources" and someone mentioned "equery d" but I don't think anyone actually said that you can do:

Code: Select all

equery d linux-sources
and

Code: Select all

equery d linux-headers
to find all packages that build against the current kernel and headers respectively.
Hope that helps simplify things at least. Cheers.
Top
Post Reply

15 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic