Quantcast
Channel: Active questions tagged kernel-modules - Unix & Linux Stack Exchange
Viewing all 1181 articles
Browse latest View live

Unable to build rtlwifi driver

$
0
0

I have an RTL8723DE wifi card and I want to install the wifi driver for the same. I have cloned the rtlwifi_new directory and ran make. I get the following error on both the 4.19.113-1 and 5.4.28-1 Linux kernels on Manjaro.

Building modules, stage 2.MODPOST 19 modulesFATAL: parse error in symbol dump filemake[2]: *** [scripts/Makefile.modpost:92: __modpost] Error 1make[1]: *** [Makefile:1526: modules] Error 2make[1]: Leaving directory '/usr/lib/modules/4.19.113-1-MANJARO/build'make: *** [Makefile:85: all] Error 2

I have installed the kernel headers for both the kernels. The wifi driver was working fine until I updated and rebooted. Initially, I had only the 5.4 kernel installed. Since I was getting the error message, I installed the 4.19 kernel and its headers after which I'm getting the same message.

What does the error mean and how do I build the module successfully?


Which kernel configuration is required for the chipset on a ASRock X570 Taichi motherboard?

$
0
0

Which kernel configuration is required for the chipset on a ASRock X570 Taichi motherboard?(Kernel 5.6, or newer is available)

How to list all loadable kernel modules?

$
0
0

I'm looking for a few kernel modules to load i2c-dev and i2c-bcm2708. But the modprobe command returns:

sudo modprobe i2c-devmodprobe: module i2c-dev not found in modules.dep

How can I list all the available modules in the system? In which directory are they located?

How to make Realtek nic use r8168 driver

$
0
0

I've been trying (unsuccessfully) for the last few days to make my Realtek ethernet card to work. I have no problems with my wireless connection: only the ethernet connection doesn't work.

I have Ubuntu 16.10 on a Dell Inspiron, with a RTL8101/2/6E PCI Express card. The card used the r8169 driver, which seems to be buggy and unreliable (as in here). Since the solution seems to be to use the r8168 driver, I:

  • installed the package r8168-dkms via apt-get,
  • blacklisted the r8169 module in /etc/modprobe.d/
  • rebooted.

It didn't work, as lsmod still listed the module as in use, and lspci -v still told me that the card was using the r8169 driver and module.

I finally managed to blacklist the module passing the option to grub, by adding modprobe.blacklist=r8169 to the default command line in /etc/default/grub.

The problem is that the r8168 module loads fine (I see it in lsmod), but it's not associated with the card so it doesn't show up in ifconfig (exactly as it happened to lumi in Make Linux load specific driver for given device (Realtek NIC)).

This is the relevant portion of my lshw -C network:

*-network UNCLAIMED   description: Ethernet controller   product: RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller   vendor: Realtek Semiconductor Co., Ltd.   physical id: 0   bus info: pci@0000:01:00.0   version: 07   width: 64 bits   clock: 33MHz   capabilities: pm msi pciexpress msix vpd bus_master cap_list   configuration: latency=0   resources: ioport:3000(size=256) memory:b0600000-b0600fff memory:b0400000-b0403fff

My device:

> lspci -v -s 01:0001:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller (rev 07)Subsystem: Dell RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controllerFlags: bus master, fast devsel, latency 0, IRQ 11I/O ports at 3000 [size=256]Memory at b0600000 (64-bit, non-prefetchable) [size=4K]Memory at b0400000 (64-bit, prefetchable) [size=16K]Capabilities: <access denied>

Please note that in the output above lspci does not show any drivers nor kernel modules in use.

Finally, I tried to make my NIC to use the r8168 driver (as explained in this answer), to no avail:

% sudo echo 10ec 8168 > /sys/bus/pci/drivers/r8168/new_id/sys/bus/pci/drivers/r8168/new_id: File exists.% sudo echo "0000:01:00.0"> /sys/bus/pci/drivers/r8168/bind/sys/bus/pci/drivers/r8168/bind: File exists.

What am I missing? Is there another way to tell a device to use a driver? Any links, clues or indications about what to read next would be helpful and very much appreciated.

