date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,636,111,100,000 |
I tried to install eCryptfs on my server to open an eCryptfs I did on my home computer.
I got these errors.
$ sudo mount -t ecryptfs /home/(place)/enc/ /home/(place)/enc/
Unable to get the version number of the kernel module. Please make
sure that you have the eCryptfs kernel module loaded, you have sysfs
mounted, and the sysfs mount point is in /etc/mtab. This is necessary
so that the mount helper knows which kernel options are supported.
Make sure that your system is set up to auto-load your filesystem
kernel module on mount.
Enabling passphrase-mode only for now.
Unable to link the KEY_SPEC_USER_KEYRING into the
KEY_SPEC_SESSION_KEYRING; there is something wrong with your kernel
keyring. Did you build key retention support into your kernel?
I have no idea what that means. My server has Debian on it. Should I do something?
|
It seems that OpenVZ is the problem (again). OpenVZ uses the parent kernel and I can't do anything with that.
| Cannot mount eCryptfs |
1,636,111,100,000 |
I'm trying to customize my initrd on kernel 2.4.
At some point, inside the file linuxrc, I have the opportunity to set my root device setting the /proc/sys/kernel/real-root-dev variable
The example on docs is the one belowe:
echo 0x301 > /proc/sys/kernel/real-root-dev
where 0x301 is for /dev/hda1
What I'm looking for is the code needed for device different form hda1.
I had searched throug the web by I didn't find an answer, so I hope some of you can help me.
|
See this file for your kernel (probably most hasn't even changed over the major kernel versions):
http://www.mjmwired.net/kernel/Documentation/devices.txt
| Initrd : Were can I found the code for real-root-dev |
1,636,111,100,000 |
I am new to linux as of yesterday. I'm using linux puppy to try to get the most out of a 10 year old, slow laptop. I installed it fine, no problems there, but as soon as I try to use my usb dongle's install CD, the problems start.
The CD included support for linux as well as windows, so I copied the linux files off the CD and, through the console, ran the install.sh file to easy install the driver. All seemed to be going well until... I get the following error:
make: *** /lib/modules/2.6.37.6/build: No such file or directory. Stop.
and then displays an Error 2 message.
This is the only web-result I could find with any information on it but I don't understand how I should correct this: http://murga-linux.com/puppy/viewtopic.php?t=76975 (something about missing kernel header files).
I must stress, I only have limited experience in C and even less in C++.
Could anybody suggest a fix?
I have already tried using the windows .inf driver information file with the ndiswrapper utility that came with the network setup wizard. This detects my wireless network but does not connect. Maybe I'm just configuring it wrongly but I don't think so?
Any ideas?
|
You need to install kernel headers to compile a module. The kernel headers are not part of the kernel source (or at least not all of them are), they are generated when the kernel is compiled, and some of these headers depend on compilation options.
There is an unofficial kernel header package. If you prefer to do things yourself, compile your own kernel.
Once you have the kernel headers, /lib/modules/2.6.37.6/build must be a symbolic link to the directory that contains the include and arch diretories with the headers, as well as the Module.symvers file containing the kernel's symbol table. For example:
ln -s /usr/src/linux-2.6.37.6 /lib/modules/2.6.37.6/build
| /lib/modules/2.6.37.6/build missing in linux puppy? what should I do? |
1,636,111,100,000 |
If a previous kernel (assuming it is not from the stone age) compiles successfully, does it make sense to assume that old config file if copied to the new kernel, will compile successfully too?
What things need to be taken care of?
|
Copy the old .config file and then, to know what needs to be taken care of, use make oldconfig. You will be prompted interactively for needed changes in your config file. It's almost safe to answer with the default option to every question. (Usually you don't care about new drivers, and you want to use new features when those are enabled by default).
If you skip this configuration update step, things might break.
| Precautions to be taken while make oldconfig |
1,636,111,100,000 |
I would like to make a bootable USB/Floopy/LiveCD with linux kernel and Grub.
After booting to that USB/Floopy/LiveCD using VirtualBox or directly, it will show my own customized Grub screen and then it will execute my C or Pascal application.
I was trying to download grub but I am not sure which one I should use. Is there any issue to download the correct version of Grub such as for 32-Bit or 64-Bit downloads are different?
Which Grub should I download to get started with my own customized bootable image?
|
There are only two versions of grub listed there, the 1x series (most recent being 0.97) and the 2x series (most recent being 1.99). Both can be customized and used for your purpose. The 1x series has more standard compatibility with old hardware and distros, but we the 2x series is coming along nicly and many major distros are switching to it. 32bit vs 64 bit architecture is not a consideration for grub at this stage of the boot process, that won't come into play until you launch a kernel. Since grub doesn't do much it's happy to run on a generic set of cpu instructions.
But really you shouldn't be starting with grub and working up form there ... that will be a long road. You should probably start with some already arranged livecd image and work backwards to pare it down to just run your program on boot. This will save you all kinds of trouble. Pick some lightweight livecd that you like and get it's source, then start stripping out the bits you don't need and adding your program.
| Which Grub to use for a custom portable boot image? |
1,636,111,100,000 |
Why does this work:
truncate -s 2043G foo
...while this fails:
truncate -s 2044G foo
Why 2043 gigabytes, of all values?
|
You're probably using a filesystem that has a 2TB maximum file size (for example, ext3 with a 4KB or 8KB block size). truncate won't let you specify a target file size greater than the maximum your file system supports; 2044GB is very close to 2TB. I'm not sure why it's not exactly 2048GB that causes the problem; it's probably something internal to ext3's method of storing files
| Why does truncate fail for sizes above 2043G in ext3? |
1,636,111,100,000 |
I have a really basic doubt, which part creates all these directories, where is this configuration of creating directories stored while installing a new OS?
What is the order in which these directories are created? Are they created after /boot has been mounted by the kernel, by which part of the kernel?
|
The root filesystem is mounted first (readonly) at bootime, as your bootlog could tell you :
[kernel] [ 2.242830] VFS: Mounted root (ext4 filesystem) readonly on device 8:24.
It will then be remounted at init time :
[kernel] [ 2.266181] Run /sbin/init as init process
...
[kernel] [ 6.882156] EXT4-fs (sdb8): re-mounted. Opts: (null)
[kernel] [ 6.882160] ext4 filesystem being remounted at /
From there incidentally populating with (at the very least) all standard base directories (/bin, /usr, /dev, /etc…) possibly empty, possibly serving as mountpoints on which, still as part of the init process…
other disk filesystems will be mounted following /etc/fstab directives :
[kernel] [ 7.155270] EXT4-fs (sdb9): mounted filesystem with writeback data mode. Opts: data=writeback,commit=120
[kernel] [ 7.155274] ext4 filesystem being mounted at /var
[kernel] [ 7.222851] EXT4-fs (sdb10): mounted filesystem with writeback data mode. Opts: data=writeback
[kernel] [ 7.222855] ext4 filesystem being mounted at /home
This as a successful result of some init service (e.g. localmount in openrc), incidentally populating every standard directory of any *x sytem as well as possibly… even more.
BTW, since the kernel does not need /boot filesystem it might well never be mounted. It just can be, at init time, depending on /etc/fstab entries.
Network File Systems can (v.g. not necessarily) be mounted as well at init time, in a way depending on the init system (e.g. netmount service in openrc) taking care network services will have been successfully launched before as an obvious prerequisite.
Special file systems (procfs / sysfs / configfs or other virtual? pseudo? filesystems presenting non-file elements of an operating system as files) will, depending on appropriate CONFIG_* kernel tuneables be mounted at init time, depending on the init system (e.g. execution of /lib/rc/sh/init.sh for openrc) and being consequently automomagically populated.
Temporary File Systems (data is stored in volatile memory instead of a persistent storage device) can also be mounted at init time following directives found in /etc/fstab e.g.
tmpfs /tmp tmpfs rw,nosuid,noatime,nodev,size=4G,mode=1777
/dev particular case :
The /dev directory exists as per / mount together with two nodes the kernel needs at early boot time : /dev/console and /dev/null.
The kernel will add new nodes into /dev directory at boot time following devices' enumeration.
If the kernel is configured to enable temporary file systems, the nodes won't be created in the root partition :
The kernel will first mount an empty temporary file system on the /dev directory, overlaying its content.
[kernel] [ 2.262470] devtmpfs: mounted
Hence allowing the devices to be created dynamically into that filesystem as they are detected (or accessed).
Of course, Linux being a plug&play OS, the population is subject to change at runtime.
| Who actually mounts the file system and creates directories like /bin, /dev, /etc |
1,636,111,100,000 |
This question is an extension of why do we need to pass buffers to system calls in order to have information returned? Why can't system calls allocate the buffer internally? since memory allocation is one of many motivations to pass callbacks to syscalls.
I would like to to pass an allocate callback to a syscall variant of the original that requires a buffer and since the original syscall would likely know the size of the buffer to allocate before writing to the buffer.
Many file system APIs (not just posix/*nix, but Windows/NT does this too) always ask that you pass a x byte path buffer (x would be 256 or 1024 or 4096 or MAX_PATH). You still have to pass x into the function to indicate buffer size and the function may fail if it needs more space than the buffer allows.
Is there a restriction where a syscall cannot call user space functions? Is it possible, but complicated since the syscall must retain the calling userspace context and the callback userspace context? Are all syscalls supposed to be atomic from a thread switching perspective and calling userspace code from within a syscall would break that atomicity?
|
System calls run kernel code. The kernel doesn't trust user mode code, so if a system call takes a callback, it can't execute that callback in kernel mode. It must execute the callback in user mode.
The system call can't know for sure what the callback will do. The callback may make system calls of its own. For example, a callback to allocate memory may want to call a system call such as sbrk or mmap to give the process more memory. So the kernel needs to maintain an extra execution context for the pending system call, in addition to the one for any nested system call. The kernel can have multiple execution contexts per process: that's what kernel threads are for. But now these contexts would need to have additional structure, since some contexts are nested in others.
This additional complication can be avoided by having the system call pass all the intermediate information to the process. Let the process execute whatever callback code it wants, and then invoke a continuation system call when it's ready. This way the kernel keeps a simple execution model (system call gets invoked, system call runs, system call returns), and the process gets to run callbacks however it wants.
Well, there you have it: that's how it works now. A process can make a system call to query the size of the needed buffer, and then another system call (possibly the same system call number with different parameters) to obtain the data.
There is an inherent difficulty that the data may change during the execution of the callback. System calls don't have to be atomic, but they have to present a consistent view of the system at a given instant. For example, a process may try to read data from a file, and the file may grow while the callback runs. Since the kernel can't trust that the callback will complete in a given amount of time — or indeed that it will ever complete — the kernel cannot block updates to the file while the callback is running. So the user land code has to cope with this difficulty in any case: when the post-callback code runs, the desired data might not fit in the buffer anymore.
| Why do syscalls not accept userspace callback functions? |
1,636,111,100,000 |
I'm looking for a way to replace my keyboard kernel module to a custom one. I have a Logitech MK710 keyboard + mouse set for this purpose, with a USB receiver with those 2 interfaces. Automatically, this USB receiver is managed by default usb, usbhid or logitech-hidpp-device modules, there is some information (note: 1-2 is the receiver device):
ubuntu@ubuntu-VirtualBox:/sys/bus/usb/devices/1-2$ tree | grep driver
│ ├── driver -> ../../../../../../bus/usb/drivers/usbhid
│ ├── driver -> ../../../../../../bus/usb/drivers/usbhid
│ │ │ ├── driver -> ../../../../../../../../bus/hid/drivers/logitech-hidpp-device
│ │ │ ├── driver -> ../../../../../../../../bus/hid/drivers/logitech-hidpp-device
│ │ ├── driver -> ../../../../../../../bus/hid/drivers/logitech-djreceiver
│ ├── driver -> ../../../../../../bus/usb/drivers/usbhid
├── driver -> ../../../../../bus/usb/drivers/usb
What I want to achieve is write a proper module which would be chosen by a kernel instead of those default drivers. I think it's a matter of writing a proper module alias, but I'm not sure because nothing worked yet. Things I already tried are:
put my module inside /lib/modules/$(uname -r)/kernel/drivers directory (I created my own custom subdir inside and put the .ko file there)
use a proper alias in the module C code, I tried all options listed below (note: USB_VENDOR_ID and USB_PRODUCT_ID are macros used by me and their values are set properly for my specific device):
static struct hid_device_id mod_table [] = {
{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY, USB_VENDOR_ID, USB_PRODUCT_ID) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(hid, mod_table);
or
static struct hid_device_id mod_table [] = {
{ HID_USB_DEVICE(USB_VENDOR_ID, USB_PRODUCT_ID) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(hid, mod_table);
and
static struct usb_device_id mod_table [] = {
{ USB_DEVICE(USB_VENDOR_ID, USB_PRODUCT_ID) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(usb, mod_table);
remove original (default) HID drivers from /lib/modules/$(uname -r)/kernel/drivers directory (those 3 I specified at the top).
Yet still kernel chooses to load original modules instead of my own. I even made sure that only my driver's alias specifies the vendor and product IDs (checking it in modules.alias file), but nothing works. The module starts to work only when I decide to detach the kernel drivers manually from user space by libusb library (using libusb_detach_kernel_driver function) and reload my own custom module - only then the kernel associates the device with my driver, but that's only till the next boot. I'd like to make it permanent, or even automatic. I hope the whole concept is understandable and is not too big of a mess. Thanks in advance.
|
Most likely you are being tripped up by initramfs: a copy of the original HID driver module has been stored in there when your current kernel was installed, and if you haven't regenerated initramfs when adding your module, your customized one won't be in there.
At boot time, the USB support modules are among the first to be loaded, when the system is still running on initramfs and the real root filesystem has not been mounted yet. So the system is still finding & loading the original usbhid + logitech-hidpp-device module combination.
You seem to be using Ubuntu, so the Debian-style sudo update-initramfs -u command should be enough to rebuild the initramfs of the current kernel version using the current set of modules and other configuration files.
| Replace HID device driver with custom one |
1,636,111,100,000 |
I dont like the intel mei kernel modules so I made a file in /etc/modprobe.d/blacklist.conf that has the following contents:
blacklist mei
blacklist mei_mei
blacklist mei_hdcp
blacklist mei_wdt
It works for everything except mei and mei_me as shown by the output of lsmod | grep mei:
mei_me 45056 0
mei 139264 1 mei_me
The only solution I've found is to manually delete the .ko files, but every time the kernel updates then the kernel modules get re added.
On other systems I've used this doesnt happen, there is no need to manually delete the files.
Anyone got any insight into why this might be happening?
|
Use this option : Blacklist with fake install
add the following line to your /etc/modprobe.d/blacklist.conf
install mei /bin/true
Then:
sudo depmod -ae
sudo update-initramfs -u
| modprobe blacklist not working Debian 11 |
1,636,111,100,000 |
Background: I'm using QEMU to virtualize xv6-riscv on top of WSL2. I'm looking to create some sort of clean OS shutdown process reminiscent of Linux's exit command. Currently I'm using Ctrl-a x to kill qemu, but I want to be able to do this programmatically from within the OS.
I know that the Linux exit command simply closes the current shell, which means I need a kernelspace way of detecting if there's any active shells left and a way of signalling to QEMU that it's turning off. I have full access to the kernel for recompiling, but I can't use external C libraries because there are none. Any solution I develop has to be basically from-scratch.
Thus, my question: What does an operating system need to do to tell a RISC-V QEMU instance that it's turning off? How do you exit QEMU itself from within the OS? This second point is important specifically because I'm instantiating QEMU from a Makefile in a CLI, and I'd like to have access to the terminal after the OS terminates, rather than have QEMU sitting there emulating a RISC-V with nothing on it.
note: This question is different from this other one because I'm asking about a guest OS initiated shutdown rather than a host initiated ACPI shutdown, as well as diving much deeper into the internals of QEMU and operating systems in general.
|
TL;DR
From the supervisor mode:
(*(volatile uint32 *) 0x100000) = 0x5555;
You also need to change the kernel page table to map the address 0x100000. You can see this commit for full implementation.
Long answer
Unfortunately, the documentation for QEMU RISC-V emulator is poor. So we need to dive into the code. We know from the xv6's Makefile that it is using QEMU's Generic Virtual Platform (virt) in order to virtualize the xv6.
The virt.c file from QEMU's source code contains the implementation of the QEMU's Generic Virtual Platform. If we search poweroff in that file, we will end up with this code snippet:
name = g_strdup_printf("/poweroff");
qemu_fdt_add_subnode(ms->fdt, name);
qemu_fdt_setprop_string(ms->fdt, name, "compatible", "syscon-poweroff");
qemu_fdt_setprop_cell(ms->fdt, name, "regmap", test_phandle);
qemu_fdt_setprop_cell(ms->fdt, name, "offset", 0x0);
qemu_fdt_setprop_cell(ms->fdt, name, "value", FINISHER_PASS);
g_free(name);
In a nutshell, this code snippet is telling the QEMU that if FINISHER_PASS is written to the 0th index of test_phandle register map, then poweroff the QEMU. If we look a few lines above it, we will realize that upon writing FINISHER_RESET we can reset the QEMU. A few lines before we can observe this line indicates the memory mapped location in the guest that we should write the FINISHER_PASS in:
qemu_fdt_setprop_cells(ms->fdt, name, "reg",
0x0, memmap[VIRT_TEST].base, 0x0, memmap[VIRT_TEST].size);
If we search VIRT_TEST in the same file, we come up with this line:
[VIRT_TEST] = { 0x100000, 0x1000 },
So the location in which we should write FINISHER_PASS in is 0x100000. Also, if we search FINISHER_PASS and FINISHER_RESET in the whole project, we can see their values in this file:
enum {
FINISHER_FAIL = 0x3333,
FINISHER_PASS = 0x5555,
FINISHER_RESET = 0x7777
};
Long story short, we currently know that to poweroff an operating system, we have to write 0x5555 into address 0x100000. You might think that you can reboot the operating system by writing 0x7777 in the same address but I couldn't do it for some reason... Let me know if you have found a reason!
Now we shall implement a syscall to poweroff xv6. To get started, we first must change the page table of the kernel in order to map the virtual address 0x100000 to physical address 0x100000 (you can map other virtual addresses if you have implemented ASLR). I did it by adding the following line to vm.c and function kvmmake:
kvmmap(kpgtbl, 0x100000, 0x100000, PGSIZE, PTE_R | PTE_W);
We use the page size because the size of the area is 0x1000 bytes according to QEMU's source.
After that, we simply add a syscall to the operating system. I did it like this:
// Power off QEMU
static uint64
sys_poweroff(void)
{
printf("Powering off...\n");
(*(volatile uint32 *) 0x100000) = 0x5555;
panic("sys_poweroff");
}
Add this syscall to the syscall table and now we are good to go!
You can then write a simple user program in order to use the syscall:
#include "kernel/types.h"
#include "kernel/stat.h"
#include "user/user.h"
int
main(int argc, char *argv[])
{
poweroff();
exit(1); // never reached
}
Add this user program to Makefile and then you can use this application to poweroff the operating systems.
As I've said, you can see this commit for full implementation.
| Writing an OS shutdown process for QEMU (xv6) |
1,636,111,100,000 |
The NOTES section of $ man 5 sysctl.conf states: The description of individual parameters can be found in the kernel documentation.
But is there a way for me to find this kernel documentation offline? Is it a package that I'd need to install?
For example, I came across the kernel.panic parameter, which on my system is set to 0 by default. Looking it up online here, it's described to be:
panic:
The value in this file represents the number of seconds the kernel
waits before rebooting on a panic. When you use the software watchdog,
the recommended setting is 60.
But there is no reasonable way I'd guessed that the 0 there referred to 0 seconds till auto reboot without searching it up online.
|
But is there a way for me to find this kernel documentation offline? Is it a package that I'd need to install?
Yes, most distributions provide the kernel documentation for their kernel in a package. On Debian, this is linux-doc, which is a meta-package pulling in the default kernel’s documentation for whichever release you’re using (version-specific packages are available too, *e.g. linux-doc-4.19). On RHEL, CentOS etc. it’s kernel-doc.
You’ll find the file you’re looking for in this case in /usr/share/doc/kernel-doc-*/Documentation/sysctl/kernel.txt on RHEL. In newer versions the file has been converted to ReSTructured text and can be found in .../Documentation/admin-guide/sysctl/kernel.rst (which is also where you can find the current kernel sysctl documentation on the kernel web site).
Checking the packaged version gives you a better chance to get the documentation matching your running kernel; in some cases though the current documentation is more accurate, even for older kernels, and this is the case here — I improved the documentation following Linux Kernel.org misleading about kernel panic /proc/sys/kernel/panic, and that ended up in version 5.7 of the kernel.
| Where to get offline documentation/descriptions of individual sysctl kernel tunable parameters? |
1,636,111,100,000 |
We have physical Linux machine with 16 cpus
lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 16
We want to disable 14 cpus on that machine , so its actually like we have linux machine with only 2 cpu
In order to achieve this , I did the following
echo 0 > /sys/devices/system/cpu/cpu15/online
echo 0 > /sys/devices/system/cpu/cpu14/online
echo 0 > /sys/devices/system/cpu/cpu13/online
echo 0 > /sys/devices/system/cpu/cpu12/online
echo 0 > /sys/devices/system/cpu/cpu1/online
echo 0 > /sys/devices/system/cpu/cpu11/online
echo 0 > /sys/devices/system/cpu/cpu10/online
echo 0 > /sys/devices/system/cpu/cpu9/online
echo 0 > /sys/devices/system/cpu/cpu8/online
echo 0 > /sys/devices/system/cpu/cpu7/online
echo 0 > /sys/devices/system/cpu/cpu6/online
echo 0 > /sys/devices/system/cpu/cpu5/online
echo 0 > /sys/devices/system/cpu/cpu4/online
echo 0 > /sys/devices/system/cpu/cpu5/online
echo 0 > /sys/devices/system/cpu/cpu4/online
and then also run mpstat
and we get
08:26:13 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
08:26:13 AM all 0.34 0.00 0.09 0.04 0.00 0.00 0.00 0.00 0.00 99.53
08:26:13 AM 0 0.42 0.00 0.12 0.01 0.00 0.00 0.00 0.00 0.00 99.45
08:26:13 AM 1 0.37 0.00 0.10 0.01 0.00 0.00 0.00 0.00 0.00 99.52
08:26:13 AM 2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
08:26:13 AM 3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
08:26:13 AM 4 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
08:26:13 AM 5 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
08:26:13 AM 6 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
08:26:13 AM 7 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
08:26:13 AM 8 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
08:26:13 AM 9 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
08:26:13 AM 10 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
08:26:13 AM 11 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
08:26:13 AM 12 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
08:26:13 AM 13 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
08:26:13 AM 14 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
08:26:13 AM 15 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
We can see that only 2 cpu’s are online
But I don’t sure if this approach is really works and I need advice
For example how to be sure that any PID's will not use the other 14 cpu’s that are disabled?
Let me know if my procedure , disable the 14 cpu’s , and process will use only 2 cpus
|
This might or might not depending on the application.
If the application simply uses APIs to poll the number of available cores, it might not work because the Linux kernel might return all the cores.
However disabling CPU cores in BIOS must work - it depends on your BIOS implementation, so please consult with your motherboard documentation.
If I were you, I'd approach this issue differently: I'd run the app in a VM and allocate the required number of cores to it. This way your host OS will still be able to use the remaining cores.
Lastly you don't need to run echo 14 times.
Here's a simpler version for bash:
echo 0 | sudo tee /sys/devices/system/cpu/cpu{2..15}/online
Lastly make sure you leave two physical cores instead of a single core with HT. To learn your CPU topology run:
lscpu -p
Normally the Linux kernel first sees physical cores, then HT/SMT cores but I'm not sure it's always the case.
| rhel + how to disable CPU's on my machine |
1,636,111,100,000 |
I have onboard SATA controller, and also an additional RAID controller card:
00:17.0 SATA controller: Intel Corporation Device a282
...
04:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS-3 3108 [Invader] (rev 02)
When linux kernel boots, disks connected on the LSI raid controller are recognized/enumerated first (sda,sdb,...), and disk hanging on the SATA controller after that (sde).
My kernel is monolithic, without loadable modules. Is it possible to tell the kernel, the disk on the SATA controller should be first (sda) ?
What affects the order? Is this just an accident, that LSI raid is recognized first, or can this be changed?
|
I was looking into something similar in the past - changing the order of the disks and the network cards for a monolithic kernel.
The order how the drivers are loaded gets decided during compilation - by initcall_levels (from lower to higher, include/linux/init.h) and then by
positions in the Makefiles.
I do not think there is much room for playing with initcall_levels - there are too many dependencies.
SATA level 4
in drivers/ata/libata-core.c
at subsys_initcall(ata_init)
MEGASAS level 6 in
drivers/scsi/megaraid/megaraid_sas_base.cat
module_init(megasas_init)
Pointers in System.map:
ffffffff829545cd t megasas_init
ffffffff8295547c t ata_init
ffffffff829e7688 t __initcall_megasas_init6
ffffffff829e8288 t __initcall_ata_init4
Changing the order in the Makefile should be an option, for example in drivers/net/ethernet/intel/Makefile switching the lines for e1000 and e1000e
will change the order for eth0 and eth1 (using net.ifnames=0)
obj-$(CONFIG_E1000) += e1000/
obj-$(CONFIG_E1000E) += e1000e/
So in drivers/Makefile moving ata before scsi
obj-$(CONFIG_ATA) += ata/
obj-y += scsi/
should change the order of the host controllers (SATAs first). Check by
ls -l /sys/class/scsi_host/
lsscsi
But even when having SATA as host0 the disks at LSI controller were found
first, I am not sure how the asynchronous SCSI probe works, but adding a
little delay (e.g. 700 ms) somewhere at the beginning of megasas_init()
in drivers/scsi/megaraid/megaraid_sas_base.c made the SATA disk to be /dev/sda
static int __init megasas_init(void)
{
int rval;
msleep(700);
...
I hope it does not cause any issues in the kernel, it worked for me but be
careful. Of course there are dependencies, not everything is possible. For example
I know when I tried mptsas (drivers/message/fusion/) before scsi, it would
compile, but the kernel immediately crashed at boot.
Hope this helps.
| change order of SATA and RAID controller when booting linux kernel |
1,636,111,100,000 |
I have a bespoke monitoring application I'm deploying on a linux cluster I wish to secure.
I would like the process not to be possible to kill.
That said, senior users need root.
I read that I can use kernel threads to achieve this. I would literally rather crash the OS than keep it up without this process.
Is this possible or even better is there a more elegant way?
|
If senior users do not need complete and unfettered root access you could allow them to become root just to use the needed functions via sudo (or setuid programs, service daemons, ...)
| Kill OS if process is killed |
1,636,111,100,000 |
I want to boot Arch Linux directly from UEFI.
My idea is to create a boot entry using the tool efibootmgr; I used this command:
efibootmgr --create --label "arch-test" --loader /vmlinuz-linux --unicode 'root=PARTUUID=f2083749-8bbc-570b-ab3b-e79d72fa08ac rw initrd=\initramfs-linux.img' --verbose
I followed the Arch Wiki page on EFISTUB and I created the entry but when I try to boot from that, system stuck on boot at very early stage with this message:
VFS: unable to mount root fs on unknown-block(0,0)
PS: I want to have this working as emergency/rescue tool; i.e. latest systemd upgrade break up the boot manager (systemd-boot) making my machine unusable; I have been able to recover my system thanks to an external live USB. I want to AVOID this in the future!
UPDATEs:
1. having or not/slash or backslash, before initrd doesn't matter
2. tried with both UUID and PARTUUID, nothing changes
3. my /boot is on /dev/sda1 while root on /dev/sda3
4. and /boot is ESP, as well
# fdisk -l /dev/sda
[...]
Disklabel type: gpt
[...]
Device Start End Sectors Size Type
/dev/sda1 2048 2099199 2097152 1G EFI System
/dev/sda2 2099200 18874367 16775168 8G Linux swap
/dev/sda3 18874368 104857599 85983232 41G Linux filesystem
[...]
# minfo -i /dev/sda1 :: | grep 'disk type'
disk type="FAT32 "
following your comments, I tried UEFI Shell. I had left this option as latest since my machine does not have an internal UEFI Shell (is it possible?). Anyway, I have:
downloaded one from tianocore
placed Shell.efi into /boot/EFI/Boot/
added an entry with
efibootmgr --create --label "TIANO-0" --loader /EFI/Boot/Shell.efi --verbose
rebooted into this Shell, I typed fs0: and vmlinuz-linux root=/dev/sda3
resulting in the same error:
VFS: unable to mount root fs on unknown-block(0,0)
it looks like initrd is mandatory (at least for Arch Linux);
the command vmlinuz-linux initrd=initramfs-linux.img root=/dev/sda3 makes the magic
my system is a Dell XPS 9343 laptop and I discovered it suffers of a bug: can't boot EFISTUB, reported on ArchWiki here.
I think it explains the failure of the (first mentioned) correct procedure!
ArchWiki page suggests a workaround too, but at the moment I have tried it.
|
-l | --loader NAME
Specify a loader (defaults to \\elilo.efi)
A kernel with EFI-stub is still not a loader. To boot from BIOS it has to be an EFI-application. All the boot loaders have .EFI suffix. I think it is possible to turn a kernel into such a directly bootable object, but normally it is one of the boot loaders that gets started (with or without offering a choice).
But you can use UEFI shell (on modern systems) as the interactive boot loader. This is perfect for testing. You activate it like a boot device in BIOS, cd to fs0:, which is the ESP, and then you can
fs0:> bzImage root=/dev/sda3
I just compiled a first bzImage a few days ago. First I forgot CONFIG_EFI_STUB and the UEFI shell treated the kernel like a non-binary. A second version did boot, without any initrd=. Besides EFI_STUB=y I just switched off a few options and kept the defaults.
But it is true most distros have kernels that do not have the basic block device drivers - they need the initrd=IMAGE option.
I use Uefi Shell as my boot loader. This is not super elegant, but very simple and flexible. And as an emergency option I think it is perfect, because the Uefi Shell is built-in, while a boot loader on a partition can be deleted.
This is from Documentation/efi-stub.txt
> Passing kernel parameters from the EFI shell
> --------------------------------------------
>
> Arguments to the kernel can be passed after bzImage.efi, e.g.::
>
> fs0:> bzImage.efi console=ttyS0 root=/dev/sda4
I have the same Uefi Shell prompt fs0:>, but I found that all the usual distros have EFI_STUB kernels, and the name does not matter at all. Most common is "vmlinuz" (= loader around a compressed vmlinux).
If you leave away the ".efi" and the "console=" option, this is left:
fs0:> bzImage root=/dev/sda4
Which is the same minimal boot command, except that I have sda3: Uefi Shell starts the bzImage by the stub, the kernel is unpacked and started and the built-in modules recognize the SATA disk. If the root= device is not valid, you get that VFS: unable to mount panic.
I could not manage to start a bzImage (or vmlinuz, or ...) from BIOS directly, like a grub64.EFI.
UEFI - Applications (wikipedia):
Beyond loading an OS, UEFI can run UEFI applications, which reside as
files on the EFI System Partition. They can be executed from the UEFI
command shell, by the firmware's boot manager, or by other UEFI
applications. UEFI applications can be developed and installed
independently of the system manufacturer.
A type of UEFI application is an OS loader such as GRUB, rEFInd,
Gummiboot, and Windows Boot Manager; which loads an OS file into
memory and executes it. Also, an OS loader can provide a user
interface to allow the selection of another UEFI application to run.
Utilities like the UEFI shell are also UEFI applications.
This confirms my view that the UEFI Shell is between the firmware boot loader and the kernel.
Gentoo has similar examples; they insist on naming the kernel with .EFI suffix.
If for some reason an initramfs is needed, it can either be embedded
into the kernel or be used as a separate file.
...
Some UEFI implementations however seem to not support passing
parameters from the NVRAM to the EFI stub kernel.
| Boot kernel from UEFI directly |
1,636,111,100,000 |
Currently I'm using Kernel version 3.10.0-1062.el7.x86_64
and I want to downgrade to 3.10.0-957.27.2.el7.x86_64 (that was not installed, it needed to support existing project)
I've tried:
yum install kernel-3.10.0-957.27.2.el7.x86_64
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.gigenet.com
* epel: mirror.steadfastnet.com
* extras: mirror.steadfastnet.com
* updates: mirror.steadfastnet.com
No package kernel-3.10.0-957.27.2.el7.x86_64 available.
Error: Nothing to do
|
... want to downgrade to 3.10.0-957.27.2.el7.x86_64
kernel-3.10.0-957.27.2.el7.x86_64 was saved / is stored at CERN :
https://linuxsoft.cern.ch/cern/centos/7/updates/x86_64/Packages/kernel-3.10.0-957.27.2.el7.x86_64.rpm
Ref. https://linuxsoft.cern.ch/cern/centos/7/updates/x86_64/repoview/kernel.html ... and ref. Google https://www.google.com/search?q=kernel-3.10.0-957.27.2.el7.x86_64
Download ... and install :
# yum install Downloads/kernel-3.10.0-957.27.2.el7.x86_64.rpm
| install centos older kernel version |
1,636,111,100,000 |
I use Mint 19.2, and I try to see CPU backtrace by the following process.
$ sudo -s
# sysctl -w kernel.sysrq=1
# echo l > /proc/sysrq-trigger
But, nothing happened. I researched more online and I tried the following input key check, and the response for the command was this.
# dmesg | grep -i sysrq
[18494.528450] sysrq: SysRq : Show backtrace of all active CPUs
[18494.528496] sysrq_handle_showallcpus+0x17/0x20
[18494.528499] __handle_sysrq+0x9f/0x170
[18494.528502] sysrq_filter+0x98/0x3e0
Even when I tried echo h > /proc/sysrq-trigger, the result woundn't be displayed, either. But, dmesg | grep -i sysrq replied:
[21964.365327] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
enter code here
By these dmesg responses, I believe the OS, at least, recognizes a letter from echo command as a SysRq input.
How can I have the OS display a result of echo l > /proc/sysrq-trigger on the current terminal?
|
The kernel will only display messages on the console and to the kernel message buffer, which is usually logged by syslog with facility 'kernel' and which can also be read by using dmesg.
The kernel has no concept of "the current terminal", so what you want is not possible.
| SysRq doesn't display any result on terminal |
1,636,111,100,000 |
lsmod -> tun 16587 0 - Live 0xbf0e1000
Openvpn error: Cannot open TUN/TAP dev /dev/net/tun no such file or directory
I tried creating a dummy directory but the error changes to Cannot open TUN/TAP dev /dev/net/tun: Is a directory.
edit:
System: ARM Linux 3.10.0
|
/dev/net/tun is character device not file nor directory. Check it with ls command:
ls -lad /dev/net/tun
It shall look like (notice first c):
crw-rw-rw- 1 root root 10, 200 Feb 10 21:38 /dev/net/tun
To fix unload tun module:
rmmod tun
remove /dev/net/tun directory if it exist (directory is marked with d instead of c):
rmdir /dev/net/tun
Reload tun module:
modprobe tun
It shall create character device /dev/net/tun.
| TUN Module Loaded but OpenVPN /dev/net/tun no such file or directory |
1,636,111,100,000 |
I need to retrieved the grab state of an evdev device in a program. More specifically, I need to retrieve the state of the grab pointer in the evdev struct seen here: https://elixir.bootlin.com/linux/v4.20/source/drivers/input/evdev.c#L42 (if it is NULL or not NULL). Is this at all possible from userspace, e.g. through reading kernel memory with /dev/(k)mem or do I need to write a kernel module? Where should I get started?
|
To determine whether a device is currently grabbed, from userspace, you can try to grab it yourself; either using the EVIOCGRAB ioctl yourself, or libevdev_grab in libevdev:
if (!ioctl(evdevfd, EVIOCGRAB, (void *) 1)) {
// We grabbed the device, no one else had it; release it
ioctl(evdevfd, EVIOCGRAB, (void *) 0);
} else if (errno == EBUSY) {
// The device is busy, someone else has it
} else {
// Something else went wrong
}
or
struct libevdev *dev;
libevdev_new_from_fd(evdevfd, &dev);
if (!libevdev_grab(dev, LIBEVDEV_GRAB)) {
// We grabbed the device, no one else had it; release it
libevdev_grab(dev, LIBEVDEV_UNGRAB);
} else if (errno == EBUSY) {
// The device is busy, someone else has it
} else {
// Something else went wrong
}
(Sprinkle liberally with error-handling; evdevfd is the open file descriptor for the evdev device you’re interested in.)
| Access grab state of evdev device |
1,534,554,907,000 |
I previously followed the answer in this question: Attaching USB-Serial device with custom PID to ttyUSB0 on embedded
Now, I need to revert that step so that the device id I echoed to new_id doesn't map to ttyUSB0 every time I connect it. The file, new_id, seems to have '0403 e0d0' permanently written to it now. I've tried to use the unbind file to no luck. There's also no "remove_id" file. Only bind, new_id, uevent, and unbind.
How can I revert this?
|
I looked into this, and it does seem like remove_id was never implemented for usb-serial. Should be able to take the work in drivers/usb/core/driver.c and implement remove_id in drivers/usb/serial/bus.c.
Sorry for not having an easy answer.
| How to remove device id from manually entered usb-serial driver |
1,534,554,907,000 |
I am developing an embedded Linux device. I have successfully created an InitramFS CPIO archive that runs quickly after boot. Now, I want to change the initial kernel command line to include "quiet" parameter so I can boot even faster.
However, once the splash screen is displayed in the InitramFS, I want to remove the quiet option for the kernel so the remainder of the boot is NOT quiet.
How can I achieve this? How can I reverse the initial "quiet" kernel command line option once I've reached the InitramFS?
Thanks.
|
You can't really change the kernel command-line after boot, but what you can do is reproduce the effects of setting or unsetting the quiet command-line through other means, which should accomplish what you want to achieve here.
In short, to increase verbosity once you don't want quiet anymore, you can use this command:
# echo 7 >/proc/sys/kernel/printk
And to emulate what quiet does, this is what you can use:
# echo 4 >/proc/sys/kernel/printk
This should take care of the kernel side of the setting... But sometimes userspace will also change behavior based on this kernel option. For instance, systemd will parse the quiet option in the kernel command-line, and act as if ShowStatus=auto was used in /etc/systemd/system.conf. If you want to revert that (to enforce the default and ignore the quiet option), edit that config file and uncomment the ShowStatus=yes line there, which should take care of it.
There might be other systems in userspace that look at this option, so you might need to take a closer look at those to see how they behave and how to reproduce (or undo) the behavior of the option being present in the kernel command-line.
The following is a deep dive into the sources to explain the behavior of the quiet option in the kernel and systemd.
The kernel parses the quiet option by calling the quiet_kernel() initialization function, which does:
static int __init quiet_kernel(char *str)
{
console_loglevel = CONSOLE_LOGLEVEL_QUIET;
return 0;
}
early_param("quiet", quiet_kernel);
The console_loglevel pseudo-variable is actually the first element of the console_printk array:
extern int console_printk[];
#define console_loglevel (console_printk[0])
Log level "quiet" is defined as 4:
#define CONSOLE_LOGLEVEL_QUIET 4 /* Shhh ..., when booted with "quiet" */
A few lines below, the default log level is defined through a kernel config:
/*
* Default used to be hard-coded at 7, we're now allowing it to be set from
* kernel config.
*/
#define CONSOLE_LOGLEVEL_DEFAULT CONFIG_CONSOLE_LOGLEVEL_DEFAULT
And that kernel config is set in Kconfig.debug, still defaults to 7:
config CONSOLE_LOGLEVEL_DEFAULT
int "Default console loglevel (1-15)"
range 1 15
default "7"
(You might want to check that your kernel is using the default config, either in /boot/config-* or in /proc/config.gz.)
And for more details on using /proc/sys/printk, see the kernel documentation for it. But, in short, it is possible to write only a single number, in which case only the first element of the array will be updated, which is what you want here.
systemd will also parse the kernel command-line, looking for entries typically named systemd.*, but it turns out systemd also recognizes the quiet kernel command-line and uses it to set the ShowStatus:
} else if (streq(key, "quiet") && !value) {
if (arg_show_status == _SHOW_STATUS_UNSET)
arg_show_status = SHOW_STATUS_AUTO;
In this case, it will only set it if it wasn't previously set (_SHOW_STATUS_UNSET) and will set it to "auto" (SHOW_STATUS_AUTO.)
Another way to set the ShowStatus is through the configuration file:
{ "Manager", "ShowStatus", config_parse_show_status, 0, &arg_show_status },
This line describes the configuration option named ShowStatus= under the [Manager] section of system.conf. The parser for this option takes either the "auto" string (in which case it sets it to SHOW_STATUS_AUTO) or takes a boolean, which can be "yes", "true" or "1" to enable it, or "no", "false" or "0" to disable it.
The systemd documentation for --show-status= is also pretty helpful here. It cites the ShowStatus= configuration too (since passing systemd command-line arguments directly is not always easy to do, updating a configuration file is definitely a more straightforward way to configure this setting.)
I hope you find this helpful and that it helps you accomplish the right verbosity for your particular use case!
| Linux Modify/Add Kernel Command Line from InitramFS "UserSpace" |
1,534,554,907,000 |
I'm trying to debug a prototype CPU that throws unhandled signal 11s and signal 7s in the startup process.
Here is what the kernel prints out. I have added extra print statements to the kernel to debug exactly which userspace processes are exhibiting the error.
[ 0.880000] Execing: /usr/bin/readlink
[ 0.884000] readlink[85]: unhandled signal 7 code 0x1 at 0x00000020000b8f60 in libc-2.26.so[2000049000+13e000]
[ 0.884000] CPU: 0 PID: 85 Comm: readlink Not tainted 4.15.0-rc6-31580-g9c3074b5c2cd-dirty #20
[ 0.884000] sepc: 00000020000b8f60 ra : 00000020000b8d2c sp : 0000003ffffd9a60
[ 0.884000] gp : 00000000001028a8 tp : 0000002000192710 t0 : 0000000000000458
[ 0.884000] t1 : 00000020000aae98 t2 : ffffffffffffffff s0 : 000000200018d468
[ 0.884000] s1 : 000000200018e7d0 a0 : 000000200018e810 a1 : 000000200018c768
[ 0.884000] a2 : fffffffffbad2884 a3 : 0000000000008000 a4 : 000000200018ef38
[ 0.884000] a5 : 0000000000000001 a6 : 0000000000000000 a7 : 0000000000000040
[ 0.884000] s2 : 0000000000000001 s3 : 0000002000192010 s4 : 000000200018c4b0
[ 0.884000] s5 : 0000000000000001 s6 : 000000200018dd58 s7 : 0000000000000000
[ 0.884000] s8 : 00000000000e3388 s9 : 0000000000000040 s10: 000000000009c000
[ 0.884000] s11: 0000000000000048 t3 : 0000000000061e98 t4 : 0000000000000002
[ 0.884000] t5 : 000000200004bb64 t6 : 0000000000000000
[ 0.884000] sstatus: 8000000200006020 sbadaddr: 0000000006200893 scause: 0000000000000006
[ 0.888000] Execing: /bin/rm
Here I see an unhandled signal 7 in readlink, which is executing some libc function. My question is, how do I determine which instruction in libc is causing this? The machine status printout does not include the instruction, only the sepc. Since libc is dynamically linked, I'm not sure how to find its reference in libc's code.
|
If I'm reading the kernel's source correctly, this line:
readlink[85]: unhandled signal 7 code 0x1 at 0x00000020000b8f60 in libc-2.26.so[2000049000+13e000]
Tells you what you need to know. libc is loaded at hexadecimal 0x2000049000, and is 0x13e000 bytes long. The address that the signal happened at is 0x00000020000b8f60. In order to figure out where relative to libc the error happens, compute 0x00000020000b8f60 - 0x2000049000.
I get 0x6ff60, so look for that location in objdump -d libc... or nm -g libc....
| Interpreting the unhandled signal exception in Linux |
1,534,554,907,000 |
I'm trying to use a compressed squashfs ubi volume as my root file system. The idea is to have two ubi volumes. Volume one contains a read-only squashfs file system. Volume two is re-sizable and uses the remaining flash space. It contains a writable ubifs file system. These two ubi volumes are to be overlayed using overlayfs after booting so that I have a writable file system with the ability to restore to factory state by formatting the second (ubifs) volume.
I know squashfs works only on block devices, so I'm using gluebi driver to emulate them on top of ubi volumes (this creates mtdx and mtdblockx for each ubi volume):
CONFIG_SQUASHFS=y
CONFIG_SQUASHFS_LZO=y
CONFIG_MTD=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_GLUEBI=y
CONFIG_UBIFS_FS=y
Here's my ubinize.conf file to create the ubi image:
[rom]
mode=ubi
image=rootfs.squashfs-lzo
vol_id=0
vol_type=static
vol_name=ubi_vol_rom
[overlay]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=ubi_vol_overlay
vol_size=1KiB
vol_flags=autoresize
I'm using these MTD partitions for testing:
mtd18: 03a00000 00040000 "sys_back"
mtd19: 058c0000 00040000 "system"
I flashed the ubi image to mtd18 (sys_back), attached it to ubi, mounted the resulting mtdblock and everything worked as intended, so I presume my ubi volume and squashfs file system are correct.
# ubiattach -m 18
# mount /dev/mtdblock23 /mnt/
# mount
/dev/mtdblock23 on /mnt type squashfs (ro,relatime)
So, I wanted to try the final configuration. I flashed the ubi image to mtd19 (system) and modified my kernel parameters to contain this:
ubi.mtd=system root=mtd:ubi_vol_rom rootfstype=squashfs
However, mounting the root file system failed:
[ 3.334908] ubi0: attaching mtd19
[ 3.725841] ubi0: scanning is finished
[ 3.751239] gluebi (pid 1): gluebi_resized: got update notification for unknown UBI device 0 volume 1
[ 3.759465] ubi0: volume 1 ("ubi_vol_overlay") re-sized from 1 to 203 LEBs
[ 3.767111] ubi0: attached mtd19 (name "system", size 88 MiB)
[ 3.772007] ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 253952 bytes
[ 3.778938] ubi0: min./max. I/O unit sizes: 4096/4096, sub-page size 4096
[ 3.785670] ubi0: VID header offset: 4096 (aligned 4096), data offset: 8192
[ 3.792583] ubi0: good PEBs: 355, bad PEBs: 0, corrupted PEBs: 0
[ 3.798604] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128
[ 3.805807] ubi0: max/mean erase counter: 3/1, WL threshold: 4096, image sequence number: 1328192
[ 3.814929] ubi0: available PEBs: 0, total reserved PEBs: 355, PEBs reserved for bad PEB handling: 40
[ 3.823843] ubi0: background thread "ubi_bgt0d" started, PID 148
[ 4.639909] UBIFS error (pid: 1): cannot open "mtd:ubi_vol_rom", error -22
List of all partitions:
[ 4.647770] 1f00 2560 mtdblock0 (driver?)
[ 4.652783] 1f01 2560 mtdblock1 (driver?)
[ 4.657822] 1f02 22528 mtdblock2 (driver?)
[ 4.662851] 1f03 5120 mtdblock3 (driver?)
[ 4.667886] 1f04 3072 mtdblock4 (driver?)
[ 4.672925] 1f05 1280 mtdblock5 (driver?)
[ 4.677956] 1f06 1536 mtdblock6 (driver?)
[ 4.682994] 1f07 1280 mtdblock7 (driver?)
[ 4.688030] 1f08 9216 mtdblock8 (driver?)
[ 4.693059] 1f09 9216 mtdblock9 (driver?)
[ 4.698094] 1f0a 6400 mtdblock10 (driver?)
[ 4.703214] 1f0b 14336 mtdblock11 (driver?)
[ 4.708339] 1f0c 16896 mtdblock12 (driver?)
[ 4.713458] 1f0d 61440 mtdblock13 (driver?)
[ 4.718582] 1f0e 1280 mtdblock14 (driver?)
[ 4.723701] 1f0f 30720 mtdblock15 (driver?)
[ 4.728826] 1f10 57344 mtdblock16 (driver?)
[ 4.733945] 1f11 127232 mtdblock17 (driver?)
[ 4.739069] 1f12 59392 mtdblock18 (driver?)
[ 4.744228] 1f13 90880 mtdblock19 (driver?)
[ 4.749313] 1f14 26676 mtdblock20 (driver?)
[ 4.754471] 1f15 50344 mtdblock21 (driver?)
[ 4.759552] No filesystem could mount root, tried: ubifs
[ 4.764942] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 5.837944] Rebooting in 5 seconds..
So from the log I can tell that ubi attached to mtd19 as expected, resized the second partition (ubi_vol_overlay), created two mtd partitions from the ubi volumes (mtd20 and mtd21), and created two block devices on top of these (mtdblock20 and mtdblock21), great.
However, mounting the squashfs filesystem (mtdblock20) failed. The log says it tried mounting with as ubifs even though I explicitly said to use squashfs via the rootfstype argument.
At first I thought that maybe the name of the device wasn't resolving correctly in the root= parameter, so I've tried using /dev/mtdblock20 but it resulted in the same.
How can I force the kernel to mount it with squashfs instead of ubifs?
|
Squashfs needs a block device to run, thus you need the block emulation over UBI. First make sure it is enabled in your kernel.
You can test this by using the ubiblock command on a running system. For example, running ubiblock -c /dev/ubi0_0 will create the devnode /dev/ubiblock0_0.
Once you have the dependency, you can enable the UBI block on the cmdline like this:
ubi.mtd=2 ubi.block=0,ubi_vol_rom root=/dev/ubiblock0_0
This will use the UBI volume named ubi_vol_rom and create an emulated block device. Then you can use it to mount your root.
| Using squashfs on top of ubi as root file system |
1,534,554,907,000 |
Whilst reading both https://lwn.net/Articles/391222/ and http://man7.org/linux/man-pages/man5/proc.5.html I have come across the terms oom_score and badness. Both numbers have the same basic meaning; the higher they are, the more likely the associated task is to be OOM-killed when the host is under memory pressure.
What is the relationship (if any) between the two numbers?
EDIT: My guess is oom_score = max(badness + oom_score_adj, 0) but I haven't found any proof
|
It looks like it is:
oom_score = badness * 1000 / totalpages
based on the kernel code https://github.com/torvalds/linux/blob/master/fs/proc/base.c#L549.
static int proc_oom_score(struct seq_file *m, struct pid_namespace *ns,
struct pid *pid, struct task_struct *task)
{
unsigned long totalpages = totalram_pages + total_swap_pages;
unsigned long points = 0;
points = oom_badness(task, NULL, NULL, totalpages) *
1000 / totalpages;
seq_printf(m, "%lu\n", points);
return 0;
}
| What is the relationship between oom_score and badness? |
1,534,554,907,000 |
I am trying to use read-only overlayfs(no workdir and upperdir) inside custom initrd.
This works fine in completely booted OS:
mkdir /tmp/ovl1 /tmp/ovl2 /tmp/merged
mount -t overlay none -o lowerdir=/tmp/ovl1:/tmp/ovl2 /tmp/merged
This also works if I use busybox sh as shell, which has built-in mount command.
Inside initrd shell directories are successfully created, and mount command gives this error:
mount: mounting none on /tmp/merged failed: No such device
Here is output of mount command inside initrd:
rootfs on / type rootfs (...
sysfs on /sys type sysfs (...
proc on /proc type proc (...
udev on /dev type devtmpfs (...
devpts on /dev/pts type devpts (...
tmpfs on /run type tmpfs (...
I got no idea how to debug this one :(
P.S. Now I use AUFS and it works fine, but it was rejected from mainline kernel and it's recommended to switch to overlayfs.
|
I was sure, that module is statically compiled in kernel, but I was wrong: CONFIG_OVERLAY_FS=m.
After adding the overlay module to initrd everything works fine.
| Can not mount overlayfs inside initrd |
1,534,554,907,000 |
I am studying Professional Linux Kernel Architecture and I am in Chapter 3 Memory Management. While I studied kernel address space itself is split into direct mapping area, vmalloc area, kmap area and fixed mapping area.
What I am wondering is just like below.
Can direct mapping area(896MB) of kernel address space in 32-bit machine be accessed by function like __va, __pa without MMU?
if 1. is true then master kernel page table(swapper_pg_dir) manages only 128MB ?
While I am studying kernel code I found difference in paging_init function between 32-bit and 64-bit. In 32-bit, I found pagetable_init function which initialize and master kernel page table in paging_init function.
function paging_init in 32-bit
void __init pageit_init(void){
pagetable_init();
__flush_tlb_all();
kmap_init();
olpc_dt_build_devicetree();
sparse_memory_present_with_active_regions(MAX_NUMNODES);
sparse_init();
zone_sizes_init();
}
But in 64-bit, I could't find kernel page table related function in paging_init function.
void __init paging_init(void)
{
sparse_memory_present_with_active_regions(MAX_NUMNODES);
sparse_init();
node_clear_state(0, N_MEMORY);
if (N_MEMORY != N_NORMAL_MEMORY)
node_clear_state(0, N_NORMAL_MEMORY);
zone_sizes_init();
}
Is 64-bit kernel doesn't have master kernel page table? If it's true is it just access kernel memory only by direct mapping?
|
Answers to questions 1 and 2: no, once paging has been enabled, the CPU instructions only use virtual addresses, which are translated to physical addresses using the MMU before reading or writing RAM. The __va and __pa macros don't access memory, they just convert addresses between the address spaces. On a 32-bit machine, __va just adds 0xc0000000 to the physical address given as argument, because the mapping has been set up so that physical address N is at virtual address N+0xc0000000.
Addresses you want to access with the CPU must have a mapping; you can't bypass the MMU. So a mapping that manages only 128 MB is not sufficient.
| Kernel address space and Kernel page table |
1,534,554,907,000 |
I have both 3.2 and 2.6 installed on a server, but neither sudo apt-get dist-upgrade nor sudo apt-get install linux-image-3.2.0-4-amd64 can upgrade the kernel.
user@server:~$ uname -a
Linux server 2.6.32-5-xen-amd64 #1 SMP Tue May 13 18:41:58 UTC 2014 x86_64 GNU/Linux
user@server:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 7.11 (wheezy)
Release: 7.11
Codename: wheezy
user@server:~$ sudo apt-cache policy linux-image-3.2.0-4-amd64
linux-image-3.2.0-4-amd64:
Installed: 3.2.89-2
Candidate: 3.2.89-2
Version table:
*** 3.2.89-2 0
500 http://security.debian.org/ wheezy/updates/main amd64 Packages
100 /var/lib/dpkg/status
3.2.78-1 0
500 http://ftp.us.debian.org/debian/ wheezy/main amd64 Packages
user@server:~$ sudo apt-cache policy linux-image-2.6.32-5-xen-amd64
linux-image-2.6.32-5-xen-amd64:
Installed: 2.6.32-48squeeze6
Candidate: 2.6.32-48squeeze6
Version table:
*** 2.6.32-48squeeze6 0
100 /var/lib/dpkg/status
Here's the last couple of lines from dpkg.log
2017-08-03 15:05:39 install linux-image-3.2.0-4-amd64:amd64 <none> 3.2.89-2
2017-08-03 15:05:39 status half-installed linux-image-3.2.0-4-amd64:amd64 3.2.89-2
2017-08-03 15:05:43 status unpacked linux-image-3.2.0-4-amd64:amd64 3.2.89-2
2017-08-03 15:05:44 status unpacked linux-image-3.2.0-4-amd64:amd64 3.2.89-2
2017-08-03 15:05:44 startup packages configure
2017-08-03 15:05:44 configure linux-image-3.2.0-4-amd64:amd64 3.2.89-2 <none>
2017-08-03 15:05:44 status unpacked linux-image-3.2.0-4-amd64:amd64 3.2.89-2
2017-08-03 15:05:44 status half-configured linux-image-3.2.0-4-amd64:amd64 3.2.89-2
2017-08-03 15:05:55 status installed linux-image-3.2.0-4-amd64:amd64 3.2.89-2
|
My hosting provider doesn't use the normal Debian grub setup where GRUB_DEFAULT is declared in the file /etc/default/grub. For me, I had to manually edit the file /boot/grub/menu.lst and change the default directive to 0.
Make sure to ask your host if they've got an alternative setup for grub.
| Stuck on old kernel when trying to upgrade from Squeeze to Wheezy |
1,534,554,907,000 |
After a reboot or crash, the syslog does not save any messages from the previous session. What should I do to tell syslogd/klogd to append to syslog instead of overwriting every session? I feel I am missing something obvious.
Some background on my system:
Distribution: Yocto (poky) with busybox
Method of launching klogd/syslogd: init
Starting configs/scrips klogd/syslogd uses: /etc/syslog-startup.conf and /etc/init.d/syslog
/etc/syslog-startup.conf
# This configuration file is used by the busybox syslog init script,
# /etc/init.d/syslog[.busybox] to set syslog configuration at start time.
DESTINATION=file # log destinations (buffer file remote)
LOGFILE=/var/log/syslog # where to log (file)
REMOTE=loghost:514 # where to log (syslog remote)
REDUCE=no # reduce-size logging
DROPDUPLICATES=no # whether to drop duplicate log entries
ROTATESIZE=100 # rotate log if grown beyond X [kByte]
ROTATEGENS=3 # keep X generations of rotated logs
BUFFERSIZE=64 # size of circular buffer [kByte]
FOREGROUND=no # run in foreground (don't use!)
LOGLEVEL=8 # local log level (between 1 and 8)
/etc/init.d/syslog
#! /bin/sh
### BEGIN INIT INFO
# Provides: sysklogd
# Required-Start: $remote_fs $time
# Required-Stop: $remote_fs $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: System logger
### END INIT INFO
set -e
if [ -f /etc/syslog-startup.conf ]; then
. /etc/syslog-startup.conf
LOG_LOCAL=0
LOG_REMOTE=0
for D in $DESTINATION; do
if [ "$D" = "buffer" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -C$BUFFERSIZE"
LOG_LOCAL=1
elif [ "$D" = "file" ]; then
if [ -n "$LOGFILE" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -O $LOGFILE"
fi
if [ -n "$ROTATESIZE" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -s $ROTATESIZE"
fi
if [ -n "$ROTATEGENS" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -b $ROTATEGENS"
fi
LOG_LOCAL=1
elif [ "$D" = "remote" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -R $REMOTE"
LOG_REMOTE=1
fi
done
if [ "$LOG_LOCAL" = "1" -a "$LOG_REMOTE" = "1" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -L"
fi
if [ "$REDUCE" = "yes" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -S"
fi
if [ "$DROPDUPLICATES" = "yes" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -D"
fi
if [ -n "$LOGLEVEL" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -l $LOGLEVEL"
fi
else
# default: log to 16K shm circular buffer
SYSLOG_ARGS="-C"
fi
case "$1" in
start)
echo -n "Starting syslogd/klogd: "
start-stop-daemon -S -b -n syslogd -a /sbin/syslogd -- -n $SYSLOG_ARGS
start-stop-daemon -S -b -n klogd -a /sbin/klogd -- -n
echo "done"
;;
stop)
echo -n "Stopping syslogd/klogd: "
start-stop-daemon -K -n syslogd
start-stop-daemon -K -n klogd
echo "done"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: syslog { start | stop | restart }" >&2
exit 1
;;
esac
exit 0
|
It seems /var/log/ directory was redirected to /var/volatile/log/ at boot which is mounted as tempfs so the data wouldn't be saved across a reboot/crash. Commenting out the line that mounts /var/volatile/ directory as tmpfs in the /etc/fstab file seems to have worked.
| How to get syslogd/klogd to append to syslog after reboot instead of overwriting? |
1,534,554,907,000 |
I don't know how to properly debug the kernel configuration process when an option that should be on ( because it doesn't really depends on anything and it doesn't conflict with anything that I can think of ) , really can't find a way to live beyond make olddefconfig .
Among other things I'm using
CONFIG_SYS_SUPPORTS_ZBOOT=y
with a 4.8.6 kernel tree and I found no way to write a .config file that will retain this specific flag on after using make and according to the available documentation and scripts in the arch/mips this shouldn't happen .
Since this option is required in order to generate vmlinuz for mips targets I have enabled lzma for the kernel for both compression and decompression but so far ... nothing, CONFIG_SYS_SUPPORTS_ZBOOT=y keeps on "going off" .
Do you have any idea how I can literally force a CONFIG flag to stay on or how to debug why make and kbuild are thinking that this flag can't be on ?
|
Manually changing the .config file without Kconfig is discouraged as it might lead to unexpected behavior. In your case the best solution would be to run
make menuconfig
and selecting the configuration option from the menuconfig (the parameter you are looking for should be under arch/mips).
| How to force a CONFIG_ option to stay on? |
1,534,554,907,000 |
Let's say that I have a following network topology:
Theoretical total(Tx + Rx) bandwidth for all four hosts in total is 100Mbps. Now if I execute Iperf in UDP mode in all four hosts simultaneously and force each Iperf instance to put 50Mbps(-b 50m in Iperf client) of traffic on wire, then Iperf does not put as much traffic on wire. This is because NICs receive collisions and thus Iperf client receives -1 as a return value for some of its write() system calls to UDP socket. While I understand how kernel and Iperf client communicate, I do not quite understand how NIC and kernel communicate. Does it happen with NIC driver(tg3 for my BCM5721 NIC)? Is there some sort of system call which informs kernel that collisions have occurred?
|
The kernel and the NIC communicate the same way the kernel
(specifically, a device driver, which is part of the kernel)
communicates with any other device (e.g., serial communications device
(like keyboard, mouse, or RS232), disk (or disk-like mass storage device),
display, security token, etc.) – they talk directly to each other.
So, yes, this happens within the NIC driver.
No, driver ↔ device communication does not go through a system call.
Device drivers communicate with devices, generally, through two access methods:
Memory-Mapped I/O (MMIO) and Port-Mapped I/O (PMIO).
These are described and discussed at some length on Super User
in these two questions:
Difference between port mapped and memory mapped access?
How does a driver actually communicate with a hardware device?
See also What is a driver, and how does it work?
if you need the background information.
BTW, which access method is used is determined by the computer architecture.
For example, Wikipedia says,
“Memory-mapped I/O is preferred in x86-based architectures …”
Getting back to your specific question, if we assume memory-mapped I/O,
the driver could test for collision with C code as simple as
if (nic->error_status & COLLISION)
{
// We get here if there was a collision.
(code to handle collision)
⋮
}
(where nic is a pointer to the NIC’s mapped address)
and it’s a trivial matter then for the driver to cause an error
to be returned to the user process from the write() system call.
Follow-up question:
Does the fact that drivers are part of the kernel mean that
there is no driver ↔ kernel communication method?
That might almost be worth asking as another question
(or at least doing some more research; i.e., web searches).
Originally, the Unix kernel was monolithic
(see also monolithic kernel).
The relationship between the kernel and the drivers
was like the relationship between a human body and its hands —
hands are distinctive,
and would never be confused with, say, elbows or lungs —
but they are an integral part of the body.
Even on machines that had four protection rings, Unix used only two —
the kernel was in ring 0 and userland was ring 3.
There are other operating systems where device drivers
are analogous to knife and fork — one level removed
(e.g., drivers are in one of the intermediate rings (1 and/or 2)).
I haven’t kept up with all the developments in *nix/Linux (e.g., LKMs),
and some unices may have a greater degree of separation
between the base kernel and the drivers than others.
For example, see
What is the difference between kernel drivers and kernel modules?
(on Unix & Linux)
The Linux Kernel, Kernel Modules and Hardware Drivers … …
(on an external site)
As I say, this stuff is at the edge of my knowledge base;
don’t ask me any further follow-up questions on the above.
But also, the question is semantically ambiguous.
Does the body communicate with the hands?
Yes, through the nervous system (and, to an extent, the skeleton).
Does “the kernel” communicate with device drivers
(that are part of the kernel)?
Yes, in the same sense that C programs (e.g., cat, cp, ls, sed, etc.)
communicate with the C library — through subroutine calls
(and perhaps the occasional, judicious use of global variables).
When a user process calls an I/O-related system call (e.g., open(),
close(), read(), write(), ioctl(), poll(), select(), etc.),
the general-purpose syscall-handling code (in the kernel)
calls the appropriate device driver routine
(possibly with some intermediate logic).
Filesystem-related code also calls the appropriate disk driver routines.
And the kernel at least facilitates the invocation
of device-specific interrupt handlers when interrupts are received
(implementations vary).
| How does Linux kernel know that collisions occurred in Ethernet collision domain? |
1,534,554,907,000 |
I am trying to install a new kernel on Ubuntu Server and I am unable to complete it due to a "gzip: stdout: no space left on device" error. The full error was produced after running sudo make modules_install install:
INSTALL /lib/firmware/cpia2/stv0672_vp4.bin
INSTALL /lib/firmware/yam/1200.bin
INSTALL /lib/firmware/yam/9600.bin
DEPMOD 3.16.0
sh ./arch/x86/boot/install.sh 3.16.0 arch/x86/boot/bzImage \
System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.16.0 /boot/vmlinuz-3.16.0
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.16.0 /boot/vmlinuz-3.16.0
update-initramfs: Generating /boot/initrd.img-3.16.0
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.16.0 with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
make[1]: *** [install] Error 1
make: *** [install] Error 2
I checked the disk space using df -h and here is the output:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/server--vg-root 103G 33G 66G 34% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 63G 4.0K 63G 1% /dev
tmpfs 13G 1.8M 13G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 63G 148K 63G 1% /run/shm
none 100M 24K 100M 1% /run/user
/dev/sda1 236M 62M 162M 28% /boot
/home/stan/.Private 103G 33G 66G 34% /home/stan
I don't understand why this error is being produced given the amount of space. I have successfully used the exact same procedure on both Debian and OpenSUSE.
|
"make modules_install install" tries to build initrd image on /boot partition, which has 162 megabytes free, which is simply not enough.
If you want to compile kernel yourself on Ubuntu, you need to prepare at least 1GB free space on /boot partition.
| Unable to install new kernel in ubuntu server. "gzip: stdout: No space left on device" error even though abundant disk space |
1,534,554,907,000 |
I have the source of Linux 3.4.0 to which I added some modifications. I know that here (ftp://ftp.kernel.org/pub/linux/kernel/v3.x/) I can find all the 107 patches that need to be applied to my source to update it to the 3.4.107 version.
I read that I have to apply them one by one: first the 3.4.1, then the 3.4.2, then the 3.4.3 etc.
But my doubt is: can I apply directly the 3.4.107 patch?
I opened the 3.4.107 patch file and noticed that it changes SUBLEVEL = 0 in Makefile to SUBLEVEL = 107, so I thought that this means that it is meant to be used by devs who still have got the 3.4.0 source. What's more, I also noticed that the size of the patch files increases from 3.4.1 to 3.4.107, this seems to confirm my idea that every patch contains:
all the changes that are included in the previous patches
its new fixes.
Can you tell me whether I'm right or not?
|
Each patch in https://www.kernel.org/pub/linux/kernel/v3.x/ applies to the first release of the corresponding series, so you should apply https://www.kernel.org/pub/linux/kernel/v3.x/patch-3.4.107.xz directly to your 3.4.0 source tree. Incremental patches are available, but they're stored separately, in https://www.kernel.org/pub/linux/kernel/v3.x/incr/; you would use these to patch an already-patched tree (e.g. if you want to upgrade your 3.4.107 tree to a future 3.4.108).
As derobert suggests, you'll find keeping up with kernel changes much easier if you work in a copy of the corresponding git stable repository; that will allow you to rebase your patches onto new releases as they come, and benefit from the merge tools available in that context.
| Linux kernel patches: can I skip some? |
1,534,554,907,000 |
Q: Is it normal if a RHEL 6.5 machine kernel panics if I type the LUKS password a few times wrong?
|
Yes. The init process, which always had process ID 1, exited. UNIX operating systems panic by design when this happens, because essentally, without init, the system cannot continue to do much of anything useful. (That's not technically quite true, some things can continue, but it's not supposed to happen and it considered bad enough to justify restarting the system.)
The initramfs gave up asking you for a password and just quit. Since in that early boot stage init is an initramfs scripts instead of the real init, the same thing happens.
| Kernel panic if LUKS password is bad x times |
1,534,554,907,000 |
I have a binary that repacks android kernel (not mkbootimg).
I'm making a script to automate the process.
I don't want any output on the screen. So I have redirected the output to a file named foo.log.
The command is - kernel_make "$zImage" "$ramdisk" "$cmdline" "$image" &> data/local/working/foo.log
My current working folder is data/local/working/.
What I've to do is, if the last line of the output (foo.log) is this -
"targed file $1 is patched sucesfully, enjoy new kernel"
Then return 0 and exit. Else return 1 and exit.
I'm trying to do with grep, but as I'm new to command line, do don't have any idea of doing it the right way.
|
grep is the way to go, it returns 0 if a match is found. You don't actually need to output the line, so just discard the line and use the test. In your case, it would just be
lastline=$(tail -n1 logfile)
if grep pattern <<<"$lastline" &>/dev/null; then
echo "yay, found pattern"
else
echo "darn"
fi
Observe the "here string" construct <<< which presents the string as a file for grep to read, and &> that redirects both standard output and error output (redirect to null in this case). Pattern could be "enjoy" or something. Replace the echoes with your custom handling.
However, it would make much more sense to just check if kernel_make returns 1 if it fails. No need to parse a user-friendly log output (which will likely change or cease to be the last message). If that is the case (most likely), I'd just do
kernel_make [...arguments...] && echo "yay" || echo "nay"
(or an if statement, like in the grep case). And you are probably familiar with exit statement which you will probably use in the form exit 1 in the case of failure.
If kernel_make is the last line of the script, you don't even have to do anything...
| How to return 0 if a pattern is matched from a file? [duplicate] |
1,534,554,907,000 |
The very little documentation about /proc/filesystems says it is a "list of supported file systems". I see a lot of file system modules in /lib/modules/linux_ver/kernel/fs, most of which do not appear in /proc/filesystems, nevertheless mount appears to have no problem using those file system modules.
So what is the use of /proc/filesystems? And why is it different from the list of filesystem modules?
|
If there is an available module for the file system you want to mount but it's not yet loaded and hence isn't yet shown in /proc/filesystems, then it will be loaded on-demand which it why you don't have any problem mounting.
After having mounted such a file system, then that file system type should have appeared in /proc/filesystems.
Hence it is a "list of supported file systems for which the driver is already loaded"; additional file systems may be added by loading the appropriate module.
| What is /proc/filesystems supposed to be and why is it different from /lib/modules/linux_ver/kernel/fs? |
1,534,554,907,000 |
Based on https://www.kernel.org/ kernel 3.12 is released in 2014-04-23 and kernel 3.10 is released in 2014-04-27.
Based on release date, 3.12 is older and based on version number 3.10 is older.
Which one is newer? Which one has more features? Does 3.12 have 3.10 features?
|
You should familiarize yourself with the different branches:
Longterm There are usually several "longterm maintenance" kernel releases provided for
the purposes of backporting bugfixes for older kernel trees. Only
important bugfixes are applied to such kernels and they don't usually
see very frequent releases, especially for older trees.
You're looking at two different longterm kernel versions. They provide you a 3.10 and a 3.12 kernel because the latest one is 3.14 but you might need something to work like it did in one of those earlier kernels. Having a long term feature freeze on a particular kernel version enables people to get bug fixes without changing anything that would be user- or admin-facing.
Does 3.12 have 3.10 features?
Yes and no. Features are added, remove, and changed all the time. The only way to know for sure is to check the release notes for each kernel version to see if the feature you're concerned about is in there somewhere.
All we can really say that the 3.12 represents a later stage of development than the 3.10 kernel. The dates beside them just reflect the last time someone updated that particular branch. If you want the latest and greatest you should look at 3.14
| Kernel 3.12 or 3.10? which one has more features, newer and better? |
1,534,554,907,000 |
I'm using buildroot to generate my images and for sure there is the option of compression with the help of different methods (LZO, LZMA, gzip, ...).
So far i found these 3 compression options in buildroot (v. 2013.11):
Kernel compression Mode (in make linux-menuconfig)
Built-in initramfs compression mode (in make linux-menuconfig)
Compression method for the .cpio root file system ( (in make menuconfig)
my questions are:
what is the difference of these modes and
why am I forced to chose between 3 methods for the kernel compression, instead of leaving it uncompressed ?
greetings
|
The three different options are for three different aspects of the generated Linux system, the kernel itself, the initramfs and the result file system.
Kernel compression Mode: this compresses the compiled kernel image. For example, on my Ubuntu 12.04 machine, the kernel is at /boot/vmlinuz-3.8.0-35-generic
Built-in initramfs compression mode: the compression of the initial ram filesystem image. On my machine, this would be /boot/initrd.img-3.8.0-35-generic.
Compression method for the .cpio root file system: This is the root / filesystem. On a desktop system, this will be usually a disk partition (ext2/3/4...), mounted read/write on /. On an embedded system, it would be a compressed .cpio archive mounted read only on / (after the boot completes).
The Linux kernel is decompressed by the boot-loader into memory and then given control, then the kernel will mount the initial ram file system as the root fs, the initramfs will do certain tasks, including loading the real file system (the .cpio root file system) and finishing the boot process.
The three different modes uses different compression algorithms, the different algorithms has different requirement when decompressing the data: memory usage, time to decompress (cpu usage) and the library decompression routines' size.
So you need to choose the compression algorithms that better suits your needs and your target platform. There exists many charts that compares the requirements and the performance of different libraries (benchmarks).
buildroot is usually targeted at embedded devices (as I know), the size factor is very critical in these devices, thus you usually need the initramfs, the kernel, and the root filesystem to be compressed.
Actually, even on non embedded devices (desktop, servers...) the kernel and the initramfs are usually compressed. The pros of doing this outscores the cons.
| I want to understand Buildroot - the 3 compression config options (kernel, initramfs & rootfs) |
1,534,554,907,000 |
I would like to install Arch Linux on my Acer TravelMate 5735Z. Sadly, it has a Intel GMA 4500 MHD graphic card. This means, I suffer from Kernel Bug [GM45] black screen at boot (0 backlight?).
When I boot from the installation CD for Arch Linux 2013.10.01, I can see the menu that lets me choose to install arch/boot the installed system (Ubuntu 10.04, I think)/Power off. But when I choose to install Arch, the screen gets black.
In this German article, the author seems to have found a solution for Linux Mint. But he begins with "start LiveCD in compatibility mode". As there is no such thing in the Arch Menu, I thought I had to edit the installation parameters. But when I hit tab, I get some cryptic stuff:
. linux boot/x86_64/vmlinuz archisobasedir=arch archisolabel=ARCH_201310 init
rd=boot/x86_64/archiso.img
I only have WLAN, so I can't try a network installation.
How can I install Arch Linux on this computer?
|
You need to hit E at the GRUB menu. According to the bug report you linked to, the workaround is to add i915.invert_brightness=1 to your kernel parameters. Scroll down to the kernel line and change it to (emphasis mine):
linux /boot/x86_64/vmlinuz archisobasedir=arch archisolabel=ARCH_201310 initrd=boot/x86_64/archiso.img i915.invert_brightness=1
To make these changes permanent, edit the kernel line of /etc/default/grub and add i915.invert_brightness=1 to the end:
GRUB_CMDLINE_LINUX="[EXISTING VALUES] i915.invert_brightness=1"
| How can I install Arch Linux on a Laptop with Intel GMA 4500 MHD? |
1,534,554,907,000 |
As seen here, compiling the Android kernel requires a prebuilt GCC toolchain (or the equivalent from the Android NDK). Cross-compilation makes sense; we are compiling code for a device with a different platform.
However, the guide to compiling the Android source does not anywhere require that one download a toolchain or NDK, and my understanding is that none of the tools used (SDK, etc.) contain a toolchain, either.
But of course compiling the source from scratch also builds the kernel. What's going on -- why do we need a gcc toolchain when building the kernel one way, but not the other?
|
You need the gcc toolchain for both.
The toolchain is part of the android source tree. Before you build the entire android source, you use the "lunch" tool, which sets the environment variables such that a prebuilt toolchain can be used.
http://source.android.com/source/building-running.html#choose-a-target
The page about compiling the android kernel has different instructions because it assumes you want to build only a kernel and may not even download the entire android source tree. That's why it explains how to get and choose a toolchain in a manner different than through "lunch".
| Why does building an Android kernel need a toolchain, but compiling the entire source does not? |
1,534,554,907,000 |
Recently, after performing a routine software upgrade, I notice a huge surge in the number of warnings from the kernel that goes like this:
warning kern [10839.717480] phy0 -> rt2800usb_txdone: Warning - Got TX
status for an empty queue 0, dropping warning kern [10839.895305]
phy0 -> rt2800usb_entry_txstatus_timeout: Warning - TX status timeout
for entry 11 in queue 2 warning kern [10839.895325] phy0 ->
rt2800usb_entry_txstatus_timeout: Warning - TX status timeout for
entry 11 in queue 2 warning kern [10839.895327] phy0 ->
rt2800usb_entry_txstatus_timeout: Warning - TX status timeout for
entry 11 in queue 2
I think it has something to do with either the newly installed kernel-3.9.4-200 or wpa_supplicant-1.1-1 as the warnings appeared soon after these were installed. From the message itself, I think it has something to do with the wireless transmission, but not sure whether this is something serious as it is filling up my log quite rapidly.
I am using a TP-Link wireless USB adapter. Has anyone encountered such problem or know whether it is something that I need to worry about?
|
This looks to be an active bug in the rt2800usb driver. There's an open issue in the Fedora's bugzilla database here, titled:
Bug 913631 - Slow wireless connection using rt2800usb driver (Asus USB-N13 dongle).
TX status timeout
The term TX refers to transfer (i.e. sending) and RX refers to receiver (i.e. receiving). I would say that it is something that you need to worry about given these messages mean your wireless driver & hardware combination aren't working 100% correctly. So you'll likely see either slow network access and/or flaky network connectivity.
| What is TX status timeout and do I have to worry about it? |
1,534,554,907,000 |
I have recently compiled a minimal kernel for my Intel(R) Pentium(R) Dual CPU T3400 @ 2.16GHz, and chose CONFIG_MCORE2 (Core 2/newer Xeon) under "Processor type and features > Processor family"
I don't know if this is related, but my laptop has 2GB of RAM, and the resulting kernel, when compiled, limited my RAM to only 800MB.
Searching google for my CPU doesn't bring anything useful!
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Pentium(R) Dual CPU T3400 @ 2.16GHz
stepping : 13
microcode : 0xa3
cpu MHz : 2166.000
cache size : 1024 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm lahf_lm dtherm
bogomips : 4322.39
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Pentium(R) Dual CPU T3400 @ 2.16GHz
stepping : 13
microcode : 0xa3
cpu MHz : 2166.000
cache size : 1024 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm lahf_lm dtherm
bogomips : 4322.39
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
|
Look, your CPU family cpu family : 6, which matches the description in CONFIG_MCORE2:
Newer ones have 6 and older ones 15
That's the right config to choose.
And your memory issue, as you disabled HIGHMEM, your kernel can only use 896M memory space.
| Which "Processor family" to choose under "Processor type and features"? |
1,534,554,907,000 |
I didn't really know where to ask this question, so since Joli OS uses the linux kernel and they don't seem to have a forum here I go.
All the official information I could gather says it doesn't work on ARM devices yet. But when I went to GitHub to look at the code I saw an arm subfolder in jolicloud-robby-kernel/arch.
So is it possible with some tweaking to install on an ARM device? Maybe someone with some kernel knowledge can enlighten me.
(GitHub link: https://github.com/jolicloud/jolicloud-robby-kernel)
|
Linux can run on ARM, and if all sources are available, with enough work most disro's could be ported. As far as JoliOS, everything seems to indicate ARM support is very experimental. If you are experienced, with embedded systems, then hacking a project might yield a usable system. It is not the type of project I would want, if I was just getting my feet wet. Also This assumed you have no problem compiling kernels, and preferably cross-compiling kernels. You would have to see if your platform is currently available in the arm kernel sources, or bring in support from another kernel version.
I've been following/messing around with ARM for a couple years now, my netbook is a Hercules eCAFE EX (Freescale I.MX51). As cool as it is, ARM support is NOTHING like the extremely mature x86 and x86_64. Hardware support is extremely fragmented, chipset by chipset specific. As crazy as it sounds... officially supported chipsets often becomes unsupported after just one release cycle. Its like the circa `97 GNU/Linux wild west, but even more fragmented. Remember ARM does not have a standard 'BIOS', so boot methods differ chipset to chipset. ARM also does not have a standard 'ACPI', although some chipsets do emulate it, more support APM.
I understand why you did not know where to ask this question, its because good information on arm is so scarce. It does exist, but only on the 'well traveled' paths. If your starting with ARM, check which distro/version you want and which chipsets/devices it supports. Always try and pick the most supported chipset, the less binary blobs the better. Look for something with some existing community of owners, some experienced hackers might exist. When I get my next device, I will try and get something officially supported by Ubuntu 12.04 LTS.
I hope I at least helped you figure out your direction. If you have platform specific details and attempt that build, I might be able to help if you get stuck.
| Joli OS on ARM devices |
1,534,554,907,000 |
Linux supports a set of different disk label or partition table formats. For example, Sun Disk Labels and MS-DOS partition tables are both disk labels that contain (largely) the same information (partitioning) in different formats. Please note, I'm not referring to filesystems like ext{2,3,4} but disklabels like the msdos, GPT, Sun Disk Label, etc.
I'd like to add support for a disk label format that's not currently in the kernel, but it looks like (from browsing fs/partitions/) that these are built into the kernel itself, and can't be compiled as modules.
Is there any sort of kernel API I could use to add support for different disk labels?
Will I have to resort to losetup instead?
|
kpartx uses the device mapper tools to create devices over the underlying media; you should be able to implement your partition parser in userspace and create DM mappings that expose parts of the underlying system to the kernel as block devices.
That absolves you of all the complexity of in-kernel work, and should still support booting through an initramfs, if required.
| Writing Linux Kernel module for non-MSDOS disk labels/partition tables |
1,534,554,907,000 |
For dacades X windows system is either BASH, C or etc. But is there any X windows system or any wrapper which can interpret HTML, CSS, Javascript to general Windows system?
I would like to build this: http://www.google.com/tv/features.html
(everything comes from my web server, and get render as UI)
What is the best way to do so?
|
ǝʃƃoo⅁ ɹɐǝ◖
while I'm not aware of anything that fits your description, you could have a look at the Mozilla Project's "Chromeless":
Instead building a whole new platform, we suggest that the web itself should be the platform. That a developer could design the browser using standard web technologies combined with a minimal set of new APIs to interact with the underlying operating system and control the application's user interface.
It's supposed to be a the-browser-is-the-OS thingy like (your, haha) Chrome OS.
Also have a look at Symphony OS with their Mezzo desktop environment, I don't know any details, but apparently they use some Mozilla base, too, so the desktop environment includes HTML, JS, even Flash.
Last but not least, the GNOME project could be interesting, for one thing, GNOME Shell is full of Javascript and Metacity at least has experimental CSS styling.
Oh, and the whole issue gets turned upside down if you consider GTK3's HTML5 backend.
| Is there any X windows system, which is HTML, CSS, Javascript? Such as Web Browser? |
1,534,554,907,000 |
After executing...
sudo modprobe rt3572sta
I get...
Invalid module format
What does it mean? I'm trying to get Wusb600n v2 working on Lucid Lynx.
Does it mean that kernel versions aren't compatible?
|
It means that the file you are trying to load is not a valid kernel module. Either it never was, or it has been corrupted, or possibly it is for an architecture other than the one you have ( 32 vs 64 bit ).
| What does 'Invalid module format' mean? |
1,534,554,907,000 |
Is there support for Kernel versions 2.4-2.6 in RedHat Enterprise Linux versions 4 and 5?
|
Both RHEL versions 4 and 5 shipped with 2.6 series Linux kernels.
It is possible but difficult to manually compile your own 2.4 kernel for RHEL 4, but even that is problematic because of the dependencies on 2.6 features. I don't think it would be practically possible with RHEL 5.
In order to use 2.4 kernels you need to also use legacy versions or alternate branches of a lot of other core Linux components. If you need 2.4 for some reason you should consider a distribution that is maintained specifically for it.
| RedHat Enterprise Edition Kernel Support |
1,534,554,907,000 |
I used the Reiser4 fs for some time and would love to see it get into the mainline kernel. I would think the project can still go forward even if Hans is not able to contribute these days. Is there any mention on a mailing list or elsewhere of plans to get Reiser4 into the mainline kernel?
|
The reason isn't so much technical or necessarily political, but perhaps pragmatic. Edward Shishkin says that before it goes mainline it needs vendor support
Hello Michael.
I don't see any technical obstacles for Reiser4 inclusion. There are only organisation ones: I don't think it will be accepted without support from some vendor.
One company might have an interest in developing Reiser4, as they said, however, there is no essential progress in this direction for now..
Thanks,
Edward.
| Status of adding Reiser4 to the Linux kernel |
1,534,554,907,000 |
I have heard that different distributions of Linux have the same Linux kernel up to that the Linux kernels may be in different versions. Do different distributions of Unix also share the same kernel up to different versions? What are some examples of various distributions of Unix? I've only heard of BSD.
|
Linux is, in a narrow sense, a kernel. In a more common wider sense, “Linux” means a software distribution (an operating system and some applications) containing this kernel. See Is Linux a Unix?.
At any given point in time, each Linux distribution contains different versions of each of the thousands of pieces it's made of. They may additionally make slight modifications to some of the pieces, for example some distributions ship additional drivers with their kernels (usually, these drivers will make it into the official kernel after a few months — some distributions prefer to ship experimental drivers on the basis that partial support is better than no support).
There are other unix systems that are not based on a Linux kernel. See
Evolution of Operating systems from Unix. The best-known unix-based operating system is Mac OS X; it contains a unix core (based on FreeBSD), but its GUI is different. Other than that, the BSD family is indeed the best-known “mainstream” unix other than Linux.
Unices other than Linux typically have a single official distribution. For example the FreeBSD project provides a kernel, a whole set of basic utilities, and a set of third-party packages. There are a few distributions in the Linux sense, that repackage software from other providers (e.g. Debian GNU/kFreeBSD, which ships a FreeBSD kernel, GNU utilities, and the software otherwise provided in Debian GNU/Linux), but they're rather marginal.
| Kernels of different distributions of Unix and of Linux |
1,534,554,907,000 |
I've never done a kernel patch before, and I've just recently started looking into how it's done. I notice that for a patch's filename, it tells us the kernel version (i.e dm-raid45-2.6.25-rc2_20080221.patch.bz2). So, I know that definitely for kernel 2.6.25, I'd need to apply this patch. But, I just want to make sure: If I've got a kernel that is more recent than the one mentioned - say, 2.6.26 - does this mean that this patch has already moved its way to the 2.6.26 kernel version and that I won't need to apply it at all?
Thanks for clarifying!
|
First of all, you shouldn't need to patch your kernel just because it's not the latest. You would normally rely on your distribution maintainers to do patching. You might need to patch if you had some kind of uncommon hardware, but most of the time, you just need a different or newer kernel module that is supplied separately from the kernel. My current touchpad has issues with the stock Ubuntu Kernel, but I installed a Package someone built to fix it instead of patching my kernel. Some of the more common reasons to patch a kernel are to test out some new feature or update some more core functionality than a device driver.
Assuming you need or just want to patch your kernel, beware that most patches are against a vanilla kernel as one might download from kernel.org. Most Linux distributions have already applied a number of patches of their choosing against a vanilla kernel which can cause a patch to fail to apply. If you want to learn how to patch a kernel, I would first practice building a vanilla kernel and try to boot from it once before patching it.
To answer your last question, it all depends. I can't tell you whether it's in later kernels without knowing exactly what the patch is and looking at the changelog of 2.6.26. Many people provide patches against the kernel for various reasons. The patch may be a bug fix or maybe just an enhancement. Sometimes, it an experiment to improve disk I/O throughput, or some other experiment. There may or may not be an intention to get it integrated with the next kernel release. A patch does not mean that a bug needs to be fixed, or it may attempt to fix a minor bug, but causing a gaping hole instead and be rejected before ever being integrated.
| kernel patches - knowing when to do them |
1,534,554,907,000 |
I tried asking my question on TI's forum, but I am not getting much feedback, so I thought I'd try my luck here.
You can see my ongoing discussion with TI here: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1158936/am3359-caught-segv-when-distro-s-systemd-starting
We have been working with the TI AM335x-ICEV2 board for some time now to develop an embedded Linux Application and received our own custom board design. After a lot of debugging and reading, I am able to make U-Boot load properly and then I went on to load the kernel with a very basic FDT (run-time configuration of U-Boot via a flattened devicetree) which seems to work, but as soon as I reach the distribution booting stage, I get segmentation fault on segmentation fault and/or freezing execution.
At first we suspected hardware issue with the DDR3 mapping, but the design seems to respect all of TI's requirements. Also the freeze/segv always happens during distribution boot. I have never seen a single crash/freeze/segv during U-Boot or Linux Kernel bootings.
The only successful configuration I could get to boot, is the Tiny Filesystem from TI-Linux-SDK that uses SysVinit and loads no module at all. Any systemd os has failed so far (Debian and Arago) and I tried replacing Systemd by a SysV in an existing Debian 10 image, but it failed.
Although the same Uboot + Kernel runs perfectly on a TI IceV2 dev. board.
I am far from being a Linux Bootloader/Kernel pro and I am running out of theories on what could cause this issue or even what tests to run. If someone is willing to answer a few questions, I am more than willing to share some data.
Here is my console output when booting:
I removed this one for an updated one beneath, due to the limit of characters.
And here is my FDT File:
/dts-v1/;
#include "am33xx.dtsi"
/ {
model = "AM335x HELLO";
compatible = "ti,am335x-hello", "ti,am33xx";
chosen {
stdout-path = &uart3;
tick-timer = &timer2;
};
memory {
device_type = "memory";
reg = <0x80000000 0x10000000>; /* 256 MB */
};
vbat: fixedregulator@0 {
compatible = "regulator-fixed";
regulator-name = "vbat";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-boot-on;
};
vmmc: fixedregulator@1 {
compatible = "regulator-fixed";
regulator-name = "vmmc";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
regulator-boot-on;
};
};
&am33xx_pinmux {
mmc0_pins_default: mmc0_pins_default {
pinctrl-single,pins = <
AM33XX_PADCONF(AM335X_PIN_MMC0_DAT3, PIN_INPUT_PULLUP, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_MMC0_DAT2, PIN_INPUT_PULLUP, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_MMC0_DAT1, PIN_INPUT_PULLUP, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_MMC0_DAT0, PIN_INPUT_PULLUP, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_MMC0_CLK, PIN_INPUT_PULLUP, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_MMC0_CMD, PIN_INPUT_PULLUP, MUX_MODE0)
>;
};
uart1_pins: uart1_pins {
pinctrl-single,pins = <
0x180 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart1_rxd.uart1_rxd */
0x184 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart1_txd.uart1_txd */
>;
};
};
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&uart1_pins>;
status = "okay";
};
&mmc1 {
status = "okay";
vmmc-supply = <&vmmc>;
bus-width = <4>;
pinctrl-names = "default";
pinctrl-0 = <&mmc0_pins_default>;
};
EDIT #1
Initialisation Logs do not always crash/freeze at the same place. here is another one but with U-Boot optargs printk.devkmsg=on systemd.log_level=debug debug:
[ 2.175611] Run /sbin/init as init process
[ 2.863478] systemd[1]: System time before build time, advancing clock.
[ 2.996170] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN
2 +IDN -PCRE2 default-hierarchy=hybrid)
[ 3.018180] systemd[1]: No virtualization found in DMI
[ 3.023569] systemd[1]: No virtualization found in CPUID
[ 3.028969] systemd[1]: Virtualization XEN not found, /proc/xen does not exist
[ 3.036559] systemd[1]: No virtualization found in /proc/device-tree/*
[ 3.043420] systemd[1]: UML virtualization not found in /proc/cpuinfo.
[ 3.050020] systemd[1]: This platform does not support /proc/sysinfo
[ 3.056508] systemd[1]: Found VM virtualization none
[ 3.061529] systemd[1]: Detected architecture arm.
[ 3.067154] systemd[1]: Mounting cgroup to /sys/fs/cgroup/perf_event of type cgroup with options perf_event.
[ 3.078818] systemd[1]: Mounting cgroup to /sys/fs/cgroup/blkio of type cgroup with options blkio.
[ 3.089463] systemd[1]: Mounting cgroup to /sys/fs/cgroup/cpu,cpuacct of type cgroup with options cpu,cpuacct.
[ 3.101298] systemd[1]: Mounting cgroup to /sys/fs/cgroup/freezer of type cgroup with options freezer.
[ 3.112236] systemd[1]: Mounting cgroup to /sys/fs/cgroup/memory of type cgroup with options memory.
[ 3.123482] systemd[1]: Mounting cgroup to /sys/fs/cgroup/devices of type cgroup with options devices.
[ 3.134395] systemd[1]: Mounting cgroup to /sys/fs/cgroup/pids of type cgroup with options pids.
[ 3.144778] systemd[1]: Mounting cgroup to /sys/fs/cgroup/net_cls of type cgroup with options net_cls.
Welcome to Debian GNU/Linux 10 (buster)!
[ 3.184740] systemd[1]: Set hostname to <arm>.
[ 3.197755] systemd[1]: Successfully added address 127.0.0.1 to loopback interface
[ 3.205882] systemd[1]: Successfully added address ::1 to loopback interface
[ 3.213414] systemd[1]: Successfully brought loopback interface up
[ 3.220179] systemd[1]: Setting 'fs/file-max' to '2147483647'.
[ 3.230141] systemd[1]: Found cgroup2 on /sys/fs/cgroup/unified, unified hierarchy for systemd controller
[ 3.240134] systemd[1]: Unified cgroup hierarchy is located at /sys/fs/cgroup/unified. Controllers are on legacy hierarchies.
[ 3.258918] systemd[1]: Can't allocate BPF LPM TRIE map, BPF firewalling is not supported: Function not implemented
[ 3.269658] systemd[1]: Can't load kernel CGROUP DEVICE BPF program, BPF device control is not supported: Function not implemented
[ 3.281537] systemd[1]: Controller 'cpu' supported: yes
[ 3.286948] systemd[1]: Controller 'cpuacct' supported: yes
[ 3.292562] systemd[1]: Controller 'io' supported: no
[ 3.297676] systemd[1]: Controller 'blkio' supported: yes
[ 3.303132] systemd[1]: Controller 'memory' supported: yes
[ 3.308654] systemd[1]: Controller 'devices' supported: yes
[ 3.314306] systemd[1]: Controller 'pids' supported: yes
[ 3.319657] systemd[1]: Controller 'bpf-firewall' supported: no
[ 3.325634] systemd[1]: Controller 'bpf-devices' supported: no
[ 3.331602] systemd[1]: Set up TFD_TIMER_CANCEL_ON_SET timerfd.
[ 3.339066] systemd[1]: Enabling showing of status.
[ 3.345654] systemd[1]: Successfully forked off '(sd-executor)' as PID 55.
[ 3.358258] systemd[55]: Successfully forked off '(direxec)' as PID 56.
[ 3.373243] systemd[55]: Successfully forked off '(direxec)' as PID 57.
[ 3.381122] systemd[55]: Successfully forked off '(direxec)' as PID 58.
[ 3.434440] systemd[55]: Successfully forked off '(direxec)' as PID 59.
[ 3.442219] systemd[55]: Successfully forked off '(direxec)' as PID 60.
[ 3.504363] systemd[55]: Successfully forked off '(direxec)' as PID 61.
[ 3.512081] systemd[55]: Successfully forked off '(direxec)' as PID 62.
[ 3.634380] systemd[55]: Successfully forked off '(direxec)' as PID 63.
[ 3.642125] systemd[55]: Successfully forked off '(direxec)' as PID 64.
[ 3.744461] systemd[55]: Successfully forked off '(direxec)' as PID 65.
[ 3.752179] systemd[55]: Successfully forked off '(direxec)' as PID 66.
[ 3.866714] systemd[55]: Successfully forked off '(direxec)' as PID 67.
[ 3.923497] systemd[55]: /lib/systemd/system-generators/systemd-rc-local-generator terminated by signal SEGV.
[ 3.971004] systemd-hibernate-resume-generator[62]: Not running in an initrd, quitting.
[ 4.046186] systemd[55]: /lib/systemd/system-generators/systemd-hibernate-resume-generator succeeded.
[ 4.080695] systemd[55]: /lib/systemd/system-generators/systemd-gpt-auto-generator terminated by signal SEGV.
[ 4.110089] systemd[55]: /lib/systemd/system-generators/systemd-getty-generator failed with exit status 127.
[ 4.121572] systemd[55]: /lib/systemd/system-generators/systemd-cryptsetup-generator succeeded.
[ 4.130888] systemd-sysv-generator[66]: Native unit for sendsigs.service already exists, skipping.
[ 4.142139] systemd-sysv-generator[66]: Cannot find unit udhcpd.service.
[ 4.149412] systemd-sysv-generator[66]: Native unit for bootlogs.service already exists, skipping.
[ 4.159691] systemd-sysv-generator[66]: Cannot find unit cpufrequtils.service.
[ 4.170591] systemd-sysv-generator[66]: Native unit for procps.service already exists, skipping.
[ 4.179985] systemd-sysv-generator[66]: Native unit for checkroot.service already exists, skipping.
[ 4.189433] systemd-sysv-generator[66]: Native unit for urandom.service already exists, skipping.
[ 4.200115] systemd-sysv-generator[66]: Native unit for rcS.service already exists, skipping.
[ 4.211224] systemd-sysv-generator[66]: Native unit for kmod.service already exists, skipping.
[ 4.220302] systemd-sysv-generator[66]: Native unit for checkfs.service already exists, skipping.
[ 4.229691] systemd-sysv-generator[66]: Cannot find unit loadcpufreq.service.
[ 4.237351] systemd-sysv-generator[66]: Native unit for rc.local.service already exists, skipping.
[ 4.248773] systemd-sysv-generator[66]: Native unit for udev.service already exists, skipping.
[ 4.257901] systemd-sysv-generator[66]: Native unit for bluetooth.service already exists, skipping.
[ 4.268275] systemd-sysv-generator[66]: Native unit for rsyslog.service already exists, skipping.
[ 4.277771] systemd-sysv-generator[66]: Cannot find unit exim4.service.
[ 4.284927] systemd-sysv-generator[66]: Native unit for umountroot.service already exists, skipping.
[ 4.294421] systemd-sysv-generator[66]: Native unit for halt.service already exists, skipping.
[ 4.303444] systemd-sysv-generator[66]: Native unit for mountnfs-bootclean.service already exists, skipping.
[ 4.313619] systemd-sysv-generator[66]: Native unit for hostname.service already exists, skipping.
[ 4.324009] systemd-sysv-generator[66]: Native unit for avahi-daemon.service already exists, skipping.
[ 4.333755] systemd-sysv-generator[66]: Native unit for mountall.service already exists, skipping.
[ 4.343999] systemd-sysv-generator[66]: Native unit for ofono.service already exists, skipping.
[ 4.354101] systemd-sysv-generator[66]: Native unit for connman.service already exists, skipping.
[ 4.363490] systemd-sysv-generator[66]: Native unit for mountkernfs.service already exists, skipping.
[ 4.372965] systemd-sysv-generator[66]: Native unit for reboot.service already exists, skipping.
[ 4.382251] systemd-sysv-generator[66]: Native unit for hostapd.service already exists, skipping.
[ 4.391633] systemd-sysv-generator[66]: Native unit for hwclock.service already exists, skipping.
[ 4.400903] systemd-sysv-generator[66]: Native unit for rmnologin.service already exists, skipping.
[ 4.411226] systemd-sysv-generator[66]: Native unit for dnsmasq.service already exists, skipping.
[ 4.420535] systemd-sysv-generator[66]: Native unit for mountdevsubfs.service already exists, skipping.
[ 4.431225] systemd-sysv-generator[66]: Native unit for dbus.service already exists, skipping.
[ 4.440317] systemd-sysv-generator[66]: Native unit for umountfs.service already exists, skipping.
[ 4.450598] systemd-sysv-generator[66]: Native unit for cron.service already exists, skipping.
[ 4.459795] systemd-sysv-generator[66]: Native unit for sudo.service already exists, skipping.
[ 4.468808] systemd-sysv-generator[66]: Native unit for mountall-bootclean.service already exists, skipping.
[ 4.479086] systemd-sysv-generator[66]: Native unit for mountnfs.service already exists, skipping.
[ 4.488424] systemd-sysv-generator[66]: Native unit for brightness.service already exists, skipping.
[ 4.498809] systemd-sysv-generator[66]: Native unit for dundee.service already exists, skipping.
[ 4.507999] systemd-sysv-generator[66]: Native unit for umountnfs.service already exists, skipping.
[ 4.517566] systemd-sysv-generator[66]: Native unit for rc.service already exists, skipping.
[ 4.527371] systemd-sysv-generator[66]: Native unit for ssh.service already exists, skipping.
[ 4.536340] systemd-sysv-generator[66]: Native unit for checkroot-bootclean.service already exists, skipping.
[ 4.546706] systemd-sysv-generator[66]: Native unit for apache-htcacheclean.service already exists, skipping.
[ 4.557047] systemd-sysv-generator[66]: Native unit for single.service already exists, skipping.
[ 4.567119] systemd-sysv-generator[66]: Native unit for rsync.service already exists, skipping.
[ 4.576220] systemd-sysv-generator[66]: Native unit for killprocs.service already exists, skipping.
[ 4.586582] systemd-sysv-generator[66]: Native unit for networking.service already exists, skipping.
[ 4.596250] systemd-sysv-generator[66]: Native unit for apache2.service already exists, skipping.
[ 4.605557] systemd-sysv-generator[66]: Native unit for bootmisc.service already exists, skipping.
[ 4.616340] systemd-sysv-generator[66]: Ignoring S02single symlink in rc1.d, not generating single.service.
[ 4.626331] systemd-sysv-generator[66]: Ignoring S01killprocs symlink in rc1.d, not generating killprocs.service.
[ 4.636740] systemd-sysv-generator[66]: Ignoring S01bootlogs symlink in rc1.d, not generating bootlogs.service.
[ 4.648331] systemd-sysv-generator[66]: Ignoring S01rsyslog symlink in rc2.d, not generating rsyslog.service.
[ 4.658459] systemd-sysv-generator[66]: Ignoring S04ofono symlink in rc2.d, not generating ofono.service.
[ 4.668189] systemd-sysv-generator[66]: Ignoring S03ssh symlink in rc2.d, not generating ssh.service.
[ 4.677527] systemd-sysv-generator[66]: Ignoring S01rsync symlink in rc2.d, not generating rsync.service.
[ 4.687190] systemd-sysv-generator[66]: Ignoring S04dundee symlink in rc2.d, not generating dundee.service.
[ 4.697047] systemd-sysv-generator[66]: Ignoring S01hostapd symlink in rc2.d, not generating hostapd.service.
[ 4.707054] systemd-sysv-generator[66]: Ignoring S03rsync symlink in rc2.d, not generating rsync.service.
[ 4.716720] systemd-sysv-generator[66]: Ignoring S03rmnologin symlink in rc2.d, not generating rmnologin.service.
[ 4.727116] systemd-sysv-generator[66]: Ignoring S01cron symlink in rc2.d, not generating cron.service.
[ 4.736608] systemd-sysv-generator[66]: Ignoring S01apache2 symlink in rc2.d, not generating apache2.service.
[ 4.746613] systemd-sysv-generator[66]: Ignoring S01ssh symlink in rc2.d, not generating ssh.service.
[ 4.755960] systemd-sysv-generator[66]: Ignoring S01sudo symlink in rc2.d, not generating sudo.service.
[ 4.765522] systemd-sysv-generator[66]: Ignoring S01bluetooth symlink in rc2.d, not generating bluetooth.service.
[ 4.775884] systemd-sysv-generator[66]: Ignoring S01ofono symlink in rc2.d, not generating ofono.service.
[ 4.785583] systemd-sysv-generator[66]: Ignoring S04bluetooth symlink in rc2.d, not generating bluetooth.service.
[ 4.795942] systemd-sysv-generator[66]: Ignoring S02apache2 symlink in rc2.d, not generating apache2.service.
[ 4.805969] systemd-sysv-generator[66]: Ignoring S01connman symlink in rc2.d, not generating connman.service.
[ 4.815976] systemd-sysv-generator[66]: Ignoring S04connman symlink in rc2.d, not generating connman.service.
[ 4.826024] systemd-sysv-generator[66]: Ignoring S05rc.local symlink in rc2.d, not generating rc.local.service.
[ 4.836208] systemd-sysv-generator[66]: Ignoring S01dundee symlink in rc2.d, not generating dundee.service.
[ 4.846062] systemd-sysv-generator[66]: Ignoring S01bootlogs symlink in rc2.d, not generating bootlogs.service.
[ 4.856258] systemd-sysv-generator[66]: Ignoring S01avahi-daemon symlink in rc2.d, not generating avahi-daemon.service.
[ 4.867164] systemd-sysv-generator[66]: Ignoring S04avahi-daemon symlink in rc2.d, not generating avahi-daemon.service.
[ 4.878058] systemd-sysv-generator[66]: Ignoring S01dbus symlink in rc2.d, not generating dbus.service.
[ 4.887561] systemd-sysv-generator[66]: Ignoring S03dbus symlink in rc2.d, not generating dbus.service.
[ 4.897057] systemd-sysv-generator[66]: Ignoring S03cron symlink in rc2.d, not generating cron.service.
[ 4.907950] systemd-sysv-generator[66]: Ignoring S01rsyslog symlink in rc3.d, not generating rsyslog.service.
[ 4.918100] systemd-sysv-generator[66]: Ignoring S04ofono symlink in rc3.d, not generating ofono.service.
[ 4.927809] systemd-sysv-generator[66]: Ignoring S03ssh symlink in rc3.d, not generating ssh.service.
[ 4.937169] systemd-sysv-generator[66]: Ignoring S01rsync symlink in rc3.d, not generating rsync.service.
[ 4.946831] systemd-sysv-generator[66]: Ignoring S04dundee symlink in rc3.d, not generating dundee.service.
[ 4.956668] systemd-sysv-generator[66]: Ignoring S01hostapd symlink in rc3.d, not generating hostapd.service.
[ 4.966695] systemd-sysv-generator[66]: Ignoring S03rsync symlink in rc3.d, not generating rsync.service.
[ 4.976358] systemd-sysv-generator[66]: Ignoring S03rmnologin symlink in rc3.d, not generating rmnologin.service.
[ 4.986727] systemd-sysv-generator[66]: Ignoring S01cron symlink in rc3.d, not generating cron.service.
[ 4.996231] systemd-sysv-generator[66]: Ignoring S01apache2 symlink in rc3.d, not generating apache2.service.
[ 5.006237] systemd-sysv-generator[66]: Ignoring S01ssh symlink in rc3.d, not generating ssh.service.
[ 5.015561] systemd-sysv-generator[66]: Ignoring S01sudo symlink in rc3.d, not generating sudo.service.
[ 5.025108] systemd-sysv-generator[66]: Ignoring S01bluetooth symlink in rc3.d, not generating bluetooth.service.
[ 5.035470] systemd-sysv-generator[66]: Ignoring S01ofono symlink in rc3.d, not generating ofono.service.
[ 5.045144] systemd-sysv-generator[66]: Ignoring S04bluetooth symlink in rc3.d, not generating bluetooth.service.
[ 5.055522] systemd-sysv-generator[66]: Ignoring S02apache2 symlink in rc3.d, not generating apache2.service.
[ 5.065531] systemd-sysv-generator[66]: Ignoring S01connman symlink in rc3.d, not generating connman.service.
[ 5.075557] systemd-sysv-generator[66]: Ignoring S04connman symlink in rc3.d, not generating connman.service.
[ 5.085585] systemd-sysv-generator[66]: Ignoring S05rc.local symlink in rc3.d, not generating rc.local.service.
[ 5.095786] systemd-sysv-generator[66]: Ignoring S01dundee symlink in rc3.d, not generating dundee.service.
[ 5.105621] systemd-sysv-generator[66]: Ignoring S01bootlogs symlink in rc3.d, not generating bootlogs.service.
[ 5.115840] systemd-sysv-generator[66]: Ignoring S01avahi-daemon symlink in rc3.d, not generating avahi-daemon.service.
[ 5.126722] systemd-sysv-generator[66]: Ignoring S04avahi-daemon symlink in rc3.d, not generating avahi-daemon.service.
[ 5.137635] systemd-sysv-generator[66]: Ignoring S01dbus symlink in rc3.d, not generating dbus.service.
[ 5.147118] systemd-sysv-generator[66]: Ignoring S03dbus symlink in rc3.d, not generating dbus.service.
[ 5.156631] systemd-sysv-generator[66]: Ignoring S03cron symlink in rc3.d, not generating cron.service.
[ 5.167496] systemd-sysv-generator[66]: Ignoring S01rsyslog symlink in rc4.d, not generating rsyslog.service.
[ 5.177641] systemd-sysv-generator[66]: Ignoring S04ofono symlink in rc4.d, not generating ofono.service.
[ 5.187344] systemd-sysv-generator[66]: Ignoring S03ssh symlink in rc4.d, not generating ssh.service.
[ 5.196702] systemd-sysv-generator[66]: Ignoring S01rsync symlink in rc4.d, not generating rsync.service.
[ 5.206365] systemd-sysv-generator[66]: Ignoring S04dundee symlink in rc4.d, not generating dundee.service.
[ 5.216198] systemd-sysv-generator[66]: Ignoring S01hostapd symlink in rc4.d, not generating hostapd.service.
[ 5.226224] systemd-sysv-generator[66]: Ignoring S03rsync symlink in rc4.d, not generating rsync.service.
[ 5.235886] systemd-sysv-generator[66]: Ignoring S03rmnologin symlink in rc4.d, not generating rmnologin.service.
[ 5.246259] systemd-sysv-generator[66]: Ignoring S01cron symlink in rc4.d, not generating cron.service.
[ 5.255763] systemd-sysv-generator[66]: Ignoring S01apache2 symlink in rc4.d, not generating apache2.service.
[ 5.265771] systemd-sysv-generator[66]: Ignoring S01ssh symlink in rc4.d, not generating ssh.service.
[ 5.275106] systemd-sysv-generator[66]: Ignoring S01sudo symlink in rc4.d, not generating sudo.service.
[ 5.284660] systemd-sysv-generator[66]: Ignoring S01bluetooth symlink in rc4.d, not generating bluetooth.service.
[ 5.295023] systemd-sysv-generator[66]: Ignoring S01ofono symlink in rc4.d, not generating ofono.service.
[ 5.304697] systemd-sysv-generator[66]: Ignoring S04bluetooth symlink in rc4.d, not generating bluetooth.service.
[ 5.315074] systemd-sysv-generator[66]: Ignoring S02apache2 symlink in rc4.d, not generating apache2.service.
[ 5.325082] systemd-sysv-generator[66]: Ignoring S01connman symlink in rc4.d, not generating connman.service.
[ 5.335108] systemd-sysv-generator[66]: Ignoring S04connman symlink in rc4.d, not generating connman.service.
[ 5.345135] systemd-sysv-generator[66]: Ignoring S05rc.local symlink in rc4.d, not generating rc.local.service.
[ 5.355336] systemd-sysv-generator[66]: Ignoring S01dundee symlink in rc4.d, not generating dundee.service.
[ 5.365172] systemd-sysv-generator[66]: Ignoring S01bootlogs symlink in rc4.d, not generating bootlogs.service.
[ 5.375388] systemd-sysv-generator[66]: Ignoring S01avahi-daemon symlink in rc4.d, not generating avahi-daemon.service.
[ 5.386269] systemd-sysv-generator[66]: Ignoring S04avahi-daemon symlink in rc4.d, not generating avahi-daemon.service.
[ 5.397180] systemd-sysv-generator[66]: Ignoring S01dbus symlink in rc4.d, not generating dbus.service.
[ 5.406664] systemd-sysv-generator[66]: Ignoring S03dbus symlink in rc4.d, not generating dbus.service.
[ 5.416178] systemd-sysv-generator[66]: Ignoring S03cron symlink in rc4.d, not generating cron.service.
[ 5.426959] systemd-sysv-generator[66]: Ignoring S01rsyslog symlink in rc5.d, not generating rsyslog.service.
[ 5.437110] systemd-sysv-generator[66]: Ignoring S04ofono symlink in rc5.d, not generating ofono.service.
[ 5.446818] systemd-sysv-generator[66]: Ignoring S03ssh symlink in rc5.d, not generating ssh.service.
[ 5.456174] systemd-sysv-generator[66]: Ignoring S01rsync symlink in rc5.d, not generating rsync.service.
[ 5.465836] systemd-sysv-generator[66]: Ignoring S04dundee symlink in rc5.d, not generating dundee.service.
[ 5.475671] systemd-sysv-generator[66]: Ignoring S01hostapd symlink in rc5.d, not generating hostapd.service.
[ 5.485698] systemd-sysv-generator[66]: Ignoring S03rsync symlink in rc5.d, not generating rsync.service.
[ 5.495360] systemd-sysv-generator[66]: Ignoring S03rmnologin symlink in rc5.d, not generating rmnologin.service.
[ 5.505731] systemd-sysv-generator[66]: Ignoring S01cron symlink in rc5.d, not generating cron.service.
[ 5.515235] systemd-sysv-generator[66]: Ignoring S01apache2 symlink in rc5.d, not generating apache2.service.
[ 5.525241] systemd-sysv-generator[66]: Ignoring S01ssh symlink in rc5.d, not generating ssh.service.
[ 5.534565] systemd-sysv-generator[66]: Ignoring S01sudo symlink in rc5.d, not generating sudo.service.
[ 5.544117] systemd-sysv-generator[66]: Ignoring S01bluetooth symlink in rc5.d, not generating bluetooth.service.
[ 5.554480] systemd-sysv-generator[66]: Ignoring S01ofono symlink in rc5.d, not generating ofono.service.
[ 5.564153] systemd-sysv-generator[66]: Ignoring S04bluetooth symlink in rc5.d, not generating bluetooth.service.
[ 5.574532] systemd-sysv-generator[66]: Ignoring S02apache2 symlink in rc5.d, not generating apache2.service.
[ 5.584540] systemd-sysv-generator[66]: Ignoring S01connman symlink in rc5.d, not generating connman.service.
[ 5.594567] systemd-sysv-generator[66]: Ignoring S04connman symlink in rc5.d, not generating connman.service.
[ 5.604592] systemd-sysv-generator[66]: Ignoring S05rc.local symlink in rc5.d, not generating rc.local.service.
[ 5.614792] systemd-sysv-generator[66]: Ignoring S01dundee symlink in rc5.d, not generating dundee.service.
[ 5.624629] systemd-sysv-generator[66]: Ignoring S01bootlogs symlink in rc5.d, not generating bootlogs.service.
[ 5.634845] systemd-sysv-generator[66]: Ignoring S01avahi-daemon symlink in rc5.d, not generating avahi-daemon.service.
[ 5.645726] systemd-sysv-generator[66]: Ignoring S04avahi-daemon symlink in rc5.d, not generating avahi-daemon.service.
[ 5.656638] systemd-sysv-generator[66]: Ignoring S01dbus symlink in rc5.d, not generating dbus.service.
[ 5.666122] systemd-sysv-generator[66]: Ignoring S03dbus symlink in rc5.d, not generating dbus.service.
[ 5.675635] systemd-sysv-generator[66]: Ignoring S03cron symlink in rc5.d, not generating cron.service.
[ 5.685319] systemd-sysv-generator[66]: Loading SysV script /etc/init.d/udhcpd
[ 5.694263] systemd-sysv-generator[66]: Loading SysV script /etc/init.d/exim4
[ 5.705397] systemd-sysv-generator[66]: Loading SysV script /etc/init.d/loadcpufreq
[ 5.716624] systemd-sysv-generator[66]: Loading SysV script /etc/init.d/cpufrequtils
[ 5.731392] systemd[55]: /lib/systemd/system-generators/systemd-sysv-generator succeeded.
[ 5.739965] systemd[55]: /lib/systemd/system-generators/systemd-debug-generator succeeded.
[ 5.748639] systemd[55]: /lib/systemd/system-generators/systemd-run-generator succeeded.
[ 5.757026] systemd[55]: /lib/systemd/system-generators/systemd-veritysetup-generator terminated by signal SEGV.
[ 5.767390] systemd[55]: /lib/systemd/system-generators/systemd-bless-boot-generator terminated by signal SEGV.
[ 5.777681] systemd[55]: /lib/systemd/system-generators/systemd-system-update-generator succeeded.
[ 5.786799] systemd[55]: /lib/systemd/system-generators/systemd-fstab-generator terminated by signal SEGV.
[ 5.797673] systemd[1]: (sd-executor) succeeded.
[ 5.802788] systemd[1]: Looking for unit files in (higher priority first):
[ 5.809936] systemd[1]: /etc/systemd/system.control
[ 5.815015] systemd[1]: /run/systemd/system.control
[ 5.820012] systemd[1]: /run/systemd/transient
[ 5.824629] systemd[1]: /etc/systemd/system
[ 5.828928] systemd[1]: /run/systemd/system
I can't seem to find the constant between each boots, except that it crashes...
EDIT 2:
Expected Dev board output is:
Welcome to Debian GNU/Linux 10 (buster)!
[ 6.828019] systemd[1]: Set hostname to <arm>.
[ 7.793038] systemd[1]: File /lib/systemd/system/systemd-journald.service:12 configures an IP fire wall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
[ 7.810794] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[ 8.292129] systemd[1]: Listening on udev Control Socket.
[ OK ] Listening on udev Control Socket.
...
(and so on)
Not that using a SySVInit environment with no modules, I can boot to the shell, but then some commands can cause a freeze.
|
This issue was fixed on the TI Forum, here is the link for those interested.
https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1158936/am3359-caught-segv-when-distro-s-systemd-starting
In summary, the issue was that my VDD_MPU(1.1V) was driven by my PMIC and the PMIC driver was not properly initialized. Meaning that when the system rose the CPU Freq. to 800MHz, the 1.1V was too low and the MPU would be in brownout and get corrupted. The solution was to either manually raise the VDD_MPU to something higher (under 1.3V) or to configure my PMIC to automatically manage the voltage based on the CPU Freq.
| AM335x - Custom Board <SEGV> when running Systemd |
1,534,554,907,000 |
Historically yarrow algorithm had a kernel process with the name of yarrow. But after replacing it with Fortuna, the kernel process disappears.
What is the name of the new kernel process of Fortuna's algorithm in the permanent kernel processes?
|
The name of the kthread is rand_harvestq and was changed in this commit in sys/dev/random/random_harvestq.c:165.
The name was prior yarrow or fortuna depending on how the kernel was compiled see line sys/dev/random/randomdev_soft.c:85
| What is the name of fortuna's kernel process in FreeBSD? |
1,534,554,907,000 |
Virtualbox 5.1.34 (and below) crashes and prints strange error messages like segementation faults or kills the x11/wayland server.
This strange behavior occurs on ubuntu22, debian bookworm, debian sid, archlinux after upgrading the host kernel to 5.18.3.
|
After some internet recherche I found this nice discussion on the virtualbox forum. At first I thought my vm installation troubles but it happens on all guest machines.
The solution up to now is to use an older kernel (< 5.17.11) or to install the the test build:
Virtualbox (6.1.34.xx) crashes frequently on debian sid. You can avoid this by using the older kernel (<5.17.10) or install the test build as described below.
Installation virtualbox test build
First you have to remove the virtualbox package with sudo apt remove virtualbox- This will not remove your configurations or virtual machines.
Download the app from Oracles' Testbuild homepage.
Install with
sudo sh ./VirtualBox-6.1.35-151573-Linux_amd64.run
This will also compile and install the dkms modules vboxdrv ...
To remove virtualbox, which gets installed in the /opt directory, run the script with uninstall parameter.
Further you have to download the Extension package and Guest Additions from the previous link and type the following command:
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.1.35-151571.vbox-extpack
You can also adopt this script for speeding up the task:
#!/bin/bash
# download virtualbox testbuild
#
# install with the following command:
# sudo sh ./VirtualBox-6.1.35-151573-Linux_amd64.run
# To uninstall run with `uninstall` parameter:
# sudo sh ./VirtualBox-6.1.35-151573-Linux_amd64.run uninstall
#
# The extension package (for usb... support) can be installed from command line
# VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.1.35-151571.vbox-extpack
release=6.1.35
build=151866
version=$release-$build
base="https://www.virtualbox.org/download/testcase"
virtualbox=VirtualBox-$version-Linux_amd64.run
guest_additions=VBoxGuestAdditions_$version.iso
extension_pack=Oracle_VM_VirtualBox_Extension_Pack-$version.vbox-extpack
download_files=($virtualbox $guest_additions $extension_pack)
for file in "${download_files[@]}"; do
wget -c $base/$file
done
sudo sh ./$virtualbox
sudo vboxmanage extpack install $extension_pack
| Virtualbox < 5.1.34 crashes frequently on kernel > 5.18 |
1,628,434,039,000 |
The latest Linux kernel now takes more than half of my /boot space. Next time I want to upgrade, how do I do that? Can I purge the current in-use kernel and then issue aptitude full-upgrade or do-release-upgrade? Seems dangerous and with possible side effects (loss of config?)
$ df -h /boot
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 236M 166M 58M 75% /boot
$ du -hc /boot/*5.11.0-18*
249K /boot/config-5.11.0-18-generic
117M /boot/initrd.img-5.11.0-18-generic
5.8M /boot/System.map-5.11.0-18-generic
15M /boot/vmlinuz-5.11.0-18-generic
137M total
Or is the only solution to boot from liveCD, chroot into your system, delete the current kernel and install the new one ?
|
I managed to halve the size taken by the initrd and associated files by simply changing MODULES=most to MODULES=dep in /etc/initramfs-tools/initramfs.conf
I left the compression unchanged as it was already using lz4 which, I believe, is currently the better compression ratio.
Then run sudo update-initramfs -u -k all to have it take effect, and reboot to test.
| How to upgrade with kernel taking more than half of /boot |
1,628,434,039,000 |
According to fs/proc/array.c:130, the following array defines various process states:
/*
* The task state array is a strange "bitmap" of
* reasons to sleep. Thus "running" is zero, and
* you can test for combinations of others with
* simple bit tests.
*/
static const char * const task_state_array[] = {
/* states in TASK_REPORT: */
"R (running)", /* 0x00 */
"S (sleeping)", /* 0x01 */
"D (disk sleep)", /* 0x02 */
"T (stopped)", /* 0x04 */
"t (tracing stop)", /* 0x08 */
"X (dead)", /* 0x10 */
"Z (zombie)", /* 0x20 */
"P (parked)", /* 0x40 */
/* states beyond TASK_REPORT: */
"I (idle)", /* 0x80 */
};
According to proc(5), the X state was added in kernel 2.6.0:
X Dead (from Linux 2.6.0 onward)
x Dead (Linux 2.6.33 to 3.13 only)
And according to ps(1), the X shouldn't be seen:
X dead (should never be seen)
Looking at the rest of the source code, it seems like it is used internally by the kernel. In the source file kernel/sched.core.c:4176, a comment briefly describes it:
/*
* A task struct has one reference for the use as "current".
* If a task dies, then it sets TASK_DEAD in tsk->state and calls
* schedule one last time. The schedule call will never return, and
* the scheduled task must drop that reference.
*
* We must observe prev->state before clearing prev->on_cpu (in
* finish_task), otherwise a concurrent wakeup can get prev
* running on another CPU and we could rave with its RUNNING -> DEAD
* transition, resulting in a double drop.
*/
It also appears to be required in some cases. In kernel/fork.c:424:
static void release_task_stack(struct task_struct *tsk)
{
if (WARN_ON(tsk->state != TASK_DEAD))
return; /* Better to leak the stack than to free prematurely */
account_kernel_stack(tsk, -1);
free_thread_stack(tsk);
tsk->stack = NULL;
#ifdef CONFIG_VMAP_STACK
tsk->stack_vm_area = NULL;
#endif
}
It looks to me like TASK_DEAD is set for a process when it terminates but before the kernel finally destroys task_struct, so it should never appear as a process state unless there is a kernel bug that fails to clean up the process. There's also these lecture notes which reinforces this idea:
TASK_DEAD – the process is being cleaned up and the task is being deleted
So to my real question:
In what circumstances will a process be reported by ps as being in state X?
|
The task state represented by “X” isn’t TASK_DEAD, it’s the EXIT_DEAD exit state. TASK_DEAD itself isn’t a reportable state, and while EXIT_DEAD is, it isn’t supposed to be visible in practice.
EXIT_DEAD’s role is similar to what you describe for TASK_DEAD: a task’s exit state is set to EXIT_DEAD shortly before its task_struct is deleted by release_task; see for example de_thread, release_task itself, and exit_notify.
I haven’t checked the locking in detail, and changing process state can be seen by readers; however it seems unlikely that a process would ever be seen in EXIT_DEAD state by another process.
Whether it can be seen or not, a process is in state “X” once it’s fully exited and its task_struct is about to be deleted.
| In what circumstances will a process be in state X (dead)? |
1,628,434,039,000 |
Consider the output of /boot/System.map-5.8.0-50-generic and /proc/kallsyms on Ubuntu 20.10 (Groovy Gorilla):
$ sudo cat /boot/System.map-5.8.0-50-generic | grep sys_call_table
ffffffff820002e0 D sys_call_table
ffffffff82001360 D ia32_sys_call_table
ffffffff82002120 D x32_sys_call_table
$ sudo cat /proc/kallsyms | grep sys_call_table
ffffffff978002e0 D sys_call_table
ffffffff97801360 D ia32_sys_call_table
ffffffff97802120 D x32_sys_call_table
AFAIK, these files should contain the current load addresses of kernel symbols, so why don't they match?
Is it because only /proc/kallsyms is affected by KASLR? If so, how can I verify whether KASLR is enabled?
|
Yes, this is caused by KASLR. Note that all addresses are offset by the same amount. The kernel doesn’t know about System.map so it doesn’t update it.
I’m not aware of any way of detecting whether KASLR is enabled from userspace at runtime, short of comparing /proc/kallsyms and System.map, or possibly causing a panic on x86 (the kernel dumps its offset on panic there).
| Why don't the addresses in `/boot/System.map-*` and `/proc/kallsyms` match? |
1,628,434,039,000 |
I'm running Linux (Debian 10) on a Chromebook (Eve) using a stock Chrome OS kernel (4.4.x) with minor modifications. Everything runs (mostly) fine except that TTY console cannot be accessed via Ctrl+Alt+Fn, which does switch framebuffers as intended (i.e. Ctrl+F1 switches to DM and Crtl+F2 switches to desktop), but there doesn't seem to be any framebuffer for TTY emulation to display on (the screen just freezes upon Ctrl+F3 but desktop can be recovered just by Crtl+F2). Given that no log is displayed at boot, I'm guessing it's a kernel configuration issue. Relevant driver options related to TTY, console, and framebuffer are already enabled in the kernel configuration, and tty devices are listed in /dev. I tried compiling the Chrome OS kernel using stock Debian 10 configurations (for what overlap and default configuration for those that don't) and the TTY console did become available (but obviously a bunch of other things didn't work), so it isn't something that was written out of the Chrome OS kernel.
I compared the stock configurations between Eve and Debian and noted where different options are chosen on the same configuration items (there are 532 of these) and noted the following differences:
CONFIG_ITEM Debian Eve
CONFIG_AGP_AMD64 y is not set
CONFIG_AGP_SIS y is not set
CONFIG_AGP_VIA y is not set
CONFIG_VGA_SWITCHEROO y is not set
CONFIG_DRM_FBDEV_EMULATION y is not set
CONFIG_DRM_LOAD_EDID_FIRMWARE y is not set
CONFIG_DRM_DP_CEC y is not set
CONFIG_DRM_VGEM is not set y
CONFIG_DRM_UDL is not set y
CONFIG_DRM_CIRRUS_QEMU is not set m
CONFIG_FIRMWARE_EDID y is not set
CONFIG_FB_BOOT_VESA_SUPPORT y is not set
CONFIG_FB_CFB_FILLRECT y is not set
CONFIG_FB_CFB_COPYAREA y is not set
CONFIG_FB_CFB_IMAGEBLIT y is not set
CONFIG_FB_SYS_FILLRECT y is not set
CONFIG_FB_SYS_COPYAREA y is not set
CONFIG_FB_SYS_IMAGEBLIT y is not set
CONFIG_FB_SYS_FOPS y is not set
CONFIG_FB_TILEBLITTING y is not set
CONFIG_FB_VESA y is not set
CONFIG_FB_EFI y is not set
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION y is not set
But nothing changes after I compiled the kernel with these setting copied from Debian to the stock Eve configuration. Something else is amiss, and help is appreciated.
|
After noticing that /dev/fb0 didn't exist despite having loaded fbcon and a framebuffer device module, I figured it out:
Build i915 as a loadable module instead of built-in and make sure that legacy fbdev support is enabled. (Building it as a loadable module is perhaps not necessary, I only did it to ensure I could blacklist/unload i915, but the key is to select legacy fbdev support.)
Enable framebuffer console (fbcon) and build it as a module.
Ensure that tty is also enabled.
Edit /src/kernel/drivers/gpu/drm/i915/i915_drv.c and remove or comment out all if loops that refer to conflicting framebuffer modules (just search for "conflict", on 4.4.250-R89 kernel source there are 3 of these loops), otherwise you might encounter an error during make. Apparently the i915 driver for ChromeOS doesn't want you to have a framebuffer console.
Build kernel and modules. Install to Linux.
Add fbcon to /etc/initramfs-tools/modules to load them at boot (they do not load by default). Alternatively, you can load it manually when you need to use TTY emulation.
Update initramfs and grub. Reboot. You should be able to see kernel boot messages and use Ctrl+Fn to access TTYn.
| How can I enable TTY console? |
1,628,434,039,000 |
Since yesterday, I am having regular total freeze of my OS, archlinux, with no clear reason why.
The only thing I'm doing is browsing the internet with Firefox while it happens.
The audio, bluetooth are still working during these freezes, but I have no way to interact with the system...
I tried to find something helpful in the system log:
$ sudo journalctl -b -1 -k -xe
...
Jan 14 10:22:45 flexywhale kernel: INFO: task kworker/0:1H:213 blocked for more than 122 seconds.
Jan 14 10:22:45 flexywhale kernel: Tainted: G W 5.10.6-arch1-1 #1
Jan 14 10:22:45 flexywhale kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Jan 14 10:22:45 flexywhale kernel: task:kworker/0:1H state:D stack: 0 pid: 213 ppid: 2 flags:0x00004000
Jan 14 10:22:45 flexywhale kernel: Workqueue: events_highpri intel_atomic_cleanup_work [i915]
Jan 14 10:22:45 flexywhale kernel: Call Trace:
Jan 14 10:22:45 flexywhale kernel: __schedule+0x295/0x810
Jan 14 10:22:45 flexywhale kernel: schedule+0x5b/0xc0
Jan 14 10:22:45 flexywhale kernel: schedule_preempt_disabled+0x11/0x20
Jan 14 10:22:45 flexywhale kernel: __ww_mutex_lock.constprop.0+0x4bd/0x810
Jan 14 10:22:45 flexywhale kernel: ? dequeue_entity+0xc6/0x460
Jan 14 10:22:45 flexywhale kernel: intel_unpin_fb_vma+0x25/0xa0 [i915]
Jan 14 10:22:45 flexywhale kernel: drm_atomic_helper_cleanup_planes+0x52/0x70 [drm_kms_helper]
Jan 14 10:22:45 flexywhale kernel: intel_atomic_cleanup_work+0x67/0x110 [i915]
Jan 14 10:22:45 flexywhale kernel: process_one_work+0x1d6/0x3a0
Jan 14 10:22:45 flexywhale kernel: worker_thread+0x4d/0x3d0
Jan 14 10:22:45 flexywhale kernel: ? rescuer_thread+0x410/0x410
Jan 14 10:22:45 flexywhale kernel: kthread+0x133/0x150
Jan 14 10:22:45 flexywhale kernel: ? __kthread_bind_mask+0x60/0x60
Jan 14 10:22:45 flexywhale kernel: ret_from_fork+0x1f/0x30
Jan 14 10:24:48 flexywhale kernel: INFO: task kworker/0:1H:213 blocked for more than 245 seconds.
Jan 14 10:24:48 flexywhale kernel: Tainted: G W 5.10.6-arch1-1 #1
Jan 14 10:24:48 flexywhale kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Jan 14 10:24:48 flexywhale kernel: task:kworker/0:1H state:D stack: 0 pid: 213 ppid: 2 flags:0x00004000
Jan 14 10:24:48 flexywhale kernel: Workqueue: events_highpri intel_atomic_cleanup_work [i915]
Jan 14 10:24:48 flexywhale kernel: Call Trace:
Jan 14 10:24:48 flexywhale kernel: __schedule+0x295/0x810
Jan 14 10:24:48 flexywhale kernel: schedule+0x5b/0xc0
Jan 14 10:24:48 flexywhale kernel: schedule_preempt_disabled+0x11/0x20
Jan 14 10:24:48 flexywhale kernel: __ww_mutex_lock.constprop.0+0x4bd/0x810
Jan 14 10:24:48 flexywhale kernel: ? dequeue_entity+0xc6/0x460
Jan 14 10:24:48 flexywhale kernel: intel_unpin_fb_vma+0x25/0xa0 [i915]
Jan 14 10:24:48 flexywhale kernel: drm_atomic_helper_cleanup_planes+0x52/0x70 [drm_kms_helper]
Jan 14 10:24:48 flexywhale kernel: intel_atomic_cleanup_work+0x67/0x110 [i915]
Jan 14 10:24:48 flexywhale kernel: process_one_work+0x1d6/0x3a0
Jan 14 10:24:48 flexywhale kernel: worker_thread+0x4d/0x3d0
Jan 14 10:24:48 flexywhale kernel: ? rescuer_thread+0x410/0x410
Jan 14 10:24:48 flexywhale kernel: kthread+0x133/0x150
Jan 14 10:24:48 flexywhale kernel: ? __kthread_bind_mask+0x60/0x60
Jan 14 10:24:48 flexywhale kernel: ret_from_fork+0x1f/0x30
...
These freezes did not occur after a system update (it was last updated about a week ago) and I updated my system since to try to fix it but without success.
What can I do to diagnose and try to resolve this ?
Thanks !
|
This is probably the same issue that is discussed here and here.
A short-term solution (that works for me too) is uninstalling xf86-video-intel.
| OS freezes completely |
1,628,434,039,000 |
Is there any equivalent in Debian for hotpatching kernels, similar to kpatch in Red Hat Linux?
|
You can try KernelCare, Ksplice.
You can try this tutorial if you want to use kpatch.
I don't use Debian for some time.
See the wiki page about the kpatch feature.
| Is there a way to hotpatch a kernel in Debian |
1,628,434,039,000 |
Due to shortage of free built-in SATA 3.0 plugs (6 totally) on my motherboard (Gigabyte 970A-DS3 rev.3) I've got an Adaptec RAID 5405 (3G SAS/SATA RAID) to move all "slow" SATA 1.0/2.0 devices to be connected to this card without creating any RAID. Adaptec RAID 5405 has one SFF-8087 connector and allows to connect up to 4 devices using SFF-8087 to 4 SATA cable. Now I have two devices, connected to this controller using this type of cable: DVD-RW (Plextor PX-891SA) and SATA 2.0 HDD (Hitachi HDP725050GLA360). For some reason, connected HDD is not visible as a block device and thus I can't mount the existing partition neither by using non-persistent /dev/sdXX namings, nor by using UUID (there is no such device/partition not only within /dev/disk/by-uuid but also within all dev/disk/by-* subtree). I'm running oldstable Debian Stretch 9.13.
uname -a:
Linux tekomspb 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64 GNU/Linux
lspci | grep -i adaptec shows me:
06:00.0 RAID bus controller: Adaptec AAC-RAID (rev 09)
First, I tried to discover anything from lsscsi -g:
[0:1:1:0] disk Hitachi HDP725050GLA360 GM4O - /dev/sg0
[0:3:0:0] cd/dvd PLEXTOR DVDR PX-891SA 1.06 /dev/sr0 /dev/sg1
[1:0:0:0] disk ATA PLEXTOR PX-128M5 1.05 /dev/sda /dev/sg2
[2:0:0:0] disk ATA Hitachi HDP72505 A50E /dev/sdb /dev/sg3
<more disks, attached to the MB SATA connectors>
The first row, sixth column says - (nothing), despite the fact that sg device is presented in /dev/ tree. I made some further research and found, that despite it is detected by HBA (both, by initial HBA BIOS at startup time and from shell using Adaptec's arcconf utility), visible in /dev as /dev/sg0, visible by smartctl, using smartctl -d sat -a /dev/sg0, it is not presented as block device in /sys. On the other hand, optical drive is quite well detected as block device both within /sys and /dev (as /dev/sr0 and /dev/sg1).
Following is the output of tree -F -d -L 3 --noreport. It is quite well seen that optical drive is detected as block device, but HDD doesn't for some reason.
/sys/devices/pci0000:00/0000:00:15.0/0000:06:00.0/host0/
├── power
├── scsi_host
│ └── host0
│ ├── device -> ../../../host0
│ ├── power
│ └── subsystem -> ../../../../../../../class/scsi_host
├── subsystem -> ../../../../../bus/scsi
├── target0:1:1
│ ├── 0:1:1:0
│ │ ├── bsg
│ │ ├── generic -> scsi_generic/sg0
│ │ ├── power
│ │ ├── scsi_device
│ │ ├── scsi_generic
│ │ └── subsystem -> ../../../../../../../bus/scsi
│ ├── power
│ └── subsystem -> ../../../../../../bus/scsi
└── target0:3:0
├── 0:3:0:0
│ ├── block
│ ├── bsg
│ ├── driver -> ../../../../../../../bus/scsi/drivers/sr
│ ├── generic -> scsi_generic/sg1
│ ├── power
│ ├── scsi_device
│ ├── scsi_generic
│ └── subsystem -> ../../../../../../../bus/scsi
├── power
└── subsystem -> ../../../../../../bus/scsi
Output from arcconf getconfig 1:
----------------------------------------------------------------------
Physical Device information
----------------------------------------------------------------------
Device #0
Device is a Hard drive
State : Ready
Supported : Yes
Transfer Speed : SATA 3.0 Gb/s
Reported Channel,Device(T:L) : 0,1(1:0)
Reported Location : Connector 0, Device 1
Vendor : Hitachi
Model : HDP725050GLA360
Firmware : GM4OA52A
Serial number : GEAXXXXXXXXXXX
Size : 476940 MB
Write Cache : Enabled (write-back)
FRU : None
S.M.A.R.T. : No
S.M.A.R.T. warnings : 0
Power State : Full rpm
Supported Power States : Full rpm,Powered off,Reduced rpm
SSD : No
MaxCache Capable : No
MaxCache Assigned : No
NCQ status : Enabled
Device #1
Device is a CD ROM
Supported : Yes
Transfer Speed : SATA 1.5 Gb/s
Reported Channel,Device(T:L) : 2,0(0:0)
Vendor : PLEXTOR
Model : DVDR PX-891SA
Firmware : 1.06
How I can fix this issue to allow HDD to be presented as block device and, thus, be mounted?
|
There is no possible to expose disk drives directly as block devices through Adaptec RAID controller. Almost all controllers from Adaptec don't support this feature - at least 5405, 5805 and, more general, a whole 3 and 5 series, though no information about 6 series of RAID controllers. Controller's BIOS doesn't allow to do this - it doesn't support HBA functionality at all.
Several folks tried to do this, but were unsuccessful.
The only thing (workaround) similar to the one described above can be done using (creating) a JBOD volume, that is going to be consisted from the only single disk.
The only exceptions that support HBA are: Adaptec Series 7 and Adaptec Series 8 Controllers (see manual). More explanation from Adaptec here
You can determine, if your controller is supported such feature by looking at it's BIOS menus. Only if the following (or similar) option: Controller Mode is presented, you can turn you RAID controller into simple HBA.
If none of such options exists you can do nothing here.
| SATA disk drive behind Adaptec RAID 5405 can't be detected as block device |
1,628,434,039,000 |
A question has been bugging my mind recently.
Since virtually all proprietary modules are out of tree (and therefore not compiled against any kernel versions), I'm wondering how exactly they are compiled and loaded.
Many major organizations allow for the download of a single .tar.gz, .deb or whatever and it just works across many kernel versions.
Are modules that are downloaded built on the target machine?
Do they distribute the source code?
Does the source code know which kernel module version they are building against?
Or do the drivers force load themselves against the kernel a la finit_module or init_module with ignore version magic flags
Or is something else going on behind the scenes?
Thanks in advance.
|
The general approach is to ship an object file containing the proprietary code, and a “shim”, provided as source code, which is rebuilt for the appropriate kernels when necessary. The interface code handles all the module interface for the kernel, including symbol imports with version strings etc.
For example, NVIDIA drivers contain an nv-kernel.o file which is provided only as a binary, and ends up wrapped in the kernel module.
| How do proprietary modules work for majority of kernel versions? |
1,628,434,039,000 |
How can I send dmesg printout to ftrace subsystem?
I like correlate the dmesg msg with the functions call graph in ftrace.
Thanks
|
Found it:
cd /sys/kernel/debug/
echo 1 > events/printk/enable
| How can I send dmesg printout to ftrace subsystem? |
1,628,434,039,000 |
I'm learning linux kernel debugging and dmesg is the tool that output kernel debug log:
...
[ 2.988000] Trace:
[ 2.988000] [<ffffffff80942810>] __warn+0x160/0x190
[ 2.988000] [<ffffffff8111ae9c>] dwc3_probe+0xc1c/0x1e60
[ 2.988000] [<ffffffff8111ae9c>] dwc3_probe+0xc1c/0x1e60
[ 2.988000] [<ffffffff80fe4434>] platform_drv_probe+0x34/0x90
...
Question 1: IIUC, __warn is kernel function, but what's the meaning of 0x160/0x190?
|
From this Stack Overflow answer:
[10991.880408] EIP: 0060:[<c06969d4>] EFLAGS: 00210246 CPU: 0
[10991.880411] EIP is at iret_exc+0x7d0/0xa59
That gives you the faulting instruction pointer, both directly and in symbol+offset form. The part after the slash is the size of the function.
Assuming a similar format, ffffffff80942810 is the address, __warn is the symbol, 0x160 is the offset from that symbol, and 0x190 is the size of the __warn function.
| How to understand Trace from dmesg? |
1,628,434,039,000 |
This page says that RANDOMIZE_BASE is for KASLR and it randomizes the physical AND virtual addresses which is obvious in 32-bit and comprehensible in 64-bit.
But what does RANDOMIZE_MEMORY do exactly? This page says:
Randomizes the base virtual address of kernel memory sections (physical memory mapping, vmalloc & vmemmap).
What does this mean? Does this mean, that the different sections are split somehow and located not together but with some space in between?
|
RANDOMIZE_BASE is a feature available on most architectures which randomises the virtual and physical base address of the kernel.
RANDOMIZE_MEMORY is an x86-64-specific feature which additionally randomises the offsets of page_offset_base, vmalloc_base, vmemmap_base, i.e. the locations of the physical mapping in kernel memory, the vmalloc space, and the virtual memory map. As you can see from the linked memory map, all of these are followed by holes which allows them to be moved around without having to deal with overlap with whatever comes before or after them in memory.
| Difference between CONFIG_RANDOMIZE_BASE and CONFIG_RANDOMIZE_MEMORY in Linux kernel config |
1,628,434,039,000 |
I'm encountering these errors when trying to compile a new kernel under Gentoo...
scripts/kconfig/conf --syncconfig Kconfig
DESCEND objtool
CC kernel/bounds.s
CC arch/x86/kernel/asm-offsets.s
GEN scripts/gdb/linux/constants.py
CALL scripts/checksyscalls.sh
CC [M] arch/x86/kvm/../../../virt/kvm/kvm_main.o
CC init/main.o
CC kernel/bpf/core.o
CC arch/x86/ia32/sys_ia32.o
CC arch/x86/kernel/acpi/boot.o
CC arch/x86/events/amd/core.o
CC certs/system_keyring.o
CC arch/x86/entry/vdso/vma.o
CC arch/x86/crypto/sha1-mb/sha1_mb.o
objdump: certs/.tmp_system_keyring.o: unable to initialize decompress status for section .debug_info
objdump: certs/.tmp_system_keyring.o: unable to initialize decompress status for section .debug_info
objdump: certs/.tmp_system_keyring.o: file format not recognized
EXTRACT_CERTS
AS certs/system_certificates.o
AR certs/built-in.a
objdump: arch/x86/ia32/.tmp_sys_ia32.o: unable to initialize decompress status for section .debug_info
objdump: arch/x86/ia32/.tmp_sys_ia32.o: unable to initialize decompress status for section .debug_info
objdump: arch/x86/ia32/.tmp_sys_ia32.o: file format not recognized
objdump: arch/x86/events/amd/.tmp_core.o: unable to initialize decompress status for section .debug_info
objdump: arch/x86/events/amd/.tmp_core.o: unable to initialize decompress status for section .debug_info
objdump: arch/x86/events/amd/.tmp_core.o: file format not recognized
CC arch/x86/ia32/ia32_signal.o
CC arch/x86/mm/init.o
CC arch/x86/events/amd/uncore.o
objdump: arch/x86/entry/vdso/.tmp_vma.o: unable to initialize decompress status for section .debug_info
objdump: arch/x86/entry/vdso/.tmp_vma.o: unable to initialize decompress status for section .debug_info
objdump: arch/x86/entry/vdso/.tmp_vma.o: file format not recognized
CC arch/x86/entry/vdso/vdso32-setup.o
objdump: arch/x86/kernel/acpi/.tmp_boot.o: unable to initialize decompress status for section .debug_info
objdump: arch/x86/kernel/acpi/.tmp_boot.o: unable to initialize decompress status for section .debug_info
objdump: arch/x86/kernel/acpi/.tmp_boot.o: file format not recognized
CC arch/x86/kernel/acpi/sleep.o
AR arch/x86/crypto/sha1-mb/built-in.a
objdump: init/.tmp_main.o: unable to initialize decompress status for section .debug_info
objdump: init/.tmp_main.o: unable to initialize decompress status for section .debug_info
objdump: init/.tmp_main.o: file format not recognized
...
I've rebuilt binutils (which is the package from which objdump comes from), but that had no effect.
I can compile and install other packages/software without any problem, but this is preventing kernel compilation from completing.
|
According to bug 671650, elfutils-0.175 has problems with alignments.
Switching into linker ld.gold unveiled massive ammount of warnings about section alignments.
Try reverting to elfutils-0.173:
# emerge dev-libs/elfutils-0.173
And then rebuild your kernel.
sys-kernel/gentoo-sources-4.19.3 on my system builds and loads fine with elfutils-0.173.
| objdump : file format not recognized |
1,628,434,039,000 |
when doing
echo 1 > /sys/bus/pci/slots/[slot number]/power
will kernel change the value in some(or particular) register of PCIe configuration space of this device?
In my understanding, when a system ( PC ) power-on, the power already provide to PCIe devices, but kernel can still control some slot to be ON and OFF ( as the sysfs contorl command in this article), is that because kernel setting a register in PCIe configuration space which controls its power?
when we reading it, does that also read from a register in slot control register?
ex:
cat /sys/bus/pci/slots/[slot number]/power
|
Here is my tracing ( let me know if I am wrong )
power_write_file()
https://elixir.bootlin.com/linux/v4.10/source/drivers/pci/hotplug/pci_hotplug_core.c#L95
slot->ops->disable_slot(slot);
ops->disable_slot = disable_slot;
https://elixir.bootlin.com/linux/v4.10/source/drivers/pci/hotplug/pciehp_core.c#L107
static int disable_slot(struct hotplug_slot *hotplug_slot)
{
struct slot *slot = hotplug_slot->private;
return pciehp_sysfs_disable_slot(slot);
}
https://elixir.bootlin.com/linux/v4.10/source/drivers/pci/hotplug/pciehp_core.c#L167
retval = pciehp_disable_slot(p_slot);
remove_board(struct slot *p_slot)
https://elixir.bootlin.com/linux/v4.10/source/drivers/pci/hotplug/pciehp_ctrl.c#L135
finally, we got:
void pciehp_power_off_slot(struct slot *slot)
{
struct controller *ctrl = slot->ctrl;
pcie_write_cmd(ctrl, PCI_EXP_SLTCTL_PWR_OFF, PCI_EXP_SLTCTL_PCC);
ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__,
pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL,
PCI_EXP_SLTCTL_PWR_OFF);
}
https://elixir.bootlin.com/linux/v4.10/source/drivers/pci/hotplug/pciehp_hpc.c#L551
#define PCI_EXP_SLTCTL_PWR_OFF 0x0400 /* Power Off */
#define PCI_EXP_SLTCTL 24 /* Slot Control */
https://github.com/torvalds/linux/blob/d01e12dd3f4227f1be5d7c5bffa7b8240787bec1/include/uapi/linux/pci_regs.h#L594
0x0400 ==> 10000000000 # bit 10 == 1 ==> Power Controller Control register is 1 in Slot Control Register ( offset 18h == 24 )
according to PCIe spec about Power Controller Control register:
0b Power On
1b Power Off
therefore, the answer is yes,
kernel will change Power Controller Control register in Slot Control Register.
| echo 1 > /sys/bus/pci/slots/[slot number]/power is changing value of PCIe configuration space register? |
1,628,434,039,000 |
I tried to install Fedora-Workstation-Live 28 from USB, at the start of the Installation as I choose [Start Fedora-Workstation-Live 28] I get the following error. Any solution?
[1.81660] ---[end Kernel] panic - not syncing: VFS: unable to mount root fs on unknown-block(0,0).
(Sys: Lenovo z51 70 - OS: Linux, Ubuntu 18.04 - kernel version: 4.15)
the following errors happened:
as i selected the [Start Fedora-Workstation-Live 28]:
as i selected [start this media & Test]:
i changed the USB and got the following errors:
as i selected the [Start Fedora-Workstation-Live 28]:
as i selected [start this media & Test]:
|
Solved. obviously the problem was from the USB so i tried to format the USB again with this command:
sudo dd if=/dev/zero of=/dev/sdb
then burning the .iso file on it. now it shows the installing page with no problem.
| Kernel panic while installing Fedora 28 |
1,628,434,039,000 |
I'm trying to capture what looks like a kernel error/stack trace when I run the command sudo zpool import. There error starts with:
[104.877657] BUG: unable to handle kernel paging request at 00000000ffff4167
...
I've tried simply redirecting stderr to a file with sudo zpool import &> err_file but that doesn't seem to capture it (I'm using bash) - the error still prints to the screen.
How can I grab the entire error message?
|
The error message isn't being written to the console by the zpool command. The kernel is writing the message. It's most likely being written to the console via syslog/rsyslog.
You might be able to find the error message by running dmesg which will print the kernel messages. dmesg > err_file
| Capturing kernel error/stack trace after running a command in bash |
1,628,434,039,000 |
I am continuously facing problems one after another, first I had this problem on Ubuntu I didn't got solution so I installed fedora and deleted Ubuntu. Now on booting I get this. After startup it shows error that:
BOOT_IMAGE=/boot/bmlinuz-4.14.13-300.fc27.x86_64 crashed,
in its description it shows that this is hardware problem not software. I am having AMD RADEON Graphics.
I think this is making my system slow while doing tasks.
P.S. This is a Lenovo notebook.
|
In your error message, that is a known ACPI firmware bug, that generates the error _SB.PCxxx and it affects several operating systems besides Linux. It affects FreeBSD and OpenBSD too, for instance.
Upgrade to the latest BIOS for your model from the Lenovo official site.
| ACPI exception: could not find/resolve named package element: AMD 3(dspkginit-381) |
1,628,434,039,000 |
THE SCENARIO
I'm writing a demo module to be inserted in Kernel and then write on system, for which I've already made entries in Header file and Table file.
PROCEDURE FOLLOWED SO FAR
I compiled the kernel using
/linux-4.12.9$ sudo make -j4
In which I got some warnings and NO ERROR. Unable to grab those warnings anyway, since terminal has overflown.
After no errors, I fired
/linux-4.12.9$ sudo make modules_install install
THE PROBLEM
which returns
INSTALL arch/x86/crypto/aes-x86_64.ko cp: cannot stat 'arch/x86/crypto/aes-x86_64.ko': No such file or directory At main.c:291:
- SSL error:02001002:system library:fopen:No such file or directory: bss_file.c:175
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: bss_file.c:178
sign-file: /lib/modules/4.12.9/kernel/arch/x86/crypto/aes-x86_64.ko: No such file or directory
scripts/Makefile.modinst:35: recipe for target 'arch/x86/crypto/aes- x86_64.ko' failed
make[2]: *** [arch/x86/crypto/aes-x86_64.ko] Error 1
Makefile:1237: recipe for target '_modinst_' failed
make[1]: *** [_modinst_] Error 2
Makefile:527: recipe for target '__build_one_by_one' failed make: *** [__build_one_by_one] Error 2
I've posted the working directory as well in the command above, in case I'm doing it in wrong one.
|
The issue was with supported libraries and packages I was using.
To compile the latest kernel at this time of writing, you must have these 4 Packages / Libraries installed:
libssl-dev
libncurses5-dev
qt4-default
qt4-dev-tools
Although I'm bit skeptical about qt4's dev-tools and default, since I've downloaded together.
Also Note,
I'm using Ubuntu 16.04 LTS and based on your Distro commands and package requirement are subject to change
The Compilation
So the above mentioned command (In question) for compilation is correct, just notice that it takes a pretty much time to complete. To verify if everything is going smooth, you reach at a point where you can find this -
Setup is 17564 bytes (padded to 17920 bytes).
System is 7215 kB
CRC 3b136d62
Kernel: arch/x86/boot/bzImage is ready (#1)
and it halts there for few mins and starts again with creation of object files. Yes, I didn't receive when I was first doing it with qt5 packages.
The Installation
Again the above mentioned command (In question) is cent percent correct and on firing same you'll see multiple Kernel objects installing in your system, something like this:
...
INSTALL /lib/firmware/emi62/spdif.fw
INSTALL /lib/firmware/emi62/midi.fw
INSTALL /lib/firmware/kaweth/new_code.bin
INSTALL /lib/firmware/kaweth/trigger_code.bin
INSTALL /lib/firmware/kaweth/new_code_fix.bin
INSTALL /lib/firmware/kaweth/trigger_code_fix.bin
INSTALL /lib/firmware/ti_3410.fw
...
and it must end with
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.12.9
Found initrd image: /boot/initrd.img-4.12.9
Found linux image: /boot/vmlinuz-4.4.0-93-generic
Found initrd image: /boot/initrd.img-4.4.0-93-generic
Found linux image: /boot/vmlinuz-4.4.0-92-generic
Found initrd image: /boot/initrd.img-4.4.0-92-generic
Found linux image: /boot/vmlinuz-4.4.0-91-generic
Found initrd image: /boot/initrd.img-4.4.0-91-generic
Found linux image: /boot/vmlinuz-4.4.0-83-generic
Found initrd image: /boot/initrd.img-4.4.0-83-generic
Found Windows Boot Manager on /dev/sda2@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
NOOB ALERT
Also please note, based on number of Operating Systems (and Kernel) installed on
your system the number of Found statements may change! I have 2 OS
and hence I've got one extra Found statement for Windows
| aes-x86_64.ko No such file or directory for Module Installation failure after 4.12.9 Kernel compilation |
1,628,434,039,000 |
Supposedly I have a file that's distributed among different sectors. As an example, assuming both physical and logical sectors are 512B. A user process issues a request for the kernel to read the file. Let's say this file uses 3 distributed sectors on the hard drive.
1) Does the hard drive read all of the sectors at once and send the whole (512 * 3) data to the kernel?
*The 3 sectors are read in full by the hard drive first and then the data gets transferred to the kernel, 512 * 3 bytes gets transferred from HDD to kernel.
2) Do HDDs read multiple sectors at once? This seems more of a hardware related question though.
|
It depends. Modern kernels of Unix-like operating systems tend to have pretty complex code to make I/O faster. The best known feature is caching: if a sector has been read in the past, there may still be a copy in memory, in which case no request is sent to the hard drive at all. Other typical acceleration features include out-of-order access (when there are many pending requests, the kernel may issue them in a different order to minimize seeks or to better exploit parallelism allowed by the hardware), and prefetching (the kernel assumes that if sectors 0 through 5 of a file have been read then it's likely that sector 6 will be read, to it will read sector 6 into the cache if it has nothing better to do).
Whether it's possible to issue the request to read sector 1 before the request to read sector 0 has been completed depends on the capabilities of the disk bus and of the disk. There's no general answer.
| How does the kernel sends I/O requests to a hard drive? |
1,628,434,039,000 |
I am running Debian on QNAP ts-119P+. It is running well, but I am experiencing
something a little bit annoying. When I use lsblk, there is obviously sda, but also flash memory chips (mtdblockX), that contain firmware and I will never need to access them in the system. Is there some way to hide them? I tried to hide them using udev rules, but with no luck. I am trying to disable them in kernel or somehow disable them from showing up in lsblk.
|
You can hide certain devices from being listed by lsblk with its -e (or --exclude) option as lsblk -e <major number>.
| Linux disable/hide mtdblock devices from lsblk |
1,628,434,039,000 |
I am learning operating systems. I have a doubt. For example if scheduling policy for some set of process(set 1) is SCHED_RR and scheduling policy for some other set of processes(set 2) is SCHED_FIFO .
Now when kernel has to pick some process from these 2 sets, which scheduling policy does Linux uses?
Is it possible to change that policy? If so how to do that?
|
man sched
Conceptually, the scheduler maintains a list of runnable threads
for each possible sched_priority value. In order to determine
which thread runs next, the scheduler looks for the nonempty list
with the highest static priority and selects the thread at the
head of this list.
A thread's scheduling policy determines where it will be inserted
into the list of threads with equal static priority and how it
will move inside this list.
although there is one more real-time policy, where the priority is not (at all?) significant
In order to fulfil the guarantees that are made when a thread is
admit‐ ted to the SCHED_DEADLINE policy, SCHED_DEADLINE threads
are the high‐ est priority (user controllable) threads in the
system; if any SCHED_DEADLINE thread is runnable, it will preempt
any thread scheduled under one of the other policies.
| what is Linux global scheduling policy? |
1,628,434,039,000 |
I'm using a VPS from a VPS provider that run a 2.6 kernel, RHEL with OpenVZ virtualization system. I want to use ipset utility to manage ip sets on my iptables firewall.
This is the error I'm getting when creating an ipset:
mindaugas@517713:~$ sudo ipset create cf_ipv4 hash:net
ipset v6.20.1: Cannot open session to kernel.
strace of the command: https://p.defau.lt/?NwzyZkxR_VgekwCRr6YlWg
Question: is it even possible to use ipset on such machine with these options? If so - how can I do it?
Mount outout:
mindaugas@517713:~$ mount
/dev/simfs on / type simfs (rw,relatime,usrquota,grpquota)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
none on /dev type devtmpfs (rw,nosuid,noexec,relatime,mode=755)
none on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/cgroup type tmpfs (rw,relatime,size=4k,mode=755)
none on /run type tmpfs (rw,nosuid,noexec,relatime,size=275252k,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
none on /run/shm type tmpfs (rw,relatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,relatime,size=102400k,mode=755)
Here is the relevant information:
mindaugas@517713:~$ uname -r
2.6.32-042stab120.3
mindaugas@517713:~$ sudo rpm -qa
vzkernel-headers-2.6.32-042stab120.3.x86_64
mindaugas@517713:~$ ipset --help
ipset v6.20.1
Usage: ipset [options] COMMAND
mindaugas@517713:~$ sudo apt-get install xtables-addons-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
xtables-addons-common is already the newest version.
The following packages were automatically installed and are no longer required:
dmsetup grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub2-common
libdevmapper1.02.1 libfuse2
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
|
So, you're not really using a RHEL kernel (and the fact you used apt-get makes me wonder if it is RHEL at all), but an OpenVZ container. OpenVZ containers rely on features provided by the hosting system's kernel, which in this case doesn't support ipsets. There's nothing you can install in the container that will make the OpenVZ hosting environment support it, you'll need to talk to your hosting provider to build a kernel with iptables/ipset support.
| RHEL: can't use ipset utility with error: cannot open session to kernel |
1,628,434,039,000 |
I'm reading Robert Love's Linux Kernel Development in order to learn more about, well, Linux kernel development!
But in Chapter 2: Getting Started with the Kernel, I'm instructed to download and install the kernel. This confuses me. "Building the kernel is easy", he says. Yet the thought of installing a Linux kernel inside a Linux environment doesn't make sense to me- as if I'd be running this new Linux virtually?
The steps he gives are to obtain the kernel source
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
$ git pull
Then decompress the tarball (two different methods in case it's GNU zip but here's the bzip2 method),
$ tar xvjf linux-x.y.z.tar.bz2
Then from there you build the kernel by running make on menuconfig, deconfig, oldconfig, etc.
Then you install the new kernel. He explains that the install is "architecture and boot-loader-dependent" and to "consult the directions for [my] boot loader on where to copy the kernel image." He then provides an example of where one might copy the image and then to run
$ make modules_install
and then the chapter simply goes no further on this tutorial of installing the kernel.
This is where I'm lost. Up to this point I understand all of the commands so far (I've been using Fedora for a few years, writing system code in C, etc.) but I don't understand this concept of "installing" the the Linux kernel in my already Linux environment. There's no explanation of what's going on here (maybe he goes into detail later) or how to actually get the kernel running. Do I put it on a new hard drive? Do I run in like a VM? Do I choose some boot-up option in BIOS? How do I actually run it? This step is not in this chapter, nor in Chapter 3 or 4.
|
make install simply copies the kernel image to the /boot directory. make modules_install copies the modules to /lib/modules/kernel-version/. Most linux distributions these days boot using grub, so you need to run update-grub to notice the new kernel image in /boot, and add an entry to boot it to the grub configuration file so you get the option to boot using that kernel. Typically you also need an initrd containing modules needed to access boot hardware and some boot scripts, and at least on Debian based distributions, you can generate this by running update-initramfs -k kernelversion, prior to running update-grub.
| How do I run the Linux kernel? |
1,628,434,039,000 |
I am using openSUSE Tumbleweed. I've bought a new PCI-E Wireless card, that supports 5G WiFi (Intel 5100 AGN). It doesn't show up in lspci and even if I take old adapter out it still cannot see my new one. I have tried switching it off and on again in BIOS, but nothing helps. The driver must be installed according to firmware folder
/lib/firmware/iwlwifi-100-5.ucode
/lib/firmware/iwlwifi-1000-3.ucode
/lib/firmware/iwlwifi-1000-5.ucode
/lib/firmware/iwlwifi-105-6.ucode
/lib/firmware/iwlwifi-135-6.ucode
/lib/firmware/iwlwifi-2000-6.ucode
/lib/firmware/iwlwifi-2030-6.ucode
/lib/firmware/iwlwifi-3160-10.ucode
/lib/firmware/iwlwifi-3160-12.ucode
/lib/firmware/iwlwifi-3160-13.ucode
/lib/firmware/iwlwifi-3160-16.ucode
/lib/firmware/iwlwifi-3160-7.ucode
/lib/firmware/iwlwifi-3160-8.ucode
/lib/firmware/iwlwifi-3160-9.ucode
/lib/firmware/iwlwifi-3945-2.ucode
/lib/firmware/iwlwifi-4965-2.ucode
/lib/firmware/iwlwifi-5000-1.ucode
/lib/firmware/iwlwifi-5000-2.ucode
/lib/firmware/iwlwifi-5000-5.ucode
/lib/firmware/iwlwifi-5150-2.ucode
/lib/firmware/iwlwifi-6000-4.ucode
/lib/firmware/iwlwifi-6000g2a-5.ucode
/lib/firmware/iwlwifi-6000g2a-6.ucode
/lib/firmware/iwlwifi-6000g2b-5.ucode
/lib/firmware/iwlwifi-6000g2b-6.ucode
/lib/firmware/iwlwifi-6050-4.ucode
/lib/firmware/iwlwifi-6050-5.ucode
/lib/firmware/iwlwifi-7260-10.ucode
/lib/firmware/iwlwifi-7260-12.ucode
/lib/firmware/iwlwifi-7260-13.ucode
/lib/firmware/iwlwifi-7260-16.ucode
/lib/firmware/iwlwifi-7260-7.ucode
/lib/firmware/iwlwifi-7260-8.ucode
/lib/firmware/iwlwifi-7260-9.ucode
/lib/firmware/iwlwifi-7265-10.ucode
/lib/firmware/iwlwifi-7265-12.ucode
/lib/firmware/iwlwifi-7265-13.ucode
/lib/firmware/iwlwifi-7265-16.ucode
/lib/firmware/iwlwifi-7265-8.ucode
/lib/firmware/iwlwifi-7265-9.ucode
/lib/firmware/iwlwifi-7265D-10.ucode
/lib/firmware/iwlwifi-7265D-12.ucode
/lib/firmware/iwlwifi-7265D-13.ucode
/lib/firmware/iwlwifi-7265D-16.ucode
/lib/firmware/iwlwifi-8000C-13.ucode
/lib/firmware/iwlwifi-8000C-16.ucode
DMESG:
rextuz@linux-c84g:~$ dmesg | grep Firmware
[ 0.358267] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored
[ 0.401370] acpi PNP0A08:00: [Firmware Info]: MMCONFIG for domain 0000 [bus 00-3f] only partially covers this bridge
rextuz@linux-c84g:~$ dmesg | grep firmware
[ 5.713117] psmouse serio2: trackpoint: IBM TrackPoint firmware: 0x0e, buttons: 3/3
[ 7.639514] iwlwifi 0000:03:00.0: loaded firmware version 39.31.5.1 build 35138 op_mode iwldvm
[ 5123.606856] usb 2-1.2: device firmware changed
[12107.630137] usb 2-1.2: device firmware changed
[12111.314260] usb 2-1.2: device firmware changed
rextuz@linux-c84g:~$ dmesg | grep Wireless
[ 7.622057] Intel(R) Wireless WiFi driver for Linux
[ 7.659264] iwlwifi 0000:03:00.0: Detected Intel(R) Centrino(R) Wireless-N 1000 BGN, REV=0x6C
lspci and lshw
linux-c84g:/home/rextuz # lspci -vnn | grep -i net
00:19.0 Ethernet controller [0200]: Intel Corporation 82579LM Gigabit Network Connection [8086:1502] (rev 04)
03:00.0 Network controller [0280]: Intel Corporation Centrino Wireless-N 1000 [Condor Peak] [8086:0084]
linux-c84g:/home/rextuz # lshw -C network
*-network
description: Ethernet interface
product: 82579LM Gigabit Network Connection
vendor: Intel Corporation
physical id: 19
bus info: pci@0000:00:19.0
logical name: enp0s25
version: 04
serial: f0:de:f1:6f:61:8d
capacity: 1Gbit/s
width: 32 bits
clock: 33MHz
capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k firmware=0.13-3 latency=0 link=no multicast=yes port=twisted pair
resources: irq:29 memory:f2500000-f251ffff memory:f252b000-f252bfff ioport:5080(size=32)
*-network DISABLED
description: Wireless interface
product: Centrino Wireless-N 1000 [Condor Peak]
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:03:00.0
logical name: wlp3s0
version: 00
serial: 8c:a9:82:be:c0:9e
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=iwlwifi driverversion=4.5.0-2-default firmware=39.31.5.1 build 35138 latency=0 link=no multicast=yes wireless=IEEE 802.11bgn
resources: irq:28 memory:f2400000-f2401fff
*-network
description: Ethernet interface
physical id: 2
logical name: enp0s29u1u2
serial: c6:bc:a4:94:d0:53
capabilities: ethernet physical
configuration: broadcast=yes driver=rndis_host driverversion=22-Aug-2005 firmware=RNDIS device ip=192.168.42.209 link=yes multicast=yes
How do I make the kernel to use my new adapter instead or together with the old one?
|
Your laptop has a BIOS whitelist and the Intel 5100 is not on it
I would recommend calling Lenovo and ordering an Intel wifi card with 5 Ghz from them that will work with the X220 as the option to update the BIOS with a version that eliminates the whitelist might render the laptop useless.
I found the maintenance manual for the X220 and the Centrino Wireless-N 1000 must have been the card it was made with and it is on the list in the maintenance manual, so that is why it works
See http://download.lenovo.com/ibmdl/pub/pc/pccbbs/mobiles_pdf/0a60739.pdf on page 114 and 115 it shows the wifi cards that work. The Intel 6205 and 6300 are both listed but the 6300 may require 3 antennas. I still recommend ordering from Lenovo as the whitelist might be looking for one variation of the card and one bought from ebay might still not work
| Change Wireless adapter driver in Linux |
1,628,434,039,000 |
I'm doing some research that has to do with GPGPU resilience with NVIDIA graphics cards and I've been looking for a way to, as accurately as possible, simulate hardware failure. I know about cudaDeviceReset() and using intentionally failing asserts() within the kernel; correct me if I'm wrong but I don't think these accurately portray realistic hardware failure.
Ultimately what I'm trying to achieve is effectively turning off the device during execution, have the host detect this and try to recover from it.
What I'd like to know is if there is some method of "power cycling" the GPU via the Linux kernel.
I'm using CentOS 7 and my device's compute capability is 2.1. Kindly see below for output from uname -a.
Linux heisenbug 3.10.0-327.10.1.el7.x86_64 #1 SMP Tue Feb 16 17:03:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
|
You can manipulate some of the pci bus registers of the device fairly easily with setpci. Note: this is dangerous and may crash your system!
For example, find the pci bus and slot for your graphics board:
$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
$ lspci -s 00:02.0 -v
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) (prog-if 00 [VGA controller])
DeviceName: Onboard IGD
Subsystem: Holco Enterprise Co, Ltd/Shuttle Computer Device 4018
Flags: bus master, fast devsel, latency 0, IRQ 29
Memory at f7400000 (64-bit, non-prefetchable) [size=4M]
Memory at e0000000 (64-bit, prefetchable) [size=256M]
I/O ports at f000 [size=64]
Expansion ROM at <unassigned> [disabled]
Capabilities: <access denied>
Kernel driver in use: i915
Kernel modules: i915
You can read and write registers using setpci. You need to be root to read some registers, and to write any of them. The register names are listed with setpci --dumpregs. Eg:
$ setpci -s 00:02.0 command
0407
The 16bit pci config command register is an important register. The bit meaning can be got from the linux header. The low 3 bits are 1 to enable the device to respond to io and memory cycles from the cpu, and to be bus master so that it can dma into the cpu's main memory.
If you disable these bits, the device will no longer respond to your driver.
Beware, this may crash your system. Do not test this lightly:
$ sudo setpci -s 00:02.0 command=0000 # DONT DO THIS!
You can try writing a script to set the register to 0, waiting a few seconds while your graphics tries to draw, then setting the register back to its original setting (command=0407). All numbers are in hex (without any 0x prefix). As mentioned in the comments, you may need to provide 4 digits for the value, despite the fact that the width of named registers (like command) are known by setpci. You can provide an explicit width with a suffix to the register name of .b (8bits), .w (16), or .l (32).
Resetting the hardware is more difficult as it often requires you either to know of a particular register in the hardware to reset, or in the parent bus hardware.
| How to simulate GPU hardware failure? |
1,628,434,039,000 |
I am trying to understand linux syscalls mechanism. I am reading a book and it in the book it says that exit function look like that(with gdb):
mov $0x0,%ebx
mov $0x1,%eax
80 int $0x80
I understand that this is a syscall to exit, but in my Debian it looks like that:
jmp *0x8049698
push $0x8
jmp 0x80482c0
maybe can someone explain me why it's not the same? When I try to do disas on 0x80482c0
gdb prints me:
No function contains specified address.
Thanks!
|
Your code's exit() call ends up getting linked to the C library (libc) function exit(), which may not actually do the int $0x80.
The call from your code's invocation of exit() function is actually compiled as call instruction into the Program Linkage Table, or PLT. The run-time dynamic linker takes care of mapping the file /usr/lib/libc.so into memory. That's the C library. The run-time dynamic linker also fixes up entries in the PLT to eventually end up calling the code mapped in from /usr/lib/libc.so.
As near as I can tell (I'm using Arch linux), your second 3 instructions are the PLT entry, which gdb calls "exit@plt" when I single step into it. The jmp 0x80482c0 jumps to another address which finally jumps into the libc.so code.
You can demonstrate this to yourself with a fairly complicated exercize. First, you've got the address of the PLT table entry, whatever gdb tells you is the address of the jmp *0x8049698 - that's the adress of "exit@plt". On my x86 Arch linux box:
(gdb) disassemble 0x8048310,+20
Dump of assembler code from 0x8048310 to 0x8048324:
0x08048310 <exit@plt+0>: jmp *0x80496e8
0x08048316 <exit@plt+6>: push $0x10
0x0804831b <exit@plt+11>: jmp 0x80482e0
Then do readelf -e _program_ > elf.headers. Look in the file elf.headers. You will find a line of text that says "Section Headers:" Somewhere in Section Headers, you'll see something like this:
[ 9] .rel.dyn REL 08048290 000290 000008 08 A 5 0 4
[10] .rel.plt REL 08048298 000298 000020 08 AI 5 12 4
[11] .init PROGBITS 080482b8 0002b8 000023 00 AX 0 0 4
[12] .plt PROGBITS 080482e0 0002e0 000050 04 AX 0 0 16
"exit@plt" is at address 0x8048310. That's right in the ".rel.plt" section. ".rel.plt" probably stands for "relocation program linkage table".
Now we get to the part where the int $0x80 may not even exist. Do ldd _program_. Again, Arch linux x86 says this:
linux-gate.so.1 (0xb77d9000)
libc.so.6 => /usr/lib/libc.so.6 (0xb7603000)
/lib/ld-linux.so.2 (0xb77da000)
See that "linux-gate.so.1"? That contains the actual code that does the system call. It might be int $0x80, or it might be a sysenter instruction, or it might be something else. The Linux kernel is supposed to put a "small shared library" in a process's address space with the actual code, and then hand off the address of that small shared library in the ELF "auxilliary vector". Do man vdso for some details. The dynamic linker, /lib/ld-linux.so.2 knows the details of the ELF auxilliary vector, and ultimately puts the address of linx-gate.so.1 into the PLT somewhere, so actual C function calls can end up making efficient system calls.
If you do multiple invocations of ldd _program_, you will see that the address of linux-gate.so.1 isn't the same from invocation to invocation. The kernel actually doesn't put the top-of-stack at the same address every time to try to confuse malware that needs to know stack locations to get its own code executed.
| Linux exit function |
1,628,434,039,000 |
Please read the full question before attempting to answer, this is a bit oddball of a situation.
I support a lot of server hardware test functionality, and essentially end up managing several internal Linux distributions, supporting various kernels (and, in a bit, CPU architectures as well). These servers are PXE/iPXE-booted from minimal test images (to save on server load and boot time) that would double in size if I were to include the make tools and gcc on them.
The trick is this. Prior to boot, I don't know what will be in any given system, which means that I need to download and install kernel modules on the fly once the system has booted. These kernel modules obviously need to be a) pre-built, and b) match the running kernel. (We expect to have dozens.)
My question is this: What's the appropriate way to manage these kernel modules? I essentially need to specify a kernel the same way I specify an architecture, but to my knowledge yum (on Centos 7) has no way to say "I need a package built for X kernel." I'm less familiar with apt-get (Ubuntu), but I don't believe it has a way to do that either. Is there a way out of essentially building a parallel package management system for this? (This is essentially managing a meta-distribution...)
|
Speaking about Debian-derived distributions:
They can differentiate multiple architectures within the same repository (including 32bit vs 64bit).
The kernel modules are stored in a kernel-specific tree /lib/modules/$(uname -r)/ so you could build a package that included a module for all your possible different kernel versions and the right one would be used.
Is this sufficient as a starting point?
| Managing Pre-Built Kernel Modules Across Kernel Versions |
1,628,434,039,000 |
I'm specifically asking about CONFIG_SND_MAX_CARDS in the kernel.
From the code using this config, for example in sound/usb/card.c for USB cards, soundcards are stored in plain arrays which are looped over.
Why does the kernel not use lists and have an unlimited number of soundcards?
I know unlimited is not possible because of hardware reasons (numbers of slots in the bus etc.), but having a dynamically allocated implementation would at least save users the hassle of specifying a maximum number at compile time.
Any ideas?
|
In the good old times of ISA sound cards, it was not possible to create device nodes in /dev/ dynamically, so all devices had to be preallocated. This resulted in a limit of 8 sound cards, and the drivers were written with this limit in mind.
Later, when devfs and USB were introduced, this limit was removed. However, the easiest way to do this was to make the minimum amount of changes, i.e., to just change the upper limit.
Rewriting the code to allow an infinite number of cards would have been a lot of effort without any concrete benefit.
(It is possible to increase the current default of 32 with a kernel configuration option, but people who try that usually find out that they do not have enough USB bandwith for that many devices.)
| Why does Linux have a maximum number of sound cards? [closed] |
1,628,434,039,000 |
I'm trying to use my new Wacom (CTL-490DW-S (Intuos DRAW)) drawing tablet with Linux Mint.
I have an PC with a clean install (due to me messing up so many times already!) of Linux Mint:
Linux Mint 17.3
Cinnamon 2.8.6 32-bit
Kernel 3.19.0-32-generic
The PC is a:
Intel Core 2 Quad Q8200 @ 2.33GHz x4
3.8GiB Memory
111.2GB SSD
I realise that I should really be running a 64bit OS, but that shouldn't effect things for now...should it?
So far
When I initially plug the tablet in it is recognised as a usb device , lsusb returns
Bus 006 Device 003: ID 056a:033b Wacom Co., Ltd
But it is not picked up as an xinput device.
So I go over to the linuxwacom site and follow the steps to install the kernel drivers and Xdrivers. Now the device is picked up and the four main buttons on the tablet seems to do stuff. Good!
But, bring the pen to the pad and my PC freezes completely. Bad!
Some googling brought me to this chat about the usbhid and a deadlock situation relating to new tablets, which seems highly relevant to the problem at hand. By my crude understanding; the wacom drivers are asking too much too fast of the usbhid and it causes the lock-out.
The solution seems to be to add the patch to the usbhid core and then recompile the kernel (and or module, I don't know?) before re-installing.
I can locate the files and make the edit manually (its just two lines in one file, basically taking a line of code outside of the loop, as I understand) but the simple steps of "recompile and install" seem to flummox me every attempt I make. I have trouble with make oldconfig and then if that works make dep never works.
Could someone guide me through/ send me on to a guide for how I should do this. Online articles seem to disagree on the steps, I'll happy do another clean install, if it simplifies the problem.
As its Christmas (Newton-mas) I assume others will have similar issues with their new tablet toys that Santa brought them.
|
I was in the same boat. Was able to get the tablet recognized on Arch linux by installing linux-headers, and input-wacom-dkms from AUR which did the patching of the kernel. I'm not sure if it will work on Debian-based distros (Ubuntu/Mint) but there's a python script for input-wacom-dkms here. From what I've read the Intuos line should be supported in the Linux 4.4 kernel which should be out in a few weeks but probably won't come to Mint for a while as they tend to prioritize stability over bleeding edge.
| Linux Kernel - Wacom Tablet (CTL-490DW-S) - Lockout |
1,628,434,039,000 |
I am writing a stackable file system which requires some database file. I am thinking of taking it as mount time argument and then reading it's content into private field of superblock of mounted FS. Precisely I intend to do this:
mount -t wrapfs -o pattdb=database.db /some/mounted/point /mount/point
Here I'm having problem in figuring out where does(in what field of FS does it reside) the file database.db go?
|
Mount time argument with -o option is received in raw_data field of wrapper file system's mount function.
struct dentry *wrapfs_mount(struct file_system_type *fs_type, int flags,
const char *dev_name, void *raw_data)
This function is defined in main.c and for the case above, raw_data points to string pattdb=database.db.
| passing file in mount options |
1,445,774,632,000 |
I have an iMac mid 2011 running OSX and I am trying to install Arch Linux following this guide. I successfully set up a dual boot last year following a similar procedure but now I can't even start since I get a kernel panic while booting from the live usb installation of archiso: right before the login prompt. I'm 100% sure the image is not corrupted (I checked the signature and booted it on another pc).
Since last year it worked I tried every old release and I isolated the one that introduced the problem: it's 2015-05-01 kernel 4.0.1.
Older versions boot fine and I can complete the installation but after a restart I get the kernel panic anyway.
I don't know what to do because I can't change any setting on the archiso image and the stack trace goes so fast I can't even record it: in a glimpse I have noticed "null pointer dereference", "scheduling while atomic" and "fixing recursive fault but reboot is needed”.
How can I debug it? And, possibly, how do I solve this issue?
|
I installed the linux-lts package as suggested by @mikeserv from chroot and I set it as the default boot option from the grub configuration.
This way I could boot nicely into linux 3.14 and complete the installation process. The vanilla linux kernel is installed alongside with the LTS version so using the "advanced options" from the grub menu I could still boot with linux 4.0 and see the system crash.
I then tried using Kdump to make a memory dump of the machine during the kernel panic but for some reason I still don't know kexec won't start on the kernel I recompiled with debug options.
Eventually I manage to read the kernel panic log the hard way: by recording it with a high-frame rate camera and I was able to identify the driver that caused the crash: radeon_audio_detect. The bug has been reported several times and it seems to affect all macs with a radeon gpu and other systems as well.
A patch for it as already been added to the kernel in 4.2rc5
| How to debug a kernel panic on boot with archiso? |
1,445,774,632,000 |
Is the whole kernel always loaded to RAM whatever the size of the RAM? In other words, can the Linux kernel be affected by paging (some part of kernel reside in virtual memory)?
|
No, (at least not that I am aware of any feature allowing for the kernel to load in swap) it makes use of the paging system (or swap) for LKM's and running processes.
The linux kernel is loaded into system memory. Depending on the size of the kernel (which would grow exponentially when used without loadable kernel modules, or static modules for device drivers etc.) the system may/or may not have enough physical memory to load. It then exposes an API for both 'kernel' & 'user' land memory resources. Here is a resource for ARM chipsets.
| Is the Linux kernel affected by paging? |
1,445,774,632,000 |
I am trying to compile a linux-sunxi kernel for my Banana pi.
Using this link: http://sunxi.org/Linux_Kernel#Compilation
Unfortunately I am getting the following message at the bottom when I am trying to compile the uImage and modules. (Step: make -j4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage modules)
Building modules, stage 2.
MODPOST 0 modules
Does anyone have any clue how to fix this? I do have a configuration where loadable modules are enabled and for example I have the hid-multitouch enabled.
When executing make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules_install I get:
DEPMOD 3.19.0-rc6-45640-g77f18db
With no build modules in it at all..
|
I ran into the same problem! After googling around for a good while, it finally turned out (in my case) that the kernel build toolchain is very picky about some env options, as pointed out here.
Here, in my ~/.bashrc I had export GREP_OPTIONS='--color=always' and that seems to be causing problem with the module script generation.
So changing it to export GREP_OPTIONS='--color=auto' or export GREP_OPTIONS='--color=never' AND logging out/in solved the problem!
When GREP_OPTIONS='--color=always' used:
$ make clean modules SUBDIRS=drivers/staging/usbip
CLEAN drivers/staging/usbip/.tmp_versions
CLEAN drivers/staging/usbip/Module.symvers
LD drivers/staging/usbip/built-in.o
CC [M] drivers/staging/usbip/usbip_common.o
CC [M] drivers/staging/usbip/usbip_event.o
CC [M] drivers/staging/usbip/stub_dev.o
CC [M] drivers/staging/usbip/stub_main.o
CC [M] drivers/staging/usbip/stub_rx.o
CC [M] drivers/staging/usbip/stub_tx.o
CC [M] drivers/staging/usbip/vhci_sysfs.o
CC [M] drivers/staging/usbip/vhci_tx.o
CC [M] drivers/staging/usbip/vhci_rx.o
CC [M] drivers/staging/usbip/vhci_hcd.o
LD [M] drivers/staging/usbip/usbip-core.o
LD [M] drivers/staging/usbip/vhci-hcd.o
LD [M] drivers/staging/usbip/usbip-host.o
Building modules, stage 2.
MODPOST 0 modules
Changing to GREP_OPTIONS='--color=auto' and logging out/in:
$ make clean modules SUBDIRS=drivers/staging/usbip
CLEAN drivers/staging/usbip/.tmp_versions
CLEAN drivers/staging/usbip/Module.symvers
LD drivers/staging/usbip/built-in.o
CC [M] drivers/staging/usbip/usbip_common.o
CC [M] drivers/staging/usbip/usbip_event.o
CC [M] drivers/staging/usbip/stub_dev.o
CC [M] drivers/staging/usbip/stub_main.o
CC [M] drivers/staging/usbip/stub_rx.o
CC [M] drivers/staging/usbip/stub_tx.o
CC [M] drivers/staging/usbip/vhci_sysfs.o
CC [M] drivers/staging/usbip/vhci_tx.o
CC [M] drivers/staging/usbip/vhci_rx.o
CC [M] drivers/staging/usbip/vhci_hcd.o
LD [M] drivers/staging/usbip/usbip-core.o
LD [M] drivers/staging/usbip/vhci-hcd.o
LD [M] drivers/staging/usbip/usbip-host.o
Building modules, stage 2.
MODPOST 3 modules
CC drivers/staging/usbip/usbip-core.mod.o
LD [M] drivers/staging/usbip/usbip-core.ko
CC drivers/staging/usbip/usbip-host.mod.o
LD [M] drivers/staging/usbip/usbip-host.ko
CC drivers/staging/usbip/vhci-hcd.mod.o
LD [M] drivers/staging/usbip/vhci-hcd.ko
Mad!
| Compiling kernel but doesn't build kernel modules |
1,445,774,632,000 |
I am not asking how to shut down. I am asking how to cut of the power.
What is the function in Linux kernel code do the action of cutting of the power? And please explain the code.
|
The actual kernel code depends on the arch of your system. For x86 systems, they are located in arch/x86/kernel/reboot.c
Halt will stop the machine, and leave it in power-on state. So it just stops the kernel, but usually does not power it off.
static void native_machine_halt(void)
{
/* Stop other cpus and apics */
machine_shutdown();
tboot_shutdown(TB_SHUTDOWN_HALT);
stop_this_cpu(NULL);
}
While power_off will also cut off the electric source from APM / ACPI pm_power_off()
static void native_machine_power_off(void)
{
if (pm_power_off) {
if (!reboot_force)
machine_shutdown();
pm_power_off();
}
/* A fallback in case there is no PM info available */
tboot_shutdown(TB_SHUTDOWN_HALT);
}
machine_shutdown() is an infinite loop
tboot_shutdown() (arch/x86/kernel/tboot.c)
stop_this_cpu(NULL) (arch/x86/kernel/process.c)
disables the IRQs of the CPU, set the CPU offline,
pm_power_off() (arch/x86/kernel/apm_32.c) is a function pointer to apm_power_off()
As you can see, all the job depends on the arch. In all cases, it's done with ASM calls.
For apm_power_off(), the Bios is called with code APT_STATE_OFF (0x0003).
apm_bios_call_simple(APM_FUNC_SET_STATE, APM_DEVICE_ALL, APM_STATE_OFF, eax, err);
For native_halt() (arch/x86/include/asm/irqflags.h) this calls is used :
asm volatile("hlt": : :"memory");
Choose your poison :)
| Which function in Linux kernel do the powering off action? |
1,445,774,632,000 |
I am writing a BASH script that automatically configures, builds and installs the most recent kernel image. The generated kernel should include the grsecurity patchset. It would use the previous configuration from /proc/config.gz, which I created manually when compiling the first custom kernel on the machine.
Is it safe to fully automatize the process? It would look like this:
Check the most recent kernel that grsecurity is available for
Download the grsecurity patchset and the matching kernel source tree
Patch the kernel
Copy the previous kernel configuration file into the kernel source directory
Run make olddefconfig to configure the kernel based on the previous configuration
Compile the kernel with fakeroot make deb-pkg
Install the resulting packages and change bootloader priority
Send me a mail indicating that a reboot is required
The main question: is it likely that a kernel compiled with olddefconfig will contain errors that prevent the system from booting if the previous configuration is working correctly? It is very important because it is a remote server accessed via SSH and a manual rescue would take a lot of effort.
|
If you can't afford failure, test.
Even if you can afford failure, testing is good. If at all possible, run the build in a dedicated test environment. In many cases a virtual guest makes for an adequate test system. When you cab reboot into your updated kernel and any subsequent tests complete successfully too, only then copy and deploy the new package to your remote system.
Now to your main question: will your plan and make olddefconfig contain errors that will result in a boot failure? Only an idiot would believe any system to be completely foolproof. When you want to run the most recent kernel, as you stated, you will be bleeding edge and have all the advantages and risks associated with that. Reducing risk is selecting a long term release where a feature set is frozen, and only bug/security fixes will be introduced.
Regardless: any reboot runs a small risk of failing.
On a side note: I have spent too many hours in the past in data centers repairing issues/misconfigurations in servers that I recommend everyone to always add a suitable remote management option (e.g. HP ILO, Dell's DRAC, Oracle's ILOM etc. or a KVM over IP gateway) to your remote servers, that allows you to fix most issues the comfort of your desk.
| Automatized kernel upgrade |
1,445,774,632,000 |
Debian/Ubuntu: How to compile a Linux kernel on one machine and use on other machines (same architecture)?
I know how to do it on the same machine. But to use a compiled kernel other machines, is tricky for me.
For example,
I have done make
But how about sudo make modules_install install ?
This will install things to my current machine.
What is good practice to compile a kernel on a fast machine but use it on other slow/(or fast too) machines.
Otherwise I have to compile, install it every time, which is time consuming.
Note:
On Ubuntu webpage, there are ways to do similar thing. But it is only good for Ubuntu kernels. Not for upstream kernels.
|
Since they're Debian machines, use make deb-pkg (instead of make, make install, etc.), which is part of the upstream kernel sources. That will generate a few Debian packages; you can scp those around and install with dpkg -i.
| Debian/Ubuntu:How to compile a Linux kernel on one machine and use on other machines (same architecture) |
1,445,774,632,000 |
I'm trying to debug the kernel. But I couldn't trigger kgdb with echo g > /proc/sysrq-trigger, it just prints help message.
I have enabled kernel debugging, kgdb over serial, frame pointer etc.
CONFIG_DEBUG_KERNEL=y
CONFIG_FRAME_POINTER=y
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_KGDB=y
CONFIG_KGDB_SERIAL_CONSOLE=y
What could be missing? The kernel version is 2.6.32.1, running CentOS 5 in KVM
|
Looks like setting kgdboc parameters in boot options worked, not sure why.
(I'm using libvirtd)
| sysrq-trigger doesn't accept parameter 'g' |
1,445,774,632,000 |
My external USB 3 hard drive is behaving very strangely:
If I plug it into a USB 2 port, it works fine
If I plug it into a USB 3 port, it doesn't work at all. It's not even mentioned in /var/log/messages.
If I plug a USB 2 device (memory stick) into the same USB 3 port, it works fine.
I think the USB 3 drive is mentioned in dmesg during boot up when it's plugged into the USB 3 port, but it's hard to tell. There are no clear device names listed, just serial ids etc.
The last time I used it on this machine, everything was alright, but that was at least a month ago. Since then I've gone through a few kernel upgrades and a number of package updates. My guess is something went wrong in the process, so I'm here to try and narrow that down.
Useful information:
I'm running Gentoo (kernel version: 3.7.4-gentoo)
CONFIG_USB_STORAGE is enabled in the kernel (obviously, since USB 2 works)
CONFIG_USB_XHCI_HCD is also enabled in the kernel
The hardware involved is:
Lenovo X1 laptop
WD 1tb portable drive. There's no external power options, and I've never needed one (when it was working)
|
So after a lot of toying with this, it started to work, though for the life of me I can't figure out why. Here's a list of things I tried:
Didn't work
Rebooting
Unplugging and plugging it back in while the laptop is running
Booting up with it plugged in
Plugging it in post-boot up
Recompiling my kernel with the same options
Did work
Recompiling my kernel with USB3 debuging enabled
Re-recompiling my kernel with USB3 debugging turned off
So basically I tried recompiling my kernel with debugging enabled to see what was wrong, and lo-and-behold it worked perfectly. Then, as an experiment, I recompiled again, this time with debugging off, and it still worked.
I have no idea what happened, but for those who might come here in search of an answer one day, I offer you what I have.
| USB3 Hard Drive Not Recognised by Linux |
1,445,774,632,000 |
A "Linux debian 3.2.0-0.bpo.3-amd64 #1 SMP Thu Aug 23 07:41:30 UTC 2012 x86_64 GNU/Linux" system has at least 5 SCSI hosts:
root@debian:~# ls /sys/class/scsi_host
host0 host1 host2 host3 host4
root@debian:~# cat /sys/class/scsi_host/host0/proc_name
mpt2sas
root@debian:~# cat /sys/class/scsi_host/host1/proc_name
ata_piix
root@debian:~# cat /sys/class/scsi_host/host2/proc_name
ata_piix
root@debian:~# cat /sys/class/scsi_host/host3/proc_name
ata_piix
root@debian:~# cat /sys/class/scsi_host/host4/proc_name
ata_piix
The mpt2sas SCSI bus has 32 drives attached. On boot (after a reboot) the drives are mostly in standby state (spin down). This causes each drive to spin up in a sequential order. The spin up time of a typical drive is 8 till 9 seconds. As a result the boot after a reboot will take almost 5 minutes.
Having configured to the kernel to scan the scsi bus asynchrone GRUB_CMDLINE_LINUX="scsi_mod.scan=async" doesn't improve boot after reboot time. And setting scsi_mod.scan=none makes the system to not boot at all.
The final goal is to boot via USB, which is another scsi_host:
# cat /sys/class/scsi_host/host5/proc_name
usb-storage
How can I configure this system to exclude mpt2sas or (mpt2sas and ata_piix) bus from spinning up all drives during boot after reboot?
|
Since the large array is on a controller of a separate type (make and model, or rather: chipset), and nothing on it is needed for the system boot process, you can work around this by forcing a delayed controller initialization. The easiest way to do that is to simply blacklist the kernel module that does the kernel initialization, then load it manually very late in the boot process.
NOTE: It is extremely important that this is done only with controllers that hold nothing that is needed for the system to boot properly. Otherwise, you will find yourself with a boot failure - anything from services failing to start or reading/writing files in the wrong place, to an outright kernel panic. Keep this in mind before implementing a scheme like this.
First, find out which kernel module handles the controller in question. A quick Google search based on the information provided in the question says this likely indeed is the mpt2sas module. Second, make sure that the code is actually compiled as a module; something like find "/lib/modules/$(uname -r)" -name 'mpt2sas*' -print will do nicely. (Yes, I know that -print is the default, but I like to be explicit...) Verify its status as a loaded module using lsmod | grep mpt2sas.
Then, add the module to the modules blacklist file. You can either add it to /etc/modprobe.d/blacklist.conf, or a separate configuration file such as /etc/modprobe.d/mpt2sas.conf. Just add the following line to such a file.
blacklist mpt2sas
This will disable automatic loading of the module in question. We are going to take advantage of the fact that it can still be loaded manually using e.g. modprobe - where "manually" can mean "from a script".
Open /etc/rc.local (which is executed after all other rc scripts) in an editor, and add the following lines somewhere in it:
modprobe mpt2sas
mount -a
You probably want to put this late in the file, but obviously before any exit or similar directives. The mount -a may or may not be needed depending on whether the file systems are actually to be mounted on boot and whether they are mounted automatically when they are found by the kernel disk partition probing. You can try without it first, if you want to and feel safe that you can gain access to the system if it doesn't work. If you need anything special to start up RAID or somesuch, that goes between the modprobe and mount. If any specific services need the large array to be available, you can create a separate rc script to start the array and specify that it should run before any such services are started. You can make it execute in the background by wrapping it in a subshell with a syntax like ( commands ) &, but that may or may not have any noticable effect on the result because partition probing is done in the kernel. You may be able to use hdparm to spin down the drives after the partition has been mounted, if they are only rarely accessed. In short, this is the part you may want to customize for your particular needs.
Then, update your initramfs by executing update-initramfs -u as root.
If nothing failed, you should now be able to reboot your system and enjoy the benefits of delayed disk spin-up and partition probing.
| How to skip/exclude one SCSI bus from scanning during boot? |
1,445,774,632,000 |
Is there a way to change the format of timestamp in kernel logs?
It was something like 2012-08-27T8:54:35.939421+03:00 now, I also checked sysctl -a | grep log, nothing found really.
|
No, see the kernel code in kernel/printk.c, it's hardcoded as:
sprintf(tbuf, "[%5lu.%06lu] ", (unsigned long) t, nanosec_rem / 1000)
All you can do is enable/disable that timestamp. You can have whatever reads /proc/kmsg (syslog, klog...) add the timestamp itself.
| Configure timestamp format of kernel log? |
1,445,774,632,000 |
I'm building the kernel (3.5) from /media/src_prog/linux-3.5/ to /media/sda5_k/. I've gone through the following steps:
make O=/media/sda5_k/ menuconfig
make -j2 O=/media/sda5_k/
make O=/media/sda5_k/ modules_install
And when it comes to make O=/media/sda5_k/ install all I get is:
[root@localhost linux-3.5]# make O=/media/sda5_k/ install
sh /media/src_prog/linux-3.5/arch/x86/boot/install.sh 3.5.0 arch/x86/boot/bzImage \
System.map "/boot"
Cannot find LILO.
[root@localhost linux-3.5]#
I also tried this manually:
cp /media/sda5_k/arch/x86/bzImage /media/sda5_k/boot/
cp /media/sda5_k/arch/x86/System.map /media/sda5_k/boot/
and repeated the make O=/media/sda5_k/ install but it doesn't work.
I'm using Arch for compilation and boot process is done with Ubuntu's GRUB2.
What do I do at this step?
Edit:
fdisk:
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 65538047 32768000 83 Linux
/dev/sda2 65538048 98306047 16384000 83 Linux
/dev/sda3 98306048 122882047 12288000 83 Linux
/dev/sda4 122882048 1953523711 915320832 5 Extended
/dev/sda5 122884096 139268095 8192000 83 Linux
/dev/sda6 139270144 204806143 32768000 83 Linux
/dev/sda7 204808192 229384191 12288000 83 Linux
/dev/sda8 229386240 245770239 8192000 83 Linux
/dev/sda9 245772288 270348287 12288000 83 Linux
/dev/sda10 270350336 319502335 24576000 83 Linux
/dev/sda11 450578432 929523711 239472640 83 Linux
/dev/sda12 929525760 1953523711 511998976 83 Linux
/dev/sda13 319504384 450576383 65536000 83 Linux
df:
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 12245648 9913616 1717632 86% /
dev 1024756 0 1024756 0% /dev
run 1027708 328 1027380 1% /run
/dev/sda3 12245648 9913616 1717632 86% /
shm 1027708 112 1027596 1% /dev/shm
tmpfs 1027708 68 1027640 1% /tmp
/dev/sda7 12245648 1100504 10530744 10% /media/src_prog
/dev/sda5 8165804 436548 7319656 6% /media/sda5_k
/media/src_prog/ -> Where I keep the source files
/media/sda5_k/ -> Where I want Linux Kernel to be put
/dev/sda1 -> Ubuntu
/dev/sda2 -> Old unused Ubuntu
/dev/sda3 -> Arch (here :-D)
/dev/sda1/boot -> Boot (Ubuntu's) the one bound to MBR.
|
I haven't checked whether this still applies to 3.5, but I think the kernel makefiles only support Lilo, not Grub. Once you've manually copied the bzImage file, and the initrd or initramfs if you're using one, you need to inform Grub of the new kernel. With simple setups, it's just a matter of running update-grub. Since you're booting one distibution's kernel with another distribution's bootloader, this may not work, so you may need to edit the Grub configuration file manually. That's /boot/grub/menu.lst for Grub legacy (Grub 0.9x) and /boot/grub.grub.cfg for Grub2 (Grub 1.9x).
For Grub2, you need an entry like
menuentry "Homemade 3.5 kernel" {
insmod ext2
set root='(hd0,msdos5)'
linux /boot/bzImage root=/dev/sda3 ro
}
| stuck at "make install" |
1,445,774,632,000 |
Reference - http://www.linode.com/wiki/index.php/PV-GRUB#Building_Your_Own_Kernel
In order to work with Xen, a number of options that must be selected:
CONFIG_PARAVIRT_GUEST=y
CONFIG_XEN=y
CONFIG_PARAVIRT=y
CONFIG_PARAVIRT_CLOCK=y
CONFIG_XEN_BLKDEV_FRONTEND=y
CONFIG_XEN_NETDEV_FRONTEND=y
CONFIG_HVC_XEN=y
CONFIG_XEN_BALLOON=y
CONFIG_XEN_SCRUB_PAGES=y
Where exactly do I specify these configuration?
I have done these steps so far:-
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.3.3.tar.bz2
tar -xf linux-3.3.3.tar.bz2
cd linux-3.3.3
make menuconfig
make menuconfig brings me to the ncurses "GUI" but there are so many options I am completely lost....
Any suggestions how I should proceed?
|
The options in all caps are what gets written into the configuration file for the kernel you will be building (which make menuconfig generates).
There are two ways to edit it:
Open the file and change/add the entries
Browse to the relevant Xen options through the GUI, and guess their names from the all caps name. Yours will most likely be in Processor type and features --->. You can press the help key to see the option's name and description so you can confirm that you are modifying/adding the correct options.
| Learning how to build my own linux kernel |
1,445,774,632,000 |
I am running Debian 6, and decided to install 2.6.38 kernel from Unstable. I also installed the headers so that I can later on :
sudo apt-get install --target-release=unstable linux-image-2.6.38-2-686-bigmem linux-headers-2.6.38-2-686-bigmem
I then re-installed virtualbox-ose-dkms to that the VirtualBox drivers for 2.6.38 can be rebuilt (so that I can use VirtualBox under 2.6.38), but I get this error:
Building initial module for 2.6.38-2-686-bigmem
Error! Bad return status for module build on kernel: 2.6.38-2-686-bigmem (i686)
Consult the make.log in the build directory
/var/lib/dkms/virtualbox-ose/3.2.10/build/ for more information.
dpkg: error processing virtualbox-ose-dkms (--configure):
subprocess installed post-installation script returned error exit status 10
configured to not write apport reports
Errors were encountered while processing:
virtualbox-ose-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)
Here's the contents of the file they asked me to look at:
$ cat /var/lib/dkms/virtualbox-ose/3.2.10/build/make.log
DKMS make.log for virtualbox-ose-3.2.10 for kernel 2.6.38-2-686-bigmem (i686)
Sat Apr 9 14:11:57 SAST 2011
make: Entering directory `/usr/src/linux-headers-2.6.38-2-686-bigmem'
LD /var/lib/dkms/virtualbox-ose/3.2.10/build/built-in.o
LD /var/lib/dkms/virtualbox-ose/3.2.10/build/vboxdrv/built-in.o
CC [M] /var/lib/dkms/virtualbox-ose/3.2.10/build/vboxdrv/linux/SUPDrv-linux.o
In file included from /var/lib/dkms/virtualbox-ose/3.2.10/build/include/VBox/types.h:30,
from /var/lib/dkms/virtualbox-ose/3.2.10/build/vboxdrv/linux/../SUPDrvInternal.h:35,
from /var/lib/dkms/virtualbox-ose/3.2.10/build/vboxdrv/linux/SUPDrv-linux.c:33:
/var/lib/dkms/virtualbox-ose/3.2.10/build/include/iprt/types.h:97:31: error: linux/autoconf.h: No such file or directory
/var/lib/dkms/virtualbox-ose/3.2.10/build/vboxdrv/linux/SUPDrv-linux.c: In function ‘VBoxDrvLinuxInit’:
/var/lib/dkms/virtualbox-ose/3.2.10/build/vboxdrv/linux/SUPDrv-linux.c:451: error: ‘nmi_watchdog’ undeclared (first use in this function)
/var/lib/dkms/virtualbox-ose/3.2.10/build/vboxdrv/linux/SUPDrv-linux.c:451: error: (Each undeclared identifier is reported only once
/var/lib/dkms/virtualbox-ose/3.2.10/build/vboxdrv/linux/SUPDrv-linux.c:451: error: for each function it appears in.)
/var/lib/dkms/virtualbox-ose/3.2.10/build/vboxdrv/linux/SUPDrv-linux.c:451: error: ‘NMI_IO_APIC’ undeclared (first use in this function)
/var/lib/dkms/virtualbox-ose/3.2.10/build/vboxdrv/linux/SUPDrv-linux.c:465: error: ‘nmi_active’ undeclared (first use in this function)
make[4]: *** [/var/lib/dkms/virtualbox-ose/3.2.10/build/vboxdrv/linux/SUPDrv-linux.o] Error 1
make[3]: *** [/var/lib/dkms/virtualbox-ose/3.2.10/build/vboxdrv] Error 2
make[2]: *** [_module_/var/lib/dkms/virtualbox-ose/3.2.10/build] Error 2
make[1]: *** [sub-make] Error 2
make: *** [all] Error 2
make: Leaving directory `/usr/src/linux-headers-2.6.38-2-686-bigmem'
|
autoconf.h moved from include/linux to include/generated in Linux 2.6.33. Authors of third-party modules must adapt their code; this has already been done upstream for VirtualBox. In the meantime, you can either patch the module source or create a symbolic link as a workaround.
As for the NMI-related errors, the NMI watchdog has changed a lot between 2.6.37 and 2.6.38. This looks like it requires a nontrivial porting effort on the module source code. In the meantime, you might have some luck just patching out the offending code. The purpose of the NMI watchdog is to debug kernel lockups, so it's something you can live without.
| I am failing to build VirtualBox driver for Linux 2.6.38 |
1,445,774,632,000 |
This is from here.
Extract the patch
tar -xvzf /usr/src/web100-2.5.22-200810130047.tar.gz
bzip2 web100/ web100-2.6.27-2.5.22-200810130047.patch
Test the patch
bzip2 -dc /usr/src/linux/web100/ web100-2.6.27-2.5.22-200810130047.patch.bz2 | patch -p1 --dry-run
I looked at the .patch, the diff output of many files and the file .patch.bz2 after the bzip2 command which is too also the diff output of many files, they seem to be the same. My question is why is bzip2 even needed to turn the .patch into a .patch.bz2? Is it for the redirection to std output from the -dc option for the patch command? Even if it is, why not just not just use the patch command in the form something like this:patch -p1 < patchfile? I don't see why the bzip2 is done here. Thanks!
Also, I think the bzip2 might have an extra space in the command after web100/, right?
|
It's unneeded. Those instructions could be abbreviated to:
tar -xvzf /usr/src/web100-2.5.22-200810130047.tar.gz
patch -p1 --dry-run < web100/ web100-2.6.27-2.5.22-200810130047.patch
| Why is bzip2 needed in the kernel patch instructions? |
1,445,774,632,000 |
After an update/ upgrade on Debian 12 (weekly update), there is NO WiFi, files are not opening, unable to shutdown or sleep, and freezes when using sudo. The bug is fixed with a new release of kernel. But, I am NOT able to install the new kernel.
I downloaded the new kernel file to a flash drive using another laptop
Copied it to the freezing laptop
But on hitting the command:
$ sudo apt install ./linux-image-6.1.0-16-amd64_6.1.67-1_amd64.deb
terminal freezes without prompting for password.
EDIT:
Tried to edit
$ nano /etc/default/grub
# GRUB_DEFAULT=0
GRUB_DEFAULT="1>2"
But it could not be saved since I did NOT use 'sudo'.
But, when I use sudo
$ sudo nano /etc/default/grub
It freezes without prompting for password (may be because of Network Manager issue)
Any help?
|
I got the trick from @Jaromanda X and details from u/Hendersen43 and
u/Only_Space7088 at:
https://www.reddit.com/r/debian/comments/18i60wx/networkmanager_service_freezes_the_whole_pc_after/
I am giving details to help newbees...:
I solved it by:
(1) Interrupting booting process, and changing the kernel back to the previous version:
While booting, press F9 to interrupt the booting
Then, use arrow keys on keyboard to highlight the previous kernel version and press ENTER
(2) Download the patched kernel (linux-image) from the site (from the above reddit posting):
https://ftp.debian.org/debian/pool/main/l/linux-signed-amd64/linux-image-6.1.0-16-amd64_6.1.67-1_amd64.deb
(3) Change Directory to Downloads folder (where the image is downloaded)
(4) Installing it using the command (from the above reddit posting):
me@debian~/Downloads$ sudo apt install ./linux-image-6.1.0-16-amd64_6.1.67-1_amd64.deb
(5) Updating and then upgrading to the matching headers (linux-headers)
$ sudo apt update
$ sudo apt upgrade
EDIT: I was unable to make changes in any system file nor install/ remove kernel, because on hitting 'sudo' the system hangs without prompting for password.
@GAD3R: Thank you for your detailed answer. But I was unable to make any change in any file or install anything since 'sudo' was disabled.
@garethTheRed: thank you
| After an update (a kernel bug it seems) Debian 12 hangs when hitting sudo: Unable to install the new kernel with bug fixed |
1,445,774,632,000 |
XEN has support for ARM and it is also possible to run it on a cpu without VHE (virtual hardware extension) cap that was introduced with ARMV8.1-A extension. As I understand linux kernel of a guest vm communicates with xen hypervisor over HVC calls. HVC call is a hardware feature, as I think only available in VHE enabled system. But how does it work without VHE? Also with HVCs but as some kind of software call? Please correct me if I'm wrong in my understanding.
|
Xen on Arm normally uses the virtualization extensions which have been present on high-end ARMv7 chips since around 2010, and are a non-optional part of ARMv8. Arm virtualization adds an extra privilege level, the hypervisor, which has its own memory virtualization. The relationship between system and hypervisor is very similar to the relationship between user and system: the MMU performs a translation from user virtual addresses (VA) (using each user partition's memory mapping) to system addresses (IPA — “intermediate physical address”), and then another translation (using each system partition's memory mapping) from system addresses to physical addresses (PA). User mode code calls the SVC instruction to enter system mode, and system mode code calls the HVC instruction to enter hypervisor mode.
When a kernel contains a hypervisor, the hypervisor itself runs in hypervisor mode. The rest of the kernel can run either in hypervisor mode or in system mode, depending on the design of that kernel. As far as I know, Xen runs Linux in system mode plus Xen-specific parts in hypervisor mode.
The v8.1-A virtualization host extensions simplify the design of a kernel-plus-hypervisor like Xen by allowing a mostly unmodified kernel to run with hypervisor privileges. The kernel parts (invoked by SVC instructions or by system-level interrupts) don't need to make HVC calls to perform hypervisor operations. This helps performance because HVC calls require additional context switches which require some cache invalidation, register saving, and extra TLB entries since each level has its own memory mappings.
(There was also an early version of Xen ARM which didn't use the virtualization extensions. Although that project was called “Secure Xen on ARM”, as far as I can tell, it could only run paravirtualized guest kernels and there was no security boundary between the guest kernels and the host.)
| How does XEN work without VHE on ARM? |
1,445,774,632,000 |
So I've compiled my kernel and initrd. How can I then create an image and install grub to actually load this image from a disk? My goal isn't to create a livecd out of it that is bootable from USB, as there are plenty of articles on that. My goal is to create an image (I know dd if=/dev/zero of=linux.img ... is what I need to create an overall image) and simply write that image to the first sector of the disk using dd and have it just boot from there. However, where does my kernel and initrd go in that img? Right behind each other? This disk isn't going to have any partitions. It's a custom kernel and minimal busybox setup that is stripped down. I therefore do not need a /boot partition and all the "files" aren't going to live on another partition because there isn't going to be one or much of any files.
I know the MBR is 512 bytes and I assume grub is also just going to overwrite 512 bytes to the first sector. But how do I even get grub installed on the image? Would grub-install linux.img even work? I know that grub knows where to load the kernel and initrd from a normal setup because those live in /boot but this "image" doesn't have partitions on it to look in /boot . Do I just set root to itself?
Any help would be appreciated
Initrd creation procedure: https://pastebin.com/ti9LXakx
Current init script within initrd:
#!/bin/sh
mount -t sysfs sysfs /sys
mount -t proc proc /proc
mount -t devtmpfs udev /dev
exec /bin/sh
|
512 bytes is far too little for GRUB: on a classic BIOS-booting MBR-partitioned disk, GRUB also places parts of itself in the normally-unused blocks #1..#2047, as modern OSs place the start of the first partition exactly 1 MiB from the beginning of the disk, at block #2048. Typically it might use about 100 of those blocks, depending on which features are selected to be built into the GRUB core image and which are left to be loaded as GRUB modules (from some filesystem).
And you don't even get all of the 512 bytes in the MBR block (block #0): at minimum, two bytes at the end of the MBR block are occupied by the signature that tells the BIOS that this disk is bootable.
GRUB has a built-in expectation that the disk/partition/logical volume/encrypted volume it finds its configuration file, kernel and initrd on contains a filesystem of some sort. If you want to read the kernel and initramfs by just reading consecutive blocks off the disk, that sounds more like what the ancient LILO bootloader did... I wonder if it's still usable with the modern kernels?
In short, leaving out the partition table is not the advantage you think it is. With a custom configuration, you could make GRUB read blocks #A .. #B as the kernel, and #(B+1).. #C as the initramfs file, but that would be just making your own life more difficult for no good reason.
And since you mentioned a Live CD, if you want your image to also work when burned to a CD-ROM/DVD or used as a virtual CD in a virtual machine, you must create a hybrid image that works both as a HDD image with a bootloader in MBR, and as a valid ISO9660 CD/DVD image with El Torito boot extensions - which requires a separate bootloader in a different location on the image.
And if you want UEFI compatibility... "You must unlearn what you have learned."
With UEFI, the system firmware will expect to find a FAT filesystem (preferably FAT32, but other forms of FAT will also be acceptable for newer versions of UEFI), and the bootloader as a file with a particular name in that filesystem. Since the filesystem is already there to satisfy the firmware requirements for UEFI bootability, you might as well use it to have the kernel, initramfs and the configuration of your bootloader in there as regular files.
To create your image, you could use losetup to bind it to a /dev/loop<device_number> device, after which you can use the device just like a real disk. If the image contains a partition table, you can use losetup -P to automatically create partition devices of the form /dev/loop<device_number>p<partition_number> to allow easy access to any partitions within the image file.
| Create custom bootable linux image; not a livecd |
1,445,774,632,000 |
I am currently working on an embedded board with a WM8776 which uses the MCASP1 of the AM335x. This works as expected and has expected behaviour.
What I now want to do is make a driver which can switch frequencies. I have two clocks which go in into the MCASP via a clock mux via a GPIO. If this GPIO is high I have an 24,576 clock, for 32/48/64/96/196, and so on audio and a 11,960 clock for 44.1/88.2/174 and so on audio.
My goal is now to be able to change this clock in kernel space. What I did so far was put some code to print out the current sample rate. Which went OK. I saw the sample rate which was currently transponded.
However, when I disabled the resampling of ALSA in .asoundrc I got the following error when trying to play a 96khz song one the 44.1khz (11,960mhz) clock.
alsa_open:303 unable to get period size: Invalid argument
This of course is logical since there is not Integer which can achieve this perfect bitrate without resampling on this clock. The problem with this is the earlier mentioned print comment I put in the kernel did not anymore put any information about the current bitrate. So it did not reach this function, as I think ALSA already did catch this.
So, I tried to trace where this error was coming from so I could program the kernel to say: we are playing this bitrate, so we want to change to this clock when we are using this specific soundcard, whenever changing a song. But I could not find this error anywhere when spitting through the kernel sound code.
In short the use case is as followed:
Start-up frequency is 11.960Mhz. -> we now are playing a 44.1 Khz song. -> Changing to 96Khz song -> Put GPIO high (clock now at 24,512Mhz) -> Inform ALSA and MCASP clock has changed.
I know how to change MCASP from kernel space.
So my question now is:
What is the first function called whenever a new playback is started(e.g. a song is changed)?
Where can I find the origin of this error?
And is there a better approach to do what I want to.
|
Ok two things: between the application playing back a stream of PCM samples and the kernel side of ALSA, there's the userland alsalib with its optional internal resampling. If the application did not disable that but requested a device as is, the kernel had no way of knowing what the original sapling rate was. It's simply not visible to the kernel in any way. This is doubly true if the application doesn't use ALSA as pure hardware interface, but uses a userland soundserver like Pulseaudio, pipe wire, esound or JACK, which might also offer userland-implemented ALSA devices, and do the mixing/resampling internally. This is the norm for modern Linux desktops.
If the application wants the hardware to sample at a specific rate, it will call snd_pcm_hw_patams from alsalib, which will do the necessary syscalls to tell your kernel driver what rate was requested. Write a minimal program that does nothing but that and strace that to see which these were!
Generally, since it's pretty common that multiple streams of potentially different rates are to be played back at the same time, it feels natural that most applications would not try to fiddle with the hardware parameters themselves - they request a correctly set up device, and that will usually include resampling-in-userland being opted in.
| Change clock bitrate (ALSA, PCM) at runtime AM335x |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.