You are not logged in.

#1 2011-10-26 10:29:09

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Why the extramodules directory under /lib/modules?

Hello,

The title said it all.
What's the need for "extramodules-<kernel>" directory under /lib/modules?

Vlad

Offline

#2 2011-10-26 10:32:24

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: Why the extramodules directory under /lib/modules?

our new kernel package returns now on uname -r the full version, including pkgrel.

to avoid recompiling external modules, those are installed in that directory, directory which has a symlink in /lib/modules/<kernel>/extramodules

Last edited by wonder (2011-10-26 10:32:50)


Give what you have. To someone, it may be better than you dare to think.

Offline

#3 2011-10-26 10:40:51

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: Why the extramodules directory under /lib/modules?

Thank you for you answer Wonder.

Offline

#4 2011-11-09 20:17:20

Vi0L0
Member
From: Poland
Registered: 2009-06-24
Posts: 1,349
Website

Re: Why the extramodules directory under /lib/modules?

Am i missing something here or now all "extra modules" must to be recompiled with every little kernel update?

Offline

#5 2011-11-09 20:18:02

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: Why the extramodules directory under /lib/modules?

Vi0L0 wrote:

Am i missing something here or now all "extra modules" must to be recompiled with every little kernel update?

you are missing the point of extramodules. see my explanation


Give what you have. To someone, it may be better than you dare to think.

Offline

#6 2011-11-09 21:07:44

Vi0L0
Member
From: Poland
Registered: 2009-06-24
Posts: 1,349
Website

Re: Why the extramodules directory under /lib/modules?

wonder wrote:
Vi0L0 wrote:

Am i missing something here or now all "extra modules" must to be recompiled with every little kernel update?

you are missing the point of extramodules. see my explanation

Ahhh, i see now... But then how can i put extra module directly into extramodules directory with some automatic script? How can i get the exact name of extramodules directory if even linux's PKGBUILD is using "extramodules-${_basekernel}${_kernelname:--ARCH}" which is useless for me? Even virtualbox-source is using old way of placing vbox modules

Guess that i need to get some chars from `uname -r` to get such exact name of extramodules directory, like first 3 chars (3.1) and the last chars that came with and after last "-" char (-ARCH) - that will gave me 3.1-ARCH, and before this string i would have to put "extramodules-" to get full dir name.
But then all AUR's maintainers have to use such naming convention of extramodules directory - now ie. linux-mainline is imho using extramodules dir in a bad way because it is creating /lib/modules/extramodules-3.2-rc1-mainline

Or maybe you have got some better idea?


EDIT: ok, let's just forget about this questions :>

Last edited by Vi0L0 (2011-11-09 21:57:45)

Offline

#7 2011-11-10 22:28:57

Wansfell
Member
Registered: 2009-03-27
Posts: 6

Re: Why the extramodules directory under /lib/modules?

Does that mean I need to install different versions of the virtualbox-modules package for different kernels?
I use a custom configured kernel, and have the stock one as a backup. but for now this is what dmesg spits out when trying to modprobe vboxdrv

[40763.450573] vboxdrv: version magic '3.1.0-3-ARCH SMP preempt mod_unload modversions ' should be '3.1.0-4-64bit SMP preempt mod_unload '

Is there any way around this?

Offline

#8 2011-11-10 22:35:04

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Why the extramodules directory under /lib/modules?

Use virtualbox-modules for the stock kernel, and virtualbox-source for custom kernels.

Pacman already gave you this information when you upgraded virtualbox.

Offline

#9 2011-11-10 22:37:22

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Why the extramodules directory under /lib/modules?

I'd take the trouble of rebuilding the module over the potential issues arising from forcing a kernel to load a module with non-corresponding symbols.

You are only about to cause yourself a lot of trouble. Your question is not related to the new policy concerning out-of-tree modules; in fact, you needed to build different modules with the old kernels as well.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#10 2011-11-10 23:32:36

Wansfell
Member
Registered: 2009-03-27
Posts: 6

Re: Why the extramodules directory under /lib/modules?

@tomk: Thank You. Strange thing is that when you read the pacman messages, nothing bad happens.. the few times you don't, that's when it goes wrong smile
I was not aware of the new virtualbox-source package.

@.:B:.: Agree. rebuild of the modules is what I want, and I get that with the new virtualbox-source package.

Offline

#11 2011-11-12 01:58:13

Vi0L0
Member
From: Poland
Registered: 2009-06-24
Posts: 1,349
Website

Re: Why the extramodules directory under /lib/modules?

Maybe this little piece of code could be useful, aspecially when using non-stock kernels:

_kernver=`uname -r`

    for r in /lib/modules/*; do
      s=${r:13}
      if [[ ${s:0:3} = "ext" ]]; then
	if [[ `cat ${r}/version | grep -c ${_kernver}` != 0 ]]; then
	  _destidir=${s}
	fi
	elif [[ ${s} = ${_kernver} ]] && [[ ! -e ${r}/extramodules ]]; then
	  _destidir=${_kernver}/video
      fi
    done

    install -m755 -d "${pkgdir}/lib/modules/${_destidir}/" || return 1
    install -m644 fglrx.ko "${pkgdir}/lib/modules/${_destidir}/" || return 1

It should to work with new extramodules dir (module lands directly into this dir) and also with older kernel's style. The 's' variable is not actually needed here (it can be removed but then it has to be changed with modified 'r'), but i used it in generator (it is needed only there) from which i started update (i knew generator will be the hardest one so i begin with it) and then just copied it into other packages... If you think it's fine feel free to use it

Last edited by Vi0L0 (2011-11-12 02:36:38)

Offline

Board footer

Powered by FluxBB