date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,415,303,231,000
I've been following these instrctions to install the guest packages for arch linux. Unfortunatelly modprobe returns: [snooc@archfire ~]$ modprobe -a vboxguest vboxsf vboxvideo modprobe: WARNING: Module vboxguest not found. modprobe: WARNING: Module vboxsf not found. modprobe: WARNING: Module vboxvideo not found. pacm...
I had the exact same problem when i was trying to install arch on virtualbox earlier today. The solution is to run depmod $ depmod 3.14.4-1-ARCH After running modprobe again, it should work. You can use uname -r to find your kernel version string. Source
VirtualBox: modprobe can't find vboxguest, vboxsf, vboxvideo
1,415,303,231,000
I'm debugging a closed-source software installer that seems to have some pre-conceived notions about my distribution. The installation aborts after not finding apt-get. The command it attempts to run is: apt-get -y -q install linux-headers-3.7.5-1-ARCH I suppose the "package name" comes from /usr/src, where the sole ...
You're running Arch linux. According to pacman -Q -i linux-headers, the package "linux-headers" contains "Header files and scripts for building modules for linux kernel". When the linux kernel gets built, various constants, which might be numbers or strings or what have you, get defined. Some loadable modules need to...
What package could "linux-headers-3.7.5-1-ARCH" mean?
1,415,303,231,000
I've built a new computer with a AMD Ryzen 5700G and to my surprise, no sensor information is picked up whatsoever. I thought perhaps the new AMD chips would not yet be recognized by Linux, but the docs say otherwise. Here's sudo sensors-detect: # sensors-detect version 3.6.0+git # System: Gigabyte Technology Co., Ltd...
The driver in Linux 5.14 doesn't support these APUs yet, it will be available in 5.15 but you can grab it now and compile in 5.14 (must be safe).
No temperature reading on Ryzen 5700G?
1,415,303,231,000
I have this embedded Linux devices. I would like to add kernel-level functionality to it, but would highly prefer not to compile my own kernel to do so. (If the kernel doesn't load and get to user space the device is bricked; I can't access the bootloader to recover it. The current kernel doesn't have kexec support so...
First, in order to answer your question "can I compile Linux kernel module without Module.symvers", we need to understand what is the purpose of Module.symvers: Module.symvers serves two main purposes: 1) It lists all exported symbols from vmlinux and all modules. 2) It lists the CRC if CONFIG_MODVERSIONS is enabled. ...
Compile Linux kernel module without Module.symvers
1,415,303,231,000
Let's take a scenario where a Linux system has booted and is running correctly. A user comes along and hotplugs a USB memory device. The sequence of events that happen are illustrated on the diagram below: Where does modprobe load its driver into ? Is the driver for the requested device found in /sys/bus/drivers af...
The uevent message contains information about the device (example). This information contains registered vendor and model identification for devices connected to buses such as PCI and USB. Udev parses these events and constructs a fixed-form module name which it passes to modprobe. modprobe looks under /lib/modules/VE...
Where does modprobe load a driver that udev requests?
1,415,303,231,000
I've recently applied a one-line patch to drivers/bluetooth/btusb.c in order to enable compatibility with my Bluetooth device. However, whenever I get a kernel upgrade, the patch will be lost until someone backports it (which isn't likely). Is there a way for me to run a script and patch each new kernel upgrade automa...
Yes, you should package up your changes as a DKMS module. Building modules for several installed kernels or automatically rebuilding them on an updated kernel is the main feature of DKMS. Ubuntu community documention has a nice article on this topic here.
Automatically apply module patch and compile kernel when updated?
1,415,303,231,000
I just compiled a new kernel and asked myself: What decides during the compilation process which kernel modules are built in the kernel statically? I then deleted /lib/modules, rebooted and found that my system works fine, so it appears all essential modules are statically built in the kernel. Without /lib/modules, th...
You do this as part of the configuration process, usually when you run make config, make menuconfig or similar. You can set the module as built-in (marked as *), or modularised (marked as M). You can see examples of this in a screenshot of make menuconfig, from here:
What decides which kernel modules are built in the kernel statically during compilation?
1,415,303,231,000
I am studying Linux device drivers, my main focus is on wifi drivers. I want to know how the code flows when I plugin my device. Maybe, I can do something like add a printk line in every function. The device I have is supported by ath9k_htc driver. I want to make some changes in the driver code for learning purposes....
When I want to do this, I use the ftrace framework. Start by mounting the special file system: mount -t tracefs nodev /sys/kernel/tracing (as root; you should become root for all this, you’ll be doing everything as root anyway, and it’s easier to have a root shell than to use sudo). Then change to that directory: cd ...
How to know the code flow of a driver module?
1,415,303,231,000
I have been provided with a vendor supplied minimal linux installation. From an answer to a previous question I discovered that it is possible to build a kernel with or without module support. I have a CANBUS device that I need to attach which comes with drivers in the form of .ko files. I would like to be able to ins...
If you have a /proc filesystem, the file /proc/modules exists if and only if the kernel if compiled with module support. If the file exists but is empty, your kernel supports modules but none are loaded at the moment. If the file doesn't exist, your kernel cannot load any module. It's technically possible to have load...
Can I detect if my custom made kernel was built with module support?
1,415,303,231,000
I am trying to understand the disadvantages of using Linux kernel modules. I understand the benefits of using them: the ability to dynamically insert code into a running system without having to recompile and reboot the base system. Given this strong advantage, I was guessing most of kernel code should then be in kern...
Yes, the reason that essential components (such as mm) cannot be loadable modules is because they are essential -- the kernel will not work without them. I can't find any references claiming the effects of memory fragmentation with regard to loadable modules is significant, but this part of the LLKM how-to might be in...
Disadvantages of linux kernel module?
1,415,303,231,000
I have Kubuntu 14.10 development workstation and recently I have bought a QinHeng Electronics HL-340 USB-Serial adapter. HL-340 is USB<---->Serial adapter and it is recognised by my kernel: user@comp001:~$ lsusb Bus 007 Device 010: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter [..] I am trying to i...
Is the adapter loading the right kernel module? I've heard that your device may be CH341 compatible: sudo modprobe ch341
Testing QinHeng Electronics HL-340 USB-Serial adapter
1,415,303,231,000
I want to build my Linux kernel on my host and use it in my VWware virtual machine. They both use the same Ubuntu kernel now. On my Host, I do make and make configure. Then, what files should I copy to the target machine, before I do make modules_install and make install? What other things do I need to do?
The 'best' way to do this, is building it as a package. You can then distribute and install it to any Ubuntu machine running the same (major) version. For building vanilla kernels from source, there's a tool make-kpkg which can build the kernel as packages. Other major advantages: easy reverting by just removing the p...
Build kernel in one machine, install in another
1,415,303,231,000
I've encountered a relatively common problem with ASIX AX88179 USB 3.0 Gigabit Ethernet adapter, where it was not working at all, or was working sporadically, and dmesg was showing errors like [23552.344134] ax88179_178a 2-1:2.1 eth1: Failed to read reg index 0x0000: -32 Searching on-line, I've found reports of this ...
A similar, but slightly cleaner strategy also involving a file in modprobe.d/ is to use the softdep feature to tell modprobe to load cdc_mbim before ax88179_178a. In /etc/modprobe.d/ax88179.conf: softdep ax88179_178a pre: cdc_mbim
How to fix an apparenlty missing kernel module dependency declaration?
1,415,303,231,000
I have been trying to get a FreeBSD box (running FreeNAS) to control its fans. It wants to just run them at high speed even though the system temperatures are quite low. The lm-sensors package can do this on Linux, but it's not available on FreeBSD. I found this similar question here, but there has been no response....
ACPI Yes. If your hardware supports Advanced Configuration and Power Interface (ACPI) then there are loadable modules for ACPI support. Unfortunately most (if not all) modules are targetting laptops. You can see if you have any settings related to fans using sysctl: # sysctl hw.acpi But rather than manually tweaking ...
FreeBSD kernel module to control fan speed
1,415,303,231,000
I am learning how to create kernel modules and it was all working fine: I compiled, inserted the .ko with sudo insmod cheat.ko, and the printk messages inside the init function (set by module_init) appeared correctly in /etc/log/syslog. Then I made changes to the module, removed it with sudo rmmod cheat.ko, reinserted...
The Linux kernel is only willing to unload modules if their module_exit function returns successfully. If some function from the module crashes, the kernel may be able to recover, but the module is locked in memory. It may be possible to rummage through the kernel data structures and forcibly mark the module as unload...
Cannot remove or reinsert kernel module after error while inserting it without rebooting
1,415,303,231,000
I would like to load a custom kernel module upon startup on my system (Debian 9). The vermagic string of this module does not exactly match my kernel version, but I can load it using modprobe -f module_name or insmod -f /path/to/module and it seems to work fine. If I just add the name of the module to /etc/modules-loa...
You should be able to override the install behaviour using a configuration file in /etc/modprobe.d, for example /etc/modprobe.d/module_name.conf: install module_name /sbin/modprobe -i -f module_name This instructs the module loading code to run /sbin/modprobe -i -f module_name when a request is made to install module...
How to force load kernel module (modprobe -f) on startup?
1,415,303,231,000
I want to try my hand at writing a linux driver. I am trying to set up my environment. My current kernel: $ uname -r 4.10.0-37-generic I then download the source code: $ apt-get source linux-image-$(uname -r) Reading package lists... Done Picking 'linux' as source package instead of 'linux-image-4.10.0-37-generic' ....
There are a number of approaches... If you’re trying to build an external module (including one you’re developing), you only need the kernel headers: apt install linux-header-$(uname -r) This will provide the necessary files so that the /lib/modules/$(uname -r)/{build,source} symlinks point to something meaningful. ...
Getting kernel source code (ubuntu)
1,415,303,231,000
TL;DR: when I was trying to compile a driver for USB DAQ device I have reconfigured the kernel. The driver refused to compile under the default distro's kernel but everything works with my tweaked kernel. The driver consists of 2 kernel modules. I know which options I changed but I want to know which particular config...
After some further experimenting I can confirm my claim made in one of my comments: the CONFIG_USB option has to have value Y; m is "not enough". Incidentally, the kernel in openSUSE 11.4 has it Y by default and the kernel in SLES11SP3 has m. It's a pity that the error message does not state it clearly. An easy way o...
How do I know which kernel configuration option enabled my driver?
1,415,303,231,000
On a "Linux debian 2.6.32-5-amd64 #1 SMP" installation where loading a kernel module (mpt2sas) is desired to be delayed to be loaded after starting sshd and users can remotely login, the mpt2sas module was disabled from loading in single user boot, by: $ echo 'blacklist mpt2sas' >> /etc/modprobe.d/mpt2sas.conf; depmod...
Check that your module is not listed in file /etc/modules. This file lists the modules that must be loaded at boot time according to http://www.debian.org/doc/manuals/debian-faq/ch-kernel.en.html#s-modules When the module name - mpt2sas in this case - is listed in file /etc/modules: Remove that mpt2sas line or commen...
How to block loading kernel module only in single user boot when blacklist fails?
1,415,303,231,000
Lets suppose I have a module named "mptsas". How can I find out, what kernel configuration menu entry (make menuconfig inside /usr/src/linux) corresponds to that module? By 'corresponds' I mean what menu entry compiles the appropriate module into the kernel. //edit: it works very nicely:
There is no recorded association. You need to explore the makefiles in the kernel source. You'll find lines like obj-$(CONFIG_FUSION_SAS) += mptbase.o mptscsih.o mptsas.o This means that: If CONFIG_FUSION_SAS is y, then the drivers mptbase, mptscsih and mptsas are compiled into the kernel. If CONFIG_FUSION_SA...
Binding lsmod module name with kernel configuration menu entry
1,415,303,231,000
Directly related: Prevent claiming of novelty usb device by usbhid so I can control it with libusb? I want to access an RFID reader (works as HID device) from a program that uses libusb-0.1. In the code, the kernel driver is correctly detached with usb_detach_kernel_driver_np (no errors), but is seems that whenever my...
I've solved this part of the problem: OPTIONS=="ignore_device" was removed from the kernel (commit) blacklist usbhid didn't do anything, not even blocked my keyboard A configuration file in /etc/modprobe.d with options usbhid quirks=0xdead:0xbeef:0x0004 did not work because usbhid was not compiled as module So, I ad...
Prevent usbhid from claiming USB device
1,415,303,231,000
I get following errors in my logs: kernel: snd_hda_intel 0000:00:1b.0: IRQ timing workaround is activated for card #0. Suggest a bigger bdl_pos_adj Google found some old posts here and here which deal with the same problem. The offered solution suggests to change the value for the kernel module: options snd-...
The kernel documentation describes bdl_pos_adj as follows (see the ALSA driver configuration guide and More Notes on HD-Audio Driver): bdl_pos_adj - Specifies the DMA IRQ timing delay in samples. Passing -1 will make the driver to choose the appropriate value based on the controller chip. (sic). On Intel controllers...
bdl_pos_adj: set IRQ timing workaround for hda-intel
1,415,303,231,000
Is it possible to boot linux without a initrd.img ? I am planning to add default drivers as a part-of-kernel itself and avoid initrd completely. What are the modules that should be made part-of-the-kernel instead of loadable modules ?
It is, unless your root volume is on an LVM, on a dmcrypt partition, or otherwise requires commands to be run before it can be accessed. I haven't used an initrd on my server in years. You need at a minimum these modules built in: the drivers of whatever controller where your root volume disk lives the drivers neces...
Booting without initrd
1,415,303,231,000
I have recently been playing around with creating kernel modules using some crosstools for an embedded setup. It would be helpful to me in future to have the ability to identify the version of the kernel that these modules have been built against. I can find no information online about this so I am starting to think ...
Execute the command modinfo <kernel_module_name> and look for vermagic shw@shw:/tmp # modinfo btrfs filename: /lib/modules/3.13.0-36-generic/kernel/fs/btrfs/btrfs.ko license: GPL alias: devname:btrfs-control alias: char-major-10-234 alias: fs-btrfs srcversion: ...
Is there a way to determine what kernel version a kernel module was compiled against?
1,415,303,231,000
I want to build kernel modules in Alpine; I know how to do it in Ubuntu. In Ubuntu, I used to install kernel headers by running: apt install -y build-essential linux-headers-$(uname -r) What is the equivalent in Alpine? I searched on the web and Github user progrium wrote a comment that the equivalent for build-essen...
build-base is indeed the equivalent to build-essential. The package providing the headers and scripts needed to build kernel modules is the -dev package matching your kernel package, e.g. linux-lts-dev.
What is the equivalent packages build-essential and linux-headers-<xxxx> in alpine?
1,415,303,231,000
I don't want to load the kernel module nouveau on my debian box at startup, so I put the following in /etc/modprobe.d/blacklist.conf: blacklist ttm blacklist drm blacklist nouveau I even did a update-initramfs -u but nonetheless those three modules get loaded each time I boot. Does anyone know why and how to fix this...
You can find the answer in the wiki: the idea is that one does not use /etc/modprobe.d/blacklist.conf. Instead, say you want to blacklist pcspkr. You create a pcspkr.conf file in /etc/modprobe.d and put blacklist pcspkr inside. Then run depmod -ae && update-initramfs -u
Excluding kernel modules through /etc/modprobe.d/blacklist.conf does not work
1,415,303,231,000
So i am on a debian buster 10 system and i installed virtualbox and i encountered an error which tells me to load some kernel modules manually. sudo ./vboxconfig [sudo] password for user: vboxdrv.sh: Stopping VirtualBox services. vboxdrv.sh: Starting VirtualBox services. vboxdrv.sh: You must sign these kernel modules...
There are three steps involved in signing modules: create a Machine Owner Key enroll it sign kernel modules with it The first two steps only need to be done once, the last will need to be redone every time the modules are built. To create a MOK: openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -...
Sign Kernel Modules
1,415,303,231,000
I would like to use LZMA-compressed kernel modules on my system. Unfortunately Canoncial leaves that feature disabled both in kernel and user-space tools. Here's what I did so far: Compile and install the current 14.04.05-LTS kernel (v4.4.19) with: CONFIG_MODULE_COMPRESS=y CONFIG_MODULE_COMPRESS_XZ=y After installat...
You need to run depmod. depmod (by default) reads the modules under /lib/modules/$(uname -r), finds which symbols they export and also what they need themselves, then using these info creates the symbol (module) dependencies between modules, and saves it in the file /lib/modules/$(uname -r)/modules.dep and also create...
How to load compressed kernel modules in Ubuntu?
1,481,569,316,000
In order to troubleshoot an issue I'm looking in my kernel configuration settings for: CONFIG_SECCOMP, CONFIG_HAVE_ARCH_SECCOMP_FILTER and CONFIG_SECCOMP_FILTER. The first one is present in the kernel's config file as: CONFIG_SECCOMP=y but the other two are simply not present. This leaves me wondering how to interpret...
For boolean or tristate yes/no/module settings, missing and n are equivalent. Boolean settings correspond to a C preprocessor macro which is either defined or not. Source files check whether the macro is defined with #ifdef. If the setting is n, the macro is not defined, which is equivalent to the default state. Yes/n...
Should settings missing in a kernel's config be interpreted as `<setting>=n` or are `defaults` used?
1,481,569,316,000
I have allocated /dev/ram0: dd if=/dev/zero of=/dev/ram0 bs=1M count=1024 Now I have 1Gb sitting in memory. How do I free up the allocated space?
I believe, you can use blockdev command, which is available from util-linux package (in Debian) blockdev --flushbufs /dev/ram0 Source
How to deallocate /dev/ram0
1,481,569,316,000
When installing kernel modules, I have the option to strip out debugging symbols using INSTALL_MOD_STRIP=1. This saves significant disk space. Does it also save memory? Why should one keep the debugging symbols in the kernel modules?
Debugging symbols just add extra information to an executable that helps when running a debugger such as GDB. It lets the debugger recreate the source code from the executable to show you where things such as segfaults occur during runtime. If you are testing / hacking / making something inter-operate with the module ...
When should I keep debugging symbols in kernel modules?
1,481,569,316,000
I'm currently having to recompile my wireless driver from source every time I get a new kernel release. Thinking it would be awesomely hackerish to automate this process, I symlinked my Bash build script to /etc/kernel/postinst.d. I've verified that it does, in fact, run when the latest kernel update is installed, but...
This is no actual answer to your question, just a pointer to a tool that might be related and helpful: Do you have dkms installed? (Some information here, the alioth page seems down at the moment.) It's supposed to do just that, if I'm not misled. It requires the appropriate linux-headers package and the module/firm...
Running a script every time a new kernel is installed
1,481,569,316,000
I am interested in Linux and been digging it for a while. I just learnt to compile a Linux kernel from source and boot it with Grub which lands you with the shell of the kernel. Now as soon as the kernel is loaded into memory it searches for the init to load it. My agenda is to bring up a shell (which a normal user c...
Hmm. This should not be complicated to achieve, but it's also very complex :) You can simply do what Alexander suggested (init=/bin/bash), and you'll do fine. The init process is what the kernel calls, and it kicks off all of your userland. Login terminal included. If your init just spawns that bash terminal, you're f...
How can I make a shell to show up in my own distro (linux)? [closed]
1,481,569,316,000
I'm wondering if I can use the directory listing of /sys/module instead of lsmod to get a list of currently loaded modules. Is that the list of loaded modules only? Or maybe that combined with /sys/module/*/initstate?
Each loaded module has an entry in /sys/module. But there are also kernel components with an entry in /sys/module that are not loaded as modules. Each kernel component¹ that can be built as a module has an entry in /sys/module, whether it is compiled and loaded as a module or compiled as part of the main kernel image....
Are Modules listed under /sys/module all the Loaded Modules?
1,481,569,316,000
I am trying to build the CP210x driver for the 3.x.x kernel on ChrUbuntu. Build instructions: Ubuntu: make ( your cp210x driver ) cp cp210x.ko /lib/modules/<kernel-version>/kernel/drivers/usb/serial insmod /lib/modules/<kernel-version/kernel/drivers/usb/serial/usbserial.ko insmod cp210x.ko I started with apt-get in...
Figured out the steps to compile this kernel module. The version on the website, silabs.com is apparently too old to be used with newer kernels (3.4+). I was able to compile a newer version of the file, cp210x.c, that I found over on kernel.org for my particular version of the kernel, using the Makefile provided in th...
Ubuntu make fails with No such file or directory /lib/modules/3.4.0/build
1,481,569,316,000
I wonder why there are so many entries in modules.dep when I don't have that many drivers? I have a plain vanilla Dell Latitude E7450 running Ubuntu 16.04 and my modules.dep lists hundreds of dependencies. Are really that many necessary? All thos can't be drivers so what is it more that is implemented as a module and ...
modules.dep lists the dependencies of every single module available on your system, not just those which are in use on your system. It also lists modules which have no dependencies, which adds to its length. Distribution kernel packages typically have thousands of modules nowadays, so it’s perfectly normal for modules...
Why are there so many entries in modules.dep?
1,481,569,316,000
I'm seeing a lot of posts reference lar_disable like this one for instance. I'm wondering what it does. modinfo iwlwifi just says, parm: lar_disable:disable LAR functionality (default: N) (bool) What is "LAR functionality"?
LAR means Location Aware Regulatory I searched LAR in the source code of Linux wireless driver, only Intel use the LAR term in their code. In their code comment [1, 2, 3] mention the full form of LAR
What is iwlwifi's "lar_disable"?
1,481,569,316,000
I would like to blacklist the amdgpu driver. I opened /etc/modprobe.d/blacklist.conf and added the following line: blacklist amdgpu Then I rebooted and ran lsmod | grep amdgpu: $ lsmod | grep amdgpu amdgpu 1564672 23 i2c_algo_bit 16384 1 amdgpu ttm 98304 1 amdgpu drm_kms_...
Many modules are loaded from the initramfs, before the root filesystem is mounted. That means the initramfs contains its own copy of the modprobe configuration, so after editing, you need to update the initramfs: sudo update-initramfs -u will do that. Note that only updates the one for the current kernel—you can spec...
How to blacklist amdgpu?
1,481,569,316,000
I read in a book written by Robert Love that: Linux supports the dynamic loading of kernel modules. He said this is the difference between Linux and Unix, but I seem to recall there is also KLD in FreeBSD? So can KLD also be seen as dynamic loading of kernel modules?
KLD is indeed dynamic kernel modules. In fact, many old school Unixen also have loadable kernel modules nowadays. Your book must be quite old :)
"Linux supports the dynamic loading of kernel modules. "
1,481,569,316,000
In this post there is some explanation about why does lsmod show -2 in 'used by' column. The idea is that the kernel config option CONFIG_MODULE_UNLOAD was not set. But what if lsmod shows -1 only for one specific module while CONFIG_MODULE_UNLOAD is set in my current kernel? How to debug this muddle?
A module reference count of -1, visible both in /sys/module/<module>/refcnt and in lsmod’s output, means that the module is currently unloading. If a module’s reference count stays at -1, that indicates a problem — dmesg should tell you more.
lsmod 'used by' shows -1 while CONFIG_MODULE_UNLOAD=y
1,481,569,316,000
I'd like to add an alias to a kernel module, e.g. make nvidia-343 available as nvidia on Ubuntu 14.10 with Linux 3.18.1, so that it can be loaded under the alias name and so that the alias appear in the list of aliases in modinfo. The current level of explanation of what a kernel module alias is in the manpages of mod...
I think you know all you need to know about module aliases. Adding that line in /etc/modprobe.conf does define an alias: doesn't it work when you run modprobe <name>? It doesn't work with modinfo because that program doesn't support aliases: they're a concept of the modprobe program, not of the lower-level tools like ...
How to add an alias to a kernel module?
1,481,569,316,000
Today I changed my workstation to Debian. As Ubuntu is not nearly stable. Now I installed VMware player. I started it and got a message "Before you can run VMware, several modules must be compiled and and loaded into the running kernel. Kernel headers for version2.6.32-5-amd64 were not found" , below a field were I ca...
In order to compile kernel modules for your running kernel, you need install the kernel headers. The following command should work: apt-get install linux-headers-$(uname -r) build-essential
VMwarePlayer on debian. Missing kernel modules
1,481,569,316,000
I'm currently trying to rebuild the kernel for a proprietary device. In order to do this I will need to produce a kernel config for the device. While I could likely do this through trial and error, it would be better to see if I can extract the config from the running host. That being said the running kernel was not...
One, arguably silly, idea that comes to mind is to see if you can pull the kernel's symbol table from the image or from /proc/kallsyms or somewhere, and reverse engineer at least the included drivers based on that. Though with something like 35000 symbols shown by kallsyms on a stock distribution kernel, that would re...
What are methods for recovering a Linux Kernel config?
1,481,569,316,000
I have a USB Linux Kernel module that compiles and builds. Running insmod loads my module and dmseg and tail -f /var/log/debug shows me it works as expected. Running depmod -a then modprobe from the terminal loads the module and modprobe -r unloads and I see - tail -f /var/log/debug output as expected. When I plug in...
You are missing with usb_register and probe functions Here is updated device driver with usb_register and probe functions #include <linux/module.h> #include <linux/kernel.h> #include <linux/usb.h> #include <linux/usb/input.h> #include <linux/hid.h> MODULE_LICENSE("GPL"); MODULE_AUTHOR("Aruna Hewapathirane"); MODULE_...
usb kernel module does not load on demand but works fine with insmod and modprobe from the shell
1,481,569,316,000
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?
From a debugging perspective, the kernel is a special "process", distinct from the user space processes, which communicate with the kernel via a sort of rpc mechanism (syscalls) or mapped memory.. I don't think you can see the kernel's data structure simply by inspecting some random user process. Another problem is,...
How to debug an inserted kernel module?
1,481,569,316,000
I just tried to extract EDID file data with read-edid util; The thing is the output shows : $sudo get-edid | decode-edid ... Manufacturer: AUO Model 20ec Serial Number 0 Made week 0 of 2013 EDID version: 1.4 Digital display 6 bits per primary color channel Digital interface is not defined Maximum image size: 34 cm x...
77MHz is the pixel clock, not the vertical refresh rate. The vertical refresh rate is measured in Hz, not MHz. Take a look at the mode: Clock 77.000 MHz, 344 mm x 193 mm 1366 1382 1398 1628 hborder 0 768 771 785 788 vborder 0 1366 is the number of "active" pixels per line, and 768 is the number of "acti...
EDID - detect proper DPI and refresh rate values
1,481,569,316,000
Suppose I called kmalloc and didn't free that memory before rmmod was called on the module, what happens to that memory? Is it a memory leak and it is completely unusable until restart, or does the kernel free that memory automatically? thanks
It won't be freed until explicitly done. Memory allocated with kmalloc() needs to be freed using kfree(). That piece of memory stays till the system is on. [...] didn't free that memory before rmmod was called on the module [...] When you do rmmod, module_exit() will be executed where you can free the memory incase...
What happens to memory that wasn't freed in a kernel module after unloading?
1,481,569,316,000
I installed Ubuntu 14.04 on my new Lenovo G50-70. The wifi works perfectly in windows, however it behaves strangely on Ubuntu. It is slow, doesn't load heavier sites at all, and after a while, completely drops. After some research I discovered: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1320070 sudo rmmod rt...
Upgrading my kernel from 3.13 to 3.16 (http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.16-utopic/) and reinstalling the new driver from https://github.com/lwfinger/rtlwifi_new seems to have solved my problems. Don't forget to reboot. Note: Upgrading the kernel in itself did not help.
rtl8723be Realtek Wifi-Card driver not working on Ubuntu 14.04
1,481,569,316,000
I was making (my first) kernel module to play with the gpio pins of my pandaboard and interrupts. Already "built-in", I noticed you can do (briefly) cd /sys/class/gpio echo 138 > export # a file gpio138 appears echo out > gpio138/direction echo 1 > gpio138/value to turn some voltage high or low on connector pins...
1) What handles /sys/class/gpio ? A kernel module ? a driver ? It's a kernel interface similar to the /proc directory. 2) is it possible to have more complicated module parameters in a kernel module, with some directory structure ? Like a 'delays' directory containing the params for delays Yes; some things in /pro...
Kernel module parameters vs /sys/class/... explanation
1,481,569,316,000
Background I occasionally have firewall rules that I need to use for maintenance windows, but don't want active (and therefore consuming CPU cycles or slowing the network interface) the rest of the time. I add the rules when I need them, and then want to wipe the slate clean and stop iptables from counting packets and...
You can't unless you patch the kernel. And you have better things to do. The counters are incremented __nf_ct_refresh_acct if the parameter do_acct is nonzero. This function is called through two wrappers: nf_ct_refresh_acct, which increments the counters, and nf_ct_refresh, which doesn't. The choice of wrapper is mad...
How can I prevent iptables from counting bytes and packets on empty chains?
1,481,569,316,000
I write a kernel module which has initialize and end function. I want one more function and want to call it from the user space process at any time i want. Is it applicable ? If so, how ? I am working on CentOS 5.2 and custom kernel, patched from linux 2.6.18. EDIT: To make clear, I want to write a function into ker...
Doing a kernel module that can use the /proc filesystem sounds like it might work for you. IBM developerWorks has an article on that topic. I worked through the code a few years ago, and it worked back then. The article is dated 2006, and seems to apply to Linux 2.6 kernels. The problem I can foresee with using "file...
kernel module function call
1,481,569,316,000
I'd like to load some additional modules at boot. This works fine from the command line: modprobe -a i2c-dev modprobe -a snd-soc-pcm512x modprobe -a snd-soc-wm8804 But I want this done at boot. I've tried creating /etc/modules, /etc/modprobe.conf and /etc/modprobe.d/i2c-dev.conf, etc. with the module name in there, b...
Couldn't find many polished and ready scripts. Turns out that Linux From Scratch (LFS) had some scripts that look good and are easy to use. My solution to loading modules for a plain BusyBox init: /etc/init.d/S02modules #!/bin/sh ######################################################################## # # Description ...
(Buildroot) How to load modules automatically
1,481,569,316,000
I'm trying to enable the kernel persistent storage (pstore) in order to help debug a module which malfunctions and freezes my laptop on suspend, but I'm having difficulties doing so. My kernel (4.1.20) config with related parameters is # gunzip -c /proc/config.gz | grep PSTORE CONFIG_CHROMEOS_PSTORE=m CONFIG_PSTORE=y ...
You need to determine a piece of memory that survives a reboot. Then it's probably the easiest approach to pass that via kernel parameters, see the ramoops Documentation in the kernel tree.
How to enable kernel pstore?
1,481,569,316,000
On a running linux system, what is a portable (among linux distributions) way to find out what filesystems the current kernel has compiled-in (not through modules) support for? Consider for example my current Ubuntu x86_64 kernel: 3.11.0-24-generic #41-Ubuntu. It has for instance no /proc/config.gz, which would be my ...
Is is as simple as comparing /proc/filesystems with lsmod? No: $ comm -31 <(lsmod | awk 'NR!=1 {print $1}' |sort) \ <(</proc/filesystems awk '{print $NF}' |sort) | fmt anon_inodefs autofs bdev cgroup cpuset debugfs devpts devtmpfs ext2 ext3 fuseblk fusectl hugetlbfs mqueue nfs4 pipefs proc pstore ramfs ro...
How do I find out what filesystem drivers are compiled-in into the linux kernel?
1,597,753,776,000
Why isn't the Linux module API backward compatible? I'm frustrated to find updated drivers after updating the Linux kernel. I have a wireless adapter that needs a proprietary driver, but the manufacturer has discontinued this device about 7 years ago. As the code is very old and was written for Linux 2.6.0.0, it doesn...
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 happ...
Why Linux module API isn't backward compatible?
1,597,753,776,000
I read the post here and I tried to make do with what I understood from the post but here are some questions: Where is the /lib/firmware located in for example /usr/src/linux/lib/firmware or /usr/lib/firmware or elsewhere? Could I use a pre-build EDID in that address the post gave and tweak it with an editor like Gvi...
Where is /lib/firmware? The final resting place for your EDID mode firmware should be under /lib/firmware/edid. However, many linux distributions place the example EDID mode-setting firmware source and the Makefile under the directory for the linux kernel documentation. For Fedora, this is provided by the kernel-doc...
How to make EDID
1,597,753,776,000
I installed VirtualBox, in the first run i got this warning: WARNING: The vboxdrv kernel module is not loaded. Either there is no module available for the current kernel (3.10.0-327.4.4.el7.x86_64) or it failed to load. Please recompile the kernel module and install it by sud...
I hit the same issue today after upgrading to 5.0.14 (I am on Ubuntu 15.10, using the official Virtualbox apt repo) I fixed it with: sudo /usr/lib/virtualbox/vboxdrv.sh setup
VirtualBox Kernel Module Installing Issue
1,597,753,776,000
I have installed a PCI card with two serial and one parallel port on it. the chipset is MCS9865. I downloaded the latest driver(V1.0.12) from here. I ran make and make install. now the two serial ports are /dev/ttyD0 and /dev/ttyD1. I have tested them with picocom and it is working perfectly. the problem is that when ...
The way this normally works is: The module source code contains calls to the MODULE_DEVICE_TABLE macro to declare a table of device identifiers that this module supports. In the compiled module, the aliases are stored as values of symbols called __mod_alias_NNN where the NNN are integers. The value encodes the bus id...
Debian does not detect serial PCI card after reboot
1,597,753,776,000
I just started learning about netfilter and I was trying to make a simple netfilter module, all the tutorials and HOW TOs register a hook function with nf_register_hook(), but I could not find one in linux kernels above 4.13-rc1. As far as I understand, the nf_register_hook() function used to call the _nf_register_hoo...
Use the following code: #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0) nf_register_net_hook(&init_net, reg) #else nf_register_hook(reg) #endif Reference: init_net
nf_register_hook not found in linux kernel 4.13-rc2 and later
1,597,753,776,000
So I had this problem with my new Lenovo ThinkPad 13 where it did not resume from suspension and hibernation. After 2 days of troubleshooting I found out that apparently a module called intel_lpss_pci is causing the problem. When I disable it, everything works fine. I'm not exactly sure what it is used for too, as eve...
The proper file is: /etc/modprobe.d/blacklist.conf (notice the extension .conf). And at the end of this file put a line: blacklist intel_lpss_pci
How do I disable a kernel module persistently?
1,597,753,776,000
I'm trying to read DDR4 RAM SPD data with the new ee1004 driver. I thought that after modprobe ee1004 I would be able to read data from /sys/bus/i2c/drivers/ee1004, however thats not the case (no devices appeared there). Am I missing something? I'm running Ubuntu 19.04 with Kernel 5.0.0-13. Contents of ee1004 director...
I was able to find solution thanks to RafDouglas. The trick is to manually set i2c addresses to ee1004 driver. Follow these instructions https://www.spinics.net/lists/linux-i2c/msg32331.html (start at "First you must find out the i2c bus number of your motherboard's SMBus ...")
How to read DDR4 SPD with ee1004 driver?
1,597,753,776,000
When I run lsmod or sudo lsmod, I get an error that says: libkmod: ERROR ../libkmod/libkmod-module.c:1655 kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory Error: could not get list of modules: No such file or directory I searched on a lot of forums but am unable to find a solution ...
In both cases, you’re trying to interact with the kernel. Any Linux environment running on WSL isn’t running a Linux kernel, it’s running on the Windows kernel; so anything tied to the Linux kernel (including modules and system controls) won’t work. In the IPv6 case, you need to configure the network using Win...
lsmod gives error: "could not get list of modules" on Debian running on WSL
1,597,753,776,000
I downloaded the sources for my kernel, applied a patch and rebuilt it and now I have a kernel module that, when I try to insmod, complains "Unknown symbol in module" with dmesg giving the error "disagrees about the version of symbol ...". Without having to hunt down the source for this module and rebuild it against m...
insmod isn't the best tool to load modules - use modprobe instead, it's smarter. In modprobe's man page, you'll find that it has a --force option which might load a module with conflicting version information. As you said, this is dangerous and should essentially never be used. You pick up the pieces if your system bl...
possible to load kernel module that "disagrees about version of symbol"
1,597,753,776,000
This is on the Linux OS. I see that on some machines the net.bridge.bridge-nf-call-iptables variable doesn't exist until I modprobe the br_netfilter filter. I also see that there are some machines where the bridge module is loaded and that itself brings in this variable. Is there a way to know which module I should lo...
There's no automatic database relating sysctl variables to modules. You can search the module binary and hope that the variable name isn't found in other strings (this one isn't). Search for the last part, i.e. bridge-nf-call-iptables — the full string isn't present in the binary, it's constructed dynamically. grep -r...
Kernel module for net.bridge.bridge-nf-call-iptables
1,597,753,776,000
Is there a neat way of stripping the Linux kernel to only support the devices that are currently in use. After NVIDIA complaining about GCC version mismatch, I decided to recompile the kernel with the current version of GCC. Now, since it is known which modules the current kernel actually uses, can I automatically gen...
That's what make localmodconfig is for. Excerpt from /usr/src/linux/README: "make localmodconfig" Create a config based on current config and loaded modules (lsmod). Disables any module option that is not needed for the loaded modules.
Recompile kernel without modules that are not currently in use
1,597,753,776,000
I have put a vendor supplied embedded Linux installation (called X-Linux) onto a hardware device. I ran lsmod to see what modules are loaded and nothing at all is shown. Also there is no /proc/modules directory on the system. What does this mean? Does it mean that no drivers are loaded to communicate with the rest of ...
This just means that the drivers are compiled directly into the kernel and that the kernel does not have module support. If you know exactly your target system and the purpose you don't necessarily need module support.
lsmod returns nothing on my embedded device
1,597,753,776,000
I'm working on building a kernel module for an input device, and I noticed that in the module source, there's a couple calls to input_get_keycode(data->input_dev, scancode, &keycode); When I was compiling I was getting errors that there's no function with that prototype. Looking into the input/input.c source code, thi...
If you are working on a kernel module, I very much recommend that you get a git tree. Obviously Linus's tree is mandatory - I also get the stable trees. Since you are working on Ubuntu, I'd check to see if they have a tree with their changes you can pull from. Using the git tree, I was able to checkout master and run ...
Changes to input_get_keycode function in linux kernel (input/input.c)
1,597,753,776,000
I have very little experience with kernel module development. Despite this I have been tasked with maintaining an old driver for a Sensoray 626 DAQ card. I am using a very simple dkms setup to build and install the driver which has been working well for a long time. The driver has been working in Ubuntu 22.04 until re...
It appears that the problem is that the Makefile (which was written by the original developers) sets the CC make variable, thus preventing DKMS from properly overriding the compiler using a CC environment variable. This potential problem is described by this bug report. Since in my case the Makefile only uses the CC m...
Unrecognized command-line option ‘-ftrivial-auto-var-init=zero’ when building kernel module
1,597,753,776,000
It might be a incoherent question about kernel headers as I don't have clear understanding about it and where and how it is used. I think it might get flagged down. My question has 3 parts: I think Kernel headers provide a interface so that other part of the kernel, like modules, can use them. That's my bookish knowl...
Welcome to Unix & Linux StackExchange! Yes, the kernel headers provide an interface for other parts of the kernel - in this you're entirely correct. They also include definitions for the interface between the kernel and the userspace - but usually the "raw" kernel interface is not used directly, but through the C libr...
What is kernel headers that can be used in userspace? Do their signature or interface differ than the headers in different directories?
1,597,753,776,000
I am writing a small simple driver module for a LED badge. I followed a couple of tutorials and references to do the job. All of them seem to imply that the module will be automatically loaded when the device is plugged in. However, when I run usb-devices the corresponding device has driver Driver=usbfs. I have anothe...
Have you placed your module in the /lib/modules/<your kernel version> directory tree and run depmod after that? If so, then in the /lib/modules/<your kernel version>/modules.alias file should be a line like this: alias usb:v0483p5750d*dc*dsc*dp*ic*isc*ip*in* ledbadge When the kernel sees a new USB device, it reads it...
How to load my custom driver module on USB device connected?
1,597,753,776,000
I would like to emulate an USB from an image file. I am using Centos7 with the Kernel 4.11.7 installed through kernel-ml and kernel-ml-devel elrepo 4.11.7-1.el7.elrepo.x86_64 (actually I tried with 3.10.* 4.10.* 4.11.1 too) We have 2 solutions: with insmod sudo insmod /link/to/g_mass_storage.ko file=/tmp/filebin.img ...
You need the dummy_hcd dummy (loopback) host controller device. The gadget USB drivers are meant for real USB hardware, and on normal PCs this hardware doesn't exist. The loopback controller provides both the framework for the gadget controller, and a USB host controller to access them. So: $ sudo modprobe dummy_hcd ...
Emulating usb device with a file using g_mass_storage => udc-core: couldn't find an available UDC - added [g_mass_storage] to list of pending drivers
1,597,753,776,000
One way is to create listening socket for some protocol, and module for that protocol will be loaded. For example, DCCP and SCTP. Are there other ways? UPD: Use case: virtual machine somewhere in AWS/Azure/... An attacker got local unprivileged user shell. No hardware changes can be done by unprivileged used. There is...
Many file-system drivers are implemented as kernel modules and will be loaded on demand, either because of user mounts or by the automount daemon. Additionally there is whole range of hot-plug devices where plugging them in will result in the kernel loading the required kernel module to manage them, with USB periphera...
What are ways in Linux for non-root user to trigger kernel module loading
1,597,753,776,000
There is a file version.h in /usr/include/linux. Many header files include this file and use the defines in there for their own ifdefs. However, when I compile my own kernel, I cannot see how this can possibly be reflected correctly in e.g. version.h. Actually this holds for all kernel-related header files. AFAICS /...
When configuring a system against your own custom kernel, I would suggest adding a name to the current version in your modified kernel sources. For instance, in Armbian they create their own kernel packages, and add a -sunxi to kernel.release. Takin as an example modifying the 4.6.3 kernel version: root@ruir:/usr/src/...
How to compile against a custom kernel (Debian)?
1,597,753,776,000
I have pre-compiled kernel 3.16.7 which has btusb v0.6 module; The current btusb v0.6 I'd like to replace with btusb v0.7 which is located in kernel 4.0; So my question is how to : remove the current btusb 0.6 from kernel 3.16.7 extract btusb 0.7 from kernel 4.0 (compile it) insert the compiled btusb 7.0 to kernel 3...
You should be able to download the source code with wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.16.7.tar.xz Then you need to extract it tar xpvf linux-3.16.7.tar.xz Then cd into the correct directory cd linux-3.16.7/drivers/bluetooth When you post the result of lsusb I should be able to finish this a...
bluetooth - btusb - How to replace module version with a newer one
1,597,753,776,000
I'm attempting to upgrade and test kernel 3.12. What is the most efficient way to identify out-of-tree modules that should be removed before testing? There are a few mentioned (vitualbox, nvidia, fglrx, bcmwl), but is there a way to identify installed modules that are considered out-of-tree?
After discovering that the Ubuntu wiki I am using is referring to external modules, it was easier to find a solution by rtfm. Summary of external modules install paths External modules are installed with modules_install at /lib/modules/$(KERNELRELEASE)/extra/ by default. When installing external modules elsewhere,...
Identify out of tree modules?
1,597,753,776,000
I removed kernel modules installed with rpm using yum remove kmodname. The *.ko was located under /lib/modules/$(uname -r)/extra/. I run depmod -a and I get depmod: ERROR: fstatat(4, kmodname.ko.xz): No such file or directory How can I force depmod to update its database?
Most likely you have symlinks, probably under one of your kernels' weak-modules, pointing at modules that have been deleted.
Why does depmod keep trying to load deleted modules
1,597,753,776,000
I just got an ASUS N13 USB wireless dongle, and unfortunately it's not detected and I can't load it with modprobe: $ sudo modprobe rt2800usb WARNING: All config files need .conf: /etc/modprobe.d/blacklist, it will be ignored in a future release. WARNING: Error inserting rt2x00usb (/lib/modules/3.0.0-14-generic/kernel/...
There's very little bandwidth for communication between the kernel and insmod or modprobe: the kernel can only choose from a small set of error codes. You'll find more information on what went wrong in the kernel logs; try the dmesg command or look in /var/log/kern.log. The most common issue is a kernel module that is...
Can't insert rt2800usb module: Invalid argument
1,597,753,776,000
I don't have any IDE drives and my only SATA hard drive is running in AHCI mode, but my initrd image loads the pata_atiixp module. Is it safe to disable this module? And what about the ata_generic one?
To answer the first question: Yes But anyway, it should be easy to generate a backup entry in your boot manager (with the original initrd and working kernel), in case something goes wrong. To answer the second one - you can use $ lsmod Module Size Used by ... On your running systems to see, if ata_g...
Do I need pata_atiixp or ata_generic kernel modules on a SATA only system?
1,597,753,776,000
My understanding of this is fairly minimal so bear with me. From what I gather so far, the i2c subsystem on Linux identifies devices that are attached, and then matches them against loaded driver modules somehow. Where it identifies a match, it calls that driver's probe function which actually kicks off the driver set...
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...
How does the i2c subsystem match devices against drivers?
1,597,753,776,000
I am trying to access SD cards on Fedora 28, but do not have any success. System info is as follows: $ lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch Distrib...
All in all both card readers I tested were faulty. However, please refer to this answer if you can eliminate hardware-related issues.
Unable to access/(auto)-mount SD card on Fedora 28
1,597,753,776,000
Context : sometimes my laptop won't go to sleep mode with the error Freezing of tasks failed after 20.008 seconds (0 tasks refusing to freeze, wq_busy=1) I know this is an indication that a workqueue is misbehaving (https://askubuntu.com/questions/692700/what-does-wq-busy-1-indicate-in-a-failure-to-suspend) and after...
You cannot force-kill kernel code if it doesn't want to be killed. Kernel code can't be killed at arbitrary times because it might be in the middle of accessing a peripheral, it might hold a lock, it might have allocated some resources that need to be freed… Userland code can be killed because the kernel holds all the...
Unload unresponsive kernel module
1,597,753,776,000
I have a development board which has an older version of Linux installed on it. The vendor supplies an image for the device with a heavily modified linux kernel, some loadable kernel modules, and some example software. I would like to install a newer version of the linux kernel on the device, but the vendor has no sup...
This question has a lot of assumptions in it. Here are some reasons. The kernel interface is not stable so a module for one version may not compile for a different version. The kernel may not expose a required facility. The kernel may expose a required facility but not in a way that is acceptable, for example requirin...
Why modify the linux kernel instead of creating a kernel module?
1,597,753,776,000
I just compiled the qcserial module which is a driver module for a Gobi USB modem. Now I have a couple of questions. Now I have two files: drivers/usb/serial/qcserial.ko and drivers/usb/serial/qcserial.o which one is the correct driver? Also, as I understand, it will need to go into /lib/modules/3.11.6/kernel/drivers...
You'll need to create a kernel package (make tar-pkg). Then copy it to your ARM system, for example to /tmp and extract to /. You'll get all driver modules installed into correct folders including proper modules.dep and other files needed to automatically resolve module dependencies. modprobe qcserial should be workin...
How can I load a module at runtime?
1,597,753,776,000
From here: http://www.xenomai.org/index.php/RTnet:Installation_%26_Testing#Debugging_RTnet The Linux driver for the real-time network device was built into the kernel and blocks the hardware. When I execute rmmod 8139too it says the module does not exist in /proc/modules. Kernel is 2.6.38.8 (64 bit). What other in...
rmmod 8139too doesn't work because either: 8139 support is built into the kernel, and the driver can't be unloaded because it's not a module. On many systems, there's a /boot/config-2.6.38.8 file (or similar). You can grep it for something like ‘8139TOO’. If you see something like CONFIG_8139TOO=m, then the 8139too d...
How to know whether the Linux driver for the real-time network device was built into the kernel?
1,597,753,776,000
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 chang...
The Arch Wiki page on CPU frequency scaling suggests a couple of different ways to make changes performed in cpupower persistent. One of those, as you mentioned, is adding a kernel module. But there are other simpler options that should be easier. The simpler is just to enable cpufreq's systemd service, as suggested ...
Making cpupower changes persistent
1,597,753,776,000
I recently secure-booted Arch and Fedora on my RTX3050 equipped laptop. As is the common knowledge, I had to sign my Nvidia modules on Fedora for the kernel to load them. However, I find that same is not the case with Arch. Arch loads the Nvidia modules even if they are not signed — provided, of course, that the kerne...
As you discovered, this is enforced by CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOOT. That setting is supported by a kernel patch which hasn’t been merged upstream; you’ll find it in Fedora and RHEL kernels but not in Arch. Since it hasn’t been merged upstream, you won’t find it in the upstream kernel documentation, or on any o...
How come Fedora ignores `module.sig_enforce` kernel parameter if SB is enabled but Arch does not?
1,597,753,776,000
I was wondering if someone has any info about how to implement a link layer portocol which uses the GPIOs (for example in a Raspberry Pi). The idea is to implement a custom interface (similar to eth0) which would be point-to-point and when a message is sent through that interface instead of calling the ethernet modul...
Assuming it's sufficient for your protocol to control the GPIO pins from userspace via /sys/class/gpio/, the simplest way is to write a userspace tap driver. From the kernel documentation linux/Documentation/networking/tuntap.txt: TUN/TAP provides packet reception and transmission for user space programs. It can b...
Custom link layer protocol in UNIX [closed]
1,597,753,776,000
I am upgrading my Fedora OS to the latest version 20 as the current one is nearing end of life. Fedora introduces a new upgrade method called FedUp that allows user to perform an upgrade over the network. I followed the instructions in there and everything went smoothly with no errors in the fedup log: # fedup --netwo...
Use the latest fedup available for your distro. Check updates-testing for updates. yum --enablerepo=updates-testing upgrade fedup Don't try to jump over releases. Use standard distro kernel. Re-enable SELinux if you disabled it. Don't ignore fedup warnings. I just upgraded two Fedora 19 systems to Fedora 20. One...
FedUp, unable to upgrade to Fedora 20
1,631,655,996,000
I recently updated from the 4.9 kernel to 4.14 only to find my speakers have a constant buzzing sound. I've narrowed the problem down to the power_save parameter of the snd_hda_intel module. When enabled there is a constant buzz, but disabled (set to 0) it is silent. I've attempted to set the value by using both a mod...
I’ve confirmed that TLP (version 1,0) is at fault here. It’s detecting the batteries of my two peripheral devices by scanning the contents of /sys/class/power_supply. Since it detects devices powered by battery and no devices powered by mains, it is incorrectly thinking the system is battery powered. The detection loo...
Unable to set kernel module parameters
1,631,655,996,000
So I've been debugging a hairy suspend-to-ram issue, where I get Oct 12 15:41:23 arjundesktop dbus[2863]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' Oct 12 15:41:23 arjundesktop systemd[1]: Reached target Sleep. Oct 12 15:41:23 arjund...
I have no real answers, but I changed my graphics card from an AMD 7950 to a AMD Vega 64. Now suspend to ram works fine on the amdgpu driver, so I suspect it was a graphics driver issue.
Debugging a suspend to ram issue with PM_TRACE
1,631,655,996,000
I'm using a box with Debian that has gone through many updates (at least lenny, squeeze, wheezy). After a long time, I wanted to mount a floppy again which didn't work as it used to. I found a tutorial explaining I had to comment out the line about /dev/fd0 in /etc/fstab because the floppy module was dropped from the ...
As unsatisfying as it is, I can not any more reproduce what I have mentioned in my question. Mounting the floppy works well either way now. The only thing I have done was to edit the formatting of /etc/fstab, i.e. I have put tabs where spaces were and I may have modified some line breaks. I have tried to undo the edit...
Why do I need to comment out the floppy in /etc/fstab in new-ish Debian versions?
1,631,655,996,000
i'm running Ubuntu 16.04 LTS and want to use an apple keyboard (wired). No i'm facing some problems whith making my custom settings permanent. I'm using the 'English internationl, AltGr dead keys' layout. The keyboard has some keys swapped and i set the settings manually in the /sys/module/hid_apple/parameters/ folde...
It appears that you can create /etc/modprobe.d/hid_apple.conf and add the entries you need fixing in there, such as, options hid_apple fnmode=2 NB: This assumes the hid_apple module is already being loaded.
Make Apple Keyboard Settings persistent in ../hid_apple/parameters/
1,631,655,996,000
I understand that you can write custom udev rules to create a symlink in /dev directory. But what is the use of having a symlink in /dev? What is the symlink linking to? I know you can interact with regular links in the /dev directory but not understanding what a symlink does. ACTION=="add", SUBSYSTEM=="usb", ATTRS{id...
Typically it's to give a known fixed pathname to access the device; /dev/mydevice is fixed but depending on the order things are plugged in it might be /dev/ttyUSB0 or /dev/ttyUSB1 or /dev/ttyUSB2 or... This can be useful for devices which can present multiple endpoints; eg I have a USB HUBZ device that presents zigbe...
What's the reason to add a symlink to /dev directory with udev rules?
1,631,655,996,000
I would be interested in finding ways to reduce the boot time, specially in embedded-related environments. I've read somewhere of a method to avoid the kernel to load some drivers or modules but I'm completely lost and all the information I find on internet is quite complex and dense. Could anyone please suggest the g...
The arch linux documentation Improving performance/Boot process may help you to learn how to improve the boot performance. Use systemd-analyze blame to check the timing for the enabled services, or systemd-analyze critical-chain to check the critical points then disable the unwanted services through systemctl disable ...
Reduce Boot time
1,631,655,996,000
I have to demonstrate a practical where I have to make my own module, add this module to a kernel's source and implement the system call. I'm using 3.16 kernel on Ubuntu but it takes around 2 hours to install the kernel from source. Is it possible to remove some part of kernel(like unnecessary drivers,etc) from the so...
As mentioned in comments, you should be building using something like make -j4. Use a number equal or slightly higher than the number of CPU cores you have. make localmodconfig The following instructions apply to building a kernel from upstream. Personally I find that simplest. I don't know how to obtain a tree wit...
Saving time while compiling Kernel
1,631,655,996,000
I have compiled a kernel with some modules, for example the ath9k for my wireless card. I don't have anything in the autoload configuration (i.e my file /etc/modules.autoload.d/kernel-2.6 is empty). However, lsmod still shows that the module has been loaded. I also notice that when I compile filesystem support as modu...
Udev loads modules automatically depending on what kind of hardware it finds. You can "blacklist" modules in order to stop them being autoloaded as described in the Gentoo udev guide.
who loaded my kernel modules?
1,631,655,996,000
Many of my modules are missing /sys/module/*/parameters directory and I can't check the module loaded parameters. # printf "%s\n" /sys/module/*/parameters | wc -l 125 # lsmod | wc -l 151 # comm -13 <(printf "%s\n" /sys/module/*/parameters | xargs dirname | xargs basename -a | sort) <(lsmod | awk '{print $1}' | sort) |...
In order for modules to have their parameters visible in /sys/module/*/parameters, the module needs to provide a module_param_cb() callback function for each parameter. Those functions will have to "know where to look" for the current setting of the respective parameter, so the sysfs filesystem driver can use them to ...
modules are missing /sys/module/*/parameters directories, how to enable them?
1,631,655,996,000
I am trying to find out what kernel modules are loaded inside a OpenVZ virtual server. Command lsmod is empty and I believe the reason is the way how OpenVZ's virtualisation is working. Specifically, I like to know if the inotify module is loaded. I have only access to the guest system.
As far as I understand, OpenVZ guests share the host's kernel and all loaded modules. Guests and are not allowed to load modules into the host's kernel, consequently lsmod shows an empty list. Apparently it is not possible to show what modules are loaded into the host's kernel, without access to the host.
How to show loaded kernel modules inside OpenVZ virtual server
1,631,655,996,000
I'm curious: What, exactly are the benefits to statically linking modules into the kernel rather than loading through rc.conf, etc? For example: To add Linux emulation, I could add linux_enable="YES" to /etc/rc.conf, or I could link it into the kernel by adding options COMPAT_LINUX to my kernel config. Is there actual...
Statically linking used to be the only way to load a module which is think is the primary reason to having options like COMPAT_LINUX. Also, prior to loader, it used to be the only way to load modules necessary to get FreeBSD to get the necessary drivers to mount the root file system and boot FreeBSD. Nowadays, I don...
Difference between rc.conf, loader.conf and static kernel linking in FreeBSD
1,631,655,996,000
Hi there Linux experts! I'm trying to find the best way possible to control and stress a PCI device. I've started off with writing a simple bash script that uses the commands from pciutils (lspci & setpci) to configure the device and create traffic on the bus While the scripts work just fine, their execution speed s...
There is a huge amount of overhead in the shell calling external commands to do anything. Fork/exec has a relatively high overhead. Just moving from a shell script to a userspace C program using the API directly (instead of by calling CLI utilities) will be a huge speedup. Also easier than writing a kernel module. If ...
PCI hardware access speeds - Kernel vs user space [closed]