Compiling kernel module

327 views
Skip to first unread message

Jan Beerden

unread,
Jul 27, 2012, 5:06:28 PM7/27/12
to qubes...@googlegroups.com
Hello

I am trying to compile a kernel module for my 3G modem.
For this I created a standalone vm and compiling the module works well.

However the kernel version in my new standalone vm is 3.4.6-2 where the kernel version of the netvm is 3.2.7-9

How can I compile this module for the netvm's kernel?


Kind regards

Jan Beerden

Marek Marczykowski

unread,
Jul 27, 2012, 6:13:05 PM7/27/12
to qubes...@googlegroups.com, Jan Beerden
On 27.07.2012 23:06, Jan Beerden wrote:
> Hello
>
> I am trying to compile a kernel module for my 3G modem.
> For this I created a standalone vm and compiling the module works well.
>
> However the kernel version in my new standalone vm is 3.4.6-2 where the
> kernel version of the netvm is 3.2.7-9

How you get this? I think you have kernel package 3.4.6-2 installed (from
Fedora repo), but running 3.2.7-9.

> How can I compile this module for the netvm's kernel?

You should install kernel-devel-3.2.7-9 package:
sudo yum --enablerepo=qubes-vm-current-testing install kernel-devel-3.2.7-9
(also should work without giving exact version)

BTW Note that /lib/modules in VM is read-only. You can place compiled modules
in some other place and load them with insmod instead of modprobe.

--
Best Regards / Pozdrawiam,
Marek Marczykowski
Invisible Things Lab

signature.asc

Jan Beerden

unread,
Jul 27, 2012, 6:36:44 PM7/27/12
to qubes...@googlegroups.com
How you get this? I think you have kernel package 3.4.6-2 installed (from
Fedora repo), but running 3.2.7-9.

I thought the kernel-devel package from the Fedora repo was the correct one.
It seems that I was wrong.

You should install kernel-devel-3.2.7-9 package:
sudo yum --enablerepo=qubes-vm-current-testing install kernel-devel-3.2.7-9
(also should work without giving exact version)

It looks like there is only a kernel-devel-3.4.4 when I try this command (with or without the version number)
Am I missing something?
 
 
BTW Note that /lib/modules in VM is read-only. You can place compiled modules
in some other place and load them with insmod instead of modprobe.
 
Thanks, I already found that in one of you previous messages on this mailing list.


Kind regards

Jan Beerden

Marek Marczykowski

unread,
Jul 27, 2012, 6:49:36 PM7/27/12
to qubes...@googlegroups.com, Jan Beerden
On 28.07.2012 00:36, Jan Beerden wrote:
>>
>> How you get this? I think you have kernel package 3.4.6-2 installed (from
>> Fedora repo), but running 3.2.7-9.
>>
>
> I thought the kernel-devel package from the Fedora repo was the correct one.
> It seems that I was wrong.
>
> You should install kernel-devel-3.2.7-9 package:
>> sudo yum --enablerepo=qubes-vm-current-testing install kernel-devel-3.2.7-9
>> (also should work without giving exact version)
>>
>
> It looks like there is only a kernel-devel-3.4.4 when I try this command
> (with or without the version number)
> Am I missing something?

Ah, the full package name is kernel-devel-3.2.7-9.pvops.qubes.x86_64. You can
specify it also as "kernel-devel-3.2.7-9*".

BTW There is also 3.4.4 kernel in our development repo (kernel for VM is
installed in dom0 as kernel-qubes-vm package). If you want, you can test it:
sudo qubes-dom0-update --enablerepo=qubes-dom0-unstable "kernel-qubes-vm-3.4.4*"
Some history and issues connected with this version can be found here:
http://wiki.qubes-os.org/trac/ticket/560. Perhaps your 3G modem will work out
of the box there. You can choose kernel version on per-VM basis and
system-wide default via qubes-manager or qvm-prefs/qubes-prefs tools.
signature.asc

Marek Marczykowski

unread,
Jul 27, 2012, 7:57:05 PM7/27/12
to j...@janbeerden.be, qubes...@googlegroups.com
On 28.07.2012 01:26, Jan Beerden wrote:
>>
>> Ah, the full package name is kernel-devel-3.2.7-9.pvops.qubes.x86_64. You
>> can
>> specify it also as "kernel-devel-3.2.7-9*".
>>
>
> That did the trick, unfortunately I can't insmod my module due to "Unknown
> symbol in module"
> I also tried the 3.4.4 kernel without any luck.

You can load required modules manually (try modprobe symbol:SYMBOL_NAME). Or
make /lib/modules writable (which also means that kernel for this VM will not
be affected by upgrades). I've described the procedure here:
https://groups.google.com/group/qubes-devel/msg/f58db0810b6bce43

But read below, perhaps you will no need to compile modules at all.

>> BTW There is also 3.4.4 kernel in our development repo (kernel for VM is
>> installed in dom0 as kernel-qubes-vm package). If you want, you can test
>> it:
>> sudo qubes-dom0-update --enablerepo=qubes-dom0-unstable
>> "kernel-qubes-vm-3.4.4*"
>> Some history and issues connected with this version can be found here:
>> http://wiki.qubes-os.org/trac/ticket/560. Perhaps your 3G modem will work
>> out
>> of the box there. You can choose kernel version on per-VM basis and
>> system-wide default via qubes-manager or qvm-prefs/qubes-prefs tools.
>>
>> The actual problem is that I need to enable my 3G modem using toshset and
> Toshiba ACPI.

Hmm... VM have no access to host ACPI. Perhaps you need to use toshiba_acpi
module (which already is in our kernel) in dom0? Also toshset is used only to
turn 3G modem on - if need access to toshiba_acpi - also can be used only from
dom0.
I guess that your modem appear as USB device, so you must attach it to netvm
with full USB controller
(http://wiki.qubes-os.org/trac/wiki/AssigningDevices). There was somewhere
more detailed instruction (especially how track which USB controller handle
which device), but don't remember where...

> Also on my Fedora 16 and 17 installation with the most recent kernel, this
> module was actually working.
signature.asc
Reply all
Reply to author
Forward
0 new messages