21

Modules can only access exported symbols, and exit_task_namespaces isn’t exported — so even though it is visible in the header files, it can’t be used in a module. Exported symbols can be accessed as you’d expect, there’s nothing special to do.


9

The Windows Subsystem for Linux version 2 uses a custom Linux kernel from Microsoft that contains all of its drivers compiled in. While it has support for modules, it doesn't contain any, as you can see from the configuration file. Therefore, there's no reason to ship a /lib/modules directory. In addition, most of the Linux distros available for WSL don't ...


8

Although I've contributed a few (very minor) patches to the Linux kernel, I don't count myself as a kernel developer. However, here's what I know: A driver written for kernel version 2.6.0.0 pre-dates the elimination of the Big Kernel Lock (BKL) that happened in kernel version 2.6.39. The BKL was created back when Linux was still a single-processor (single-...


7

I had a similar issue with a Varmilo VA109M Keyboard (for some reason it registers as an apple keyboard). I'm running Ubuntu 20.04, and everything worked after doing these steps from this guide: Run the following command to append the configuration line to the file /etc/modprobe.d/hid_apple.conf creating it if necessary: $ echo options hid_apple fnmode=0 | ...


6

I had to do this for an assignment, so I figure I'll share my solution here. The base WSL2 kernel does not allow modules to be loaded. You have to compile and use your own kernel build. How to compile and use a kernel in WSL2: sudo git clone https://github.com/microsoft/WSL2-Linux-Kernel.git sudo apt install build-essential flex bison libssl-dev libelf-dev ...


6

Greg Kroah-Hartman has written on this topic here: https://www.kernel.org/doc/html/v4.10/process/stable-api-nonsense.html Besides some technical details regarding compiling C code he draws out a couple of basic software engineering issues that make their decision. Linux Kernel is always a work in progress. This happens for many reasons: New requirements ...


4

You can add a configuration file /etc/modprobe.d/vboxdrv-includes-vfat.conf with a "soft dependency" command: softdep vboxdrv post: vfat The man page modprobe.d(5) documents the syntax: softdep modulename pre: modules... post: modules... The softdep command allows you to specify soft, or optional, module dependencies. modulename can be used ...


3

Can you try rmmod -f snd_usb_audio ?


3

You need to append a newline to the end of printk(). It seems that printk() without newline will not be flushed into dmesg until another printk() without KERN_CONT. printk(KERN_INFO "Current value in t1 is %d\n",7); printk(KERN_INFO "Current value in t2 is %d\n",8); As for how to correctly create and stop kthreads, here is a sample code ...


3