WiFi not working - wlan0 FAILED

$
0
0

My Arch (3.6.5-1) is exhibiting a rather peculiar problem: when wifi is set up, all logs indicate that the setup was successful and that the interface is up and functional. However, when attempting to access a website (or execute ping) all requests time out (despite that connection is reported as working and signal at 63% strength). This tends to happen randomly after laptop is switched on - after some time the connection usually starts working and does not break until next shutdown/suspend.

Relevant dmesg entries (full dmesg output can be found here):

[   13.858528] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready[   14.024275] r8169 0000:02:00.0: eth0: link down[   14.024339] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready[   34.895920] wlan0: authenticate with 00:24:6c:c8:e4:a1[   34.900827] wlan0: send auth to 00:24:6c:c8:e4:a1 (try 1/3)[   34.902963] wlan0: authenticated[   34.908362] wlan0: associate with 00:24:6c:c8:e4:a1 (try 1/3)[   34.911153] wlan0: RX AssocResp from 00:24:6c:c8:e4:a1 (capab=0x1431 status=0 aid=9)[   34.911217] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready[   34.911294] wlan0: associated

ip -s link shows:

wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT qlen 1000    link/ether 50:b7:c3:1e:f4:21 brd ff:ff:ff:ff:ff:ff    RX: bytes  packets  errors  dropped overrun mcast       14970982   50472    0       0       0       0          TX: bytes  packets  errors  dropped carrier collsns     19116      233      0       0       0       0      

ip minotor outputs some failure messages:

[NEIGH]144.32.78.1 dev wlan0  FAILED[NEIGH]144.32.78.1 dev wlan0  FAILED[LINK]3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP>     link/ether [LINK]3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN     link/ether 50:b7:c3:1e:f4:21 brd ff:ff:ff:ff:ff:ff[LINK]3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state DORMANT     link/ether 50:b7:c3:1e:f4:21 brd ff:ff:ff:ff:ff:ff[LINK]3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP>     link/ether [LINK]3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP>     link/ether [NEIGH]144.32.78.1 dev wlan0  FAILED[NEIGH]144.32.78.1 dev wlan0  FAILED[LINK]3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP     link/ether 50:b7:c3:1e:f4:21 brd ff:ff:ff:ff:ff:ff[NEIGH]144.32.78.1 dev wlan0  FAILED[NEIGH]144.32.78.1 dev wlan0  FAILED[NEIGH]144.32.78.1 dev wlan0  FAILED[NEIGH]ff02::2 dev wlan0 lladdr 33:33:00:00:00:02 NOARP[NEIGH]ff02::1:ff1e:f421 dev wlan0 lladdr 33:33:ff:1e:f4:21 NOARP[NEIGH]ff02::16 dev wlan0 lladdr 33:33:00:00:00:16 NOARP[NEIGH]144.32.78.1 dev wlan0  FAILED[NEIGH]144.32.78.1 dev wlan0  FAILED[NEIGH]144.32.78.1 dev wlan0  FAILED[NEIGH]144.32.79.218 dev lo lladdr 00:00:00:00:00:00 NOARP[NEIGH]144.32.78.1 dev wlan0  FAILED[NEIGH]144.32.78.1 dev wlan0  FAILED[NEIGH]144.32.78.1 dev wlan0  FAILED[NEIGH]144.32.78.1 dev wlan0  FAILED[LINK]3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP>     link/ether [NEIGH]144.32.78.1 dev wlan0  FAILED[NEIGH]144.32.78.1 dev wlan0  FAILED[NEIGH]144.32.78.1 dev wlan0  FAILED[NEIGH]144.32.78.1 dev wlan0  FAILED[NEIGH]144.32.78.1 dev wlan0  FAILED

All that should be loaded seem to be (output of lsmod). Any idea on how to solve this or what the problem is?

Module (un)loading procedure in the linux kernel

$
0
0

I would like to know how a userspace program like modprobe can inject an executable file from userspace to kernel memory?
What kind of syscalls does it issue and what interfaces are provided by the kernel to make that possible? (detailed explanation please).

