date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,436,080,480,000
The Linux kernel documentation page for building external modules (https://www.kernel.org/doc/Documentation/kbuild/modules.txt) says this: === 2. How to Build External Modules To build external modules, you must have a prebuilt kernel available that contains the configuration and header files used in the build. ...
ad 1. and 2. The kernel image is called vmlinux, that's right, but that's not what you actually need when you want to build external modules. It's the configuration and header files from this kernel that is needed. ad 3. To build modules, internal or external, you need support for loadable modules in this kernel, you ...
Some questions regarding linux kernel external module build process
1,436,080,480,000
I'm trying to figure out at which point in the boot up process /dev/kmsg gets initialized and can thus be written. On my system the first line that occurs in dmesg is printk(KERN_INFO "Initializing cgroup subsys %s\n", ss->name); from kernel/cgroup.c. I tried to trace backwards and search the kernel but I didn't find ...
The /dev/kmsg represeted by the kmsg_fops structure which has file_operations type that represents standard operations with a file: const struct file_operations kmsg_fops = { .open = devkmsg_open, .read = devkmsg_read, .write_iter = devkmsg_write, .llseek = devkmsg_llseek, .poll = devkmsg_poll, ...
Where in the kernel /dev/kmsg gets initialized?
1,436,080,480,000
I'm trying to understand some kernel level concepts in Linux. I was checking on the difference between shell builtin commands and the other executable commands. This wonderful answer clearly tells the difference and also specifies the need for shell builtin commands. Now I know that using type <command-name>, I could...
Because pwd or echo have external commands with the same name, /bin/pwd or /bin/echo. If you look at strace output, you can see: $ strace pwd execve("/bin/pwd", ["pwd"], [/* 68 vars */]) = 0 brk(0) = 0x241e000 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directo...
strace works for some builtin commands
1,436,080,480,000
I'm connected via SSH to a PC running Linux kernel 3.11.1: root@alix:~# uname -r 3.11.1 how can I find out which package installed this specific file or kernel version respectively? I tried root@alix:/boot# dpkg -S vmlinuz-3.11.1 dpkg-query: no path found matching pattern *vmlinuz-3.11.1* Other installed kernel ver...
You can list every installed package with dpkg -l and filter through the results with grep for the kernel packages dpkg -l | grep 'linux-image' dpkg -l | grep 'linux-image' | grep '3.11' To find the kernel headers package for your running kernel: apt-cache search linux-headers-`uname -r`
Debian: get package name for installed file
1,436,080,480,000
I downloaded, configured and installed kernel downloaded from kernel.org. While booting up this new kernel for the first time, this error screen shows which is pointing towards a missing or wrongly mentioned root device probably. But I didn't mention it explicitly, installation scripts did it. So if this is the error,...
Found it!!! It was the drivers for my hard disk controller, SATA AHCI was not added while configuring kernel before compilation. Now I added, recompiled and viola! new installed kernel booted up. :)
Newly compiled kernel not booting up (vanilla kernel 3.12.14)
1,436,080,480,000
When a process requires actions that require kernel mode, it uses a system call. So, how are the results returned to the process?
NOTE: ALL THE BELOW INFORMATION IS FROM THE REFERENCED SITE From this link, I found the below information. A system call is an interface between a user-space application and a service that the kernel provides. Because the service is provided in the kernel, a direct call cannot be performed; instead, you must use a pr...
Result from kernel returned to what process?
1,436,080,480,000
GRUB2 doesn't have the menu.lst file. How do I configure a boot script. During boot, I hit E on the kernel image that I want to modify and make my modifications. But I would prefer to make the modifications in /grub.d/ folder and then run update-grub command. Basically, I am including certain modules at boot time, usi...
The main config file is /boot/grub/grub.cfg. As it says at the top: DO NOT EDIT THIS FILE It is automatically generated by grub-mkconfig using templates from /etc/grub.d and settings from /etc/default/grub As you can see, /boot/grub/grub.cfg is generated by files from /etc/grub.d. As mentioned in /etc/grub.d/README,...
GRUB2 Insert additional kernel modules
1,436,080,480,000
I'm trying to loop mount my root filesystem (a loop file) within a busybox initramfs. I try to run the command: mount /rootfs.raw /root ... which works on my Ubuntu laptop, however, I simply get mount: mounting /dev/loop0 on /root failed: Invalid argument No matter what combination of options I use, (including loading...
In order to solve this problem, I had to be more verbose about my mounting command. I ended up using: modprobe loop mount -t iso9660 -o loop /bootpart/rootfs.raw /root This worked properly.
busybox initramfs loop mount
1,436,080,480,000
First the link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1060268 Since this affects the kernel and other Distros, what does this type of error mean and why it happens?
When your PC has more than 4 GB of memory, but has also some devices that support only 32-bit addresses, any I/O from or to these devices must be mapped to somewhere in the low 4 GB range. Typically, a range of 64 MB is allocated for this. "Out of SW-IOMMU space" means that either you are doing so much I/O that you n...
What does "DMA: Out of SW-IOMMU space" error mean?
1,436,080,480,000
Is it necessary to enable CONFIG_USB_OHCI_HCD on a system that has USB 2.0 port only ? I'm not sure those devices present , e.g bluetooth , camera use that driver ? Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 8087:...
Yes, is is needed to have one of OHCI_HCD (Open Host Controller Interface) or UHCI_HCD (Universal Host Controller Driver) depending on your USB controller hardware. The driver responsible for USB 2.0 communication is EHCI_HCD (Enhanced Host Controller Interface); but EHCI controllers are packaged with "companion" host...
Is it necessary to enable CONFIG_USB_OHCI_HCD , when there's only USB 2.0 ports
1,436,080,480,000
In linux or a library for linux, is there an equivalent to critical section in win32? I am aware of Mutex, but it is not the same as critical section since a critical section uses user-mode spinlock and an event object internally, and it is must be faster than mutex.
If you want something coming from kernel space, then you might want to look at semaphores (sem_overview(7)). You can built higher level constructs from a semaphore, like "event", "condition", "mutex" ("critical sections"). There are the older and newer interfaces in C. Some higher level languages like Python and Pe...
critical section for linux
1,436,080,480,000
I have to program a realtime application on Linux, but don't know whether the standard installation of Ubuntu has CONFIG_HIGH_RES_TIMERS enabled. How can I check this? I'm using Ubuntu 11.04 64bit.
Ubuntu ships the kernel configuration in /boot/config-$version (in the same package as the kernel image /boot/vmlinuz-$version). You can check this file on a live system, or you can download it from the Ubuntu website. There are several images to choose from; the default under amd64 is -generic, and you can download t...
How to check if CONFIG_HIGH_RES_TIMERS enable?
1,436,080,480,000
Which happens the most, context switches or mode switches? I have two answers myself, but I do not know which one is correct: Context switches happen in user mode, but this does not mean that a system call is needed; therefore, mode changes do not happen when a context switch occurs. Context switches mean a dispatch...
A context switch between processes always involves entering supervisor mode at the processor level. The scheduler needs to access the process table and the next process's memory map, both of which are not accessible to the old process and therefore require privilege elevation; and then the scheduler needs to point the...
What happens the most, context switches or mode switches?
1,436,080,480,000
I'm trying to compile a Linux Kernel to run light and paravirtualized on XenServer 5.6 fp1. I'm using the guide given here: http://www.mad-hacking.net/documentation/linux/deployment/xen/pv-guest-basics.xml But I'm stumped when I reached the option CONFIG_COMPAT_VDSO. Where is it exactly in make menuconfig? The site in...
As you had already said, it IS under "Processor Types and Features". You are compiling Gentoo's hardened kernel source, so the code would have undergone many patches. A quick search in Google returned this: Gentoo kernel VDSO. It looks like Gentoo has it disabled even several versions before. Why don't you download di...
Where is CONFIG_COMPAT_VDSO in make menuconfig?
1,436,080,480,000
I used zen kernel patchset for a long time which included tp_smapi patch. Recently in zen-stable tp_smapi was removed as "We no longer need tp_smapi as of 2.6.36 - the in-kernel thinkpad acpi support is better.". How to port following code to in-kernel thinkpad acpi: echo 40 > /sys/devices/platform/smapi/BAT0/start_ch...
It might not be possible. At least there is nothing in the documentation of thinkpad-acpi, nothing in the release notes, nothing in the thinkpad-acpi thinkwiki page and no mentioning of tp_smapi being obsolete in the tp_smapi thinkwiki page.
Migrating from tp_smapi to 'normal' ACPI support in 2.6.36
1,436,080,480,000
In https://stackoverflow.com/questions/39614772/how-to-know-the-linux-kernel-run-either-el2-non-secure-or-el3-secure-mode, I saw in recent arm64 linux, the kernel runs at EL2 not EL1. Recently I'm doing linux port on a test board using u-boot-spl falcon mode. There too, when the CPU hardware started from EL3, the linu...
When we use u-boot as bootloader, (I think it will be the same if we do it using UEFI and grub, or arm reference design) the bootloader runs at EL3 and at the final code sets the elr (address to return to from the exception handling) to the entry address of linux. It then executes eret which makes it jump to linux add...
in arm64 linux, when linux is to be run in EL2 (bootloader in EL3), do I have to set something for this during kernel build?
1,436,080,480,000
On CentOS 7.X I use the following command to clean up unused old kernel: package-cleanup --oldkernels --count=1 But it no longer works on CentOS 8.X, does anyone know the correct command?
Have you tried this? dnf remove --oldinstallonly --setopt installonly_limit=1 Alternatively, you can do 1. rpm -qa kernel // lists kernels 2. rpm -e kernel_name // on which kernel you want to remove This should also automatically remove grub entries for you.
Remove old kernels on CentOS 8
1,436,080,480,000
I generally get how the whole major/minor device number thing works for a given device (though please correct me if I'm way off here), and how a major device number essentially relates to a class of device (be that a block device or character device/character special), while the minor number relates to a specific type...
On my system, /proc is 6h, and /dev is 5h. A quick test: # for x in a b c d e f g h i j; do mkdir $x; mount -t tmpfs tmpfs $x; done # stat */. gave numbers 33h to 3dh with 35h missing from the middle (it was used by /run/user/1000/gvfs). Seems like just dynamic allocation with the first free number used at mount time...
How are minor device numbers assigned for unnamed/non-device mounts (major number 0)?
1,436,080,480,000
is it possible to run xfs repair by re-edit the fstab file? /dev/mapper/vg-linux_root / xfs defaults 0 0 UUID=7de1dc5c-b605-4a6f-bdf1-f1e869f6ffb9 /boot xfs defaults 0 0 /dev/mapper/vg-linux_var /var xfs defaults 0 0 /dev/mapper/vg-linux_swap...
No, just editing /etc/fstab cannot cause xfs_repair to be executed. For other filesystem types, it would work. But XFS is special here. Changing the 6th field of /etc/fstab to a non-zero value on a XFS filesystem will cause the system to run fsck.xfs, whose man page says: NAME fsck.xfs - do nothing, successfull...
repair file system by edit the fstab file
1,436,080,480,000
I want to disable swap on several running ubuntu 16.04 servers. I'd like, if possible, not to reboot them. From my research, it seemed that running swapoff -a to disable swap until the next reboot and commenting the swap line in /etc/fstab to persist after the next reboot should do the job. However, it seems that t...
The disks were using GPT, and this was due to GPT partition automounting: On a GPT partitioned disk systemd-gpt-auto-generator(8) will mount partitions following the Discoverable Partitions Specification, thus they can be omitted from fstab. Another page of the same documentation explains how to disable this: Star...
Can't disable swap on a GPT-based system
1,436,080,480,000
UPDATED (see below) After installing the usbip package on client and server, loading the kernel modules on both, I started usbipd on the server: sudo usbipd usbipd: info: starting usbipd (usbip-utils 2.0)EDIT: I found better instructions here: https://github.com/torvalds/linux/tree/master/tools/usb/usbip client: sudo...
Anytime I've had that error it has been due to a usbip-utils version mismatch between the client and server. Check both by executing usbip version which should return something along the lines of usbip (usbip-utils 2.0)
usbip error open vhci driver
1,436,080,480,000
I have a VERY simple Ubuntu 16 x64 VM setup on my ESXi host which acts as a fileserver. It has NFS/SMB and MDADM installed. It is fully updated. Twice in the last week it has hung with an error about “rcu_sched detected stalls on CPUs and something about not enough jiffies. I took a screen shot this time, but its so...
TLDR; About a Week Later I lost a CPU Core likely due to overheating/badly placed heatsink/fan. If you are using ESXi I would fire up another OS and check on Temp's and/or consider re-seating your CPU heat sink. This post has got a lot of views, and when I had the issue, google had very little information for me. Ple...
“rcu_sched detected stalls on CPUs/tasks” - jiffies - ESXi Ubuntu 16 FileServer Guest
1,436,080,480,000
How can I boot the linux rootfs from u-boot passing rootfs partition by label ? I'm using u-boot as bootloader and the card is a RedPitaya. The linux is a customized Linux based on the stable ubuntu image available for the card. U-boot is flashed in the sd card's first partition with the linux kernel and the device tr...
The problem is that LABEL and UUID handling is not done by the Linux Kernel but is done via an initramfs, which you would need to provide as well. If you want to bypass that you need to use PARTUUID which is something that via the part command, U-Boot can determine for you and pass along.
Pass root file system by label to linux kernel
1,436,080,480,000
I need to create a test that would check if the driver for a specific device was a kernel module(as opposed to statically linked). Is there a way to know this information at run time? Thanks!
lsmod will list the currently loaded kernel modules. So, if a driver is not listed there then it was either built-in to the kernel or it isn't loaded. Most distributions should have a config file stored in their /boot directory, which contains the kernel configuration options that were used. If you were to download an...
Is there a way to know at runtime if a driver is a kernel module or if it was statically linked?
1,436,080,480,000
I have a zpool (3x 3TB Western Digital Red) that I scrub weekly for errors that comes up OK, but I have a recurring error in my syslog: Jul 23 14:00:41 server kernel: [1199443.374677] ata2.00: exception Emask 0x0 SAct 0xe000000 SErr 0x0 action 0x0 Jul 23 14:00:41 server kernel: [1199443.374738] ata2.00: irq_stat 0x400...
In the end, it's your data, so you would be the one to say whether the drive should be replaced or not. In the end, it's just spinning rust. Though, I should point out that it appears you've created a cat/RAID0 pool, so if a drive fails, you'll lose everything. And without a mirror, ZFS is unable to repair any faile...
ZFS - "Add. Sense: Unrecovered read error - auto reallocate failed" in syslog, but SMART data looks OK
1,436,080,480,000
I wanted to update my system (Slackware current) which was in multilib. Before updating, I tried to remove all packages (compat32 and multilib). Big mistake !!! This have broken some crucial symlinks and give me now a kernel panic when i trie to boot it. I have tried several methods, including this one But it does not...
since you can't boot your system, you need some other medium - cd or usb. there is no other magic way to boot unbootable system. basically what you have to do is: boot your machine (slackware installer). mount your partitions and chroot to system / dir. install packages you removed (download them from some slackware ...
Linux Slackware ( Broken - kernel panic )
1,451,799,439,000
This is my first attempt at compiling a Kernel. I have a fresh minamalist Debian Jessie installation, I then... sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils sudo apt-get install kernel-package Obtained Kernel cd /mnt/local/btrfs_a/Kernel\ Downloads/ wget https://www.kernel.org/pub/linux/ker...
Looks like the issue may have been a space in the folder structure the kernel files were located in. After I removed the space, it was fine!
Problems compiling Kernel 4.2 Under Debian Linux (Jessie)
1,451,799,439,000
I install the Linux kernel source code RPM: [root@localhost ~]# rpm -ivh kernel-3.10.0-229.el7.src.rpm warning: kernel-3.10.0-229.el7.src.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY Updating / installing... 1:kernel-3.10.0-229.el7 ################################# [100%] warning: user b...
Source packages are not added to the rpm database, so they will not show on query. Probable location is ~/rpmbuild/{SOURCES,SPECS} with SOURCES containing the package sources and distribution patches while the SPECS subdirectory containing the .spec file being used to build the package (see rpmbuild (8) man page for d...
Where is the RHEL7 kernel source code installed?
1,451,799,439,000
The "How to Build External Modules" section of the kernel.org kbuild documentation ( https://www.kernel.org/doc/Documentation/kbuild/modules.txt ) says: To build external modules, you must have a prebuilt kernel available that contains the configuration and header files used in the build. Also, the kernel must ha...
It's an alternative to "using a distribution [...] package", which is synonymous with having "the configuration and header files" available. You should include a .config before you do this. Most distro kernels have this available in /proc/config.gz; copy that into the top of the source tree and gunzip -c config.gz >...
linux kernel module building prerequisites
1,451,799,439,000
I'm trying to use a new usb wireless interface (atheros ar9271) and my onboard wireless (intel 6200) is interfering with it. The goal is for me to be able to turn the rf kill switch on (enabling wireless, that is) so that I can use the external wireless adapter, and not have the onboard wireless show up at all. I al...
On Linux, you can find out which driver a network interface is using with this command: ls -l /sys/class/net/<interface name>/device/driver You can rmmod that unless it is statically linked into the running kernel (not likely for a distribution kernel and a wireless driver). Watch out for any other interfaces using t...
How do I completely remove a wireless interface (and re-add it)?
1,451,799,439,000
I have an embedded Linux system with unencrypted kernel image and initramfs in NAND flash. My RootFS is in SD card. I want to encrypted some files on SD Card as my SD card is easily accessible physically. For this I am planing to use eCryptfs. But I want to keep the keys inside NAND flash in kernel image or initramfs....
If you didn't have an initramfs, you could do it with kernel parameters. Just add a random string as kernel parameter and then use /proc/cmdline as the key for your encryption. If it's not easy to add such parameters to your boot loader, the Linux kernel has a CMDLINE config option that lets you compile it in. (Note: ...
eCryptfs key in kernel image or initramfs
1,451,799,439,000
... ... ... --> Running transaction check ---> Package db4-devel.x86_64 0:4.7.25-18.el6_4 will be installed --> Processing Dependency: db4-cxx = 4.7.25-18.el6_4 for package: db4-devel-4.7.25-18.el6_4.x86_64 --> Processing Dependency: libdb_cxx-4.7.so()(64bit) for package: db4-devel-4.7.25-18.el6_4.x86_...
The solution is to remove vzkernel-firmware package: rpm -e vzkernel-firmware and exclude it by adding the line marked in bold to openvz yum repo file /etc/yum.repos.d/openvz.repo: [openvz-kernel-rhel6] name=OpenVZ RHEL6-based kernel #baseurl=http://download.openvz.org/kernel/branches/rhel6-2.6.32/current/ mirrorlis...
YUM won't update KERNEL
1,451,799,439,000
I'm currently working on a project. There's an Ubuntu Linux system installed on a disk, DA, mounting the other disk, DB. What it requires is that DB can be only mounted by DA in order to prevent data stealing. I planned to use encryption tools provided by Ubuntu to encrypt the whole disk DB. Other Linux won't be able ...
To answer the question in your title: how to fake a filesystem that cannot be mounted by others? Write random data. It's a fake filesystem and nobody will be able to mount it. To answer the question you're asking: sure, you can fake a filesystem this way, but it's equally trivial to un-fake. Others can definitely moun...
How to fake a filesystem that cannot be mounted by others
1,451,799,439,000
I'm a gentoo user. When compiling the kernel there are a lot of options which one may enable depending on one's hardware. My question is how to know what to enable/disable, I'm aware of the hardware I'm using (processor instruction set, number of cores, etc./ motherboard NB and SB/sata drives, etc.) but still don't ha...
I found this document which explains exactly what I was looking for, I hope it's useful for some of you http://www.linuxtopia.org/online_books/linux_kernel/kernel_configuration/ch08s02.html Read the entire document, it's full of nice things, specially this: When the topic of this book was first presented to me, I di...
How to know what to enable in the kernel?
1,451,799,439,000
I run docky which is programmed with mono so I think the binfmt is running correctly, but proc-sys-fs-binfmt_misc.automount complains about it, since I don't have /proc/sys/fs/binfmt_misc/CLR I already have CONFIG_BINFMT_MISC=y in my kernel config.
/proc/sys/fs/binfmt_misc/CLR gets created by the kernel when you register a binary format that you've named "CLR". Are you able to register one manually? echo ':CLR:M::MZ::/usr/bin/mono:' | sudo tee /proc/sys/fs/binfmt_misc/register If this works, then the solution is probably that you should add a file in /etc/binfm...
No /proc/sys/fs/binfmt_misc/CLR on my system?
1,451,799,439,000
I upgraded the kernel on my OpenSUSE 12.1 64bit from 3.1.9 to 3.2.9, and when I rebooted, X-windows refused to start, and I got into shell. I tried to run it manually with startx, but still no good. I managed to make X-windows work by removing the NVidia driver(I had the latest version). When I tried to reinstall it, ...
There is a solution which will surely do the job, but it might be painful. Compile and install the kernel you need with GCC 4.5, and then install the NVidia driver. It would be hard because compiling an own kernel is almost never easy, even if configfile is reachable. Possibly your system contains components which nee...
NVidia driver for the 3.2.9 kernel
1,451,799,439,000
I've got an old Logitech USB gamepad that worked well under both Windows and Mac OS X. That is, the gamepad was totally "plug and play" for games run by a Super Nintendo emulator (SNES9X). Does Linux support such gamepads out of the box? Or any other controller for that matter? Thanks.
Yes - they're recognised as an input device and you should be able to see information about it with "lsusb".
Linux kernel support for USB gamepads?
1,451,799,439,000
I am working on a C program which gets the timestamping information for a given network interface, like my own version of ethtool. My goal is to get the information printed by $ ethtool -T myNetIf. Something like: Time stamping parameters for myNetIf: Capabilities: hardware-transmit (SOF_TIMESTAMPING_TX_HARDWA...
This is embarrassing: I have reviewed my code and found that I did fail to properly initialize a struct, just not in quite the way I expected. I also didn't provide the full context needed to solve the problem, since I thought I had ruled out the possibility of junk values left over from before allocation. The sample ...
How does the Linux Kernel store hardware TX and RX filter modes?
1,451,799,439,000
I am trying to figure out how to disable bounce buffers used in IOMMU when the hardware IOMMU is used. To give more context, when IOMMU_DEFAULT_DMA_STRICT is set in the kernel it enables strict IOTLB invalidations on page unmap. Also, it uses an "additional layer of bounce-buffering". Reference: config IOMMU_DEFAULT_D...
I asked the kernel developers the same question and am posting the answer here if anyone else has the same question (relevant kernel mail thread). There is no kernel boot option or config option to enable or disable IOMMU SW bounce buffers. SW bounce buffers are internally enabled for any untrusted PCI device. Linux k...
How to disable/enable bounce-buffers in IOMMU?
1,451,799,439,000
I'm using Ubuntu 20.04 LTS Server and re-complied whole kernel with my patches. Now at the stage of installing it, but when I runs sudo make install I'm seeing following error, root@localhost:/home/linux-5.4# sudo make install sh ./arch/x86/boot/install.sh 5.4.0 arch/x86/boot/bzImage \ System.map "/boot" run-p...
I went with installing Kernel first then ran make clean, then proceed with installing Modules. This approach saves the needed space.
Error 24 : Write error : cannot write compressed block
1,451,799,439,000
My situation is virtually the same as this post on serverfault. To summarize: I have a really simple C++ app that uses a hash-map to count and merge a number of large files. I reserve memory with with std::unordered_map::reserve() before filling it and start iterating. At about 60Gb of memory used (the system has 378G...
I'm not certain what is the modern C++ way of doing it, but you might want to look into mlock(2) to disable swapping for memory pages. I'm also somewhat curious as to what happens if you rerun it immediately. I would expect the reserve call you use do not actually touch all memory pages (and thus do not force them to ...
Large memory allocations cause kernel to swap even though more than enough memory is free
1,451,799,439,000
I am following this document I struggle to wrap my head around file descriptors and how I could read data from one, process it and then send to another. As a server I need to be able to accept connections, receive data, process it and then pass it to another client. I have been introduced to epolling yesterday and I w...
Ok, guys. I have come to a conclusion for my question: it depends. It depends on the application. I studied some benchmarks for epoll only/multithread only/ epoll with worker threads. I concluded that I will use epoll with worker threads for my project because that makes the most sense: epoll_wait is the fastest fd ch...
Communication between two file descriptors (clients)
1,451,799,439,000
I have olddevice mounted to /mnt with: $ mount olddevice /mnt I would like to change the device at /mnt mount point. For this purpose, I simply mount newdevice on top of it: $ mount newdevice /mnt With that, processes that still have file descriptors on olddevice can keeps working on old device, but new processes us...
If you are not already running with mount propagation enabled e.g. as per systemd defaults, run this first: mount --make-rshared / Then: mkdir /root.orig mount --rbind / /root.orig mount --make-rprivate /root.orig/mnt mount newdevice /mnt ... umount -R /root.orig/mnt # instead of umount olddevice Then safely dis...
How to unmount device from a path hidden by another mounted device?
1,451,799,439,000
I am using kernel 4.14.24 from kernel.org on a KARO-TX6Q and an ADV7182 on a custom board. With the kernel 4.1.15 from KARO git, I used the adv7180_tvin driver modified to work with adv7182. This driver does not use the media_controller system and directly creates a /dev/videoX entry. Since a new software update, the...
The media controller needs to have both two IPU activated. Solved by adding in dts : &ipu2 { status = "okay"; };
IMX6 ADV7180 : no /dev/media0
1,451,799,439,000
In linux kernel source, some header files and directories are located directly at /include, but some others are located at /include/linux. Why they just don't put everything into /include? What is the difference between /include and /include/linux?
But not only linux/, also uapi/ and asm-generic/ are special dirs inside of include. This generic "include" dir is heterogenous -- include/linux is the kernel itself: half of the 40MB of include/. K&R "C" notes at the end of the chapter: "...for a much larger program more organization and more headers would be needed...
/include vs /include/linux in kernel source tree
1,451,799,439,000
I am running tar in the background, eg: tar xfvz large_file.tar.gz & It does extract my file, but when I then launch du -h, du, df or df -h, the output remains the same, and I have to wait few minutes for it to refresh. Is there any workaround? That's not really a problem, I am asking this for my own Unix culture ...
Probably the data has not actually been written to disk yet but is still in the page cache ("dirty pages"). Check with grep Dirty /proc/meminfo You can try to run sync before df/du. That should force any data in the page cache to be written to disk.
Why are du -h / du / df / df -h not refreshing when extracting a large file
1,451,799,439,000
command rpm -qa | grep kernel output kernel-3.10.0-514.16.1.el7.x86_64 kernel-tools-libs-3.10.0-514.16.1.el7.x86_64 kernel-headers-3.10.0-862.9.1.el7.x86_64 kernel-devel-3.10.0-862.9.1.el7.x86_64 kernel-tools-3.10.0-514.16.1.el7.x86_64 command uname -r output 3.10.0-514.16.1.el7.x86_64 trying to install match...
To install Kernel devels run: yum install kernel-devel-3.10.0-514.16.1.el7.x86_64 OR yum install kernel-devel-$(uname -r) To install Kernel headers run: yum install kernel-headers-3.10.0-514.16.1.el7.x86_64 OR yum install kernel-headers-$(uname -r)
kernel headers and kernel devel
1,451,799,439,000
Folks, there's something I fail to understand: I've got a laptop with 4 GB of RAM, running a 32 bit, PAE-enabled Linux kernel. The system is powered by an AMD APU with integrated graphics which, as far as I can tell, takes its graphics memory from system memory. Now, in my dmesg, I see this: Memory: 3574156K/3638392K ...
I knew I had read about this years abog, but I had to take a trip on the wayback machine to find this: https://web.archive.org/web/20130513093456/http://kerneltrap.org/node/2450 Not sure if it directly answers your question, but it might help. I barely grok some of it myself.
Linux kernel: LOWMEM + HIGHMEM > Total memory?
1,451,799,439,000
Main question: How to get the absolute finger position on the touchpad? I would like to get the absolute position (x, y coordinates) of a finger on a touchpad? I believe it is possible to extract it from the synaptics-family source code. Subquestion: How to get the synaptics.h header? I am trying to get synaptics.h s...
I didn't manage to get the synaptics.h header however I found the way to get the position (x y coordinates) of a finger on a touchpad. The software is called evtest and the source code can be found here for example. There is a single evtest.c file and it is quite easy to modify it and extract the absolute finger posit...
How to get the absolute position (x, y coordinates) of a finger on a touchpad?
1,451,799,439,000
When a physical interface status is changed from up to down, there are 3 things related to the computer's current routing table and OSPF. The (connected) network for that interface and remote networks that are routed via that (connected) network are removed from the computer's routing table. OSPF neighbors on that (c...
Depending on operating system -- via routing socket (BSD family) or netlink socket (Linux). Very brief overview of available kernel interfaces is in GNU Quagga's documentation.
How do kernel inform OSPF daemon when a physical interface status is down?
1,352,768,351,000
I got a Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz CPU here , not sure which module should be enabled for EDAC: Chipset: Inter Coporation 6 Series/C2000 , driver in use: i801_smbus
The right answer is Sandy Bridge, after digging a bit in Intel's site.
Which edac module should I enable here?
1,352,768,351,000
I am trying to use PCI-X1 capture card (intensiy pro) using Ubuntu 10.04 (now) / 11.04 (failed) or Fedora (failed). None of them is yet capturing. I did my best but now i need some backup on this. Question: Do you know what is causing my capture/input as "Frame received (#0) - No input signal detected"? Where i have a...
Your PS3 is probably putting out an HDCP-protected video signal. The HDMI licensing authority requires that lossless conversion and transmission products like the BlackMagic Intensity refuse to work unless the downstream element also obeys HDCP. Since this test program doesn't have an HDCP key and your hard disk isn't...
How to capture from instensive pro in Ubuntu, Fedora, CentOS using HDMI interface?
1,352,768,351,000
I was trying to bring up my custom kernel. I did the following : $ make menuconfig && make modules && make modules_install && make install I would like to change the install PATH. How can i do that? I tried doing $ export INSTALL_PATH=<my custom path> But then it is only creating vmlinux.bin (it is not creatin...
Yup, I found where is that install path. It is inside /sbin. The script file name is installkernel. Just need to make a couple of changes in there and i could change the default install path of my Linux source(which was /boot).
How to change the install path of my Linux Source tree?
1,352,768,351,000
I have some doubts about setting the policy of a thread and how that policy is going to be followed while it is executing. Pthread allows setting the scheduling policy of a thread to SCHED_FIFO/SCHED_RR/SCHED_OTHER. I am trying to understand how this user-set-policy works as the Linux kernel uses CFS as the default sc...
A/ BASIC THEORY 3: CFS is not the default "scheduler policy" under Linux. CFS is the default scheduler under linux. A scheduler chooses among all existing threads those to which cpu time should be granted. This choice is governed by miscellaneous parameters that are taken into account differently depending on the sche...
Scheduling policy of a POSIX thread Vs kernel's Completely Fair Scheduler when the thread is actually executing
1,492,192,042,000
Kernel EFI stub loader support was added in kernel 3.3, but I'm stuck on 3.2 running an Ubuntu 12.04 64bit distribution. Is there a way for me to somehow bring that stub loader support into my kernel?
I ended up simply installing a later kernel. You'd be surprised how easy this is. Simply searching packages.ubuntu.com for kernel packages allowed me to find the packages I needed. I needed to install essentially linux-image-3.X.*, linux-image-extra-3.X.*, and linux-headers-3.X.*. Posting from a nice, shiny EFI-bootin...
Installing the kernel EFI stub loader in kernel 3.2?
1,492,192,042,000
I have successfully built both libfreenect (driver for Xbox Kinect) and libusb (which is a dependency). However, if I try to open the Kinect using the freenect_init(...) function, it returns -99. I tracked down the error to the funtion libusb_init(...) which is returning this error, LIBUSB_ERROR_OTHER. As I use a min...
libusb requires that the VFS usbfs is mounted. After adding the following line to /etc/fstab the problem was solved: usbfs /proc/bus/usb usbfs defaults 0 0
libusb_init() returns -99
1,492,192,042,000
I can't seem to shutdown my machine from mandriva,I have to restart to shut it down from GRUB it says "System Halted" and just freezes there I'm using the x86_64 GNOME version I've already asked on mandriva forums and they couldn't determine the cause of this problem P.S. I'm using the 2.6.36.2-desktop-2mnb kernel
It turns out that the cause of the problem was ACPI,it was switched off turning it back on solved the problem :) just in case somebody has a similar issue
Can't shutdown mandriva 2010.2
1,492,192,042,000
Reading one of Stephen's excellent replies, I was wondering what differences are between When the operating system shuts down. ... and When the kernel shuts down, ... (... I’m considering that the variant which uses an external command to shut down isn’t the kernel) ? Is "the variant which uses an external command...
He seems to be noting a difference between the kernel itself, and the rest of the operating system, the user-space constructs built on top of the kernel. When you shut down the system with /sbin/reboot or equivalent (which in turn calls systemd or some init scripts or something), it does more than just ask the kernel...
What is the difference between "when the operating system shuts down" and "when the kernel shuts down"?
1,492,192,042,000
Currently I am playing with the idea of a jvm running in the kernel space, as a (maybe linux) kernel module. I see a lot of advantage of the idea. Of course the biggest advantage of a such system were the major simplification of the kernel space development. But it happened because different aspects: 1) every java dev...
I think this would be a very big project, since you would need a JVM implementation written in C with custom parts using the kernel API. The openjdk hotspot is apparently 250K+ LOC in C and C++. Note you cannot use C++ with the linux kernel. Methinks that could work out to a number of person-years to implement. It'...
Porting jvm into the kernel space?
1,492,192,042,000
If not, what do they use. Please provide a source.
Some of the OpenSolaris 10 source code is publicly available, and yes, kmem uses a slab allocator in that release. See kmem.c, the comments describe the allocator in some detail. (Illumos uses the same allocator.) Looking at the Debugging With the Kernel Memory Allocator pages from the Oracle Solaris Modular Debugger ...
Do Solaris 10 and 11 still use slab allocation for their kernel memory allocator
1,561,650,454,000
I'm reading through the documentation for Linux Wireless Extensions, linked in a related question. It says: /proc/net/wireless is designed to give some wireless specific statistics on each wireless interface in the system. This entry is in fact a clone of /proc/net/dev which gives the standard driver statistics...
This entry is in fact a clone of /proc/net/dev which gives the standard driver statistics. is an over-simplification. The comment in the code implementing /proc/net/wireless is more accurate: This interface is a pure clone of /proc/net/dev (in net/core/dev.c). The content of the file is basically the content of...
How is /proc/net/wireless a "clone" of /proc/net/dev?
1,561,650,454,000
I am about to install a patch for wireless drivers named Compat Wireless in order to solve a problem with my WiFi channel (it locks on the not existing -1 channel) on my Ubuntu Linux v12.04 and Kali Linux v1.0.9. But first I would like to know if this patch is already installed (why installing something I do have?)....
Has a patch already been applied to my Linux kernel? If one is comfortable enough with Linux to be applying a patch, as this questioner appears to be, then checking if the patch is already in the default kernel is relatively simple: Just check the source code. Use the Source, Luke!¹ The following should work for any d...
How can I check if a certain patch is already installed in my system?
1,561,650,454,000
So if n processes are sharing a library L with size M then the contribution to their PSS is M/n. Now imagine one of the process terminates. So the contribution would be M/(n-1). Q1: My question is how soon is this change reflected in the PSS values of processes still running and using the shared library? Q2: As a triv...
The change is reflected immediately. There is no caching along the way. When you read /proc/<pid>/smaps, you actually trigger a traversal of that process's page table. Information about the mappings is accumulated along the way, then displayed, without any caching. The code behind the /proc/<pid>/smaps file is in fs/p...
How often is PSS value updated for a given process in /proc/pid/smaps
1,561,650,454,000
Let's say I have a file which I want to query on demand to check which process is currently accessing is (opened). Going through all PIDs in /proc/{PID}/fd seems resource intensive, Is there any alternative way to accomplish the same?
There are tools to do it for you: fuser (just outputs the PIDs) and lsof (lots of options and fancy output). Going through all PIDs in /proc/{PID}/fd seems resource intensive It's the only way anyway on Linux. There's no system call to query which processes have a file open. But don't do it yourself — if only becaus...
What is most efficient way to get the PID of the process that is using a file on Linux
1,561,650,454,000
How can I manually create a Linux kernel module dependency? For example, at some point in time module vboxdrv gets loaded automatically. BUT, when this happends I also want to automatically load module vfat (just as example). Thus, how can I create a dependecy, when module 1 gets loaded, it triggers automatic load of ...
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 dependencie...
Create Linux module dependency for autoloading module
1,561,650,454,000
Say, I have custom kernel from my distribution, how could I get list of all options the kernel was build with? It's possible to get them by reading config file from kernel package from vendor's repo, but is there any other way? I mean ways to get that information form the kernel itself, maybe from procfs?
In addition to what @Stephen Kitt said, at least on my Debian system you can find the information in: /boot/config-<version> Where version, in my case, is: 3.16.0-4-686-pae So, issuing: less /boot/config-3.16.0-4-686-pae Spits out the kernel configs in a long list!
How to determine the options Linux kernel was build with? [duplicate]
1,561,650,454,000
Is there any way to cause a kernel panic under Linux? I've heard of echo c > /proc/sysrq-trigger but it seems to just freeze, and I'm not sure it's a kernel panic. Is there any C program I can run as root to cause a kernel panic?
using kill I think you could try the following: $ kill -6 1 This sends signal # 6 to process #1 (the init process). If you read up in the signals man page: "man 7 signals": Signal Value Action Comment ------------------------------------------------------------------------- SIGHUP 1 Te...
Intentional kernel panic under Linux?
1,561,650,454,000
From my understanding, BIOS 1) initializes HW and 2) jumps to a location and loads a boot loader into RAM. When the BIOS does the initialization of HW, it must be running some routines (i.e. setting proper register bits, delays, etc...). The questions I'm asking is if those BIOS routines are: Are BIOS routines called...
It depends. In most cases, the kernel drives hardware directly, without going through the system firmware; but it does rely on firmware-provided functions in some cases (e.g. through ACPI). The original PC BIOS was written in assembly language (the source code was included in IBM’s technical reference manuals). Curr...
Does the Linux Kernel access HW through BIOS, or does it directly interface with the HW?
1,561,650,454,000
I am not an electrician, so I am not sure how to ask this, whether I need to refer to voltage, or watts, or something out. In lamens terms, I am wondering how much electricity is currently being fed to my laptop through my charging adapter. The reason why I want to know this is because sometimes my laptop internal bat...
There are several tools for checking the power status of your computer. You can try installing upower if you haven't got it already. Then run: upower -e This will display the detected devices. Then run the information mode on the battery according to the device you have available: upower -i /org/freedesktop/UPower/de...
Find out how much electricity is being fed through my charging adapter?
1,561,650,454,000
I am currently reading Linux Kernel Development by Robert Love. In the chapter "15 The Process Address Space" he prints the memory map of a process. user@machine:~$ pmap 1424 #all the processes mapped memory (skipped for readability) bfffe000 (8KB) rwxp (0:00 0) [ stack ] The last line shows the stack ...
That information is outdated, and the stack is typically not executable any more: 00007ffd884fa000 356K rw--- [ stack ] GCC needs an executable stack if it generates trampolines for nested function calls. These trampolines are small pieces of code generated at runtime, and stored on the stack — so if they are us...
Why must the stack VMA be executable?
1,561,650,454,000
I need to update the kernel from version 2.6.30 to 2.6.37. I'm going to just compile the kernel and kernel modules for this architecture and boot it. But also there are a lot of packages installed, and I would like to know if I have to update all of them also for the newer kernel, or can I update only some of them whi...
2.6.37 is quite old, so you should really be asking yourself if that's what you want. The age also means that many people have probably forgotten how much change happened at that time (I know I have), but those versions are close enough, and both 2.6, so I guess there were no API/ABI-changes, and that means it should ...
Updating kernel but not packages
1,561,650,454,000
I know there are solution for not rebooting after kernel update: https://en.wikipedia.org/wiki/Ksplice But If Ksplice isn't installed, and the user doesn't reboots it's notebook after even several kernel updates (so notebook running for even months). Could there be a problem about it? (not counting that an update pro...
It won't affect the kernel itself (besides not taking advantage of the update). However, some newly installed programs might rely on newer kernel features. Also, if you run a program that relies on loading a kernel module then you may find that that module is no longer installed, and newly installed modules won't load...
Could it cause any problem if I not reboot after a kernel upgrade?
1,561,650,454,000
We know a program is a process (ex: gedit, ssh....etc ). How about kernel and driver? are they individual processes? ex: A process running kernel code. B process running driver foo.
In Unix-style contexts, some people think of the kernel as “process 0” (coming before process 1, init). However that’s not really accurate, notably because kernels aren’t scheduled in the same way as processes. Unix-style kernels, in general, only run in response to some event. These events come under two or three maj...
kernel code is a dedicated process running?
1,561,650,454,000
Containers share the machine’s OS system kernel https://www.docker.com/resources/what-container/ If container's share the machine's OS system kernel, is it true that there isn't a kernel included in Docker base images of Linux like Debian or Alpine? Can the rootfs builds used in these base images be used in environm...
is it true that there isn't a kernel included in Docker base images of Linux like Debian or Alpine? That's typically true. As your reference to alpine shows, they are based on the mini root filesystem which do not contain a kernel. Can the rootfs builds used in these base images be used in environments other than ...
Can the Linux base images for Docker containers be used in environments other than Docker?
1,561,650,454,000
on our rhel machine ( production server ) we noticed that lastlog is huge we not want to interrupt the OS logs that always wrote to log but we want to clear the lastlog is it ok to clear the lastlog as echo > /var/log/lastlog second how is it possible to disable writing to lastlog as permanent?
Lastlog does not report its size correctly in ls and is often not very large at all. If you are checking its size make sure to either run ls -s or use du. I believe lastlog is what is called a sparse file. ls without the -s flag is reporting the apparent size of the file instead of the actual size. Most likely you do ...
how to clear the lastlog file without interruption
1,561,650,454,000
I've gone to upgrade my machine as I do every day and I've received the following errors: $ sudo apt-get update && sudo apt-get upgrade Hit:1 http://ftp.uk.debian.org/debian buster InRelease Hit:2 http://security.debian.org/debian-security buster/updates InRelease Hit:3 h...
You can free up some space by deleting the 4.9 kernel: sudo apt purge linux-image-4.9.0-11-amd64
Errors when trying to upgrade Linux kernel
1,561,650,454,000
Suppose I have 10 process such as : process p0 with PID 1. process p1 with PID 2. process p2 with PID 3. process p3 with PID 4. process p4 with PID 5. process p5 with PID 6. process p6 with PID 7. process p7 with PID 8. process p8 with PID 9. process p9 with PID 10. When I kill a process, such as : kill 7 and proces...
PIDs aren’t reused as soon as they’re freed because doing so results in races, and ultimately, bugs which can sometimes be used to evade security restrictions (see these examples of Android security bugs caused by PID races). If PIDs are reused, then processes which hold a PID for whatever reason (e.g., to send a sign...
PID and incremental aproach
1,561,650,454,000
I wanted to migrate to CentOS 7.5 from CentOS 6.9. during installation I saw an option kdump that i could enable or disable. I wonder what is kdump and disabling it has any bad effect on server? I want to install database on my server later I just want to make sure that kdump cause no problem.
kdump is a kernel crash dumping mechanism. In the event of a system crash, kdump produces a crash dump of the kernel that can be used for further analysis. Depending upon the severity of the failure, this crash dump may be the only information available for further analysis. In the event of a system crash, kdump work...
kdump in CentOS 7
1,561,650,454,000
In my journal I see the following a few times a day: kernel: wlp2s0: failed to remove key (1, ff:ff:ff:ff:ff:ff) from hardware (-22) lspci reports: 02:00.0 Network controller: Intel Corporation Wireless 8260 (rev 3a) My kernel version is 4.14.15-1-MANJARO.
Kernel Bug 198357 - iwlwifi: failed to remove key (1, ff:ff:ff:ff:ff:ff) from hardware (-22) lists the issue as: CLOSED CODE_FIX Kernel Version: 4.15.0-rc6-00048-ge1915c8195b3 Regression: Yes My hope is that this will be made available to earlier maintained kernel versions in the near future.
kernel: wlp2s0: failed to remove key (1, ff:ff:ff:ff:ff:ff) from hardware (-22)
1,561,650,454,000
I read through the docs of man proc. When it comes to the overcommit_memory, the heuristics in overcommit_memory=0 isn't understood well. What the heuristics actually mean? does "calls of mmap(2) with MAP_NORESERVE are not checked" mean that the Kernel only allocate virtual memory without being aware of even the exis...
The overcommit_memory setting is taken into account in three places in the memory-management subsystem. The main one is __vm_enough_memory in mm/util.c, which decides whether enough memory is available to allow a memory allocation to proceed (note that this is a utility function which isn’t necessarily invoked). If o...
What does heuristics in Overcommit_memory =0 mean?
1,561,650,454,000
What if boot like this: Pass INIT=/bin/sh(or /bin/bash) parameter to kernel, through GRUB command line or similar ways, then boot; Once shell is loaded, exit immediately. Then the computer has no response to any key pressed. I am quite curious about the STATUS of the system at this moment. As I have learned that init ...
I'm surprised. My understanding was that terminating PID 1 causes a kernel panic. I can tell you what happened in that case. Panic behaviour is configurable. With the default options, you will reach a loop that looks exactly as you say. The delay function used is documented as being a "busy-wait". It is not expect...
Is system totally idle if boot with INIT=/bin/sh kernel parameter then quit immediately from shell?
1,561,650,454,000
Is it possible to umount the partition, whose files/directories are in use? The underlying files and directories are in memory so un-mounting the partition is technically safe (I guess). But umount is not allowing me to un-mount it. (Who is denying this operation: umount or kernel?)
You can do a "lazy unmount". A lazy unmount makes the filesystem unavailable to any new processes that are launched, but any processes which are currently using it will be able to continue using it. Then once those processes which are currently using it are finished, the filesystem will unmount. To do this, it's simpl...
Un-mount active partition
1,561,650,454,000
I see that $ du -h /boot/initrd-2.6.37.6-0.5-pae 3.9M /boot/initrd-2.6.37.6-0.5-pae $ du -h /boot/vmlinuz-2.6.37.6-0.5-pae 4.1M /boot/vmlinuz-2.6.37.6-0.5-pae $ du -sh /boot 17M /boot So why does the "kernel-default" package on SUSE Studio come with 114MB?
The main reason for the 114MB (openSUSE 12.1's kernel-default-3.1.0-1.2.1.x86_64.rpm (34MB)) is that the kernel modules that are included with the RPM are collectively quite large. From the extracted RPM, as an example: $ du -sh lib/modules/3.1.0-1.2-default/kernel/* 1.3M lib/modules/3.1.0-1.2-default/kernel/arch 1...
Why is kernel-default 114MB on SUSE Studio?
1,561,650,454,000
Using lshw to query my WiFi USB adapter shows the following: $ lshw -C network *-network description: Wireless interface physical id: 12 bus info: usb@3:7 logical name: ... serial: ... capabilities: ethernet physical wireless configuration: broadcast=...
A module is a library containing functions that can be loaded into the kernel. When writing a module, you can define a C data structure that defines the name of a driver, and the functions to be called to check whether there's a device that can be handled by the driver, which function to call when the device gets unpl...
What is the difference between driver name and kernel module name for lshw?
1,561,650,454,000
How is nanosleep implemented on x86 Linux? The description states: nanosleep() suspends the execution of the calling thread until either at least the time specified in *req has elapsed, or the delivery of a signal that triggers the invocation of a handler in the calling thread or that terminates the process. Let's ...
In Linux, nanosleep relies on high-resolution timers. The main sleep loop loops over put the current task to sleep start a timer reschedule as long as there’s no pending signal and the timer hasn’t expired (t->task becomes NULL when the timer expires), restarting if necessary (when a signal is handled before the tim...
How is POSIX nanosleep implemented on x86 Linux?
1,636,111,100,000
I post here what I wrote, with no yet luck, to the VirtualBox forum at https://forums.virtualbox.org/viewtopic.php?f=7&t=104377&p=508627#p508627 . I installed the newest kernel 5.15.0 on my Linux Mint 19.3 (Ubuntu 18,04) equipped with the latest VirtualBox release. Starting any VM I get this error: Kernel driver not i...
Oracle VirtualBox aims to support whatever was the newest released Linux kernel at the time a particular version of VirtualBox was released. Linux kernel 5.15.0 was released on 2021-10-31. VirtualBox 6.1.28 (the current version) was released on 2021-10-19. Since kernel 5.15.0 did not exist yet when VirtualBox 6.1.28...
VirtualBox: "Kernel driver not installed" on Kernel 5.15.0
1,636,111,100,000
I found this in my kernel logs: kernel: r8169 0000:02:00.0: can't disable ASPM; OS doesn't have ASPM control What does it mean and how should I fix it? lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 21.04 Release: 21.04 Codename: hirsute
ASPM is the Active State Power Management of PCI Express. It governs things like switching the PCIE link to a low-power mode whenever there is no data to transfer. It can be controlled by the ACPI firmware, or by the operating system. When the system is booting up, the firmware initially controls "everything". As the ...
What "r8169 can't disable ASPM" means and how should I fix it?
1,636,111,100,000
My OS: uname -a Linux debian 5.10.0-0.bpo.5-amd64 #1 SMP Debian 5.10.24-1~bpo10+1 (2021-03-29) x86_64 GNU/Linux Something is wrong with my r8168-dkms; every time I install some other package, this appears at the end of the output: Setting up r8168-dkms (8.046.00-1) ... Removing old r8168-8.046.00 DKMS files... -----...
You can install the newer r8168-dkms (8.048.03-1~bpo10+1) package from backports which compiles fine on my system (same kernel version). If not already done, add the following line to your /etc/apt/sources.list deb http://deb.debian.org/debian buster-backports main contrib non-free to enable the backports repository....
How to set up r8168-kms?
1,636,111,100,000
I've been using Docker for a while and I'm interested in learning its internals. I've read about kernel namespaces it uses. But I don't understand how they are used. So my problem is: I haven't found any official Linux kernel documentation about it. I haven't found any official source covering subcategories either (PI...
The closest thing to official documentation for namespaces is the namespaces(7) manpage and related pages. These are maintained by kernel developers. The best introduction to containers’ use of namespaces I know of is Matt Turner’s “Istio — the packet’s eye view” presentation (which also exists as a lengthier workshop...
How to find official documentation about Linux kernel namespaces?
1,636,111,100,000
I would guess that it does so into the memory of the process from which the system call is made. However, if so, how do the rest of the processes use that space? How does the kernel know that the buffer points to a virtual address space, and not a real one? But then that would be like eating up space meant for the pro...
vmalloc is a kernel allocator, it doesn’t (necessarily) relate to processes. The kernel also sees virtual memory, not linear memory, most of the time. The particularity of vmalloc is that it only allocates contiguous virtual memory, not physical memory; kmalloc allocates contiguous virtual and physical memory. Both re...
Which processes' page table does vmalloc() allocate new memory in?
1,636,111,100,000
I want to compile a new kernel 4.14.8-gentoo-r1 on Gentoo Linux. I had created symbolic link using eselect kernel set 2 before I entered to directory /usr/src/linux and I executed genkernel all in this directory. Unfortunately, while compiling Linux kernel 4.14.8-gentoo-r1 I've received following error: pecan@tux /usr...
This issue was reported on the Gentoo Forums and the Gentoo bugtracker a little while ago. As mentioned in the bug report, you can either set FIRMWARE_INSTALL=no in your genkernel.conf, or upgrade genkernel to the unstable version (the thread also suggests setting CONFIG_FIRMWARE_IN_KERNEL=y in your .config file, but ...
Compile kernel 4.14.8-gentoo-r1 on Gentoo
1,636,111,100,000
I just finished installing Nvidia driver on Ubuntu. Nvidia installer created a key pair and signed the module with it. Now it says I should add this key pair to list of kernels' trusted keys to be able to use module. I googled but couldn't find any solution for this as I am not an expert Linux user. I appreciate your...
Here I found the solution. https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sect-signing-kernel-modules-for-secure-boot.html If your key pair are created, then: (The instruction is for RedHat but worked fine on Lubuntu and most probably will work for Ubuntu too)...
How to add a key pair (public and private) to list of kernel's database which hold list of trusted keys
1,636,111,100,000
I want to install kernel 4.5 on a Debian Jessie machine (I want to be as close as possible to a specific machine I have in production). Currently the version on the backports repo is 4.7, and I can't find a way to obtain 4.5 How do I look for versions that are not the latest? Any repository I can add that holds an arc...
echo 'Acquire::Check-Valid-Until false;' > /etc/apt/apt.conf.d/archive echo 'deb http://snapshot.debian.org/archive/debian/20160529T223338Z/ jessie-backports main contrib non-free' > /etc/apt/sources.list.d/debian-snapshot.list apt-get update apt-get install linux-image-4.5.0-0.bpo.2-amd64 But you don't need this, be...
Installing a specific kernel version on debian linux
1,636,111,100,000
So, there were already questions about ignoring ata devices (like How to tell Linux Kernel > 3.0 to completely ignore a failing disk?) from where I got the info that one has to add something like libata.force=2:disable to your kernel argument line. However, for some, reason, on one of my system's controller cards,...
It's always good to refer to the kernel parameters documentation. There we can read, for libata.force: [LIBATA] Force configurations. The format is comma separated list of "[ID:]VAL" where ID is PORT[.DEVICE]. PORT and DEVICE are decimal numbers matching port, link or device. Your ports are 2 and 4, and your VAL i...
Q: How to tell the Linux Kernel to ignore MULTIPLE ata devices?
1,636,111,100,000
I normally would test whether sysrq + sub works when the kernel panic occurs, but "unfortunately" my system works pretty stable, and I have no idea how to make kernel panic. So the question is very simple. Does sysrq work when the kernel panics, or do I have to reboot the machine by using the reset button? A bonus que...
You should be able to generate a panic using: sysctl kernel.panic=1 sysctl kernel.sysrq=1 echo c > /proc/sysrq-trigger See the kernel documentation for details on the kernel.sysrq parameter and the 'c' command The kernel.panic=1 parameter is to set to have the host to reboot after 1 second when a panic occured. If yo...
Does sysrq work when the kernel panic occurs?
1,636,111,100,000
Is it possible to generate major page faults in the linux kernel at will? Can a program be written such that it is guaranteed to cause a major page fault on it's execution.
To produce major page faults you need to force reads from disk. The following code maps the file given on the command-line, telling the kernel it doesn't need it; if the file is large enough (pick a large file in /usr/bin), you'll always get major page faults: #include <fcntl.h> #include <stdio.h> #include <sys/mman.h...
Generate major page faults
1,636,111,100,000
I've just noticed the very weird situation I don't have a good explanation for. The machine (debian) has one interface with one IP address assigned: # ifconfig vmbr0 |grep inet inet addr:192.168.1.26 Bcast:192.168.1.255 Mask:255.255.255.0 In the some software settings (powerdns recursor if it's necessary) it is spe...
As indicated in the comments, the address (192.168.1.24) is actually present on the host, but due to limitations in the ifconfig utility, it is not shown. Instead you should be using the Iproute2 utility ip, and not ifconfig. ifconfig has been deprecated in Linux for several years now, and is missing a lot of function...
Binding to not existing interface
1,636,111,100,000
I have a Linux 3.14.0 kernel(CentOS 6.2) running on my machine, but the source isn't in /usr/src/. Is there any way to find out the source from which it was compiled? The source is most definitely somewhere on the machine, it was compiled by one of my colleagues. Also, these are lab machines not connected to the int...
/lib/modules/$(uname -r)/source should be a symbolic link to the kernel source tree (if it was installed in a reasonable way). Other than that find / -type d -name "linux-3.14.0" will look for the distribution directory of the 3.14.0 Linux kernel - that is the one you get when you unpack the tarball. If that fails, f...
How to find the source of a currently running kernel on my machine?
1,636,111,100,000
I'm trying to setup an environment for kernel module development in Linux. I've built the kernel in the home folder and would like to place the sources and binaries to the correct place so include correctly. The example for building the kernel module has the following includes: #include <linux/init.h> #include <linux/...
I generally approach this question like this. I'm on a Fedora 19 system but this will work on any distro that provides locate services. $ locate "linux/init.h" | grep include /usr/src/kernels/3.13.6-100.fc19.x86_64.debug/include/linux/init.h /usr/src/kernels/3.13.7-100.fc19.x86_64.debug/include/linux/init.h /usr/src/k...
Placement of kernel binary and sources for kernel module building?
1,636,111,100,000
Looking at the proc man page (http://man7.org/linux/man-pages/man5/proc.5.html) it is possible to detect which processes are kernel threads in /proc/<pid>/stat by looking at the flags value (PF_KTHREAD) flags %u (%lu before Linux 2.6.22) (9) The kernel flags word of the process. For bit meanings, see the PF...
Heuristically, see https://stackoverflow.com/questions/12213445/identifying-kernel-threads ps and top (from procps-3.28) use "no command line" as the check, and have no knowledge of PF_KTHREAD. That is what triggers them to add [``] to the process name, it's not part of the actual process name. Since the command line ...
Detecting kernel thread on pre-3.0 kernels