You could append one line defining such a dependency to modules.dep echo "${module1}: ${module2}" >> "/lib/modules/$(uname -r)/modules.dep" (Note: running depmod later may destroy your change, and you'll have to reapply) Reference: https://linux.die.net/man/5/modules.dep


3

-kernel only says where to load a kernel from, nothing else. It's like telling the bootloader in real hardware "load this kernel file". Once the guest kernel has booted, it is what makes the decision about where to look for modules (or even whether to look for modules at all). So the modules have to be in the guest filesystem. Personally I usually ...


2

You can check how autocompletion does it: $ complete -p modprobe complete -F _modprobe modprobe declare -f _modprobe _modprobe () { ... In that function there's an internal _installed_modules $ declare -f _installed_modules _installed_modules () { COMPREPLY=($(compgen -W "$(PATH="$PATH:/sbin" lsmod | awk '{if (NR != 1) print $...


2

I believe the most appropriate trigger for that case would be the activity, that aims at showing the CPU activity system-wise. Here is the description of it: This allows LEDs to be controlled by an immediate CPU usage. The flash frequency and duty cycle varies from faint flashes to intense brightness depending on the instant CPU load For that you need to ...


2

I had the same issue following the same procedure and couldn't figure out why it wasn't working, then i realized that the issue was running again vboxconfig after signing the modules since it would trigger the kernel modules rebuild: " vboxdrv.sh: Building VirtualBox kernel modules." At that point i just signed the modules and loaded them using ...


2

I²C doesn’t support device enumeration, so the kernel provides four different ways of initialising I²C devices: listing them in a devicetree (the Warp i.MX7 Board does this with ov2680), in ACPI tables, or in board files (ignore the latter, it’s only provided for backward compatibility); instantiating them explicitly, when the hardware “knows” they exist (...


2

This doesn’t seem to be mentioned in the kernel’s LSM documentation, but no, security modules can’t completely override the kernel’s access model, they supplement it. For example, checks before execution include those in do_open_execat, which checks the permissions; the LSM hooks are called later (look for security_). Other examples include all the functions ...


2

You should run dpkg -S /lib/modules/* to check whether any installed package matches those directories. You can delete any directory for which the above says dpkg-query: no path found matching pattern /lib/modules/... For directories still matching a package, you should remove the corresponding package first. If you’re using Ubuntu, sudo apt -get ...


2

Try: cat >> /etc/modprobe.d/usbhid.conf << "EOF" options usbhid mousepoll=2 EOF And, if applicable: update-initramfs -u -k all ...this .conf file should set the option for you the first time the module is loaded, and be persistent. Another option is to include the setting in the kernel command line: usbhid.mousepoll=2. You will need ...


2

By default, two ifb interfaces are created when loading the ifb kernel module. This is for obsolete reasons, the same way two dummy interfaces are created when loading the dummy kernel module. Those interfaces are created in the initial network namespace. For example if the system is inside a container or simply a (non initial) network namespace, no ifb ...


2

The vital clue is in the kernel version that failed to compile: 5.4.0-42-generic. Support for the SUBDIRS parameter was removed in that version in favor of the newer M parameter and KBUILD_EXTMOD environment variable. Previous versions (since 11/2018) printed a warning even while successfully compiling, so depending on how often you update your packages, ...


2

In Debian, the PC speaker support is built into the main kernel, as opposed to being a separate loadable module like in Arch. But the other methods mentioned in the Arch wiki should still work. If you're using your system in text mode, setterm -blength 0 sets the default beep length to 0 ms, effectively silencing it. You'll need to add this to your login ...


2

The difference being (man nm) that flush_tlb_all is in the text section, where as sys_call_table is in the data section. However, both symbols are global (external). This is exactly why register_kprobe fails on sys_call_table: it only allows probes in the kernel text. kprobe_register calls check_kprobe_address_safe once it has the address to probe, and the ...


2

module verification failed: signature and/or required key missing - tainting kernel This does not mean your module did not load. All it means is any kernel oops/panic messages will have a bit of information indicating that you have (or had at some point) an unsigned module loaded. This message is just a warning, not an error. (But if you try to submit a ...


2

I’m assuming you’re running Debian 10, but the instructions for later versions are similar. The module you’re after is supported by the kernel version used in Debian 10, but it is not enabled; let’s fix that. Install the kernel source for the default version in your release: sudo apt install linux-source Extract it: cd /usr/src tar xf linux-source-*.tar.xz ...


1

Based on Brian Turek's answer above I managed to fix the issue. I still don't know what causes this kind of issue, but reinstalling the kernel headers did not fix the problem for me. In fact I can see the issue resists for me for multiple kernel versions now. This issue may apply to you, if the output of the both commands differ: root@:/# uname -r 5.4.0-60-...


1

The stats file is named diskstats, instead of blkdevstats or similar. This is a clue. The statistics are output by diskstats_show() in block/genhd.c, and it uses the struct gendisk structures as its information source. You have created a block device, but for regular disks that is just the first step. After that there is usually alloc_disk() to allocate ...


1

How/when It depends. AMD microcode: Can be embedded into the kernel image (vmlinuz) Can be loaded via an initrd Can be loaded during a normal boot. This wiki article should answer your question: https://wiki.archlinux.org/index.php/microcode In all three instances you can reload it manually once you have updated it.


1

USB Network Gate apparently requires a kernel extension of some sort. On a standard Debian or Ubuntu installation, such an extension can be added by providing source and using the DKMS system to build kernel modules for the appropriate kernel. However, doing so requires the kernel headers for the appropriate kernel, which are normally shipped in a package ...


1

Try this instead: rpm -ivh kernel-3.10.0-957.el7.src.rpm cd ~/rpmbuild/SOURCES rpmbuild -bp kernel.spec cd ~/rpmbuild/BUILD/kernel-3.10.0-957.el7/linux-3.10.0-957.fc32.x86_64 make menuconfig make bzImage make modules


1

When you run a command via time it will include sys and user times. The system time indicates how much time the kernel was occupied running the process. I'm not sure if you can use the sys time as a basis for quantifying the performance of the iSCSI driver. I personally wouldn't. E.g. time 7z b > /dev/null real 0m32.160s user 7m31.279s sys 0m1....


Only top voted, non community-wiki answers of a minimum length are eligible