Thanks.

Building Ubuntu Linux kernel - what are the various images?

$
0
0

I just built the Ubuntu linux kernel according to https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel (which seems to be reasonably up to date according to the September 2019 date).

The target I built is:

fakeroot debian/rules binary-headers binary-generic binary-amd64

I have these images (which annoyingly it spits out in the parent directory):

linux-buildinfo-5.4.0-29-generic_5.4.0-29.33_amd64.deblinux-cloud-tools-5.4.0-29-generic_5.4.0-29.33_amd64.deblinux-headers-5.4.0-29_5.4.0-29.33_all.deblinux-headers-5.4.0-29-generic_5.4.0-29.33_amd64.deblinux-image-unsigned-5.4.0-29-generic_5.4.0-29.33_amd64.deblinux-modules-5.4.0-29-generic_5.4.0-29.33_amd64.deblinux-modules-extra-5.4.0-29-generic_5.4.0-29.33_amd64.deblinux-tools-5.4.0-29-generic_5.4.0-29.33_amd64.deb

Whereas in that document it says I should expect something like that:

linux-headers-4.8.0-17_4.8.0-17.19_all.deblinux-headers-4.8.0-17-generic_4.8.0-17.19_amd64.deblinux-image-4.8.0-17-generic_4.8.0-17.19_amd64.deb

Although it does say there may be a linux-extra- packge in newer kernels, there's still several discrepancies:

  1. My linux-image- is unsigned
  2. There's no linux-extra package, only a linux-modules-extra.
  3. It doesn't mention to install either of the linux-modules- packages, and yet if I don't some of my decivce stop working (Bluetooth/Wifi).

Is there any definitive explanation of all these packages, and which ones exactly I need to replicate the out-of-the-box setup for Ubuntu Focal please?

RTNETLINK answers: Operation not supported when start wireguard

$
0
0

when I using this command to start wireguard:

$ sudo yum install epel-release https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm$ sudo yum install yum-plugin-elrepo$ sudo yum install kmod-wireguard wireguard-tools$ wg-quick up wg0

the result:

