Compiling kernel modules

170 views
Skip to first unread message

Zbigniew Łukasiak

unread,
Mar 23, 2019, 12:01:48 PM3/23/19
to qubes-users
Hi there,

I am trying to connect my qubes box via wifi - but I cannot compile
any kernel module for my wifi cards (on both fedora 26 and 29). The
compilation fails at the first object file:

[user@sys-usb rtl8821AU]$ make
make ARCH=x86_64 CROSS_COMPILE= -C
/lib/modules/4.14.103-1.pvops.qubes.x86_64/build
M=/home/user/rtl8821AU modules
make[1]: Entering directory
'/usr/lib/modules/4.14.103-1.pvops.qubes.x86_64/build'
make[2]: *** No rule to make target
'/home/user/rtl8821AU/core/rtw_cmd.o', needed by
'/home/user/rtl8821AU/8821au.o'. Stop.
make[1]: *** [Makefile:1535: _module_/home/user/rtl8821AU] Error 2
make[1]: Leaving directory
'/usr/lib/modules/4.14.103-1.pvops.qubes.x86_64/build'
make: *** [Makefile:2003: modules] Error 2

but the source file for that object file is there:

[user@sys-usb rtl8821AU]$ ls /home/user/rtl8821AU/core/rtw_cmd.c
/home/user/rtl8821AU/core/rtw_cmd.c

I have installed the headers:
sudo dnf install make automake gcc gcc-c++ kernel-devel

This looks like it must be something silly - but I really cannot find
anything. I have installed the

I have also tried the kernel modules that are already in the system
for the two cards that I have bought (tp-link AC600 Archer T2UH and
Edimax EW-7811UTC) - but no result, i.e. /proc/net/dev does not show
anything, I am doing it in sys-usb - so that the access to the device
is a sure thing. The Edimax one explicitly lists Linux as supported
but the instructions still require compiling a kernel module.

--
Zbigniew Lukasiak
https://medium.com/@zby
http://brudnopis.blogspot.com/

Zbigniew Łukasiak

unread,
Mar 24, 2019, 12:23:02 PM3/24/19
to qubes-users
OK - so it looks that it does not work like that in QubesOS - i.e. by
default the modules directory is read only. I found some instructions
on installing custom kernels in:
www.qubes-os.org/doc/managing-vm-kernel/#using-kernel-installed-in-the-vm.
I don't really need a new kernel - I just want to be able to compile
the modules - but this looks like a possible way out for me. So I did
cloned the fedora-29 template and:

qvm-prefs <clonetemplatename> virt_mode hvm
qvm-prefs <clonetemplatename> kernel ''

unfortunately now the cloned template does not start - so I cannot
continue with the instructions at the doc linked above. When I change
the kernel back to '4.14.103-1' it works fine.

--
ZL

awokd

unread,
Mar 26, 2019, 7:50:05 PM3/26/19
to qubes...@googlegroups.com
Zbigniew Łukasiak wrote on 3/24/19 4:22 PM:
That should be all you have to do. Might be an issue with fedora-29.
Does it work with 28?

Zbigniew Łukasiak

unread,
Mar 27, 2019, 4:22:22 AM3/27/19
to awokd, qubes-users
With 28 the same thing. It does not start -
/var/log/xen/console/guest-fedora-28-netvm-template.log is empty.

In /var/log/xen/console/guest-fedora-28-netvm-template-dm.log there
are entries - last lines are:

+ target=40
+ device_model=device-model/40
+ true
+ xenstore-watch -n 2 device-model/40/command
device-model/40/command
-device 'scsi-hd,bus=scsi0.0,drive=disk1,wwn=0x3525400051756266'
-drive 'file=/dev/xvdc,if=none,id=disk2,format=host_device,cache=writeback,readonly=off'
-device 'scsi-hd,bus=scsi0.0,drive=disk2,wwn=0x3525400051756267'
+ set +x
random: qemu: uninitialized urandom read (16 bytes read)
{"QMP": {"version": {"qemu": {"micro": 0, "minor": 0, "major": 3},
"package": ""}, "capabilities": []}}
{"execute": "qmp_capabilities"}
qubes_gui/init: 592
qubes_gui/init: 607
qubes_gui/init: 609
qubes_gui/init[639]: version sent, waiting for xorg conf
{"return": {}}
qemu: pin_memory_cacheattr failed: Operation not permitted
clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x39c700f5c78,
max_idle_ns: 440795340708 ns
random: crng init done


awokd

unread,
Mar 30, 2019, 12:07:48 PM3/30/19
to Zbigniew Łukasiak, qubes-users
Zbigniew Łukasiak wrote on 3/27/19 8:22 AM:
> On Wed, Mar 27, 2019 at 12:50 AM 'awokd' via qubes-users
> <qubes...@googlegroups.com> wrote:
>>
>> Zbigniew Łukasiak wrote on 3/24/19 4:22 PM:
>>> OK - so it looks that it does not work like that in QubesOS - i.e. by
>>> default the modules directory is read only. I found some instructions
>>> on installing custom kernels in:
>>> www.qubes-os.org/doc/managing-vm-kernel/#using-kernel-installed-in-the-vm.
>>> I don't really need a new kernel - I just want to be able to compile
>>> the modules - but this looks like a possible way out for me. So I did
>>> cloned the fedora-29 template and:
>>>
>>> qvm-prefs <clonetemplatename> virt_mode hvm
>>> qvm-prefs <clonetemplatename> kernel ''
>>>
>>> unfortunately now the cloned template does not start - so I cannot
>>> continue with the instructions at the doc linked above. When I change
>>> the kernel back to '4.14.103-1' it works fine.
>>
>> That should be all you have to do. Might be an issue with fedora-29.
>> Does it work with 28?
>
> With 28 the same thing. It does not start -
> /var/log/xen/console/guest-fedora-28-netvm-template.log is empty.
>

This worked for me with Debian-9:

- create Standalone based from template, or clone existing template
- leave PVH and kernel set, start terminal
- sudo dkms autoinstall -k 4.9.0-8-amd64 [without this step I got either
gibberish or no terminal window]
- powerdown, set to HVM and kernel to none
- start terminal

I had the same problem you described while trying Fedora-28. I'm not
sure how to run dkms in there because it complains about a missing
dkms.conf. See also https://github.com/QubesOS/qubes-issues/issues/4920.


Zbigniew Łukasiak

unread,
Apr 4, 2019, 6:21:09 AM4/4/19
to awokd, qubes-users
Thanks - it worked!

I hope a fix gets into the core system as I still have some problems
with the modem and I am not sure what I am doing wrong.

Z.
Reply all
Reply to author
Forward
0 new messages