Warning: `/etc/wireguard/wg0.conf' is world accessible[#] ip link add wg0 type wireguardRTNETLINK answers: Operation not supportedUnable to access interface: Protocol not supported[#] ip link delete dev wg0Cannot find device "wg0"

this is my kernel version:

[root@izbp19pke6x0v6ruecuy1yz wireguard]# uname -r4.4.219-1.el7.elrepo.x86_64

I just do not known where is the problem?

yum install kmod-wireguardPackage kmod-wireguard-1.0.20200413-1.el7_7.elrepo.x86_64 already installed and latest versionNothing to do

How to debug an inserted kernel module?

$
0
0

I would like to debug a loaded kernel module I don't have the source code to; I suspect it's a virus. Is there a way to feed it into GDB for analysis?

insmod: ERROR: could not insert module 8188eu.ko: Invalid module format

$
0
0

I'm trying to use the TL-WN725N as an USB WiFi-Adapter with Fedora 20.

I followed these insructions and the adapter worked fine and even survived two updates during the last few weeks.

Then I did a yum update today, and it still worked fine until I restarted my computer.I tried to reload the module and got insmod: ERROR: could not insert module 8188eu.ko: Invalid module format.

What I found out was, that my kernel and the kernel-headers in the module are not the same anymore and that I had to update the kernel, so I did that and got

sudo yum install kernel-headersLoaded plugins: langpacks, refresh-packagekitPackage kernel-headers-3.17.3-200.fc20.x86_64 already installed and latest versionNothing to do

Now I am a bit puzzeld about how to get the module to load properly.Anyone got any idea?

What is an idiomatic way of creating vagrant base bow with a custom kernel module?

$
0
0

I am making a tutorial resource where the participants have to interact with a custom kernel module.

In particular I want to stick to vagrant with VirtualBox provider, as it is the tool that the participants are familiar with.

Previously, I simply let the participants to download .ko file and corresponding script, so that they can run the script to install the modules (i.e., insmod)

However, for this time, I'd like to try another approach, where I can deploy a vagrant base box, where the kernel module is already installed and runs by default on each boot.

My question here is what is the idiomatic way of creating a box of a common distro, say Ubuntu, which contains a custom kernel module?

Load NFS-Kernel-Server modules via /etc/modules

$
0
0

I have added the following to my /etc/modules:

nfsnfsv4

and this is the result after a reboot:

nfsv4                 638976  0nfs                   294912  1 nfsv4lockd                  98304  1 nfsfscache               368640  2 nfsv4,nfssunrpc                385024  4 nfsv4,lockd,nfs

But, if I install nfs-kernel-server, this is the result:

nfsv4                 638976  0nfs                   294912  1 nfsv4fscache               368640  2 nfsv4,nfsnfsd                  368640  13auth_rpcgss            94208  1 nfsdnfs_acl                16384  1 nfsdlockd                  98304  2 nfsd,nfsgrace                  16384  2 nfsd,lockdsunrpc                385024  20 nfsd,nfsv4,auth_rpcgss,lockd,nfs_acl,nfs

What am I not doing correctly to get the same kernel modules loaded that installing via "apt" gets me?

Update: this is the "pure" apt install output, the other output has my "/etc/modules" NFS line + APT mixed together.

nfsd                  368640  9auth_rpcgss            94208  1 nfsdnfs_acl                16384  1 nfsdlockd                  98304  1 nfsdgrace                  16384  2 nfsd,lockdsunrpc                385024  16 nfsd,auth_rpcgss,lockd,nfs_acl

How to ignore accelerometer and override hardware disabling keyboard?

$
0
0

My laptop is configured to disable the keyboard when it is in tablet mode. This would normally be beneficial, but my laptop's accelerometer/hinge sensor is broken. This means the keyboard never works. I know this is the problem, because when flip the screen around(it's a convertible) the keyboard starts working.

I think I can fix this if Linux could override the the hardware(bios?) and ignore the sensor or enable the keyboard. This was possible on windows by disabling the accelerometer/sensor through regedit or command prompt.

So is there a way to configure Linux to disable/ignore the accelerometer?

My laptop is a HP Spectre x360 15(the 2016 model). I am on the arch linux installation disk.

Where exactly is the file linux/kernel.h?

$
0
0

I am reading through Salzman's Linux Kernel Module Programming Guide, and I was wondering about where the file linux/kernel.h is located. I couldn't find it with find. Or rather the files I found did not have any printk priority macros in them.

Making cpupower changes permanent

$
0
0

I have been fiddling with power management and I can't find a way to make the changes I want permanent. For example, I have set the maximum cpu frequency with this command:

sudo cpupower frequency-set 2GHz

but the value goes back to its original value on every reboot? Is there a standard way to make this change permanent? I have read about kernel modules but I don't know how they work... can anyone help me?

Note. My machine is running Ubuntu 20.


How to automatically load a new VID&PID to module usb_serial

$
0
0

I have a 4G module that requires me to run

echo '03f0 581d'> /sys/bus/usb-serial/drivers/generic/new_id

after every startup/resume to make the modem visible. How should I make this automatic?

  • Add the VID&PID to usb-serial sources and recompile
  • Create script that run on startup/resume that adds them dynamically
  • Some sort of udev rule?

What would be the best approach. I think the udev approach sounds the most reasonable. I assume that would work over suspend/resume too?

The modem is a HP lt4112 LTE/HSPA+ Gobi 4G Modem (Huawei ME906E).

Bonus question: Why does the command need to be re-run after a suspend/resume cycle. Does the kernel module get unloaded or somehow reset when the laptop gets suspended to RAM?

Linux/compiler-gcc5.h: No such file or directory

$
0
0

I run into problem compiling a kernel scheduler for testing

the compiling error

 linux-2.6.32-rc3/include/linux/compiler-gcc.h:86:30: fatal error: linux/compiler-gcc5.h: No such file or directory

Do I get this error because the kernel is too old?

kernel

uname -r4.1.0-3-generic

gcc

gcc --versiongcc-5.real (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010

So if this is the reason for the compilation error - what solutions are available? Should I for instance update the kernel - how do I do that? Or regress to an earlier version of gcc? Other sugestions?

Cross-compiling backports for kernel 3.0

$
0
0

I am trying to compile backports (I have chosen latest [5.6.8-1] release) for an i.MX35 (armv6) Embedded Linux system with the provided toolchain (arm-fsl-gnueabi-gcc 4.6.2, a different compiler is not an option) and the BSP kernel (3.0, a different kernel is, sadly, not an option).

The relevant page claims that

Every backports release has been test compiled for usage against all supported kernels. The oldest release is (currently) 3.0.

so I should be fine, although, as written below, I am sure they did not test this release against 3.0, because it simply cannot be compiled for that release without manual interventions.

I have [re]built the kernel source tree and followed instructions under "cross-compiling" for out-of-tree backports building. Then first I selected, via menuconfig, a bunch of USB WiFi drivers, but due to compile errors, I deleted and reextracted the tarball and did (since they claim

Its understood users may not know how to configure the backports package, just like they may not know how to configure the Linux kernel, so a short cut is provided with default configuration files that can be used to only build their drivers / subsystems of interest.

) just a defconfig-mwifiex to be sure I was not doing anything wrong in the configuration. Yes, I'm such an hopeless optimistic guy.

I had to expunge some "not-too-much-backported" functions that depends on functionalities not found in 3.0:

  1. change __atomic_add_unless to atomic_add_unless in backport-include/linux/atomic.h

  2. change debug_fs_create_xul in backport-include/linux/debugfs.h to unconditionally call debug_fs_create_x32 since debug_fs_create_x64 does not exist; since the conditional version dispatches basing on the size of unsigned long, that is 32 bit on this platform, the latter won't be called anyway.

  3. commented out netdev_upper_dev_link stuff in backport-include/linux/netdevice.h (from line 360 onwards) because it does not exists in 3.0 but only in some later release. Anyway is only called by a module I'm not compiling (actually, it does not even appear in menuconfig due to the base kernel configuration) so it is safe.

  4. placed under #ifdef CONFIG_PCI the definition of pcie_find_root_port because it calls/{depends on} a chain that is #ifdefed with the same variable in backport-include/linux/pci.h

  5. #ifdefed pm_runtime_active in backport-include/linux/pm_runtime.h with CONFIG_PM_RUNTIME since the struct members it uses are under the same #ifdef

  6. #ifdefed NETLINK_CB(in_skb).sk accesses in compat/backport-genetlink.c with LINUX_IS_VERSION_GEQ(3, 10, 0) because the sk struct member was added only in that release.

Unfortunately net/wireless/trace.c has a problem with TP_PROTO expansions, so GCC errors out with a lot of error: expected ')' before 'struct', and I had not managed to solve those. Any ideas?

If not, any really tested on 3.0 backports release (hoping to have a good bunch of battle-tested WiFi USB drivers available)?

Is developing/testing a linux module safe using a virtual machine?

$
0
0

I'm in an operating systems class. Coming up, we have to do some work modifying kernel code. We have been advised not to use personal machines to test (I suppose this means install it) as we could write bad code and write over somewhere we shouldn't. We are given access to a machine in a lab to be safe.

If I were to test using a VM, would that protect the host system from potentially unsafe code? I really want to not have to be stuck to a system at school and snapshots will be useful.

If it is still high risk, any suggestions on what I need to consider to test safely?

We will be using something like linuxmint to start with. If anyone wants to see what will be in the current project: http://www.cs.fsu.edu/~cop4610t/assignments/project2/writeup/specification.pdf

Making cpupower changes persistent

$
0
0

I have been fiddling with power management and I can't find a way to make the changes I want persistent. For example, I have set the maximum cpu frequency with this command:

sudo cpupower frequency-set --max 2GHz

but the value goes back to its original value on every reboot. Is there a standard way to make this change persistent? I have read about kernel modules but I don't know how they work... can anyone help me?

Note. My machine is running Ubuntu 20.04.

Viewing all 1181 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>