date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,670,605,065,000 |
Background : in ima-evm-utils I found lgetxattr() can't return expected value.I wrote a simple c program to verify it.
#include <sys/types.h>
#include <sys/xattr.h>
#include <stdio.h>
int main(){
char xattr_value[1024];
int size;
size=lgetxattr("/bin/tcpm", "security.capability", xattr_value, sizeof(xattr_value));
printf("caps: %s\n", &xattr_value);
printf("%d\n",size);
size=lgetxattr("/bin/tcpm", "security.selinux", xattr_value, sizeof(xattr_value));
printf("selinux: %s\n", &xattr_value);
printf("%d\n",size);
return 0;
}
[root@localhost ~]# ./a.out
caps:
20
selinux: system_u:object_r:bin_t:s0
27
[root@localhost ~]# getcap /bin/tcpm
/bin/tcpm cap_net_bind_service,cap_net_admin=ep
[root@localhost ~]# getfattr -m - -d /bin/tcpm
getfattr: Removing leading '/' from absolute path names
# file: bin/tcpm
security.capability=0sAQAAAgAUAAAAAAAAAAAAAAAAAAA=
security.selinux="system_u:object_r:bin_t:s0"
size is not -1 means lgetxattr() suceess,but xattr_value is not expected value
try to gdb ima-evm-utils: #err = return of lgetxattr()
(gdb) p err
$6 = 20
(gdb) p xattr_value
$7 = "\000\000\000\002\000 ", '\000' <repeats 14 times>, "P\261\037&@&^\a\022\274fOT\031", '\000' <repeats 294 times>...
(gdb) p err
$8 = 27
(gdb) p xattr_value
$9 = "system_u:object_r:bin_t:s0", '\000' <repeats 302 times>...
source code of this probelm:
for (xattrname = evm_config_xattrnames; *xattrname != NULL; xattrname++) {
err = lgetxattr(file, *xattrname, xattr_value, sizeof(xattr_value));
if (err < 0) {
log_info("no xattr: %s\n", *xattrname);
continue;
}
if (!find_xattr(list, list_size, *xattrname)) {
log_info("skipping xattr: %s\n", *xattrname);
continue;
}
log_info("name: %s, size: %d\n", *xattrname, err);
log_debug_dump(xattr_value, err);
err = !HMAC_Update(pctx, xattr_value, err);
if (err) {
log_err("HMAC_Update() failed\n");
goto out_ctx_cleanup;
}
}
|
getxattr or lgetxattr get the binary capability value in fact.
[root@localhost ~]# strace -e getxattr getfattr -d -m - /bin/tcpm
getxattr("/bin/tcpm", "security.capability", NULL, 0) = 20
getxattr("/bin/tcpm", "security.capability", "\0\0\0\2\0 \0\0\0\0\0\0\0\0\0\0\0\0\0", 256) = 20
| lgetxattr can't get security.capability |
1,670,605,065,000 |
When I run sudo apt-get upgrade or sudo apt-get autoremove, it returns:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
linux-image-amd64 : Depends: linux-image-5.10.0-16-amd64 (= 5.10.127-2) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Then, when I run sudo apt --fix-broken install, it returns:
[...]
Preparing to unpack .../linux-image-5.10.0-16-amd64_5.10.127-2_amd64.deb ...
Unpacking linux-image-5.10.0-16-amd64 (5.10.127-2) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-5.10.0-16-amd64_5.10.127-2_amd64.deb (--unpack):
cannot copy extracted data for './boot/vmlinuz-5.10.0-16-amd64' to '/boot/vmlinuz-5.10.0-16-amd64.dpkg-new': failed to write (No space left on device)
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-5.10.0-16-amd64_5.10.127-2_amd64.deb
I had nearly the same error on a second Debian11/KDE computer with the same error message.
There I could solve it using these two commands from here to free disk space on the boot partition. However, the command to remove unneeded kernel images doesn't work on this computer: when I run
dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]'
it shows a number of kernel image filenames but when I run the full command
dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]' | xargs sudo apt -y purge
it doesn't remove them. The same filenames still show when I run the former command and no disk space is freed so my problem remains. The output of the above is:
The following packages have unmet dependencies:
linux-headers-amd64 : Depends: linux-headers-5.10.0-14-amd64 (= 5.10.113-1) but it is not going to be installed
linux-image-amd64 : Depends: linux-image-5.10.0-16-amd64 (= 5.10.127-2) but it is not going to be installed E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
First of all, all of this shouldn't be needed as upgrades should run smoothly and be so easy to do that basically most grandmas could do it. If there are issues with available disk space, it should prompt the user (in the console as well as in GUIs like Apper if that's used for upgrading) to do things like clearing old kernel images (maybe using the command above) or running sudo rm -rf /var/cache/apt/archives/* or clearing /tmp or running sudo apt-get autoremove/autoclean or other things depending how much disk space is needed and where. It should calculate how much disk space is needed and check if sufficient is available. Alternatively, if insufficient space is available, it could run the upgrades one at a time and clean up after each, or notify the user about it and abort the upgrade until enough disk space is available to prevent any issues. This is probably a separate question/issue. It's very inconvenient, outdated, insecure and user-unfriendly.
How to remove those old kernel images to free up the required disk space? If that wouldn't be the recommended route to solving this problem (again, it worked on another computer where I also had this problem), then please (also?) add how you'd solve it instead.
|
I can’t help you with your first bullet point. To resolve your second one, you’ll have to temporarily remove linux-headers-amd64 and linux-image-amd64:
sudo apt remove linux-{headers,image}-amd64
Then explicitly remove any installed kernel package other than the package corresponding to the running kernel:
dpkg -l linux-{image,headers}-"[0-9]*" | awk "NR>5 && \!/^un/ && \!/$(uname -r | cut -d- -f-2)/ { print \$2 }" | xargs sudo apt -y purge
Finally, install the latest kernel:
sudo apt install linux-{headers,image}-amd64
If you install unattended-upgrades, it will take care of removing automatically-installed kernels for you when they are no longer needed.
| Can't remove old kernel images to free disk space to solve "linux-image-... but it is not installed" / "failed to write (No space left on device)" |
1,670,605,065,000 |
I've added isolcpus to the Grub file:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash isolcpus=2,3"
Restarted machine (Ubuntu 22.04)
However, when I run:
cat /proc/cmdline
it doesn't show my isolcpus change:
BOOT_IMAGE=/boot/vmlinuz-5.15.0-43-generic root=UUID=d0731368-37f5-4a83-84d9-a899d39f5a59 ro quiet splash vt.handoff=7
I can also see interrupts on those 2 cores.
Am I missing something to get this to work?
|
Merely editing the grub configuration does not suffice; a command must be run to rebuild the grub menu. On ubuntu, this command is update-grub so after editing the configuration file one must run
sudo update-grub
and only then reboot.
| Added isolcpus to Grub, restarted but cat /proc/cmdline doesn't show it added |
1,670,605,065,000 |
Im trying make my plymouth-git work
Im on Arch Linux
When i restart or shutdown, the plymouth init and appears the theme i choosed
But when the PC boot, it doesn't appear the theme, it only appears a grey screen and white 3 dots
/etc/mkinitcpio.conf
# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run. Advanced users may wish to specify all system modules
# in this array. For instance:
# MODULES=(piix ide_disk reiserfs)
MODULES=()
# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image. This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()
# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way. This is useful for config files.
FILES=()
# HOOKS
# This is the most important setting in this file. The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added. Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
## This setup specifies all modules in the MODULES setting above.
## No raid, lvm2, or encrypted root is needed.
# HOOKS=(base)
#
## This setup will autodetect all modules for your system and should
## work as a sane default
# HOOKS=(base udev autodetect block filesystems)
#
## This setup will generate a 'full' image which supports most systems.
## No autodetection is done.
# HOOKS=(base udev block filesystems)
#
## This setup assembles a pata mdadm array with an encrypted root FS.
## Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
# HOOKS=(base udev block mdadm encrypt filesystems)
#
## This setup loads an lvm2 volume group on a usb device.
# HOOKS=(base udev block lvm2 filesystems)
#
## NOTE: If you have /usr on a separate partition, you MUST include the
# usr, fsck and shutdown hooks.
HOOKS=(base udev plymouth autodetect modconf block filesystems keyboard fsck)
# COMPRESSION
# Use this to compress the initramfs image. By default, zstd compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="zstd"
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"
# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()
/etc/default/grub
# GRUB boot loader configuration
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet splash vt.global_cursor_default=0"
GRUB_CMDLINE_LINUX=""
# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"
# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y
# Set to 'countdown' or 'hidden' to change timeout behavior,
# press ESC key to display menu.
GRUB_TIMEOUT_STYLE=menu
# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console
# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto
# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep
# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true
# Uncomment and set to the desired menu colors. Used by normal and wallpaper
# modes only. Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"
# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"
# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"
# Uncomment to make GRUB remember the last selection. This requires
# setting 'GRUB_DEFAULT=saved' above.
#GRUB_SAVEDEFAULT=true
# Uncomment to disable submenus in boot menu
#GRUB_DISABLE_SUBMENU=y
# Probing for other operating systems is disabled for security reasons. Read
# documentation on GRUB_DISABLE_OS_PROBER, if still want to enable this
# functionality install os-prober and uncomment to detect and include other
# operating systems.
GRUB_DISABLE_OS_PROBER=false
/etc/plymouth/plymouthd.conf
# Set your plymouth configuration here.
[Daemon]
Theme=spinfinity
ShowDelay=0
DeviceTimeout=8
lspci
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Processor Root Complex
00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) I/O Memory Management Unit
00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Host Bridge
00:02.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Processor Root Port
00:03.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Host Bridge
00:03.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Processor Root Port
00:08.0 Encryption controller: Advanced Micro Devices, Inc. [AMD] Carrizo Platform Security Processor
00:09.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Carrizo Audio Dummy Host Bridge
00:09.2 Audio device: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Audio Controller
00:10.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB XHCI Controller (rev 20)
00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 49)
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 49)
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 4a)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 11)
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Processor Function 0
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Processor Function 1
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Processor Function 2
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Processor Function 3
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Processor Function 4
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Processor Function 5
05:00.0 USB controller: Advanced Micro Devices, Inc. [AMD] Device 43bc (rev 02)
05:00.1 SATA controller: Advanced Micro Devices, Inc. [AMD] Device 43b8 (rev 02)
05:00.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 43b3 (rev 02)
06:04.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port (rev 02)
06:05.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port (rev 02)
06:06.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port (rev 02)
06:07.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port (rev 02)
1e:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
22:00.0 VGA compatible controller: NVIDIA Corporation GK208B [GeForce GT 710] (rev a1)
22:00.1 Audio device: NVIDIA Corporation GK208 HDMI/DP Audio Controller (rev a1)
Can somewhone help :(?
|
I fixed by adding my kernel modules of my video card; for me, that is nouveau to the MODULES=() in mkinitcpio.conf and running sudo mkinitcpio -p linux
| plymouth-git when boot appears a grey screen and white 3 dots and then lightdm |
1,670,605,065,000 |
So I just build LFS system and it's working fine, but the annoying part is there's alert that every periode show like every 3 second.
It said
root@LFS:# clocksource: timekeeping watchdog on CPU0: acpi_pm wd-wd readback delay of 643744ns
clocksource: wd-tsc-wd read-back delay of 182144ns, clock-skew test skipped!
clocksource: timekeeping watchdog on CPU0: acpi_pm wd-wd readback delay of 643744ns
clocksource: wd-tsc-wd read-back delay of 182144ns, clock-skew test skipped!
clocksource: timekeeping watchdog on CPU0: acpi_pm wd-wd readback delay of 643744ns
clocksource: wd-tsc-wd read-back delay of 182144ns, clock-skew test skipped!
...
This is annoying my bash prompt, I even can't see my output from bash prompt
|
These are logs from the kernel which default to being displayed on the console (/dev/console) which most probably matches the tty terminal you used for login in.
This is of course usually suboptimal and most systems resort to some specific daemon in order to sort and archive logs :
I personally use metalog, syslog-ng is well known, apparently LFS gets a dedicated packet sysklogd
I suggest you first ensure it is not running already (ps -ef | grep klogd), in which case you would have to correct its configuratrion file, and if not then install it, configure it (edit /etc/syslog.conf) and ensure it is launched at init time the sysVinit way.
| annoying clocksource alert/warning in bash prompt periodically |
1,670,605,065,000 |
I am configuring a kernel (4.19.235) and need the option NO_HZ_FULL to be active.
Currently, I only see the option HZ_PERIODIC and NO_HZ_IDLE in menuconfig. I checked the line "Depends on:" of NO_HZ_FULL to see the options requiered, here is the list of it :
Depends on: <choice> && !ARCH_USES_GETTIMEOFFSET [=n] && GENERIC_CLOCKEVENTS [=y] && SMP [=y] && HAVE_CONTEXT_TRACKING [=n] && HAVE_VIRT_CPU_ACCOUNTING_GEN [=n]
The current status of theses options is :
Symbol: ARCH_USES_GETTIMEOFFSET [=n]
│ Type : bool
│ Defined at kernel/time/Kconfig:25
Symbol: GENERIC_CLOCKEVENTS [=y]
│ Type : bool
│ Defined at kernel/time/Kconfig:29
│ Selected by [y]:
│ - X86 [=y]
Symbol: SMP [=y]
│ Type : bool
│ Prompt: Symmetric multi-processing support
│ Location:
│ (1) -> Processor type and features
│ Defined at arch/x86/Kconfig:376
Symbol: HAVE_CONTEXT_TRACKING [=n]
│ Type : bool
│ Defined at arch/Kconfig:495
│ Selected by [n]:
│ - X86 [=y] && X86_64 [=n]
Symbol: HAVE_VIRT_CPU_ACCOUNTING_GEN [=n]
│ Type : bool
│ Defined at arch/Kconfig:512
Do you know why the option don't appear? Should I edit the .config by hand to add the line by myself?
|
The required options are not met. HAVE_CONTEXT_TRACKING and HAVE_VIRT_CPU_ACCOUNTING_GEN are both set to n (no) even though they are required.
| Kernel option hidden even if the depending options are met |
1,670,605,065,000 |
I have a liveCD ubuntu Linux iso image. I need to update the kernel of this image. I've tried to get the iso on a host Ubuntu system and move the compiled kernel and the modules from there to the liveCD but after doing that, the system stuck at:
loading kernel /casper/vmlinuz.. done
loading file /casper/inited.img.. done
I think that the initrd can't find the root filesystem which is at "/casper/filesyste.squashfs".
Does anyone know a valid way to do this task? my next attempt would be to mount the root filesystem of liveCD on the host system and compile the new kernel from there.
|
Issue resolved by:
Installing the new kernel in the chroot environment of the liveCD root file system itself and then moved the new kernel (vmlinuz) and the initramfs image (initrd) to the /casper directory in the USB top filesystem.
| How to update the kernel for a live CD Linux image |
1,670,605,065,000 |
Today I was messing around with my computer and wondered what would happen if I killed init. I tried kill 1, nothing happened. I tried kill -9 1, nothing happened. I tried many very fatal signals, and all of them were ignored. I was finally able to attach to it with gdb and kill it that way. Now that I have killed PID 1, init, I want to kill PID 0, the kernel scheduler. How would I go about doing this? gdb can't find the process so that method is out and I am stumped.
Also, yes, I know there is absolutely no practical purpose of doing this but this is just a PC, I trust the journaling capabilities of ext4 and I have backups, so I just want to mess around with it (and maybe learn a bit about the Linux kernel in the process.)
This is on Ubuntu 20.04.
|
The kernel scheduler isn’t a separate process, you can’t stop it like that. See What's the process scheduler in Linux? for details.
To stop the kernel, you need to make the system panic; Does sysrq work when the kernel panic occurs? describes one way of doing that.
| How to kill the kernel scheduler |
1,670,605,065,000 |
According to How create a second midi device? n´one can create multiple virmidi devices, but that does not seem to work for me - according to aconnect -l I get exactly one:
client 14: 'Midi Through' [type=Kernel]
0 'Midi Through Port-0'
This is the config (and the options) I've tried.
> cat /etc/modules-load.d/90-virmidi.conf
snd-virmidi
# check params:
> /usr/sbin/modinfo snd-virmidi
# configure the module
# attempt #1
> cat /etc/modprobe.d/90-virmidi.conf
options snd-virmidi enable=1,1 midi_devs=1,1
# attempt #2
> cat /etc/modprobe.d/90-virmidi.conf
options snd-virmidi index=0 enable=1 midi_devs=1
options snd-virmidi index=1 enable=1 midi_devs=1
# attempt #3
> cat /etc/modprobe.d/90-virmidi.conf
options snd-virmidi index=0,1 enable=1,1 midi_devs=2,2
# reboot
# check params:
> cat /sys/module/snd_virmidi/parameters/*
Y,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N
(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null)
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
A few things that I find confusing:
lsmod shows the module as "snd_virmidi", but the file is snd-virmidi.ko - I am not sure which speling needs to be used in the config
I have fou d not way to check from logs if the /etc/modprobe.d/90-virmidi.conf is used or not.
Any ideas what I am missing?
|
Have you tried this exactly as in the Q&A you linked?
The first step is to run modprobe directly, to verify the driver works. If I do that on my machine, I get
$ sudo modprobe snd-virmidi enable=1,1,1,1,1 midi_devs=1,1,1,1,1
$ ll /dev/midi*
crw-rw---- 1 root audio 14, 18 Dez 29 19:52 /dev/midi1
crw-rw---- 1 root audio 14, 34 Dez 29 19:52 /dev/midi2
crw-rw---- 1 root audio 14, 50 Dez 29 19:52 /dev/midi3
crw-rw---- 1 root audio 14, 66 Dez 29 19:52 /dev/midi4
crw-rw---- 1 root audio 14, 82 Dez 29 19:52 /dev/midi5
So that works. If it also works on your machine, the next step is to create your config file
> cat /etc/modprobe.d/90-virmidi.conf
options snd-virmidi enable=1,1 midi_devs=1,1
and then run modprobe snd-virmidi. Because options only sets the default options, it doesn't insert the kernel module.
If you want the module to get inserted on boot, then there are various ways for that, so you'd need to decide which way works best for you. That depends on your use case (what do you need the virtual MIDI interfaces for?), which you have not explained.
| how to create multiple snd-vimidi devices |
1,670,605,065,000 |
in order to solve the issue at https://gitlab.freedesktop.org/drm/amd/-/issues/1598 I should know your opinion about installing linux firmware drivers at https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/ manually, so going over the ones provided by the official Ubuntu 18.04 repository.
Do you think it is safe?
Thank you
|
Any firmware that is stored in /lib/firmware will need to be re-loaded after a power-cycle, so you could always access the system disk using a live media (or any other method), and restore the standard version of the firmware file if the version you manually updated turns out not to work.
If you don't trust the security of the git.kernel.org repository server, remember that it's also where the Linux kernel development happens.
The firmware files in the linux-firmware repository are usually provided by the respective hardware vendors; they have just been collected to the repository for easy availability. In the case of the specific firmware version you mentioned in the Freedesktop Gitlab, note that the files were authored and signed-off for placement in the repository by alexander.deucher @amd.com so it's obvious they are coming straight from AMD.
Since we're talking about firmware for a modern CPU-integrated GPU, I would expect that the GPU will at least use some sort of checksum and identifier mechanism to validate any loaded firmware before actually using it. There might even be a cryptographic signature, although it's often difficult to know for sure since the firmware files are often to be treated as black boxes.
So yes, I would say that using the newest firmware provided by AMD is at least as safe as using the new 5.15.x kernel instead of the official Ubuntu 18.04 kernel (which is apparently version 5.3.x if Ubuntu Wiki is to be trusted).
| Install Linux Firmware update by hand |
1,670,605,065,000 |
After running the following command
make ARCH=i386 CROSS_COMPILE=i386-linux- menuconfig
I get the error specified above.
What is the implication and what are the possible solves?
What am I trying to do?
I'm trying to access Kernel's configuration menu and make some configurations.
|
If you only want to access configuration options for a specific architecture, you don’t need to specify a cross-compiler:
make ARCH=i386 menuconfig
If you want to build anything, you’ll need a valid cross-compiler, with the appropriate prefix. For example on Debian, you’d install the gcc-i686-linux-gnu package, and specify ARCH=i386 CROSS_COMPILE=i686-linux-gnu-.
| scripts/Kconfig.include:39: compiler 'i386-linux-gcc' not found |
1,670,605,065,000 |
I havent gotten any kernel updates in over a month on Debian unstable, which seems like a long time for the unstable distribution. My output of uname -a shows:
5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64 GNU/Linux
As you can see, the compilation time is August 3. Is this normal? I'm used to constantly getting kernel updates in unstable. This also coincides with the release of Debian 11, maybe that has something to do with it.
My /etc/apt/sources.list looks fine to me:
deb http://debian.csail.mit.edu/debian/ unstable main contrib non-free
deb-src http://debian.csail.mit.edu/debian/ unstable main contrib non-free
|
Yes, this is normal; you have the latest kernel available in unstable.
Newer kernels have been uploaded to experimental.
I imagine that kernels will start going to unstable soon, now that Debian 11 has been released; but I don’t know the timeline. As you surmise, kernel updates in unstable were only those intended for Debian 11, right up to the release; all others went to experimental. It’s possible that the kernel team are continuing this distinction for a little while after the release, to make any patches for Debian 11 simpler to review.
| No kernel updates in over a month debian unstable |
1,670,605,065,000 |
I trace the code and got:
native_machine_shutdown()
https://elixir.bootlin.com/linux/latest/source/arch/x86/kernel/reboot.c#L682
but I didn't see any code to shut down the power supply or trigger which CPU register to power down?
I got there from:
void kernel_power_off(void)
{
kernel_shutdown_prepare(SYSTEM_POWER_OFF);
if (pm_power_off_prepare)
pm_power_off_prepare();
migrate_to_reboot_cpu();
syscore_shutdown();
pr_emerg("Power down\n");
kmsg_dump(KMSG_DUMP_SHUTDOWN);
machine_power_off();
}
https://elixir.bootlin.com/linux/latest/source/kernel/reboot.c#L287
|
It's in reboot.c, and nicely commented.
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);
}
So, pm_power_off: That now is really platform-specific; it's different whether you're on a gaming console or a rack server.
You're probably looking for the EFI driver that does this:
efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL);
in drivers/firmware/efi/reboot.c
| Which function is the last function when powering off? |
1,670,605,065,000 | ERROR: type should be string, got "\nhttps://wiki.gentoo.org/wiki/Ryzen#GCC\nsays, neither GCC 6.x nor GCC 7 is Ryzen optimized.\nBut, when doing man gcc-7 I clearly see march=znver1 is available in GCC-7. Or is this just a dummy option doing nothing? I´d like to use march=znver1 to get my kernel a bit more optimized for my Ryzen 2500U.\nIn my distro there is actually GCC-9 and GCC-10 available, I could upgrade from 7 to 9 or 10.\n" |
znver1 was added to GCC in 2015, and included in GCC 6.1. It has always provided some level of tuning for Zen CPUs (see the cost tables in that first commit), but the Phoronix benchmarks quoted by the Gentoo wiki suggest that that wasn’t particularly effective at the time.
In general, when it comes to compiler support and optimisation for “newer” architectures, newer releases of the compiler are better — optimisation improvements are rarely back-ported, and they take time to be developed in the compilers. This includes the many patches which have helped improved the performance of code generated for Zen CPUs (look for patches by Jan Hubicka in particular). As always when it comes to performance, you should benchmark the scenarios you care about.
| GCC and AMD Ryzen |
1,670,605,065,000 |
In Linux kernel to loop over all threads alive you use do_each_thread() and while_each_thread() macros which both defined as :
#define do_each_thread(g, t) \
for (g = t = &init_task ; (g = t = next_task(g)) != &init_task ; ) do
#define while_each_thread(g, t) \
while ((t = next_thread(t)) != g)
which i am very curious how this works since the outer for loop will loop over all main threads but in the inner loop we loop over all threads using next_thread() and we repeat whole process for every main thread in the system since the inner loop will only end if both t and g are same thread. I know i must be missing something but i cant see it right now. so why we loop over all threads again and again. So, this means it will loop_number = tasks_number * thread_number; visiting same thread multiple times.
|
The outer loop loops over processes (thread group leaders), the inner loop loops over the current (in the loop) process’s threads. Each time the inner loop starts, g is the current process’s main thread; next_thread is used to iterate over all that thread group’s threads, until it loops back to the main thread.
Every thread is visited once, and once only.
| How do_each_thread() kernel macro works? |
1,670,605,065,000 |
On my Linux machine, I have:
❯ ulimit -Sn # Check soft limit
ulimit -Hn # Check hard limit
1024
1048576
Does this mean that I can increase my max open files to 1048576, regardless of /etc/security/limits.conf, /etc/pam.d/common-session*, etc?
|
/etc/security/limits.conf is the configuration file of pam_limits.so, which sets the same limits the shell's ulimit command does. If the hard limit is set to 1048576, then you can raise the soft limit to that. But if limits.conf specifies a lower hard limit (when you log in via PAM), that's the one that should end up as the limit on your shell session.
| Is the value returned by `ulimit -Hn` an optimistic limit or a tight, achievable limit? |
1,670,605,065,000 |
Correct me if I'm wrong:
As far as I searched around the web, the main difference between a micro-controller (like Arduino) and a SBC (like Raspberry Pi) is that the micro-controller is atomic which means it runs your code line by line and does nothing else, no delay. But a SBC (RPi for example) runs an OS, and the OS is not atomic, which means it will schedule your code for running, because the OS has to do other works too, your code may run with a delay, depending on how busy the OS is.
Therefore, for some projects like a flight controller for example, we should use a micro-controller so the drone would react to our commands and sensors' data immediately without any delay.
There are some boards like the BeagleBone that have a CPU capable of running an OS, and one or more micro-controllers capable of doing something atomic. which means you get both worlds with one board.
Now here's my question:
On a multi-core CPU that is running a Linux OS, can we tell the Linux kernel to reserve one core for only one process? Say I have a Python program that controls a drone on a Raspberry Pi, can I tell Linux to use three of four cores for itself and use one core just for my flight controller program? Am I making any sense?
I am aware of Linux job priority and some real-time Linux kernels, but I haven't looked into those options in detail. I would appreciate any guidance regarding this topic, thanks.
|
Turned out that what I had in my mind is kind of possible (but it's complex).
We have two ways to tell Linux to exclude one or more CPUs from its normal process scheduling.
The isolcpus boot option (documentation)
The Linux specific cpusets (documentation)
After that, a program can tell Linux that it wants to be run on that CPU with the following system call:
#define _GNU_SOURCE
#include <sched.h>
int sched_setaffinity(pid_t pid, size_t len, cpu_set_t *set);
This way that specific CPU (or CPUs) will be just for that process (or processes).
| Can Linux use a CPU core as a micro-controller? |
1,670,605,065,000 |
Here is my /boot/cmdline.txt for context.
$ cat /boot/cmdline.txt
console=serial0,115200 console=tty1 root=PARTUUID=5838cc20-02 rootfstype=ext4 elevator=deadline rootwait fbcon=map:10 fbcon=font:VGA8x8 fastboot fsck.mode=skip noswap ro systemd.volatile=state
Thanks!
|
It makes the system boot with the root filesystem as read-only and the /var mounted as a writable tmpfs RAM-disk. Basically a system should behave like a live Linux media without persistence.
Later parts of the start-up process might include remounting the root filesystem in read-write mode, or they might not.
Is this a RasPi or something similar? In that case, it might be to minimize the wear of the SD card by making the /var filesystem non-persistent, at the expense of reverting the state of /var back to what the read-only system image has, on every reboot.
| What does systemd.volatile=state do when used along side of ro? |
1,670,605,065,000 |
At my office I have a linux machine (ubuntu 16.04) and a tablet wacom (one) that I can't use with this machine.
On more recent distros this tablet work out of the box.
I can't upgrade my system, but I can install a recent distros on a virtualbox on my system, that is a distribution that handles this tablet out of the box.
My question is, would this allow the virtual machine to use the tablet ? or does the fact that the host kernel can't handle the tablet will impeach the guest to do so ?
Cheers,
PS: I can't just install the wacom driver.
|
Using VirtualBox, you can to pass through USB devices to guests. You can give your guest access to your tablet, and the guest kernel will have full access to it regardless of the host kernel’s level of support.
| Can virtualbox be used to profit from a more recent kernel ? [ Or: does a recent kernel on the guest, could handle hardware the host can't ? ] |
1,670,605,065,000 |
I'm on Fedora 33 and I would like initramfs to be readable by any user after each kernel upgrade. How can I change its default permissions?
|
cat /etc/kernel/postinst.d/noreadirfs.sh
#! /bin/bash
chmod 640 /boot/initramfs*
| Fedora and default permissions for initramfs |
1,670,605,065,000 |
I'm a beginner in LKM programming.
I was writing a simple argument passable module which gains command line arguments and then logs them in alert level.
The problem is that I don't know why it doesn't call the second printk in hello_start function, maybe an error had occurred there but the amazing thing is that it works in unloading(rmmod) process.
Here is logs and codes:
// insmod thetestmodule.ko yes_no=1
Dec 26 20:25:31 duckduck kernel: [ 995.877225] Hi darcy. I'm now alive!
// Expect the argument here.
// rmmod thetestmodule
Dec 26 20:26:11 duckduck kernel: [ 995.877230] This is the passed argument: 1
Dec 26 20:26:11 duckduck kernel: [ 1035.956640] Understood. Bye.
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/moduleparam.h>
#define AUTHOR "Darcy"
MODULE_LICENSE("GPL");
MODULE_AUTHOR(AUTHOR);
MODULE_DESCRIPTION("OH. Kernel log, ALERT LEVEL O_o");
MODULE_VERSION("0.1");
static int short yes_no;
module_param(yes_no , short ,0);
MODULE_PARM_DESC(yes_no, "Enter 0 or 1 to say if you want the module be loaded in rescue mode.");
static int __init hello_start(void)
{
printk(KERN_ALERT "Hi darcy. I\'m now alive!\n");
printk(KERN_ALERT "This is the passed argument: %d" , yes_no);
return 0;
}
static void __exit hello_end(void)
{
printk(KERN_INFO "Understood. Bye.\n");
return NULL;
}
module_init(hello_start);
module_exit(hello_end);
Thanks for your cooperation!
|
Your second printk() does not have a \n at the end, while the first one has.
Also, the bracketed number after the word kernel: is the system uptime in seconds, so it looks like the second message was in fact generated well within the same second of time as the first one.
My first assumption is that the missing \n line terminator caused the process that was reading the kernel message buffer to wait in case more text was about to arrive, and the rest of the message was only processed by user-space logging daemon after the \n of the third message signaled that a complete line was received.
In the kernel message buffer (see the dmesg command) the bracketed uptime is typically the first element of the message: the human-readable timestamp, hostname and the word kernel: are added by whatever logging system was used to read the kernel message buffer and inject the kernel messages into the user-space logging stream(s).
So, try adding \n to the end of your second message, like this:
printk(KERN_ALERT "This is the passed argument: %d\n" , yes_no);
| Loadable Kernel Module logging problem in insmoding process |
1,670,605,065,000 |
How to spawn each child in a separate PID namespace using unshare (without CLONE_NEWPID flag in child process clone syscall). I am able to successfully spawn first child in PID namespace but I am not sure how to spawn the second child in another PID namespace.
Psuedo code of the parent process
1 unshare CLONE_NEWPID
2 spawn child1
3
4 unshare CLONE_NEWPID
5 spawn child2
Here child1 entered into the separate PID namespace and got the PID as 1. When the execution reached line 4 it threw Sys(EINVAL) error.
|
From reading the manual unshare CLONE_NEWPID acts on the calling process, not the child. Calling this multiple times seems redundant. After the 1st call all children are in a new pid namespace.
To put them in there own, you need a different parent to call unshare CLONE_NEWPID.
Try
repeat:
fork
if child:
unshare CLONE_NEWPID
spawn
This is all untested, and just what I would try next.
I am also reading that you need to use clone.
| How to spawn each child process in separate pid namespace |
1,670,605,065,000 |
Why pseudo-terminal infers keystrokes from /dev/pts/{number}
(and) X-session infers keystrokes from /dev/input/by-id/{keyboard-device-name}?
I understand pseudo-terminal are running on-top of X-session.
Why is pseudo-terminal so special that it has a separate file location to read/write the data which will be subsequently displayed in the UI terminal view?
How did Kernel knew the difference between a pseudo-terminal and other applications such that it wrote to 2 different file locations?
|
Why is pseudo-terminal so special that it has a separate file location to read/write the data which will be subsequently displayed in the UI terminal view?
Because there are two fundamentally different views of the user input in play on your desktop.
The display server (X11 or your Wayland compositor) handles all the input from hardware, through /dev/input/... (when using libinput at least). X11 and Wayland clients receive the corresponding events through the respective protocols.
Programs which aren’t X11 and Wayland clients, but need to receive input, are run using some form of emulation. A terminal emulator is one such emulation: as its name suggests, it emulates a terminal, and is helped in this by pseudoterminals which involve /dev/pts/... devices.
Thus when you run a program in a terminal emulator, your keystrokes follow this path:
keyboard → kernel → display server → terminal emulator (as a higher-level event) → pseudoterminal → program
This provides the final program with the illusion that it’s running with its input (and output) connected to a terminal.
How did Kernel knew the difference between a pseudo-terminal and other applications such that it wrote to 2 different file locations?
It doesn’t know about applications and where they receive their input. It knows about the keyboard and feeds events from that through input devices; and separately, it knows about pseudoterminals, and allows controlling programs to transmit events through them.
| Why pseudo-terminals and X write to different special files |
1,670,605,065,000 |
I have a swap file in BTRFS for which I need the resume_offset for the kernel command line.
How do I calculate its CORRECT physical offset ?
filefrag does not work.
btrfs_map_physical.c does not work.
|
Below is a C program that calculates the starting offset from the start of the partition for some files on a Btrfs file system. It seems there is no reliable way to do this for Btrfs.
#include <unistd.h>
#include <linux/fs.h>
#include <stdlib.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <linux/fiemap.h>
int main(int argc, char **argv)
{
char buffer[sizeof (struct fiemap) + sizeof (struct fiemap_extent)];
struct fiemap *map = (struct fiemap *)buffer;
map->fm_start = 0;
map->fm_length = 4096;
map->fm_flags = FIEMAP_FLAG_SYNC;
map->fm_extent_count = 1; /* If you change this, you'll need to enlarge `buffer´. */
map->fm_reserved = 0;
int fd;
if (argc < 2) {
fprintf(stderr, "Usage %s filename\n", argv[0]);
return 1;
}
fd = open(argv[1], O_RDONLY);
if (fd < 0) {
perror("Error opening file");
return 1;
}
int block = 0;
int ret = ioctl(fd, FS_IOC_FIEMAP, map);
if (ret < 0) {
perror("ioctl");
close(fd);
return 1;
}
close(fd);
printf("Number of extents returned: %ld\n", map->fm_mapped_extents);
printf("File %s starts at byte offset %lu\n", argv[1], map->fm_extents[0].fe_physical);
return 0;
}
| How do you find the physical offset for a file in BTRFS? |
1,606,701,250,000 |
I know it's a duplicate of a duplicate of a duplicate... but I tried solutions that I found (about sudo groupadd rfkill and others) and it didn't work
So I will begin with that
$ bluetoothctl
Agent registered
[bluetooth]# power on
No default controller available
$ sudo systemctl stop bluetooth; sudo /usr/lib/bluetooth/bluetoothd -n -d
bluetoothd[315732]: Bluetooth daemon 5.55
bluetoothd[315732]: src/main.c:parse_config() parsing /etc/bluetooth/main.conf
bluetoothd[315732]: src/main.c:parse_config() Key file does not have key “DiscoverableTimeout” in group “General”
bluetoothd[315732]: src/main.c:parse_config() Key file does not have key “AlwaysPairable” in group “General”
bluetoothd[315732]: src/main.c:parse_config() Key file does not have key “PairableTimeout” in group “General”
bluetoothd[315732]: src/main.c:parse_config() Key file does not have key “Privacy” in group “General”
bluetoothd[315732]: src/main.c:parse_config() Key file does not have key “JustWorksRepairing” in group “General”
bluetoothd[315732]: src/main.c:parse_config() Key file does not have key “TemporaryTimeout” in group “General”
bluetoothd[315732]: src/main.c:parse_config() Key file does not have key “Name” in group “General”
bluetoothd[315732]: src/main.c:parse_config() Key file does not have key “Class” in group “General”
bluetoothd[315732]: src/main.c:parse_config() Key file does not have key “DeviceID” in group “General”
bluetoothd[315732]: src/main.c:parse_config() Key file does not have key “ReverseServiceDiscovery” in group “General”
bluetoothd[315732]: src/main.c:parse_config() Key file does not have key “Cache” in group “GATT”
bluetoothd[315732]: src/main.c:parse_config() Key file does not have key “KeySize” in group “GATT”
bluetoothd[315732]: src/main.c:parse_config() Key file does not have key “ExchangeMTU” in group “GATT”
bluetoothd[315732]: src/main.c:parse_config() Key file does not have key “Channels” in group “GATT”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “BRPageScanType” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “BRPageScanInterval” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “BRPageScanWindow” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “BRInquiryScanType” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “BRInquiryScanInterval” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “BRInquiryScanWindow” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “BRLinkSupervisionTimeout” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “BRPageTimeout” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “BRMinSniffInterval” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “BRMaxSniffInterval” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEMinAdvertisementInterval” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEMaxAdvertisementInterval” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEMultiAdvertisementRotationInterval” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEScanIntervalAutoConnect” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEScanWindowAutoConnect” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEScanIntervalSuspend” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEScanWindowSuspend” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEScanIntervalDiscovery” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEScanWindowDiscovery” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEScanIntervalAdvMonitor” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEScanWindowAdvMonitor” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEScanIntervalConnect” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEScanWindowConnect” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEMinConnectionInterval” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEMaxConnectionInterval” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEConnectionLatency” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEConnectionSupervisionTimeout” in group “Controller”
bluetoothd[315732]: src/main.c:parse_controller_config() Key file does not have key “LEAutoconnecttimeout” in group “Controller”
bluetoothd[315732]: src/adapter.c:adapter_init() sending read version command
bluetoothd[315732]: Starting SDP server
bluetoothd[315732]: src/sdpd-service.c:register_device_id() Adding device id record for 0002:1d6b:0246:0537
bluetoothd[315732]: src/plugin.c:plugin_init() Loading builtin plugins
bluetoothd[315732]: src/plugin.c:add_plugin() Loading hostname plugin
bluetoothd[315732]: src/plugin.c:add_plugin() Loading wiimote plugin
bluetoothd[315732]: src/plugin.c:add_plugin() Loading autopair plugin
bluetoothd[315732]: src/plugin.c:add_plugin() Loading policy plugin
bluetoothd[315732]: src/plugin.c:add_plugin() Loading a2dp plugin
bluetoothd[315732]: src/plugin.c:add_plugin() Loading avrcp plugin
bluetoothd[315732]: src/plugin.c:add_plugin() Loading network plugin
bluetoothd[315732]: src/plugin.c:add_plugin() Loading input plugin
bluetoothd[315732]: src/plugin.c:add_plugin() Loading hog plugin
bluetoothd[315732]: src/plugin.c:add_plugin() Loading gap plugin
bluetoothd[315732]: src/plugin.c:add_plugin() Loading scanparam plugin
bluetoothd[315732]: src/plugin.c:add_plugin() Loading deviceinfo plugin
bluetoothd[315732]: src/plugin.c:add_plugin() Loading midi plugin
bluetoothd[315732]: src/plugin.c:add_plugin() Loading battery plugin
bluetoothd[315732]: src/plugin.c:plugin_init() Loading plugins /usr/lib/bluetooth/plugins
bluetoothd[315732]: profiles/input/suspend-none.c:suspend_init()
bluetoothd[315732]: profiles/network/manager.c:read_config() Config options: Security=true
bluetoothd[315732]: plugins/hostname.c:read_dmi_fallback() chassis: laptop
bluetoothd[315732]: plugins/hostname.c:read_dmi_fallback() major: 0x01 minor: 0x03
bluetoothd[315732]: src/main.c:main() Entering main loop
bluetoothd[315732]: src/rfkill.c:rfkill_event() RFKILL event idx 0 type 1 op 0 soft 0 hard 0
bluetoothd[315732]: Bluetooth management interface 1.14 initialized
bluetoothd[315732]: src/adapter.c:read_version_complete() sending read supported commands command
bluetoothd[315732]: src/adapter.c:read_version_complete() sending read index list command
bluetoothd[315732]: src/rfkill.c:rfkill_event() RFKILL event idx 1 type 2 op 0 soft 0 hard 0
bluetoothd[315732]: src/rfkill.c:rfkill_event() RFKILL event idx 2 type 1 op 0 soft 0 hard 0
bluetoothd[315732]: src/adapter.c:read_commands_complete() Number of commands: 65
bluetoothd[315732]: src/adapter.c:read_commands_complete() Number of events: 35
bluetoothd[315732]: src/adapter.c:read_commands_complete() enabling kernel-side connection control
bluetoothd[315732]: src/adapter.c:read_index_list_complete() Number of controllers: 0
bluetoothd[315732]: src/profile.c:register_profile() sender :1.966
bluetoothd[315732]: src/profile.c:create_ext() Created "Message Notification"
bluetoothd[315732]: src/profile.c:register_profile() sender :1.966
bluetoothd[315732]: src/profile.c:create_ext() Created "Message Access"
bluetoothd[315732]: src/profile.c:register_profile() sender :1.966
bluetoothd[315732]: src/profile.c:create_ext() Created "Phone Book Access"
bluetoothd[315732]: src/profile.c:register_profile() sender :1.966
bluetoothd[315732]: src/profile.c:create_ext() Created "Synchronization"
bluetoothd[315732]: src/profile.c:register_profile() sender :1.966
bluetoothd[315732]: src/profile.c:create_ext() Created "File Transfer"
bluetoothd[315732]: src/profile.c:register_profile() sender :1.966
bluetoothd[315732]: src/profile.c:create_ext() Created "Object Push"
bluetoothd[315732]: src/profile.c:register_profile() sender :1.966
bluetoothd[315732]: src/profile.c:create_ext() Created ":1.966/org/bluez/obex/00005005_0000_1000_8000_0002ee000001/00005005-0000-1000-8000-0002ee000001"
bluetoothd[315732]: src/agent.c:add_default_agent() Default agent set to :1.5039 /agent
bluetoothd[315732]: src/agent.c:agent_ref() 0x556a11044990: ref=1
bluetoothd[315732]: src/agent.c:register_agent() agent :1.5039
bluetoothd[315732]: src/agent.c:agent_ref() 0x556a1106ea80: ref=1
bluetoothd[315732]: src/agent.c:register_agent() agent :1.962
bluetoothd[315732]: src/agent.c:add_default_agent() Default agent set to :1.962 /modules/bluedevil/Agent
bluetoothd[315732]: src/profile.c:register_profile() sender :1.973
bluetoothd[315732]: src/profile.c:create_ext() Created "Headset Voice gateway"
bluetoothd[315732]: plugins/hostname.c:property_changed() static hostname: user-hostname
bluetoothd[315732]: plugins/hostname.c:property_changed() pretty hostname:
bluetoothd[315732]: plugins/hostname.c:property_changed() chassis: laptop
bluetoothd[315732]: src/profile.c:register_profile() sender :1.973
bluetoothd[315732]: src/profile.c:create_ext() Created "Headset unit"
bluetoothd[315732]: src/agent.c:agent_ref() 0x556a1106d970: ref=1
bluetoothd[315732]: src/agent.c:register_agent() agent :1.1001
bluetoothd[315732]: src/agent.c:add_default_agent() Default agent set to :1.1001 /org/bluez/agent/blueman
$ lsusb | grep -i bluetooth
$ lspci | grep -i bluetooth
$ lshw | grep -i bluetooth
bash: lshw: command not found
$ hwinfo | grep -i bluetooth
E: RFKILL_NAME=asus-bluetooth
E: RFKILL_TYPE=bluetooth
bluetooth 692224 14 rfcomm,bnep,btusb,btrtl,btbcm,btintel, Live 0x0000000000000000
ecdh_generic 16384 1 bluetooth, Live 0x0000000000000000
rfkill 28672 11 bluetooth,asus_wmi,cfg80211, Live 0x0000000000000000
crc16 16384 2 bluetooth,ext4, Live 0x0000000000000000
$ sudo pactl load-module module-bluetooth-discover
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
$ lsmod | grep -i bluetooth
bluetooth 692224 14 btrtl,btintel,btbcm,bnep,btusb,rfcomm
ecdh_generic 16384 1 bluetooth
rfkill 28672 11 asus_wmi,bluetooth,cfg80211
crc16 16384 2 bluetooth,ext4
then if you want me to try some commands or get some logs tell me so (I don't really know what to give more because everything seems fine (ig)) (bluetooth used to work on Windows; and on Linux before a kernel update some month ago)
|
Cold boot or/and static discharge
| No bluetooth and |
1,606,701,250,000 |
I am using parrot os (based on Debian unstable). My audio controller is Intel audio. Here is the lspci:
Multimedia audio controller: Intel Corporation Device 02c8
Flags: bus master, fast devsel, latency 32, IRQ 16, IOMMU group 11
Memory at b629c000 (64-bit, non-prefetchable) [size=16K]
Memory at b6000000 (64-bit, non-prefetchable) [size=1M]
Capabilities: [50] Power Management version 3
Capabilities: [80] Vendor Specific Information: Len=14 <?>
Capabilities: [60] MSI: Enable- Count=1/1 Maskable- 64bit+
Kernel driver in use: sof-audio-pci
Kernel modules: snd_hda_intel, snd_sof_pci
I get follow error in dmesg:
[ 0.355028] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
[ 9.698733] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[ 9.698883] sof-audio-pci 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[ 9.698893] sof-audio-pci 0000:00:1f.3: enabling device (0000 -> 0002)
[ 9.699007] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[ 9.699092] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 9.705642] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[ 10.052328] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[ 10.052330] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[ 10.088657] sof-audio-pci 0000:00:1f.3: firmware: failed to load intel/sof/sof-cml.ri (-2)
[ 10.088660] sof-audio-pci 0000:00:1f.3: Direct firmware load for intel/sof/sof-cml.ri failed with error -2
[ 10.088663] sof-audio-pci 0000:00:1f.3: error: request firmware intel/sof/sof-cml.ri failed err: -2
[ 10.088664] sof-audio-pci 0000:00:1f.3: error: failed to load DSP firmware -2
[ 10.089021] sof-audio-pci 0000:00:1f.3: error: sof_probe_work failed err: -2
I see no hw audio device, neither in alsa nor in pulseaudio. I have seen this answer, my problem is exact same, but solution doesn't work (I didn't downgrade kernel, and don't want to).
Manually reloading kernel modules also doesn't work. sof firmware is missing but not sure how to install this in Debian (Arch has a package).
|
You're missing alsa-sof-firmware.
You could install it by following the instructions poster here:
https://github.com/thesofproject/sof-bin
| No sound device in kernel 5.7 failed to load sof firmware |
1,606,701,250,000 |
Without going into a lot of detail about why I want to do this ... is there any way to force modern Linux kernels to ignore the O_DIRECT flag when opening a file? Basically, I want O_DIRECT treated as a no-op, in which the application is free to specify it, but the kernel simply treats it as if it was not specified.
I've seen various other questions on Stack Exchange and elsewhere that ask similar things, but I haven't been able to find any information about this exact requirement. Is there any sysctl or anything I can set that would produce this effect?
|
No, there isn't any sysctl or alike for that.
You should use a LD_PRELOAD hack to override the openat() function.
| Is there any way to force the Linux kernel to ignore O_DIRECT? |
1,606,701,250,000 |
I use NFS to edit files on servers. When these files are scripts with shebang lines, and I execute them, I get the "text file busy" error for about 5 seconds after I save each time.
The same problem is reproducible if a file is opened in vi (on 4.19 kernel), as follows:
:>test.sh
chmod +x test.sh
vi test.sh
# Ctrl-Z to suspend vi
./test.sh
# text file busy: ./test.sh
On 5.7 kernel the above vi example doesn't produce the error but NFS write from 5.7 to 5.7 system still yields the "text file busy" error for 5 seconds after each save.
Per https://stackoverflow.com/questions/16764946/what-generates-the-text-file-busy-message-in-unix the error can be worked around by explicitly invoking the binary that runs the script:
bash test.sh
I believe I can then write a script, call it e, that will open the path given by the argument, see if the file begins with the shebang, if so parse the shebang line and invoke the binary in the shebang manually:
e ./test.sh
But, this begs the question: what am I paying my operating system for?
How can I configure Linux to execute files open for writing?
I grepped the 5.7 kernel source for ETXTBUSY and it produced no hits.
Alternatively, as a less universal workaround, how can I make it so that writes over NFS immediately close the file being written instead of keeping it open for ~5 seconds?
Edit:
The issue with vi (nvi, to be more precise), per a comment, is this one which is fixed in 1.81.6-16 on Debian (my 4.19 system has 1.81.6-15 and 5.7 system has 1.81.6-16). I would still like to figure out how to make NFS saves not produce the text file busy error.
Second edit:
/etc/exports on the server:
/home/w 10.0.9.0/24(rw,insecure)
Mounted with -o soft,intr:
serene:/home/w on /mnt/speed type nfs4 (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,soft,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.0.9.153,local_lock=none,addr=10.0.2.2)
Server packages (Devuan testing):
serene% dpkg -l|grep nfs
ii libnfsidmap2:amd64 0.25-5.1 amd64 NFS idmapping library
ii nfs-common 1:1.3.4-4 amd64 NFS support files common to client and server
ii nfs-kernel-server 1:1.3.4-4 amd64 support for NFS kernel server
Client packages on the working client where I cannot currently reproduce the issue (Devuan testing):
averagest% dpkg -l|grep nfs
ii libnfsidmap2:amd64 0.25-5.1 amd64 NFS idmapping library
ii nfs-common 1:1.3.4-4 amd64 NFS support files common to client and server
|
I can't comment yet, but can you give us more specifics on your environment?
I am unable to reproduce the behavior you are seeing. For example, I have an NFS filesystem mounted on /test. If I run the following command, it returns immediately, no 5s delay at all:
$ cd /test
$ vi xx; chmod 755 xx; ./xx
Tue Sep 8 17:45:17 EDT 2020
The contents I put into xx are:
#!/bin/sh
date
In addition, if I "vi xx" and CTRL-Z to suspend, there is no delay, nor is there any error:
$ vi xx
(CTRL-Z)
[1] + Stopped vi xx
$ ./xx
Tue Sep 8 17:51:01 EDT 2020
I'm testing on: CentOS Linux release 7.7.1908. I wouldn't expect NFS to behave differently between linux's, but you never can be sure.
If you use vim instead of nvi, does the behavior change?
What does "mount | grep nfsmountpoint" show?
| How to make Linux kernel execute files open for writing, or fixing the "text file busy" error |
1,606,701,250,000 |
I have computer where I'm trying to install real-time kernel.
My OS:
# uname -a
Linux localhost.localdomain 3.10.0-1127.el7.centos.plus.i686 #1 SMP Sun Apr 5 18:08:31 UTC 2020 i686 i686 i386 GNU/Linux
I have created file /etc/yum.repos.d/CentOS-rt.repo with following content
# CentOS-rt.repo
[rt]
name=CentOS-7 - rt
baseurl=http://mirror.centos.org/centos/\$releasever/rt/\$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
When I tried to update packages I got error message, please see below
# yum update -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror1.hs-esslingen.de
* extras: mirror1.hs-esslingen.de
* updates: mirror1.hs-esslingen.de
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
http://mirror.centos.org/centos/7/rt/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article
https://wiki.centos.org/yum-errors
If above article doesn't help to resolve this issue please use https://bugs.centos.org/.
One of the configured repositories failed (CentOS-7 - rt),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=rt ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable rt
or
subscription-manager repos --disable=rt
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=rt.skip_if_unavailable=true
failure: repodata/repomd.xml from rt: [Errno 256] No more mirrors to try.
http://mirror.centos.org/centos/7/rt/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
I have never installed kernel previously.
Please help me bypass above error.
Thank you.
|
It seems that real time kernel is available on AMD64/x86_64 architectures only - yours is i386 (32 bit). Repo URLs can be accessed from a browser, so if you open CentOS 7 real time kernel or Centos real time kernel on Cern you'll see only 64 bit support. This is also confirmed on Red Hat's real time kernel installation guide, page 9, only 64 bit support. Although RHEL 7 is a 64 bit only distro with 32 bit libraries support, so no surprise. Yet I suggest you read Red Hat's doc, it'll you help understand the benefits of a real time kernel and if you really need it.
| Install a real-time kernel on CentOS 7 i386 |
1,606,701,250,000 |
Here's my problem. I'm managing two VM servers under proxmox. Recentry, I upgraded (with apt update & apt upgrade) a lot of the VM linux kernels to linux-image-4.9.0-13-amd64 through the update linux-image-amd64/oldstable, now 4.9+80+deb9u11 amd64.
Distro is Debian :
lsb_release -a No LSB modules are available. Distributor ID: Debian
Description: Debian GNU/Linux 9.13 (stretch) Release: 9.13
Codename: stretch
One of the VM has mongoDB on it. Since I did the upgrade and rebooted the machine (all without any errors), mongoDB disappeared (not installed anymore) and I had to reinstall it.
For your information, prior I started managing these servers, an apt upgrade has been done on another server, one with mysql. Mysql has been uninstalled on it as well after the upgrade...
My question is : Why, and what can I do to avoid that?
Here is the end of my /var/log/apt/history.log file (for the last seven days) :
Start-Date: 2020-07-22 12:00:07
Commandline: apt-get upgrade -y
Upgrade: nodejs:amd64 (10.21.0-1nodesource1, 10.22.0-1nodesource1)
Error: Sub-process /usr/bin/dpkg returned an error code (1)
End-Date: 2020-07-22 12:00:14
Start-Date: 2020-07-23 12:00:04
Commandline: apt-get upgrade -y
Upgrade: librsvg2-common:amd64 (2.40.16-1+b1, 2.40.21-0+deb9u1), librsvg2-2:amd64 (2.40.16-1+b1, 2.40.21-0+deb9u1)
Error: Sub-process /usr/bin/dpkg returned an error code (1)
End-Date: 2020-07-23 12:00:05
Start-Date: 2020-07-24 12:00:04
Commandline: apt-get upgrade -y
Error: Sub-process /usr/bin/dpkg returned an error code (1)
End-Date: 2020-07-24 12:00:04
Start-Date: 2020-07-27 10:17:29
Commandline: apt upgrade
Install: linux-image-4.9.0-13-amd64:amd64 (4.9.228-1, automatic)
Upgrade: libcomerr2:amd64 (1.43.4-2+deb9u1, 1.43.4-2+deb9u2), e2fsprogs:amd64 (1.43.4-2+deb9u1, 1.43.4-2+deb9u2), e2fslibs:amd64 (1.43.4-2+deb9u1, 1.43.4-2+deb9u2), libss2:amd64 (1.43.4-2+deb9u1, 1.43.4-2+deb9u2), linux-image-amd64:amd64 (4.9+80+deb9u10, 4.9+80+deb9u11)
End-Date: 2020-07-27 10:37:34
Below, this is after mongoDB has been reinstalled today :
Start-Date: 2020-07-29 11:55:34
Commandline: apt-get install -y mongodb-org
Requested-By: user (1001)
Install: mongodb-org-mongos:amd64 (3.6.19, automatic), mongodb-org-tools:amd64
(3.6.19, automatic), mongodb-org-shell:amd64 (3.6.19, automatic), mongodb-org:amd64 (3.6.19), mongodb-org-server:amd64 (3.6.19, automatic)
End-Date: 2020-07-29 11:55:50
Start-Date: 2020-07-29 12:00:07
Commandline: apt-get upgrade -y
Upgrade: libcurl3:amd64 (7.52.1-5+deb9u10, 7.52.1-5+deb9u11), curl:amd64 (7.52.1-5+deb9u10, 7.52.1-5+deb9u11), libcurl3-gnutls:amd64 (7.52.1-5+deb9u10, 7.52.1-5+deb9u11)
End-Date: 2020-07-29 12:00:09
and
> dpkg.log | grep remove
gives me nothing.
I did a backup of the VM prior to the upgrade so I have the possibility to post files from before the upgrade if needed.
It's my first time using a stackexchange so please excuse me and tell me if I did something wrong on the post !
Any help appreciated to understand this phenomenon !
Thanks.
EDIT
I just finished restoring backup and mongodb is already not there. Is there anyway I can check when it got uninstalled ? I have an error
[26] 12:00:35 R servername Exited with error code 100
from a distant server managing the updates on this one. Can it be related ?
EDIT 2
> zgrep mongodb-org /var/log/apt/history.log.*
I found this in history.log.4.gz:
Start-Date: 2020-03-04 11:47:17
Commandline: apt autoremove
Remove: mongodb-org-mongos:amd64 (3.6.17), sgml-base:amd64 (1.29), libicu64:amd64 (64.1-0.1+0~20190410090943.5+stretch~1.gbp38f694), php7.3-mysql:amd64 (7.3.15-4+0~20200224.55+debian9~1.gbpbea824), mongo-tools:amd64 (3.2.11-1+b2), mongodb-org-shell:amd64 (3.6.17), libtcmalloc-minimal4:amd64 (2.5-2.2), xml-core:amd64 (0.17), libgoogle-perftools4:amd64 (2.5-2.2), libunwind8:amd64 (1.1-4.1), linux-image-4.9.0-8-amd64:amd64 (4.9.144-3.1), libstemmer0d:amd64 (0+svn585-1+b2), mongodb-org-server:amd64 (3.6.17), libyaml-cpp0.5v5:amd64 (0.5.2-4)
End-Date: 2020-03-04 11:47:27
So, here's the culprit? Any way I can find who issued the command and why it removed mongoDB while no newer version was installed? No more recent history.log files shows any mongo-db activity. Strange thing is that it would seem no user noticed any problem until today? Any chance the reboot I did after kernel update did that? Something about a cache somewhere maybe?
|
As we determined in comments, the removal of MongoDB isn’t related to the kernel upgrade. The logs at the end of your question,
Commandline: apt autoremove
show that most of the MongoDB packages were removed because they had been installed automatically but were no longer needed. This is probably because they were installed as dependencies of mongodb-org, and the latter was subsequently removed. The removal of mongodb-org would have happened by March 4 and no longer appears in the logs.
As far as noticing the change, I suspect that the key factor is the reboot. A Debian policy-compliant package would stop its service on removal, but this might not be the case for the MongoDB packages (which don’t come from Debian). So the packages were removed in March, but the service continued running and serving data; it only stopped when the server was rebooted.
| Upgrade to linux-image-4.9.0-13-amd64 uninstalled mongoDB |
1,606,701,250,000 |
I've known that we have Kernel space and User space in a Linux system. User space is used by some specific program, and it can communicate with Kernel space with some way, for example, system call.
I've also known that a program uses the memory with the rule: Memory layout, we have Stack, Heap, Text, BSS, Data etc.
Now I have a question: what is the relation between Memory layout and Kernel/User space? Must Memory layout be in the User space? Or are the two notions irrelevant?
|
The two notions are orthogonal. When referring to memory, user space is the memory accessible when running with user-level privileges, kernel space that accessible when running with kernel-level privileges. The memory layout is how that memory is used, and that’s up to each “user”.
The kernel has its own memory layout, extensively documented on 64-bit x86.
| Memory layout and kernel space - user space |
1,606,701,250,000 |
Do patches on different files qualify as a patch series?
I made 5 patches in total, 3 of which are changes to 3 different files, and 2 of which are changes to another single file. I assume that the 2 patches on the single file qualify as a series of patches, but my question is do all 5 patches qualify as a series of patches? Keep in mind that 2 of the patches make changes to a single file and the other 3 patches make changes to 3 different files.
Thank you for reading this question
|
Yes, patches to different files can qualify as a patch series. Loosely defined, a patch series is a series of patches which should be applied one after the other; more precise definitions depend on the target project’s practices.
One common pattern for patch series is to add a new feature, possibly as several patches, then use it; the “define” versus “use” parts will often touch different files.
In most cases, I would use a patch series to submit multiple patches which don’t make sense without each other. If individual patches are useful on their own, I would submit them individually. The general use for a patch series is to split up a complex change into multiple steps, in order to simplify review (whether the initial review, or “review“ when people look at the history).
| Can patches on different files be a part of a single patch series? |
1,606,701,250,000 |
I'm not sure how to troubleshoot these, but at least once a week, the amdgpu driver crashes and I either have to hard power down or try to ssh in from my laptop and reboot.
0c:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Vega 10 XL/XT [Radeon RX Vega 56/64] (rev c1) (prog-if 00 [VGA controller])
Subsystem: Sapphire Technology Limited Device e37f
Flags: bus master, fast devsel, latency 0, IRQ 103
Memory at e0000000 (64-bit, prefetchable) [size=256M]
Memory at f0000000 (64-bit, prefetchable) [size=2M]
I/O ports at e000 [size=256]
Memory at fcc00000 (32-bit, non-prefetchable) [size=512K]
Expansion ROM at 000c0000 [disabled] [size=128K]
Capabilities: <access denied>
Kernel driver in use: amdgpu
Kernel modules: amdgpu
Here's the last kernel log
https://pastebin.com/d6qyJ8ha
I'm on Fedora 31 running a vanilla kernel (I was hoping this slightly newer kernel would fair better). Details are at the top of the kernel log pastebin
Maybe I need to submit a bug report but I'm not even sure what information I need & if there's any troubleshooting I can do
|
There's little you can do to solve this issue on your own, so do please file a bug report here: https://bugzilla.kernel.org/enter_bug.cgi?product=Drivers (choose Video(Other) as a component).
What info you could provide (attach it as files):
Full sudo dmesg output
Full sudo lspci -vvv output
Full sudo lshw output
And of course describe under which circumstances you get this issue.
| amdgpu driver crashes |
1,606,701,250,000 |
I'm using Ubuntu 20.4 LTS. I added a patch to the linux-5.4 kernel and followed below commands to complie it,
cp /boot/config-$(uname -r) .config
make oldconfig
ccache make ARCH=i386
sudo make modules_install
It took about 8-10 hours to compile and when I try to make the modules_install, I'm seeing no space left message.
I took following steps found on StackOverflow to diagnose the issue,
Ran du -sh command and it outputs,
15G .
Ran du -h command and it outputs,
Filesystem Size Used Avail Use% Mounted on
udev 448M 0 448M 0% /dev
tmpfs 99M 12M 87M 12% /run
/dev/sda 25G 25G 0 100% /
tmpfs 491M 0 491M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 491M 0 491M 0% /sys/fs/cgroup
Ran lsof | grep deleted command and it outputs nothing
Ran df -i command and it outputs,
Filesystem Inodes IUsed IFree IUse% Mounted on
udev 114642 367 114275 1% /dev
tmpfs 125596 501 125095 1% /run
/dev/sda 1568000 320966 1247034 21% /
tmpfs 125596 4 125592 1% /dev/shm
tmpfs 125596 3 125593 1% /run/lock
tmpfs 125596 18 125578 1% /sys/fs/cgroup
Finally, I ran sudo tune2fs -m 0 /dev/sdaand rebooted the server but the error still there
Ran sudo du -x / | sort -n | tail -50 and here is the output from it,
288224 /root/.conan/data/project1stuff
288948 /root/.conan/data
289348 /root/.conan
291712 /home/linux-5.4/drivers/infiniband
295732 /root/.ccache/3
298872 /home/linux-5.4/sound/soc
300136 /home/chris/project1/source/Dist
300684 /root/.ccache/8
300996 /root/.ccache/5
303284 /root/.ccache/c
305472 /root/.ccache/7
308620 /usr/lib/modules/5.4.0/kernel/drivers/media
312200 /home/linux-5.4/arch
349576 /usr/lib/x86_64-linux-gnu
358224 /var/log/journal/98934a16ea8846759c9ae817caf8c438
358228 /var/log/journal
361268 /home/linux-5.4/drivers/gpu/drm/amd/amdgpu
386436 /home/linux-5.4/drivers/scsi
441516 /var/log
452736 /usr/lib/modules/5.4.0/kernel/drivers/gpu/drm
452740 /usr/lib/modules/5.4.0/kernel/drivers/gpu
483996 /home/linux-5.4/drivers/gpu/drm/nouveau
525444 /home/linux-5.4/drivers/staging
529596 /usr/lib/firmware
616428 /home/linux-5.4/drivers/gpu/drm/amd
627008 /home/linux-5.4/sound
850876 /var
902680 /home/linux-5.4/drivers/media
913128 /home/chris/project1/source
920664 /home/linux-5.4/fs
921180 /home/chris/project1
1023064 /home/linux-5.4/drivers/net/ethernet
1033372 /home/chris
1067620 /home/linux-5.4/drivers/net/wireless
1411676 /home/linux-5.4/net
1618588 /usr/lib/modules/5.4.0/kernel/drivers
1659620 /usr/lib/modules/5.4.0/kernel
1659904 /usr/lib/modules/5.4.0
1664808 /home/linux-5.4/drivers/gpu/drm
1666220 /home/linux-5.4/drivers/gpu
1927408 /usr/lib/modules
2427396 /home/linux-5.4/drivers/net
3252368 /usr/lib
4006852 /usr
4294576 /root/.ccache
4700716 /root
8790276 /home/linux-5.4/drivers
14319228 /home/linux-5.4
15533372 /home
25200780 /
|
df -h (not du -h as you wrote) indicates you have no free space left.
The following command will let you see where the space has gone:
sudo du -x / | sort -n | tail -50
Edit:
You're running low on space.
/home/linux-5.4 occupies around 14GB
/root/.ccache occupies around 4GB - you can safely sudo rm -rf /root/.ccache but I'm not sure that will be enough. Please don't use ccache going forward if you have no space at all.
| While making modules_install getting an error "No space left on device" |
1,606,701,250,000 |
Does using the kernel command-line option acpi=off in a virtual machine (i.e VirtualBox 5.2) make sense when the host OS has been booted with ACPI on ?
I mean for debuging purposes if someone wants to disable ACPI , is it a good idea to use VBox or (s)he has to boot it as the main OS ?
|
A virtual machine has its own virtual ACPI implementation: it is not directly connected to the ACPI of the host. A VM's ACPI implementation is likely to be relatively minimalist and straightforward, and most virtualization hosts should have pretty much got it right by now, so the question is: what is the actual problem you're trying to solve with acpi=off?
In most cases, disabling ACPI is overkill as a permanent fix: a sort of "my mobile phone charger started smoking, so I turned the house main circuit breaker off and have been living without mains electricity ever since".
Back in late 1990s and early 2000s when ACPI was a new thing and Linux's support of it was still work in progress, it might have been good advice. But now, the ACPI Component Architecture (ACPICA), which forms the base of operating-system-side ACPI code in Linux, Haiku and FreeBSD, actually is a reference implementation of ACPI support in operating systems. If the ACPI implementation in the system firmware is so bad you need to resort to a permanent acpi=off, it must be really bad indeed.
| Using "acpi=off" in a virtual machine |
1,606,701,250,000 |
thank you for taking a look at this question.
I am writing a simple misc char device with read and write operations. Please keep reading ...
The following code prints the required text in TEXT only once when i do
cat /dev/mydevice01
This is the code to the read function.
static ssize_t my_read(struct file *file, char __user *buff, size_t count, loff_t *ppos)
{
char *print_str = TEXT;
if (*ppos != 0)
return 0;
if ((count < TEXT_LENGTH) || (copy_to_user(buff, print_str, TLF_ID_LENGTH)))
return -EINVAL;
*ppos += count;
return count;
}
TEXT is defined using #define and so is TEXT_LENGTH
I felt this code was a little too complicated and hence, I tried to modify it. This is the modified code, but that keeps printing the required text until I use a SIGINT (Ctrl+C) on the process:
static ssize_t my_read(struct file *file, char __user *buff, size_t count, loff_t *ppos)
{
char *print_str = TLF_ID;
if (copy_to_user(buff, print_str, TLF_ID_LENGTH))
return -EINVAL;
return count;
}
I am new to Linux kernel programming. I want to know what is going wrong with the code. And if possible, a single line of code that can implement the same functionality.
Thanks in advance!
|
I figured it out myself, I'll leave the answer here to anyone else looking for something similar.
static ssize_t my_read(struct file *file, char __user *buff, size_t count, loff_t *ppos)
{
char *print_str = TEXT;
int len = TEXT_LENGTH;
return simple_read_from_buffer(buff, count, ppos, print_str, len);
}
This works as it is supposed to. Just don't forget to include these modules.
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
Thank you all for the help :).
| Writing a simple misc char device driver with read and write operations |
1,606,701,250,000 |
we have linux rhel server
uname -r
3.10.0-862.el7.x86_64
more /etc/redhat-release
Red Hat Enterprise Linux Server release 7.5 (Maipo)
from the dmesg we see the following
dmesg | grep "The driver for the device detected"
[ 3.142303] i40e 0000:05:00.0: The driver for the device detected a newer version of the NVM image than expected. Please install the most recent version of the network driver.
[ 3.483157] i40e 0000:05:00.1: The driver for the device detected a newer version of the NVM image than expected. Please install the most recent version of the network driver.
[ 3.777228] i40e 0000:05:00.2: The driver for the device detected a newer version of the NVM image than expected. Please install the most recent version of the network driver.
[ 4.031402] i40e 0000:05:00.3: The driver for the device detected a newer version of the NVM image than expected. Please install the most recent version of the network driver.
[ 4.017949] i40e 0000:05:00.2: PCI-Express: Speed 8.0GT/s Width x8
[ 4.018367] i40e 0000:05:00.2: Features: PF-id[2] VFs: 32 VSIs: 34 QP: 32 RSS FD_ATR FD_SB NTUPLE VxLAN Geneve PTP VEPA
[ 4.031399] i40e 0000:05:00.3: fw 7.81.51051 api 1.8 nvm 7.10 0x800051a6 19.0.12
[ 4.031402] i40e 0000:05:00.3: The driver for the device detected a newer version of the NVM image than expected. Please install the most recent version of the network driver.
[ 4.261774] i40e 0000:05:00.3: MAC address: 2c:bd:fe:1f:60:a1
ethtool:
ethtool -i papa1
driver: i40e
version: 2.1.14-k
firmware-version: 7.10 0x800051a6 19.0.12
expansion-rom-version:
bus-info: 0000:05:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: yes
lshw
lshw -class network -short
H/W path Device Class Description
===========================================================
/0/100/3/0 network NetXtreme BCM5720 Gigabit Ethernet PCIe
/0/100/3/0.1 network NetXtreme BCM5720 Gigabit Ethernet PCIe
/0/100/3.1/0 network NetXtreme BCM5720 Gigabit Ethernet PCIe
/0/100/3.1/0.1 network NetXtreme BCM5720 Gigabit Ethernet PCIe
/0/100/3.2/0 network Ethernet Controller X710 for 10GbE SFP+
/0/100/3.2/0.1 network Ethernet Controller X710 for 10GbE SFP+
/0/100/3.2/0.2 network Ethernet Controller X710 for 10GbE SFP+
/0/100/3.2/0.3 network Ethernet Controller X710 for 10GbE SFP+
/3 network Ethernet interface
/4 virbr0-nic network Ethernet interface
/5 virbr0 network Ethernet interface
is it means that we need to upgrade new kernel version?
if yes to which version?
additionally we see the following message from kernel
[ 1.017375] pci 0000:03:00.0: can't claim BAR 6 [mem 0xfff00000-0xffffffff pref]: no compatible bridge window
[ 1.017378] pci 0000:02:00.0: can't claim BAR 6 [mem 0xfffc0000-0xffffffff pref]: no compatible bridge window
[ 1.017381] pci 0000:02:00.1: can't claim BAR 6 [mem 0xfffc0000-0xffffffff pref]: no compatible bridge window
[ 1.017383] pci 0000:01:00.0: can't claim BAR 6 [mem 0xfffc0000-0xffffffff pref]: no compatible bridge window
[ 1.017385] pci 0000:01:00.1: can't claim BAR 6 [mem 0xfffc0000-0xffffffff pref]: no compatible bridge window
[ 1.017387] pci 0000:05:00.0: can't claim BAR 6 [mem 0xfff80000-0xffffffff pref]: no compatible bridge window
[ 1.017390] pci 0000:05:00.1: can't claim BAR 6 [mem 0xfff80000-0xffffffff pref]: no compatible bridge window
[ 1.017392] pci 0000:05:00.2: can't claim BAR 6 [mem 0xfff80000-0xffffffff pref]: no compatible bridge window
[ 1.017394] pci 0000:05:00.3: can't claim BAR 6 [mem 0xfff80000-0xffffffff pref]: no compatible bridge window
dmesg --level=err
[ 2.632067] i8042: No controller found
[ 3.108100] megaraid_sas 0000:03:00.0: Init cmd return status SUCCESS for SCSI host 0
|
As you mentioned in a comment, the warning about the NVM version can probably be ignored. However, since the server has an X710 NIC, you should consider upgrading to at least version 3.10.0-1112.el7 of the kernel; see the RHEL 7 kernel changelog for details.
| dmesg + rhel + what need to update according to dmesg |
1,606,701,250,000 |
I know
export LD_LIBRARY_PATH=xxxxx
will let kernel to search target lib in this path.
but why assign it as ':'
export LD_LIBRARY_PATH=:
What's the function? It works if .so in the current path.
By the way, when we separate paths, shouldn't we use ';' ?
ex:
export LD_LIBRARY_PATH=foo1;foo2
|
LD_LIBRARY_PATH is used by the dynamic linker not the kernel. The name of the dynamic linker varies but is something like /lib64/ld-linux-x86-64.so.2.
It is documented by man ld.so. On my system it says
LD_LIBRARY_PATH
A list of directories in which to search for ELF libraries at execution
time. The items in the list are separated by either colons or
semicolons, and there is no support for escaping either separator.
Using colon has the minor advantage of not needing quotes, as ; is a special character to the shell. It also agrees with the use of colon in the value of the PATH variable.
As to why LD_LIBRARY_PATH=:, I suggest getting a better book or guide.
| Why assign export LD_LIBRARY_PATH=: |
1,606,701,250,000 |
When using numactl, I was seeing
numactl: this system does not support NUMA policy.
Is it because some kernel config is not enabled?
Confirmed BIOS enabled NUMA.
lscpu shows there are NUMA nodes.
|
Short answer
NUMA ACPI is probably disabled from (A) BIOS or (B) cmdline or (C) kernel config. See details below.
More details
Looking at the numactl source code (from github), I see that the error above is coming from the checknuma() function:
void checknuma(void)
{
static int numa = -1;
if (numa < 0) {
if (numa_available() < 0)
complain("This system does not support NUMA policy");
}
numa = 0;
}
Which would fail when numa_available() return value is less than 0. This would only happen when get_mempolicy() syscall would fail with the error code ENOSYS:
int numa_available(void)
{
if (get_mempolicy(NULL, NULL, 0, 0, 0) < 0 && errno == ENOSYS)
return -1;
ENOSYS error correlates to 'Function not implemented', so it looks like NUMA isn't supported by your system. Since this support was added to the kernel long ago (kernel v2.6.7), than it is probably a configuration issue:
NUMA support is disabled in BIOS (you mention you verified this).
NUMA ACPI is disabled either from:
cmdline - check for acpi=off in /prco/cmdline
kernel config - check for CONFIG_X86_64_ACPI_NUMA=y and CONFIG_ACPI_NUMA=y.
Make sure CONFIG_NUMA=y is set as well.
See more details in this article.
Hope this helps.
PS - you didn't mention which kernel are you running and if this is bare-metal or VM/docker. If the latter, the get_mempolicy() sysctl might be blocked. See more information here.
| numactl: this system does not support NUMA policy |
1,606,701,250,000 |
I am trying to write a kernel module that hides some sockets from netstat.
I checked how netstat is working and saw that it's reading from /proc/net/tcp.
Now I am stuck. I am trying to figure out what is happening when I am reading the /proc/net/tcp file. After a little research in Google I found that it's using tcp4_seq_show function.
My question is how can I find out which function is used without googling it?
I tried using strace like -
strace -y -yy -v cat /proc/net/tcp
but the output not contain any reference to the tcp4_seq_show function or any another kernel function.
the relevant output -
arch_prctl(ARCH_SET_FS, 0x7ff5ec3e1580) = 0
mprotect(0x7ff5ec3d6000, 12288, PROT_READ) = 0
mprotect(0x55c369b3b000, 4096, PROT_READ) = 0
mprotect(0x7ff5ec420000, 4096, PROT_READ) = 0
munmap(0x7ff5ec3e2000, 71701) = 0
brk(NULL) = 0x55c36a40e000
brk(0x55c36a42f000) = 0x55c36a42f000
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=5698896, ...}) = 0
mmap(NULL, 5698896, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff5ebc7f000
close(3) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
openat(AT_FDCWD, "/proc/net/tcp", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
fadvise64(3, 0, 0, POSIX_FADV_SEQUENTIAL) = 0
mmap(NULL, 139264, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff5ebc5d000
read(3, " sl local_address rem_address "..., 131072) = 900
write(1, " sl local_address rem_address "..., 900 sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode
0: 00000000:0915 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 69736 1 ffff9f59772fc600 100 0 0 10 0
1: 3500007F:0035 00000000:0000 0A 00000000:00000000 00:00000000 00000000 102 0 31698 1 ffff9f59772f9a40 100 0 0 10 0
2: 00000000:0016 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 38399 1 ffff9f5972c3a300 100 0 0 10 5
3: 0100007F:0277 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 38548 1 ffff9f5972c3b480 100 0 0 10 0
4: 0100007F:A879 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 44812 1 ffff9f59772fd780 100 0 0 10 0
) = 900
read(3, "", 131072) = 0
munmap(0x7ff5ebc5d000, 139264) = 0
close(3) = 0
close(1) = 0
close(2) = 0
exit_group(0) = ?
+++ exited with 0 +++
Tried also using ltrace but it's returning an empty output...
So how can I determinate which function is used without knowing all the kernel and without googling it?
|
I don't think you can trace kernel calls simply with userspace tools. What you are probably looking for is ftrace, then you could (if your kernel supports it) do something like this:
sysctl kernel.ftrace_enabled=1
echo function_graph > /sys/kernel/debug/tracing/current_tracer
echo 1 > /sys/kernel/debug/tracing/tracing_on
cat /proc/net/tcp
echo 0 > /sys/kernel/debug/tracing/tracing_on
less /sys/kernel/debug/tracing/trace
For further information on what exactly goes on when you read /proc/net/tcp, you could download the kernel source files and/or read the kernel documentation, eg. about the virtual filesystem, /proc and the seq_file interface.
As the /proc filesystem is a kernel feature to make system information available to userspace, I don't know if it's possible to hide sockets from netstat (cf. How can I edit /proc/net/tcp?).
| How to find out what function is runnng when reading /proc |
1,606,701,250,000 |
If I mount a Kindle (on my Ubuntu machine), it shows me various files and databases related to books, metadata, etc.
But I don't see the actual OS and its files - am I seeing them and not realizing it, or are those hidden somehow? How do I access the actual OS?
(What I'm after is to find the log files. The last update messed up my device, and I'm hoping there is a record of the previous firmware's version somewhere, so I can roll back.)
|
You can't even do that on android. And the Swindle is even more closed, so unless you jail-break it you can't do it. The solution is not on the Gnu/Linux machine.
| How do I access a Kindle's core files? |
1,606,701,250,000 |
In order to disable the THP
We did the following on all 635 RHEL machines (we have rhel 7.5 version)
This lines are from bash script that we runs on all machines
Step 1
[[ -f /sys/kernel/mm/transparent_hugepage/enabled ]] && echo never > /sys/kernel/mm/transparent_hugepage/enabled
[[ -f /sys/kernel/mm/transparent_hugepage/defrag ]] && echo never > /sys/kernel/mm/transparent_hugepage/defrag
Verification:
cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
cat /sys/kernel/mm/transparent_hugepage/defrag
always madvise [never]
But as all know this steps are not considered when machine restarted/rebooted
Step 2
So we also did this , we append the following lines to /etc/rc.local
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
The question is:
Does step 1 as I mentioned above really disabled the THP on the fly?
Note - also other info from one typical machine
sysctl -a | grep hugepage
vm.hugepages_treat_as_movable = 0
vm.nr_hugepages = 0
vm.nr_hugepages_mempolicy = 0
vm.nr_overcommit_hugepages = 0
reference - Configuring Transparent Huge Pages.
|
Does step 1 as I mentioned above really disabled the THP on the fly?
Yes, any thing you do in sysfs is done on the fly. It's already documented in the kernel doc/transhuge.html
However, Quoting from https://access.redhat.com/solutions/46111
NOTE: Running the above commands will stop only creation and usage of
the new THP. The THP which were created and used at the moment the
above commands were run would not be disassembled into the regular
memory pages. To get rid of THP completely the system should be
rebooted with THP disabled at boot time.
There is a post with your same question. There, ub3rst4r explained that /etc/rc.local didn't work for his use case since it is executed after all the services are started
So, I highly recommend following the official way mentioned in the same kernel doc/transhuge.html
You can change the sysfs boot time defaults of Transparent Hugepage
Support by passing the parameter ... transparent_hugepage=never to the
kernel command line.
You can of course make it persistent using /etc/default/grub. Also, I recommend testing after the reboot with
grep AnonHugePages /proc/meminfo
AnonHugePages: 0 kB
You should get a value of 0 if it's disabled properly.
| Is it possible to disable Transparent Huge pages on the fly? |
1,606,701,250,000 |
ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
Used to retrieve data from the device. A null pointer in this position
causes thereadsystem call to fail with-EINVAL(“Invalid argument”). A
nonnegative returnvalue represents the number of bytes
successfully read (the return value is a “signed size” type,
usually the native integer type for the target platform).
ssize_t (*aio_read)(struct kiocb *, char __user *, size_t,loff_t);
Initiates an asynchronous read—a read operation that might not
complete before the function returns. If this method isNULL,
all operations will be pro-cessed (synchronously) byread instead.
ssize_t (*write) (struct file *, const char __user *, size_t, loff_t
*);
Sends data to the device. IfNULL,-EINVALis returned to the program
calling thewritesystem call. The return value, if nonnegative,
represents the number ofbytes successfully written.
ssize_t (*aio_write)(struct kiocb *, const char __user *, size_t,
loff_t *);
Initiates an asynchronous write operation on the device.
Took this statement from LDD3, can anyone please explain what will happen if a device driver not implemented the asyn write function? Will, it upgrades to sync silently like asyn read does (if it is NULL).
|
The aio_read and aio_write entries in file_operations are obsolete, replaced (albeit not identically) by read_iter and write_iter. Write-capable file_operations need to have at least one of write and/or write_iter, and the VFS will use whichever one is available. (The availability is checked earlier, and recorded using FMODE_CAN_WRITE.)
aio_write itself does need write_iter, and will return -EINVAL if it’s not available. There’s a generic implementation available which can be used in many cases, but it won’t be used as a fallback automatically.
| What will happen if a device driver not implemented the asyn write function? |
1,606,701,250,000 |
I updated my CentOS to kernel version 4.4 (kernel-lt) and want to install kernel-devel for the new kernel now.
This question suggests the following command:
sudo yum install "kernel-devel-uname-r == $(uname -r)"
In my case uname -r evaluates to 4.4.193-1.el7.elrepo.x86_64
$ sudo yum install "kernel-devel-uname-r == $(uname -r)"
[sudo] password for sadik:
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: artfiles.org
* elrepo: mirrors.nav.ro
* epel: epel.mirror.nucleus.be
* extras: mirror.23media.com
* updates: mirror.fra10.de.leaseweb.net
No package kernel-devel-uname-r == 4.4.193-1.el7.elrepo.x86_64 available.
Error: Nothing to do
When I look for the source directories, I can only see the ones for version 3.10:
$ ls /usr/src/kernels/
3.10.0-1062.1.1.el7.x86_64 3.10.0-1062.1.1.el7.x86_64.debug
I tried to look for other versions of kernel-devel with the option --showduplicates:
$ sudo yum search --showduplicates kernel-devel
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: artfiles.org
* elrepo: fedora.is
* epel: mirror.de.leaseweb.net
* extras: mirror.23media.com
* updates: mirror.fra10.de.leaseweb.net
=========================================================== N/S matched: kernel-devel ===========================================================
kernel-devel-3.10.0-957.21.3.el7.centos.plus.x86_64 : Development package for building kernel modules to match the kernel
kernel-devel-3.10.0-1062.el7.x86_64 : Development package for building kernel modules to match the kernel
kernel-devel-3.10.0-1062.1.1.el7.x86_64 : Development package for building kernel modules to match the kernel
kernel-devel-3.10.0-1062.1.1.el7.x86_64 : Development package for building kernel modules to match the kernel
How can I install kernel-devel or kernel-headers for the kernel that is currently running (4.4)?
|
You say you installed the kernel from kernel-lt repo, so you need to make sure you enable that repo to install anything kernel related
yum --enablerepo=elrepo-kernel install ...
| yum doesn't list other versions for kernel in repositories |
1,606,701,250,000 |
Does this mean a driver is not from the original OS-distributor, the kernel becomes a tainted kernel?
What does 'X' mean?
I didn't see an explanation for 'x'
ref:
https://www.kernel.org/doc/html/v4.15/admin-guide/tainted-kernels.html
|
Look at the latest version of that document: https://www.kernel.org/doc/html/latest/admin-guide/tainted-kernels.html
Bit Log Number Reason that got the kernel tainted
...
16 _/X 65536 auxiliary taint, defined for and used by distros
Its C name is TAINT_AUX; As its definition suggests, it's not set by any code in the vanilla kernel.
| externally supported module, setting X kernel taint flag |
1,606,701,250,000 |
I need custom patch my linux kernel so it can access the MacBook Pro (2018/2019) SSD for Ubuntu installation. Luckily, someone made a patch that seems to work. I have a second computer with a 1TB drive and there was several hundred GB's (maybe 500GB?). So I thought I would go ahead and compile from source (kernel 5.2). Well, I guess I should have cleaned my config file, because the kernal compile returned error that there was not enough disk space to proceed. Whaaaa?
Anyway, I'm having difficulty finding out where all the space went. When the compile fails, where are the files? What should I delete from the failed compile to try again with a much better config? I guess I could just rewipe the partition and reinstall linux again, but I'd like to avoid that if the fix is relatively easy.
|
In general, you can do:
make clean
to clean up most artifacts generated by the build.
| How to free up space after kernel compile fail - where are the extraneous stuff |
1,606,701,250,000 |
I am reading Robert Love's linux kernel development book. In that, book he is mentioning about register-impaired architecture. I don't know what is register-impaired architecture. Kindly explain me, if anyone knows about this.
Thanks in advance.
|
The context can make it somewhat clearer (emphasis mine):
This allowed architectures with few registers, such as x86, to
calculate the location of the process descriptor via the stack pointer
without using an extra register to store the location.With the process
descriptor now dynamically created via the slab allocator, a new
structure, struct thread_info, was created that again lives at the
bottom of the stack (for stacks that grow down) and at the top of the
stack (for stacks that grow up).3
3 Register-impaired architectures were not the only reason
for creating struct thread_info.
The author is just joking about the architectures like x86 having few registers. "X-impaired" ~ X is diminished compared to others. (For example, "financially impaired" = does not have enough money.)
| What is meant by register-impaired architecture |
1,606,701,250,000 |
Just like Ubuntu, Arch, Red Hat etc are just modifications to the original Linux Kernel... macOS (XNU), Solaris etc are some variants of the closed source code of AT&T's UNIX. But what is the purest UNIX kernel or distribution, per se?
Is the UNIX kernel code (the original one) completely lost? Or is it still being maintained by someone (AT&T)?
If there is an up-to-date nothing-except-the-kernel-source-code? How can I get my hands on it? (I obviously intend to pay) Is it available under personal/student license or do I need to buy a business license?
P.S. I have a limited knowledge about UNIX.
|
FreeBSD is likely the most directly-derived modern UNIX-based OS. In June of 2017, Diomidis
Spinellis of the Athens University of Economics and Business
published a research paper which documents the evolution of the Bell Labs UNIX codebase from its early beginnings through to the modern-day FreeBSD 12. Using a variety of sources and methods, he essentially reconstructed a Git repository timeline which traces current-day FreeBSD back to epochal origin of UNIX.
The project has achieved its major goal with the establishment of a
continuous timeline from 1970 until today. The repository contains:
snapshots of PDP-7, V1, V2, V3, V4, V5, V6, and V7 Research Edition,
Unix/32V,
all available BSD releases,
the CSRG SCCS history,
two releases of 386BSD,
the 386BSD patchkit,
the FreeBSD 1.0 to 1.1.5 CVS history,
an import of the FreeBSD repository starting from its initial imports that led to FreeBSD 2.0, and
the current FreeBSD repository.
The files appear to be added in the repository in chronological order
according to their modification time, and large parts of the source
code have been attributed to their actual authors. Commands like git blame and git log produce the expected results.
In particular, Figure 5 of the paper documents the proportional provenances of
the codebases comprising several Berkeley UNIX milestone releases.
I recommend his paper highly to anyone interested in the historical evolution
of UNIX and BSD. The GitHub page for the project is also interesting reading.
| What is the most similar distro/flavor to the original UNIX source code? [duplicate] |
1,606,701,250,000 |
I have added the debug parameter on the kernel command line to enable debug in the kernel, unfortunately this also enables debug in systemd causing my /var/log/daemon.log and /var/log/debug to fill up with crap leading to out of disk space issues.
I would like to keep debug enabled for the kernel but not for systemd, how can I do this?
|
It seems that the systemd log level can be set on the kernel command line either by the debug parameter or by the systemd.log_level parameter. So one can set the debug parameter first and then follow it with systemd.log_level=info to set systemd logging back to it's normal level.
| enable debug for kernel but not systemd |
1,606,701,250,000 |
recently, i moved fedora29 into the desktop harddrive from external hard drive
(Miraculously, i installed fedora29 on external hard drive anyway ^^:)
as installed as soon, it was too slow. i added up second swap partition on the secondary hard disk(/dev/sda1:4TB)
after that, my computer was always busy with hdd led on(hdd is too busy to work).
then i removed the second swap partition, the secondary disk from the /etc/fstab.
Since then, my computer became unstable..like write-error , kernel panic...etc
EXT4-fs error(device dm-0):ext4_find_entry:1439: inode #1966722: comm systemd:reading directory lblock 0
EXT4-fs error(device dm-0):ext4_journal-check_start: Detected aborted journal
EXT4-fs(dm-0):Remounting filesytem read-only
cpu3: Core Temperature above threshold, cpu clock throttled(total events:1)
Because of removed the secondary disk,there is no dm-0(maybe mounted disk name with /etc/fstab)
How could i fix the problem???
/etc/fstab
/dev/mapper/fedora-root / ext4 defaults 1 1 UUID=9b493611-0fb7-491b-9fc0-ae42f5a54a3f /boot ext4 defaults 1 2
/dev/mapper/fedora-home /home ext4 defaults 1 2
/dev/mapper/fedora-swap swap swap defaults 0 0
blkid:
/dev/sda1: UUID="5fedba61-5bf3-4c50-9818-bc63b771306a" TYPE="ext4" PARTLABEL="primary" PARTUUID="84d63caf-ab6d-4350-af92-39e87755a96d"
/dev/sdb1: UUID="9b493611-0fb7-491b-9fc0-ae42f5a54a3f" TYPE="ext4" PARTUUID="9b543e06-01"
/dev/sdb2: UUID="qnCBLA-tzkn-Lt0E-m9ed-4Ujj-W1A2-OAtoFG" TYPE="LVM2_member" PARTUUID="9b543e06-02"
/dev/mapper/fedora-root: UUID="5a09dd9f-03c5-474f-8e13-08aa5cde26a4" TYPE="ext4"
/dev/mapper/fedora-swap: UUID="28a3e920-5418-4799-9e18-5e501b838447" TYPE="swap"
/dev/mapper/fedora-home: UUID="b3c099eb-83e1-4328-98bf-e8f46c59e35f" TYPE="ext4".
df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 2.0G 1.1M 2.0G 1% /run
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/mapper/fedora-root 49G 19G 29G 39% /
tmpfs 2.0G 4.0K 2.0G 1% /tmp
/dev/sdb1 1008M 203M 737M 22% /boot
/dev/mapper/fedora-home 52G 9.0G 41G 19% /home
tmpfs 395M 0 395M 0% /run/user/0
|
I noticed the following line
cpu3: Core Temperature above threshold, cpu clock throttled(total events:1)
and not to long back I lost a CPU when ignoring similar messages. I suspect your CPU might need reseating and that this may fix the problem. Hot CPU can cause all sorts of issues. Hope that fixes it!
| error messages::ext4-fs error(device dm-0) after write-error on swap device |
1,606,701,250,000 |
I read here this:
Falco depends on a kernel module that taps into the stream of system calls on a machine and passes those system calls to user space.
(Emphasis mine).
That hints at the possibility of logging arbitrary instruction invocations from arbitrary processes (but not quite), which is what I would like to know how to do.
I've been recommended ptrace/strace/dtrace/gdb (I have a Mac), but I would like to know what low-level, probably kernel-level feature I could write a kernel module for that would log any process already running in the background on my machine. In the same way that ps lists the running processes, and top keeps an updated panel of them with some stats, I would like to basically control a process completely. That is, given pid 123, I would do pause 123 or step 123 to pause or make one step in the program, and then inspect 123 to look at the complete memory layout of the computer to see what the memory is that has changed. All of this without ptrace/dtrace/strace/gdb.
This is probably a broad topic, but I would like to be pointed to the right area on where to look for more information. Specifically this seems like it could be a kernel module, and so access some features exposed by the kernel API. I'm not sure though if this is technically possible (to watch any process from the outside, at any time, and control its evaluation), or if any part of this is possible. I would first like to know what parts of this are/aren't possible, and then where I can look for more information.
The few tutorials on gdb I've seen all want you to run/invoke your program/script with gdb directly, as in gdb myscript. That makes sense how it could get access to the stepping/pausing/etc. behaviors of the program. But I would like to go further than that. Instead of requiring your program (like gdb) to invoke the program directly, instead it works by attaching to a program already running in the background. And then, just by attaching to the program from the outside, it allows you to pause/step/inspect/etc.. Not sure if this is possible. But this way I could inspect the daemons and other things my computer is doing from the get go.
|
gdb can do exactly what you describe. You can attach to running process 123 using a command such as:
$ gdb -p 123
Or passing the path to the executable:
$ gdb /path/to/program 123
You can use the attach command from gdb prompt to the same effect.
That seems to do everything you describe, since gdb is already able to pause, step and inspect memory of an attached process (and do even more, like modify contents of memory.)
The underlying kernel feature used by gdb is ptrace(2) (beware, there be dragons!), so if you want something similar to gdb but different in some way, you can look into using ptrace for that purpose.
Developing a new kernel interface could of course be done, but it's unclear what that would offer that ptrace still doesn't... The hooks needed for this kind of feature are probably quite invasive into the kernel, so you would need a heavily patched kernel source tree to create something akin to ptrace (not likely done in a simple loadable kernel module.)
In short, gdb and ptrace do what you describe. You can of course develop alternatives to this tool and syscall, just unclear what the point of that would be.
| How to log every instruction and change in memory in any process |
1,606,701,250,000 |
Do fully rolling_release distros like ArchLinux, openSUSE, Alpine and so forth include kernel-upgrades as part of their rolling upgrades?
Or kernel upgrades are a separate issue even within the rolling_release paradigm?
|
The kernel is just another package in Arch. When upstream pushes a stable release, the maintainer will package it for Arch.
The only special treatment the kernel, and every other package in the [core] repository gets, is that they are released to [testing] first, so that developers and experienced users with that repository enabled can report any issues before they are introduced to the general population of users.
Once a package--including the kernel--has sufficient sign-offs, it will be pushed to the standard repositories.
| Do rolling release distros like Arch Linux include kernel upgrades as part of their rolling upgrades? |
1,543,684,762,000 |
recently , we upgrade our redhat server ( version 7 ) from 4 CPU CORE to 32 CPU CORE
is it possible to know which CPU was triggered during last day ?
I mean how to know if the additional CPU that we add are now in process ?
|
top command would be helpful. Use top command to list the utilization of each core. Press 1 if necessary to split the CPU row into a separate row for each core.
You can also add a column that shows the last-used core for each process. Press f to bring up the field list, then select column P and press d or <space> to toggle the value. Now, press q or <Esc> to end and see live. In right side you will see a column P which shows cpu core no. used by corresponding processor.
| Linux + how to know which CPU Cores was active last day |
1,543,684,762,000 |
When compiling the kernel, if I choose Ethernet Gadget (with CDC Ethernet support) or Network Control Model (NCM) instead of the Android composite device, I get an error:
drivers/built-in.o:coresight-tmc.c:function tmc_etr_store_out_mode: error: undefined reference to 'usb_qdss_close'
drivers/built-in.o:coresight-tmc.c:function tmc_etr_store_out_mode: error: undefined reference to 'usb_qdss_open'
drivers/built-in.o:coresight-tmc.c:function tmc_disable: error: undefined reference to 'usb_qdss_close'
drivers/built-in.o:coresight-tmc.c:function tmc_enable: error: undefined reference to 'usb_qdss_open'
drivers/built-in.o:coresight-tmc.c:function tmc_enable: error: undefined reference to 'usb_qdss_close'
Makefile:878: recipe for target '.tmp_vmlinux1' failed
make: *** [.tmp_vmlinux1] Error 1
Kernel version: 3.4.0
Toolchain: google arm-linux-androideabi-4.6
|
coresight-tmc.c seems to refer to Coresight Trace Memory Controller, which seems to be a kernel/hardware debugging tool on ARM architecture.
You may have found an undeclared dependency in the kernel configuration: the Trace Memory Controller seems to depend on the Android composite device, but the kernel configurator is not aware of this fact and so allows you to choose a configuration that includes the Trace Memory Controller driver but not the Android composite device.
Your options with the kernel version you're using are:
keep the Android composite device in your kernel configuration to satisfy Coresight's dependency, or
disable the CORESIGHT_* configuration items in your kernel configuration, and so give up Coresight support.
Since the kernel version 3.4.0 is no longer in active development, there's probably no point in reporting the bug unless you can reproduce it with a newer kernel version: the oldest kernel version with active long-term upstream support is 3.16.60 at this time.
| Android kernel compiling error |
1,543,684,762,000 |
Referring to How source ports get assigned, I do know, how the local port is determined. (=> Random free ephemeral port).
However, why does my raw socket using socket(AF_INET, SOCK_RAW, IPPROTO_TCP) get port 6 assigned?
ss -lnp shows: tcp UNCONN 0 0 0.0.0.0:6 0.0.0.0:* users:(("exe",pid=13164,fd=5))
Do I create the socket incorrectly (because IPPROTO_TCP is defined with =6 in linux/in.h)? Or are RAW_SOCKETS defaulted to port 6 if available?
I am Using Ubuntu 4.15 if that's important.
|
As @dirkt commented, the socket is not-port bound and displays the protocol aftert the local IP instead of the port (which is not there obviously).
using socket(AF_INET, SOCK_RAW, 123), ss outputs ??? UNCONN 0 0 0.0.0.0:123 0.0.0.0:* users:(("exe",pid=10039,fd=3))
Also, testing with other numbers as the third argument to socket(), ss shows that as the local port.
| Which ephemeral ports are used with raw sockets |
1,543,684,762,000 |
Fabian Lee : Software Architect's steps to installing VitualBox:
Make sure the kernel modules (vboxnetadp,vboxnetflt,vboxpic) were loaded properly:
$ lsmod | grep vboxdrv
vboxdrv 446464 3 vboxnetadp,vboxnetflt,vboxpci
My kernel modules seem okay however the numbers don't match Fabian's:
$ lsmod | grep vboxdrv
vboxdrv 471040 3 vboxnetadp,vboxnetflt,vboxpci
|
The first number represents the size of the module in memory, and it’s normal for it to vary from one system to another — it depends on the kernel version it was built for, the version of the module being built, and the compiler and compiler settings used.
| My Kernel modules don't match those of the VirtualBox installation guide. Should I be concerned? |
1,543,684,762,000 |
My Zabbix monitoring system told me that the uname output has changed on a virtual server (Host information was changed on ...). The ISP has shut down the entire server in order to perform some security patches on the physical hardware. How can it be, that the kernel information, which is received by the uname syscall, has changed after that? In my understanding, the patches pertain a completely different system layer and should have left the software OS VM layer untouched, isn't that so?
|
Updating the kernel will change the output of uname (or at least, uname -v and uname -a).
If you’re running a full virtual machine, that should only change when you update the kernel in the virtual machine.
But there are many hosting systems which use an external kernel: this includes containers, but also OpenVZ. It’s likely you’re using that.
| How can the output of `uname` change in a VM after a physical server was patched? |
1,543,684,762,000 |
I am building a customized kernel for RPi. The problem is that the RPi bootloader requires a vfat /boot partition whereas I intend to minimize the kernel size, so need to remove vfat support from kernel.
I have read Embedded Linux Primer and Linux Kernel Development books. From what I understood, it seems that /boot partition is used by bootloader to look for kernel and initramfs, among some other important files
I tried removing vfat support from the kernel while keeping /boot formatted as vfat. The kernel booted just fine. However, systemd stuck somewhere saying that it failed to mount /boot, whoch is perfectly fine since the kernel doesnt support vfat. Systemd then gave me a rescue shell.
I was wondering that since the RPi bootloader already supports vfat, and is able to load kernel without any issue, is there any way I can ask systemd not to mount /boot at all? As per my understanding, since the kernel is already loaded by this stage, the kernel doesnt need access to the /boot partition.
Any help will be appreciated.
|
systemd will try to mount the filesystems you have listed in /etc/fstab, so if you remove /boot from /etc/fstab it shouldn't try to mount it.
(I just tested this on a Fedora system, removed it from /etc/fstab and confirmed it wasn't mounted.)
systemd does have some code to treat EFI partitions specially, so maybe that's what you have on the RPi and that's what is triggering the mount... But that is typically implemented using an auto-mount unit, in other words, it will try to mount it only if someone looks inside /boot.
The logic to mount from /etc/fstab is implemented by systemd-fstab-generator and the logic to mount the EFI partition is implemented by systemd-gpt-auto-generator.
Another useful command is systemctl status /boot (when you have it mounted with the kernel that supports vfat), which can give you more hints on where it's coming from.
| Build kernel without support for /boot's file system |
1,543,684,762,000 |
On a BeagleBone Black the Linux release installed is a bone-debian-9.2-iot-armhf-2017-10-10-4gb.img. After booting the stock system, it is updated to the Linux 4.9.37-ti-r47 image by:
apt-get update
apt-get install linux-image-4.9.37-ti-r47
apt-get install linux-firmware-image-4.9.37-ti-r47
Everything works fine. Now I uncommented all the deb-src line in /etc/apt/sources.list file. Did a apt-get update. And followed the steps in the related SO: how to know the source repository of a package in debian, to find out where to get the source code. Unfortunately it turns up an error:
root@beaglebone:/home/debian# apt-cache showsrc linux-image-4.9.37-ti-r47
W: Unable to locate package linux-image-4.9.37-ti-r47
N: No packages found
Where to find the source package that can be used to build the binary kernel?
I did the same for the bash package. It works fine.
|
I believe the source code does not exist in a single package/snapshot.
There is a build script from https://eewiki.net/display/linuxonarm/BeagleBone+Black . The script is pulling code in three steps:
It clones from https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Then it fetches from https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Finally it pulls from https://github.com/RobertCNelson/ti-linux-kernel.git and applies the patches from this repo.
When all these steps are done, the build script tags and commits the code.
| Where to find the source of the kernel package on a debian armhf BeagleBone Black build? |
1,543,684,762,000 |
I had odroid-xu4 with DietPi OS on it.
My current kernel version; uname -a:
Linux DietPi 3.10.106+ #1 SMP PREEMPT Fri Nov 24 16:26:38 CET 2017 armv7l GNU/Linux
I'm trying to install tp-link TL-WN822N wifi device driver. But it asks me to upgrade my kernel version to 3.10 to 4.*.
I tried:
sudo apt-get install linux-headers-$(uname -r)
and
sudo apt-get update
also i tried:
sudo apt-get install linux-generic
It installed correctly but i run uname -a.It gives the same out as Linux DietPi 3.10.106+ #1 SMP PREEMPT Fri Nov 24 16:26:38 CET 2017 armv7l GNU/Linux
When i finally restart my odroid,it cannnot boot.
So,can anyone tell me a correct procedure to upgrade my kernel and how to change uname -a output to show a upgraded kernel
|
Please keep back up of your important files before the upgrade. Please read this XU4 kernel upgrade
Solution 1:
sudo apt-get dist-upgrade
Solution 2:
If dist-upgrade does not work then please try removing conflicting 3.x package before install:
sudo apt-get purge linux-image-3*
Do not reboot system, until below is installed.
sudo apt-get install linux-image-4.9-armhf-odroid-xu3
Solution 3: [Solved] XU4 kernel upgrade from 3.10 to 4.9
Download the .deb file
wget https://oph.mdrjr.net/meveric/kernel/XU3/4.9.x/linux-image-4.9.29+_4.9.29-20170527-XU3_armhf.deb -O package.deb
install the .deb file using dpkg
dpkg -i package.deb
| Dietpi - How to upgrade my kernel version to latest version |
1,543,684,762,000 |
Please, can someone give me step-by-step instructions how to get back into my Linux Cinnamon operating system.
I updated the definitions. After a reboot this issue appeared.
|
Every distro I've seen keeps at least one prior kernel version available in grub if not more. My multiple 18.x updated across versions Mint system has 11 at the moment....
So, in the grub menu, select an older kernel, boot that, remove bad kernel, update grub. If you don't see the grub menu press the shift key on your keyboard at the end of the BIOS stage of your computer.
FWIW it looks like the initrd didn't get updated properly either for file system drivers, hard drive controller, etc. OR the reference to the root file system is wrong.
EDIT - to remove the bad kernel, etc.
Get a list of installed kernels on your system -
user@darkstar ~ $ dpkg -l | grep "Linux kernel"
ii cpufrequtils 008-1 amd64 utilities to deal with the cpufreq Linux kernel feature
ii kmod 22-1ubuntu5 amd64 tools for managing Linux kernel modules
ii libaio1:amd64 0.3.110-2 amd64 Linux kernel AIO access library - shared library
ii libaio1:i386 0.3.110-2 i386 Linux kernel AIO access library - shared library
ii libcpufreq0 008-1 amd64 shared library to deal with the cpufreq Linux kernel feature
ii linux-firmware 1.157.17 all Firmware for Linux kernel drivers
ii linux-headers-4.4.0-21 4.4.0-21.37 all Header files related to Linux kernel version 4.4.0
ii linux-headers-4.4.0-21-generic 4.4.0-21.37 amd64 Linux kernel headers for version 4.4.0 on 64 bit x86 SMP
ii linux-headers-4.4.0-53 4.4.0-53.74 all Header files related to Linux kernel version 4.4.0
ii linux-headers-4.4.0-53-generic 4.4.0-53.74 amd64 Linux kernel headers for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-21-generic 4.4.0-21.37 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-53-generic 4.4.0-53.74 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-21-generic 4.4.0-21.37 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-53-generic 4.4.0-53.74 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-kernel-generic 4.4.0-53 all The Linux kernel.
ii ndiswrapper 1.60-3~ubuntu16.04.2 amd64 Userspace utilities for the ndiswrapper Linux kernel module
ii ndiswrapper-dkms 1.60-3~ubuntu16.04.2 all Source for the ndiswrapper Linux kernel module (DKMS)
user@darkstar ~ $
First, if linux-image-generic is installed remove it. It is a meta package that keeps your kernel up with latest releases. Then remove the offending version.
user@darkstar ~ $ sudo apt-get remove kernel-image-generic
... apt doing stuff ...
user@darkstar ~ $ sudo apt-get remove kernel-image-x.y.z-a-generic
When a new release is made, you can install it specifically and test it - if it works, you can reinstall the kernel-image-generic to keep up to date on releases
| kernel panic after Linux updates |
1,543,684,762,000 |
How can I find out on a running Debian system whether a version-specific (e.g. linux-image-3.16.0-4-amd64) or generic (e.g. linux.image-amd64) was selected when the Debian installer presented the choice at setup time (in "Installing the base system")?
I understand that uname -r would always return the specific version number (e.g. 3.16.0-4-amd64).
|
You can check if the linux-image-amd64 package is installed.
There are numerous ways to do this, including:
$ dpkg -l linux-image-amd64
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii linux-image-am 4.14+88 amd64 Linux for 64-bit PCs (meta-packag
and:
$ dpkg --get-selections linux-image-amd64
linux-image-amd64 install
These "generic" packages are almost empty (aside from some files in e.g. /usr/share/doc/linux-image-64) that depend on the package containing the latest kernel version. E.g. the version in debian unstable at the moment has:
Depends: linux-image-4.14.0-2-amd64
So, installing or upgrading linux-image-amd64 will cause linux-image-4.14.0-2-amd64 to be installed.
If you have dlocate installed, you can list all installed kernel packages (and related packages, such as dkms module packages) with dlocate -k (simple list) or dlocate -K (detailed list, almost identical to dpkg -l output).
e.g. on my current desktop machine:
$ dlocate -k
linux-doc-4.12
linux-doc-4.14
linux-headers-4.12.0-2-amd64
linux-headers-4.12.0-2-common
linux-headers-4.14.0-2-amd64
linux-headers-4.14.0-2-common
linux-headers-amd64
linux-image-4.12.0-2-amd64
linux-image-4.14.0-2-amd64
linux-image-amd64
linux-kbuild-4.12
linux-kbuild-4.14
nvidia-kernel-dkms
spl-dkms
zfs-dkms
| Find out whether version-specific or generic kernel was selected during Debian installation |
1,543,684,762,000 |
I am trying to change to the installed OpenVZ kernel in my fresh install of Debian 8.8.
This is list of my installed kernels:
So I edited my /etc/default/grub like this:
GRUB_DEFAULT=2
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="nomodeset"
GRUB_CMDLINE_LINUX=""
and then I executed grub-update however after reboot I am still with my original kernel so I cannot use OpenVZ. The only problem I could think of if that my CPU is Skylake so maybe that kernel is not compatible? Is it possible?
|
You have to use update-initramfs to update the existing kernel to a new one. You can do that like this:
update-initramfs -c -k 2.6.32-openvz-042stab123.9-amd64
If the kernel initramfs already exists, move your old kernels into a different directory and run update-grub
| Change kernel in grub |
1,543,684,762,000 |
I have 16GB of RAM with Debian 9 in my notebook but almost all of it is unused by the kernel. It uses only 1GB for buffer/cache.
Where can I tell the kernel to use more of the free RAM for caching?
My FS is Ext4.
Thanks!
|
The kernel only caches data that has been accessed. If you have not read more than 1GB of data from the disk since the last boot, then it will not have more than 1GB cached.
| Where to set kernels buffer/cache size |
1,543,684,762,000 |
In some of the EC2 servers of the same type, DirectMap4k can be anywhere between ~100000 kB down to ~50000 kB. How is it set and if it's possible to tune it?
|
None of the stuff in /proc/meminfo is anything that's tunable, all of it is just statistics measured by the kernel, and some of it isn't even memory usage.
The DirectMap entries in particular are a rough measure of TLB load. They represent how many pages of each size are mapped in the TLB. They have nothing to do with actual memory utilization, but can be useful on rare occasion for tracking down performance issues. This information isn't actually all that useful in most cases, and especially without knowing a lot about your workload.
Put a bit differently, this is something you base tuning on, not something you tune, but even then it's not something that's worth worrying about most of the time.
| How is `DirectMap4k` set in /proc/meminfo? |
1,543,684,762,000 |
After updating linux Mint kernel to 4.10.0-14-generic virtualbox is not working anymore.
I tried to run "mobprobe vboxdrv"
modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/4.10.0-14-generic
Then following several webpages I tried reconfiguring the dkms:
sudo dpkg-reconfigure virtualbox-dkms
------------------------------
Deleting module version: 5.0.32
completely from the DKMS tree.
------------------------------
Done.
Loading new virtualbox-5.0.32 DKMS files...
Building only for 4.10.0-14-generic
Building initial module for 4.10.0-14-generic
Error! Bad return status for module build on kernel: 4.10.0-14-generic (x86_64)
Consult /var/lib/dkms/virtualbox/5.0.32/build/make.log for more information.
Job for virtualbox.service failed because the control process exited with error code. See "systemctl status virtualbox.service" and "journalctl -xe" for details.
invoke-rc.d: initscript virtualbox, action "restart" failed.
● virtualbox.service - LSB: VirtualBox Linux kernel module
Loaded: loaded (/etc/init.d/virtualbox; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2017-04-11 16:29:30 CEST; 3ms ago
Docs: man:systemd-sysv-generator(8)
Process: 6978 ExecStart=/etc/init.d/virtualbox start (code=exited, status=1/FAILURE)
Apr 11 16:29:30 marco-HP systemd[1]: Starting LSB: VirtualBox Linux kernel .....
Apr 11 16:29:30 marco-HP virtualbox[6978]: * Loading VirtualBox kernel modu....
Apr 11 16:29:30 marco-HP virtualbox[6978]: * No suitable module for running...d
Apr 11 16:29:30 marco-HP virtualbox[6978]: ...fail!
Apr 11 16:29:30 marco-HP systemd[1]: virtualbox.service: Control process ex...=1
Apr 11 16:29:30 marco-HP systemd[1]: Failed to start LSB: VirtualBox Linux ...e.
Apr 11 16:29:30 marco-HP systemd[1]: virtualbox.service: Unit entered faile...e.
Apr 11 16:29:30 marco-HP systemd[1]: virtualbox.service: Failed with result...'.
Hint: Some lines were ellipsized, use -l to show in full.
This is the output of the log:
DKMS make.log for virtualbox-5.0.32 for kernel 4.10.0-14-generic (x86_64)
Tue Apr 11 16:29:21 CEST 2017
make: Entering directory '/usr/src/linux-headers-4.10.0-14-generic'
LD /var/lib/dkms/virtualbox/5.0.32/build/built-in.o
LD /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/built-in.o
CC [M] /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/linux/SUPDrv-linux.o
CC [M] /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/SUPDrv.o
CC [M] /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/SUPDrvGip.o
CC [M] /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/SUPDrvSem.o
CC [M] /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/SUPDrvTracer.o
CC [M] /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/SUPLibAll.o
CC [M] /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/r0drv/alloc-r0drv.o
CC [M] /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/r0drv/initterm-r0drv.o
CC [M] /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/r0drv/memobj-r0drv.o
CC [M] /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/r0drv/mpnotification-r0drv.o
CC [M] /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/r0drv/powernotification-r0drv.o
CC [M] /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/r0drv/linux/assert-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/r0drv/linux/initterm-r0drv-linux.o
CC [M] /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.o
/var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjNativeLockUser’:
/var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:1066:18: error: too few arguments to function ‘get_user_pages_remote’
rc = get_user_pages_remote(
^
In file included from /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/r0drv/linux/the-linux-kernel.h:88:0,
from /var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:31:
./include/linux/mm.h:1289:6: note: declared here
long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm,
^
scripts/Makefile.build:294: recipe for target '/var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.o' failed
make[2]: *** [/var/lib/dkms/virtualbox/5.0.32/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.o] Error 1
scripts/Makefile.build:567: recipe for target '/var/lib/dkms/virtualbox/5.0.32/build/vboxdrv' failed
make[1]: *** [/var/lib/dkms/virtualbox/5.0.32/build/vboxdrv] Error 2
Makefile:1524: recipe for target '_module_/var/lib/dkms/virtualbox/5.0.32/build' failed
make: *** [_module_/var/lib/dkms/virtualbox/5.0.32/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.10.0-14-generic'</code>
Does anyone know how to solve this?
Thanks a lot!
|
Solved the issue by moving the virtual machine files to a safe location (in order to protect the virtual machines) and then uninstalling completely all virtualbox related packages. Then I downloaded the deb package from oracle's website and installed it.
| dpkg-reconfigure virtualbox-dkms failure |
1,543,684,762,000 |
I am writing some firmware for a microcontroller that communicates over USB. I am getting this error from dmesg:
[3034764.122150] hid-generic 0003:16C0:27DB.0015: item fetching failed at offset -1080905469
[3034764.122158] hid-generic: probe of 0003:16C0:27DB.0015 failed with error -22
Does this error come from the kernel or userspace? Where can I find out what this error means?
|
It is from the kernel driver. If you go to the kernel sources web site freetext search lxr, and enter the search string you will find it leads you to the file hid/hid-core.c
1033 hid_err(device, "item fetching failed at offset %d\n", (int)(end - start));
| Where can I find information on hid-generic error codes? |
1,543,684,762,000 |
Can anyone did Kernel live patching using Kgraft in SLES 11 or 12 ?
Is there any procedure to be followed ?
How can we verify the kernel vulnerability fixes after Kgraft patching ??
|
Live patching is available only on SLE12+
Is sold as SLE12 extension so you need valid key and register this to get Live patches.
SUSE offers 60day trial on Live patching purchase page
Live patching is controlled by kgr tool:
# kgr
Error: no command provided
Usage: /usr/bin/kgr [-h][-v] COMMAND
Query and manipulate kGraft patching status.
Commands:
status: display the overall status of kGraft patching
patches: display the list of loaded patches
blocking: list processes that are preventing kGraft patching
from finishing
poke: move forward with the kGraft patching by sending
STOP and CONT signal to the pending processes
Options:
-h print this help
-v more detailed output
Report bugs at https://bugzilla.suse.com/.
and verification of applied patches:
# kgr -v patches
kgraft_patch_2_2_1
active: 1
RPM: kgraft-patch-3_12_62-60_64_8-default-2-2.1.x86_64
CVE: CVE-2016-8666 CVE-2016-6480
bug fixes and enhancements: (none)
For own verification of fixed bug you might try bug reproducer if exists. ( not recommended way , SUSE's QA-Maintenace tests this patches very extensively before release to it customers)
| kGraft ,Live Kernel patching in suse |
1,543,684,762,000 |
I am wondering if it is possible to intercept traffic emmited by a process before it goes through an interface on my host? How could I try and do this?
|
Yes, that is what a packet filter is.
A common packet filter is implemented in firewalls. On Linux, the most common is iptables which can take many rules that can filter and redirect traffic in any direction.
| Intercept traffic before interface |
1,543,684,762,000 |
I want to design a new OS to learn more about how an OS works. This OS is only for educational purpose and I had a few doubts choosing its kernel.
Is there any legal issue for using an Ubuntu kernel?
Should I use an Ubuntu Supported kernel source, a mainline kernel source or simply a Linux kernel source? (I thought choosing Supported Ubuntu Kernel would be best as I'd get a lot of hardware driver support with it)
Assuming that I succeeded in designing an OS with Ubuntu Kernel(mainline or supported), can I call it Linux <"whatever-name-I'll-come-up-with"> or would it just be called a modified Ubuntu?
|
The linux kernel source in Ubuntu is open source, so there is no problem with using (parts of) it, just like you can use any other linux kernel source.
Using the Ubuntu name for your OS is not allowed unless you have permission from Canonical (who own the Ubuntu trademark), which in general is true for any other trademarks and their owners too. Of course you could mention that your kernel is based on the Ubuntu (or Red Hat, or any other) kernel if that's true.
In other words “Whatever”, “Whatever OS” & “Whatever Linux” are all fine (provided you actually use a linux kernel in case of the latter one), but calling it “Ubuntu Whatever” is probably not okay.
| Designing a new Operation System |
1,543,684,762,000 |
I'm on an archlinux 4.4.1-2 and I'm trying to set up a netctl service.
Problem is that for netctl to work I need to have bcma and b43 loaded.
Since these two are not out-of-tree modules I thought I didn't had to load them myself.
Neverthless I also tried to load described in this article here.
Unfortunalty this doesn't seem to work either.
Has anyone an Idea what the problem could be?
thanks:D
modinfo of bcma
filename: /lib/modules/4.4.1-2-ARCH/kernel/drivers/bcma/bcma.ko.gz
license: GPL
description: Broadcom's specific AMBA driver
alias: pci:v000014E4d0000A8DCsv*sd*bc*sc*i*
alias: pci:v000014E4d0000A8DBsv*sd*bc*sc*i*
alias: pci:v000014E4d00004727sv*sd*bc*sc*i*
alias: pci:v000014E4d000043B1sv*sd*bc*sc*i*
alias: pci:v000014E4d000043AAsv*sd*bc*sc*i*
alias: pci:v000014E4d000043A9sv*sd*bc*sc*i*
alias: pci:v000014E4d000043A0sv*sd*bc*sc*i*
alias: pci:v000014E4d00004365sv*sd*bc*sc*i*
alias: pci:v000014E4d00004360sv*sd*bc*sc*i*
alias: pci:v000014E4d00004359sv*sd*bc*sc*i*
alias: pci:v000014E4d00004358sv*sd*bc*sc*i*
alias: pci:v000014E4d00004357sv*sd*bc*sc*i*
alias: pci:v000014E4d00004353sv*sd*bc*sc*i*
alias: pci:v000014E4d00004331sv*sd*bc*sc*i*
alias: pci:v000014E4d0000A8D8sv*sd*bc*sc*i*
alias: pci:v000014E4d00004313sv*sd*bc*sc*i*
alias: pci:v000014E4d00000576sv*sd*bc*sc*i*
and modinfo of b43
filename: /lib/modules/4.4.1-2-ARCH/kernel/drivers/net/wireless/b43/b43.ko.gz
firmware: b43/ucode9.fw
firmware: b43/ucode5.fw
firmware: b43/ucode16_mimo.fw
firmware: b43/ucode15.fw
firmware: b43/ucode14.fw
firmware: b43/ucode13.fw
firmware: b43/ucode11.fw
license: GPL
author: Rafał Miłecki
author: Gábor Stefanik
author: Michael Buesch
author: Stefano Brivio
author: Martin Langer
description: Broadcom B43 wireless driver
alias: ssb:v4243id0812rev10*
alias: ssb:v4243id0812rev0F*
alias: ssb:v4243id0812rev0D*
alias: ssb:v4243id0812rev0C*
alias: ssb:v4243id0812rev0B*
alias: ssb:v4243id0812rev0A*
alias: ssb:v4243id0812rev09*
alias: ssb:v4243id0812rev07*
alias: ssb:v4243id0812rev06*
alias: ssb:v4243id0812rev05*
alias: bcma:m04BFid0812rev2Acl*
alias: bcma:m04BFid0812rev28cl*
alias: bcma:m04BFid0812rev1Ecl*
alias: bcma:m04BFid0812rev1Dcl*
alias: bcma:m04BFid0812rev1Ccl*
alias: bcma:m04BFid0812rev18cl*
alias: bcma:m04BFid0812rev17cl*
alias: bcma:m04BFid0812rev15cl*
alias: bcma:m04BFid0812rev11cl*
depends: mac80211,ssb,bcma,led-class,mmc_core,cfg80211,rng-core
intree: Y
vermagic: 4.4.1-2-ARCH SMP preempt mod_unload modversions
parm: bad_frames_preempt:enable(1) / disable(0) Bad Frames Preemption (int)
parm: fwpostfix:Postfix for the .fw files to load. (string)
parm: hwpctl:Enable hardware-side power control (default off) (int)
parm: nohwcrypt:Disable hardware encryption. (int)
parm: hwtkip:Enable hardware tkip. (int)
parm: qos:Enable QOS support (default on) (int)
parm: btcoex:Enable Bluetooth coexistence (default on) (int)
parm: verbose:Log message verbosity: 0=error, 1=warn, 2=info(default), 3=debug (int)
parm: pio:Use PIO accesses by default: 0=DMA, 1=PIO (int)
parm: allhwsupport:Enable support for all hardware (even it if overlaps with the brcmsmac driver) (int)
|
There is a file /etc/modules which lists modules to be loaded at boot. Just add those modules to that file
| module not loaded at boot |
1,451,582,489,000 |
I'm using Ubuntu Mini 15.04 and I want to update the kernel to the latest 4.1.1. I've been looking online but there are so many different ways. I've tried some but always ran into some error.
I am not using a GUI, just command line.
|
First, install the initramfs tools before we being so that we can update the kernel properly.
sudo apt-get install initramfs-tools
Create a new temp folder that we can use for the time being for installation:
mkdir /kernel_tmp
Go to your /kernel_tmp folder, and run the following lines to download the kernel.
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.1.1-unstable/linux-headers-4.1.1-040101-generic_4.1.1-040101.201507011435_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.1.1-unstable/linux-headers-4.1.1-040101_4.1.1-040101.201507011435_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.1.1-unstable/linux-image-4.1.1-040101-generic_4.1.1-040101.201507011435_amd64.deb
then from the /kernel_tmp folder type in
sudo dpkg -i linux-*.deb
Then we need to update the initramfs for the new kernel:
sudo update-initramfs -c -k all
Then update the grub
sudo update-grub
Reboot when completed, it should be up to kernel 4.1.1.
| Update kernel to 4.1.1 in Ubuntu Mini |
1,451,582,489,000 |
When I run
make-kpkg --initrd buildpackage
with concurrency_level set to 17, all cores are at 100% according to gnome-system-monitor, when running the cc1-jobs.
When I run
fakeroot make-kpkg --initrd buildpackage
with concurrency_level set to 17 as well, the cores stay at around 40-60%.
What am I doing wrong?
Do I have to use fakeroot-ng?
p.s.:
The xsltproc-jobs take 100%, btw. I am confused.
|
make-kpkg --rootcmd fakeroot --initrd kernel_image kernel_headers kernel_source kernel_manual kernel_debug
is the way to go.
I don't know why
make-kpkg --rootcmd fakeroot --initrd buildpackage
has problems.
| fakeroot make-kpkg buildpackage |
1,451,582,489,000 |
I'm building LFS. I was trying to enable Ati radeon drivers in the kernel, but it didn't seem to work, so I did a little Googling and found that the there is something called firmware which the kernel needs in order to work with the H/W. I checked my dmesg and found that my kernel tries to load the file radeon/OLAND_pfp.bin from lib/firmware/radeon which unfortunately is not present.
I checked my other distros and they all have it. I know that when I run make modules_install the modules and firmware are copied into the required directories, but I want to know how to get this firmware. Also if I plan to run this LFS on other systems with different H/W, how can I get the maximum driver support?
|
All firmware which isn't distributable under the GPL-2 isn't provided within the kernel, but is available separately in the linux-firmware project. You'll find OLAND_pfp.bin there; you can clone the repository and run make install as root, which will install all the firmware in appropriate sub-directories of /lib/firmware.
| Kernel Firmware for Radeon |
1,451,582,489,000 |
I have a single core NAS My Live Duo. It runs Debian lenny release.
I found via htop utility that it constantly use 100% of red cpu without any noticeable process to eat it.
Than I checked via iostat -xkt 1 for more details and found this output:
03/01/15 11:35:12
avg-cpu: %user %nice %system %iowait %steal %idle
0.00 0.00 100.00 0.00 0.00 0.00
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util
sda 0.00 0.00 780.00 0.00 49920.00 0.00 128.00 0.41 0.53 0.52 40.80
sdb 0.00 0.00 780.00 0.00 49920.00 0.00 128.00 0.36 0.47 0.47 36.40
md0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
md2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
md3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
How to find what causes this high io usage in order to fix that?
|
I think problem there df -H
One of your disks is fully loaded.
All you need is lsof | grep deleted | less
This help you to understand what files were deleted and "keeps in memory" by processes.
For solve your problem you should restart process that holds deleted files.
| NAS: 100% system (kernel) cpu usage |
1,451,582,489,000 |
I recently built my own computer, and I was excited to finally get to the installation of the operating system. I chose Fedora 20 to use as my primary operating system, and I was able to successfully install the system as I wished without running into any major issues.
I started with an updated ISO from October 27th that I downloaded from the link in the Fedora IRC channel topic (here). One of the first things I ended up doing was updating the system with sudo yum update, which there were about 80 different packages that needed updating. The kernel version that was included with my ISO was a 3.16 variant, and the update installed the latest 3.17 kernel update available for Fedora 20. I successfully updated and rebooted my machine.
Upon reaching the kernel selection screen, it automatically booted into the latest kernel, and it was here that I first noticed the issue. Immediately after the kernel option was selected, it very quickly popped up with some sort of error message (I think something about TCI check failing?) and then proceeded to a blank, black screen. My only option at this point was to power off and power back on.
Just in case it may have been a random error, I did try rebooting a few times and kept getting the same results. I then tried going back to the original kernel version installed with my system, and it immediately prompted me for my hard drive decryption phrase. After entering the phrase, I was successfully able to log back into my system.
Additionally, I have also tried booting into runlevel 3 or multi-user mode in systemd, and even that ended up with the same result as before. I manually edited the kernel boot parameters and added systemd.unit=multi-user.target, and even with that parameter, there was no change in my results, limiting my ability to further diagnose the issue.
Is there something added in the latest kernel that might have an incompatibility with my system? Or is there a place where I can check the full system log? I'm not an expert with Linux, but I do know how to navigate the system via command line, so if you need more information, please just ask for it and tell me where to find it! Thanks.
|
As it turns out, it seems the underlying issue was not having the right proprietary drivers installed for my nVidia graphics card. I was under the presumption that I had to use nVidia's driver installer, but installing the right packages from RPMFusion and disabling Nouveau worked perfectly. Since installing the necessary drivers, my system is running significantly smoother, and it also eliminated this annoying magenta line that was on the far left end of my monitor.
I followed a guide from if-not-true-then-false.com, which can be found here. I installed the drivers and then re-enabled Plymouth as per the instructions in the guide. This fixed 100% of my issues.
| Cannot boot latest kernel update after installing on new system |
1,451,582,489,000 |
I am writing a common code in a driver to get the distros name and host name. host name i am taking from struct utsname{nodename[]}, but how do I get the distro name?
|
The Scope for getting distro name is not in kernel development scope. So no specific method is present currently. I am asking for module param in my driver for this. you can also ask for a ENV variable while compiling.
Thanks, for your help...
| Linux Distro name API to get name of linux distro in a driver code? |
1,451,582,489,000 |
I'm trying to build a custom kernel from a git repository on my Ubuntu virtual machine. I run the make command as follows :
sudo apt-get install vim libncurses5-dev gcc make git exuberant-ctags
mkdir -p git/kernels; cd git/kernels
git clone -b staging-next git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
cd staging
cp /boot/config-`uname -r`* .config
make olddefconfig
make menuconfig
make
The build process ends with the following error.
drivers/staging/media/cxd2099/cxd2099.c: In function ‘slot_reset’:
drivers/staging/media/cxd2099/cxd2099.c:537:4: error: expected ‘;’ before ‘if’
make[4]: [drivers/staging/media/cxd2099/cxd2099.o] Error 1
make[3]: [drivers/staging/media/cxd2099] Error 2
make[2]: [drivers/staging/media] Error 2
make[1]: [drivers/staging] Error 2
make: [drivers] Error 2
How should I repair this error?
|
staging-next is, as of right now, currently broken, specifically f823182bc289 of staging-next is broken.
If you really want to use staging-next, check out fcf1b73d08cd, which is near the top and does compile.
| Compilation error when building a custom kernel |
1,451,582,489,000 |
Could someone teach me or give me some tutorial? How do I compile the linux kernel version 3.16.1 to run in Slackware 14.1.
|
Please keep in mind that not using the kernel distributed with Slackware may break your system.
Apart of that, compiling the official kernel is a difficult task and takes its time. You can learn about how to compile your own or the official linux kernel on Kernelnewbies.org.
Related:
http://kernelnewbies.org/KernelBuild
https://www.kernel.org
| How do I compile the linux kernel version 3.16.1 to run in Slackware 14.1? |
1,451,582,489,000 |
I've built a newer (3.16-rc2) kernel which is running fine. My userspace program needs to link against the newer headers as it uses some new definitions in fcntrl.h etc.
My question is how do I preserve the headers of the old kernel when running "make headers_install" ?
If run
make headers_install INSTALL_HDR_PATH=/usr/src/kernels/`uname -r`
Header definitions clash as /usr/src/include is still in the PATH.
Whats the proper way to handle this?
|
You can't #include two headers with an identical path, but you can install one outside of the normal paths and have it supersede those when you compile by using the appropriate switch (for gcc, -I). I think you understand that stuff already, so it should not take too much thinking to recognize that you if you place more than one asm/fcntl.h in normal include directories, only one of them will apply anyway.
I don't think you have much to worry about, however. Starting with some of your comments:
Those features in the userspace program that use newer kernel mechanisms can be disabled.
This is good. If you need #define NEWVALUE 666 in order to compile, and that involves a feature that will only work on a newer kernel and you can catch or disable the use of such otherwise, then the sections that actually apply NEWVALUE will never get called. Remember, it's not that there's no header defining this available when the old kernel is running -- even if there was, it wouldn't matter, since the real problem at runtime is that you've effectively invoked a non-existent part of the kernel ABI. You don't need any headers at all present just to run an executable, so going back to the old kernel won't matter for that.
Perhaps I'm being paranoid but...
Yes and no. If this is a system where various people arbitrary swap in different kernel headers in order to exploit new features when compiling stuff that's going to be left around and run later using an older kernel, then paranoia is an appropriate response, lol. However, there's probably not much that really falls into this category.
Distros replace the kernel headers at every upgrade, but the list of user land things they have to replace at the same time usually seems not so long (if it exists at all). I suppose that's in part because maintaining backward compatibility in this context is pretty easy, but I think it's also because things in this context don't change drastically over time.
I suppose I could save off the old headers and reinstall them.
You could do that, or you could replace them from the appropriate source when needed (make headers_install); if it's a distro kernel and you are worried they may be patched, the distro should have a source package for it.
| install kernel headers without overwriting old headers |
1,451,582,489,000 |
I am building the 3.14 kernel for a board that requires the intel e1000e driver. I would like this kernel to have the driver built in so that I can remove loadable module support.
I have chosen the option in menu config and verified that the driver is compiled (the .o exists), however the device does not appear to be found or recognized.
Is there something I am missing to add a module to the kernel?
|
Apparently there were missing pieces that the driver depended on, that were not auto-selected by the menuconfig. In my case I was missing: pps_core and ptp
I found these by booting a working install with the modules folder renamed. This caused the kernel to not find any loadable modules. Then I tried to insmod the e1000e.ko. This indicated that there were missing PTP module. An attempt at loading that indicated a missing pps driver.
Once all three were loaded, the driver worked. I modified my kernel config to include all three, and it worked right away.
| How to use a built in driver in the kernel? |
1,451,582,489,000 |
Assuming that I have the sources for my kernel and I know the name of a SoC or a CPU, how I can check that the hardware is supported without compiling and running ?
|
I am not sure if you will find a single place in kernel sources that will list all kinds of hardware supported: CPU architectures, aux cards, peripheral devices etc. To get a better idea you may construct find commands in the kernel source to get an idea of the types of devices supported. One such place could be to look into the arch directory of your kernel:
find /usr/src/kernels/yourkernel/arch -type f -exec grep -i 'supported' {} \; -print
Another could be the include directory:
find /usr/src/kernels/yourkernel/include -iname "*.h" -exec grep -i 'supported' {} \; -print
And refine/narrow down your search from here.
A more efficient approach would be to look into documentation of the system.
| How do you check the support for a specific CPU in the Linux or BSD kernel? |
1,451,582,489,000 |
I 'm trying to configure kernel via make menuconfig [Angstrom distribution] on BeagleBoard-xM, but I get these errors:
make: Warning: File `/usr/src/linux-2.6.32.61/arch/arm/Makefile' has modification time 11647 s in the future
make[1]: Warning: File `scripts/Makefile.host' has modification time 11529 s in the future
HOSTCC scripts/basic/fixdep
gcc: error trying to exec 'cc1': execvp: No such file or directory
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2
As far I know, this is because cc1 is not in the PATH.
I have no Linux experience and I can't figure out what my next steps should be. Any help would really be appreciated.
|
Problem solved after installing cpp: opkg install cpp cpp-symlinks.
| cc1 not in the PATH |
1,451,582,489,000 |
How to verify if the Linux kernel is doing what it's saying for network interfaces? I have one network interface eth0 which has hardware support to do 1GB full-duplex.
I have prepared 2 box.
Now when I do normal x11vnc from box to box after 1 or 2 minute later both system get frozen, unless I power off and power on.
Now, how can I verify it's an issue of the Linux kernel and it's unable to do data upload and download of 1GB?
Is there any way to test accurate 1GB packet transfer live from PC1 to PC2 over TCP or UDP and do a full-duplex test, if the kernel is not causing frozen or crash?
|
for upload/download testing i found the iperf tool quite useful:
user@hostA: iperf -s
user@hostB: iperf -c hostA
if the kernel is really the problem, you will usually get a kernel oops before the crash. the main problem is accessing anything the kernel prints to the console, when you are using a graphical interface (and cannot switch to the console once the system is frozen)
for starters, you could switch to a TTY (Ctrl+Alt+F1) before running the network tests, and see whether you get some printout when the system freezes.
| How do I verify that the Linux kernel is not freezing when uploading or downloading large data over the ethernet interface? |
1,451,582,489,000 |
when I reboot my Linux machine Linux version 5.5 red hat
I get the following warning on the console screen ,
Linux cant startup and I can't login
please advice , how to login as single user mode and how to bypass the following problem ?
umounting old /dev
umounting old /proc
umounting old /sys
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: attempted to kill init!
|
The easiest way to examine you system state is to use rescue mode of RHEL installation media. Just boot from CD or DVD and type linux rescue. Here you can find more information about procedure.
| Linux + Kernel panic |
1,451,582,489,000 |
Since kernel 3.3.x there are frequent kernel panics during the boot process. It seems to be a kernel problem since I downgraded to 3.0 and the problems are gone.
The kernel panics happen almost at every boot attempt. After 4 or 5 restarts the system boots normally. It also seems to affect only Sandy Bridge systems, and maybe Ivy Bridge too.
Last kernel I checked was 3.4.9 with the same results.
|
So it seems to be TLP causing the issues, in detail the part where radio devices are turned off during the boot sequence.
I changed this line
DEVICES_TO_DISABLE_ON_STARTUP="bluetooth wwan"
to
DEVICES_TO_DISABLE_ON_STARTUP=""
until now all boot attemps ran successfully.
There is a new version of TLP out (0.3.7) and it addresses a similar problem. Maybe this fixes the problems. For now I'm happy finding the cause and I'll mark this as resolved.
| Occasionally kernel panics during boot since 3.3.x with Sandy Bridge |
1,451,582,489,000 |
I have a Macbook Pro and I want to build the Linux Kernel. Can I build 3.3.6 on my Mac? How?
|
There's an excellent site for newbies about Linux Kernel, it's called kernelnewbies.
You'll find on it an excellent tutorial explaining how you can get the source, configure and compile the Linux Kernel.
But, beware, it's not an easy task. There's really many many many options to look at and to understand before you can start to build a decent one. It can be a little more complicated on Mac OS X, since you won't have any oldconfig ready to recompile.
BTW, there's also an interesting book made by Greg Kroah-Hartman.
| Can the Linux kernel be compiled on Mac OS X 10.6.8? |
1,451,582,489,000 |
On my embedded device, I have this error showing up after kernel boot:
init.exe: Caught segmentation fault, core dumped
But I cannot understand why is this happening? If I do battery cut( i.e. reboot my device foricbly) then the device boots and comes up fine.
Any pointers will be extremely helpful. Is this some transient low level memory issue?
It is linux 2.6.31 on Arm architecture.
|
The output mentions it dumped core. Try doing:
gdb -c [corefile]
Then at the (gdb) prompt, do:
(gdb) bt
To get a backtrace. If the binary was not stripped, you might be in luck and at least have something to google for :-)
PS: The core file might be core.PID, where PID was the PID of init.exe when it died.
sc.
| init.exe: Caught segmentation fault, core dumped - what is the source of this error |
1,451,582,489,000 |
I'm trying to patch an android kernel 4.9 to support probe_read_{user, kernel} and probe_read_{user, kernel} helpers. For the backporting I took example from another patch that adds bpf_probe_read_str helper. While I've patched the kernel to add the helpers and running bpftrace --info, the str helper shows up but the newly added ones don't.
bpftrace output
System
OS: Linux 4.9.337-g4fcceb75c5cd #1 SMP PREEMPT Sat May 18 17:26:12 EEST 2024
Arch: aarch64
Build
version: v0.19.1
LLVM: 14.0.6
unsafe probe: yes
bfd: no
libdw (DWARF support): no
libbpf: failed to find valid kernel BTF
Kernel helpers
probe_read: yes
probe_read_str: yes
probe_read_user: no
probe_read_user_str: no
probe_read_kernel: no
probe_read_kernel_str: no
get_current_cgroup_id: no
send_signal: no
override_return: no
get_boot_ns: no
dpath: no
skboutput: no
get_tai_ns: no
get_func_ip: no
Kernel features
Instruction limit: -1
Loop support: no
btf: no
module btf: no
map batch: no
uprobe refcount (depends on Build:bcc bpf_attach_uprobe refcount): no
Map types
hash: yes
percpu hash: yes
array: yes
percpu array: yes
stack_trace: yes
perf_event_array: yes
ringbuf: no
Probe types
kprobe: yes
tracepoint: yes
perf_event: yes
kfunc: no
kprobe_multi: no
raw_tp_special: no
iter: no
probe_read_{user, kernel} and probe_read_{user, kernel}
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
index cc5ba47062e8..48762ecbfd66 100644
--- a/include/linux/uaccess.h
+++ b/include/linux/uaccess.h
@@ -88,6 +88,7 @@ static inline unsigned long __copy_from_user_nocache(void *to,
* happens, handle that and return -EFAULT.
*/
extern long probe_kernel_read(void *dst, const void *src, size_t size);
+extern long probe_kernel_read_strict(void *dst, const void *src, size_t size);
extern long __probe_kernel_read(void *dst, const void *src, size_t size);
/*
@@ -126,6 +127,8 @@ extern long notrace probe_user_write(void __user *dst, const void *src, size_t s
extern long notrace __probe_user_write(void __user *dst, const void *src, size_t size);
extern long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
+long strncpy_from_unsafe_strict(char *dst, const void *unsafe_addr,
+ long count);
extern long strncpy_from_unsafe_user(char *dst, const void __user *unsafe_addr,
long count);
extern long strnlen_unsafe_user(const void __user *unsafe_addr, long count);
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 67d7d771a944..d1036b0ba1fa 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -552,6 +552,11 @@ enum bpf_func_id {
*/
BPF_FUNC_get_socket_uid,
+ BPF_FUNC_probe_read_user,
+ BPF_FUNC_probe_read_kernel,
+ BPF_FUNC_probe_read_user_str,
+ BPF_FUNC_probe_read_kernel_str,
+
__BPF_FUNC_MAX_ID,
};
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 83b20092b84c..e872ab1fb235 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -85,44 +85,6 @@ BPF_CALL_3(bpf_probe_read, void *, dst, u32, size, const void *, unsafe_ptr)
return ret;
}
-static const struct bpf_func_proto bpf_probe_read_proto = {
- .func = bpf_probe_read,
- .gpl_only = true,
- .ret_type = RET_INTEGER,
- .arg1_type = ARG_PTR_TO_RAW_STACK,
- .arg2_type = ARG_CONST_STACK_SIZE,
- .arg3_type = ARG_ANYTHING,
-};
-
-BPF_CALL_3(bpf_probe_read_str, void *, dst, u32, size, const void *, unsafe_ptr)
-{
- int ret;
-
- /*
- * The strncpy_from_unsafe() call will likely not fill the entire
- * buffer, but that's okay in this circumstance as we're probing
- * arbitrary memory anyway similar to bpf_probe_read() and might
- * as well probe the stack. Thus, memory is explicitly cleared
- * only in error case, so that improper users ignoring return
- * code altogether don't copy garbage; otherwise length of string
- * is returned that can be used for bpf_perf_event_output() et al.
- */
- ret = strncpy_from_unsafe(dst, unsafe_ptr, size);
- if (unlikely(ret < 0))
- memset(dst, 0, size);
-
- return ret;
-}
-
-static const struct bpf_func_proto bpf_probe_read_str_proto = {
- .func = bpf_probe_read_str,
- .gpl_only = true,
- .ret_type = RET_INTEGER,
- .arg1_type = ARG_PTR_TO_RAW_STACK,
- .arg2_type = ARG_CONST_STACK_SIZE,
- .arg3_type = ARG_ANYTHING,
-};
-
BPF_CALL_3(bpf_probe_write_user, void *, unsafe_ptr, const void *, src,
u32, size)
{
@@ -465,6 +427,139 @@ static const struct bpf_func_proto bpf_current_task_under_cgroup_proto = {
.arg2_type = ARG_ANYTHING,
};
+BPF_CALL_3(bpf_probe_read_user, void *, dst, u32, size,
+ const void __user *, unsafe_ptr)
+{
+ int ret = probe_user_read(dst, unsafe_ptr, size);
+
+ if (unlikely(ret < 0))
+ memset(dst, 0, size);
+
+ return ret;
+}
+
+static const struct bpf_func_proto bpf_probe_read_user_proto = {
+ .func = bpf_probe_read_user,
+ .gpl_only = true,
+ .ret_type = RET_INTEGER,
+ .arg1_type = ARG_PTR_TO_RAW_STACK,
+ .arg2_type = ARG_CONST_STACK_SIZE,
+ .arg3_type = ARG_ANYTHING,
+};
+
+BPF_CALL_3(bpf_probe_read_user_str, void *, dst, u32, size,
+ const void __user *, unsafe_ptr)
+{
+ int ret = strncpy_from_unsafe_user(dst, unsafe_ptr, size);
+
+ if (unlikely(ret < 0))
+ memset(dst, 0, size);
+
+ return ret;
+}
+
+static const struct bpf_func_proto bpf_probe_read_user_str_proto = {
+ .func = bpf_probe_read_user_str,
+ .gpl_only = true,
+ .ret_type = RET_INTEGER,
+ .arg1_type = ARG_PTR_TO_RAW_STACK,
+ .arg2_type = ARG_CONST_STACK_SIZE,
+ .arg3_type = ARG_ANYTHING,
+};
+
+static __always_inline int
+bpf_probe_read_kernel_common(void *dst, u32 size, const void *unsafe_ptr,
+ const bool compat)
+{
+ int ret;
+ ret = compat ? probe_kernel_read(dst, unsafe_ptr, size) :
+ probe_kernel_read_strict(dst, unsafe_ptr, size);
+ if (unlikely(ret < 0))
+ memset(dst, 0, size);
+ return ret;
+}
+
+BPF_CALL_3(bpf_probe_read_kernel, void *, dst, u32, size,
+ const void *, unsafe_ptr)
+{
+ return bpf_probe_read_kernel_common(dst, size, unsafe_ptr, false);
+}
+
+static const struct bpf_func_proto bpf_probe_read_kernel_proto = {
+ .func = bpf_probe_read_kernel,
+ .gpl_only = true,
+ .ret_type = RET_INTEGER,
+ .arg1_type = ARG_PTR_TO_RAW_STACK,
+ .arg2_type = ARG_CONST_STACK_SIZE,
+ .arg3_type = ARG_ANYTHING,
+};
+
+BPF_CALL_3(bpf_probe_read_compat, void *, dst, u32, size,
+ const void *, unsafe_ptr)
+{
+ return bpf_probe_read_kernel_common(dst, size, unsafe_ptr, true);
+}
+
+static const struct bpf_func_proto bpf_probe_read_compat_proto = {
+ .func = bpf_probe_read_compat,
+ .gpl_only = true,
+ .ret_type = RET_INTEGER,
+ .arg1_type = ARG_PTR_TO_RAW_STACK,
+ .arg2_type = ARG_CONST_STACK_SIZE,
+ .arg3_type = ARG_ANYTHING,
+};
+
+static __always_inline int
+bpf_probe_read_kernel_str_common(void *dst, u32 size, const void *unsafe_ptr,
+ const bool compat)
+{
+ int ret;
+ /*
+ * The strncpy_from_unsafe_*() call will likely not fill the entire
+ * buffer, but that's okay in this circumstance as we're probing
+ * arbitrary memory anyway similar to bpf_probe_read_*() and might
+ * as well probe the stack. Thus, memory is explicitly cleared
+ * only in error case, so that improper users ignoring return
+ * code altogether don't copy garbage; otherwise length of string
+ * is returned that can be used for bpf_perf_event_output() et al.
+ */
+ ret = compat ? strncpy_from_unsafe(dst, unsafe_ptr, size) :
+ strncpy_from_unsafe_strict(dst, unsafe_ptr, size);
+ if (unlikely(ret < 0))
+ memset(dst, 0, size);
+ return ret;
+}
+
+BPF_CALL_3(bpf_probe_read_kernel_str, void *, dst, u32, size,
+ const void *, unsafe_ptr)
+{
+ return bpf_probe_read_kernel_str_common(dst, size, unsafe_ptr, false);
+}
+
+static const struct bpf_func_proto bpf_probe_read_kernel_str_proto = {
+ .func = bpf_probe_read_kernel_str,
+ .gpl_only = true,
+ .ret_type = RET_INTEGER,
+ .arg1_type = ARG_PTR_TO_RAW_STACK,
+ .arg2_type = ARG_CONST_STACK_SIZE,
+ .arg3_type = ARG_ANYTHING,
+};
+
+BPF_CALL_3(bpf_probe_read_compat_str, void *, dst, u32, size,
+ const void *, unsafe_ptr)
+{
+ return bpf_probe_read_kernel_str_common(dst, size, unsafe_ptr, true);
+}
+
+static const struct bpf_func_proto bpf_probe_read_compat_str_proto = {
+ .func = bpf_probe_read_compat_str,
+ .gpl_only = true,
+ .ret_type = RET_INTEGER,
+ .arg1_type = ARG_PTR_TO_RAW_STACK,
+ .arg2_type = ARG_CONST_STACK_SIZE,
+ .arg3_type = ARG_ANYTHING,
+};
+
static const struct bpf_func_proto *tracing_func_proto(enum bpf_func_id func_id)
{
switch (func_id) {
@@ -474,10 +569,8 @@ static const struct bpf_func_proto *tracing_func_proto(enum bpf_func_id func_id)
return &bpf_map_update_elem_proto;
case BPF_FUNC_map_delete_elem:
return &bpf_map_delete_elem_proto;
- case BPF_FUNC_probe_read:
- return &bpf_probe_read_proto;
case BPF_FUNC_probe_read_str:
- return &bpf_probe_read_str_proto;
+ return &bpf_probe_read_compat_str_proto;
case BPF_FUNC_ktime_get_ns:
return &bpf_ktime_get_ns_proto;
case BPF_FUNC_tail_call:
@@ -504,6 +597,17 @@ static const struct bpf_func_proto *tracing_func_proto(enum bpf_func_id func_id)
return &bpf_current_task_under_cgroup_proto;
case BPF_FUNC_get_prandom_u32:
return &bpf_get_prandom_u32_proto;
+ case BPF_FUNC_probe_read_user:
+ return &bpf_probe_read_user_proto;
+ case BPF_FUNC_probe_read_kernel:
+ return &bpf_probe_read_kernel_proto;
+ case BPF_FUNC_probe_read:
+ return &bpf_probe_read_compat_proto;
+ case BPF_FUNC_probe_read_user_str:
+ return &bpf_probe_read_user_str_proto;
+ case BPF_FUNC_probe_read_kernel_str:
+ return &bpf_probe_read_kernel_str_proto;
+
default:
return NULL;
}
diff --git a/mm/maccess.c b/mm/maccess.c
index 03ea550f5a74..583935a288ad 100644
--- a/mm/maccess.c
+++ b/mm/maccess.c
@@ -47,6 +47,9 @@ probe_write_common(void __user *dst, const void *src, size_t size)
long __weak probe_kernel_read(void *dst, const void *src, size_t size)
__attribute__((alias("__probe_kernel_read")));
+long __weak probe_kernel_read_strict(void *dst, const void *src, size_t size)
+ __attribute__((alias("__probe_kernel_read")));
+
long __probe_kernel_read(void *dst, const void *src, size_t size)
{
long ret;
@@ -157,6 +160,10 @@ EXPORT_SYMBOL_GPL(probe_user_write);
* If @count is smaller than the length of the string, copies @count-1 bytes,
* sets the last byte of @dst buffer to NUL and returns @count.
*/
+long __weak strncpy_from_unsafe_strict(char *dst, const void *unsafe_addr,
+ long count)
+ __attribute__((alias("strncpy_from_unsafe")));
+
long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count)
{
mm_segment_t old_fs = get_fs();
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index a339bea1f4c8..e6caf916d217 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -516,6 +516,11 @@ enum bpf_func_id {
*/
BPF_FUNC_get_socket_uid,
+ BPF_FUNC_probe_read_user,
+ BPF_FUNC_probe_read_kernel,
+ BPF_FUNC_probe_read_user_str,
+ BPF_FUNC_probe_read_kernel_str,
+
__BPF_FUNC_MAX_ID,
};
bpf: add bpf_probe_read_str helper
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 83b20092b84c..59182e6d6f51 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -465,6 +465,36 @@ static const struct bpf_func_proto bpf_current_task_under_cgroup_proto = {
.arg2_type = ARG_ANYTHING,
};
+BPF_CALL_3(bpf_probe_read_str, void *, dst, u32, size,
+ const void *, unsafe_ptr)
+{
+ int ret;
+
+ /*
+ * The strncpy_from_unsafe() call will likely not fill the entire
+ * buffer, but that's okay in this circumstance as we're probing
+ * arbitrary memory anyway similar to bpf_probe_read() and might
+ * as well probe the stack. Thus, memory is explicitly cleared
+ * only in error case, so that improper users ignoring return
+ * code altogether don't copy garbage; otherwise length of string
+ * is returned that can be used for bpf_perf_event_output() et al.
+ */
+ ret = strncpy_from_unsafe(dst, unsafe_ptr, size);
+ if (unlikely(ret < 0))
+ memset(dst, 0, size);
+
+ return ret;
+}
+
+static const struct bpf_func_proto bpf_probe_read_str_proto = {
+ .func = bpf_probe_read_str,
+ .gpl_only = true,
+ .ret_type = RET_INTEGER,
+ .arg1_type = ARG_PTR_TO_RAW_STACK,
+ .arg2_type = ARG_CONST_STACK_SIZE,
+ .arg3_type = ARG_ANYTHING,
+};
+
static const struct bpf_func_proto *tracing_func_proto(enum bpf_func_id func_id)
{
switch (func_id) {
@@ -504,6 +534,8 @@ static const struct bpf_func_proto *tracing_func_proto(enum bpf_func_id func_id)
return &bpf_current_task_under_cgroup_proto;
case BPF_FUNC_get_prandom_u32:
return &bpf_get_prandom_u32_proto;
+ case BPF_FUNC_probe_read_str:
+ return &bpf_probe_read_str_proto;
default:
return NULL;
}
|
I fixed it by instead of doing this, checking if the pointer is within the user space or not and use the appropriate methods to read it
// Same goes for probe_read_str
BPF_CALL_3(bpf_probe_read, void *, dst, u32, size, const void *, unsafe_ptr)
{
int ret;
if ((unsigned long)unsafe_ptr < TASK_SIZE) {
ret = bpf_probe_read_user(dst, size, unsafe_ptr);
} else {
ret = bpf_probe_read_kernel(dst, size, unsafe_ptr);
}
return ret;
}
``
| New added android kernel bpf helpers are not detected |
1,451,582,489,000 |
I tried to upgrade my debian system from buster to bullseye and messed up everything. I cant start apache2 and proftpd. When I do apachectl configtest I get the following error message:
(38)Function not implemented: AH00141: Could not initialize random number generator
I looked around all the internet and I have /dev/urandom and /dev/random
php -v gives:
PHP 8.1.28 (cli) (built: Apr 24 2024 19:21:45) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.28, Copyright (c) Zend Technologies
with Zend OPcache v8.1.28, Copyright (c), by Zend Technologies
Some say the kernel version is old,
uname -r:
3.14.32-xxxx-grs-ipv6-64
I tried later apt-get upgrade linux-image-generic :
Note, selecting 'linux-image-amd64' instead of 'linux-image-generic'
linux-image-amd64 is already the newest version (5.10.216-1).
here is boot/grub/grub.cfg
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=30
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/06_OVHkernel ###
menuentry "GNU/Linux with OVH Kernel, OVH kernel 3.14.32-xxxx-grs-ipv6-64" {
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
linux /boot/bzImage-3.14.32-xxxx-grs-ipv6-64 root=/dev/sda1 ro
}
### END /etc/grub.d/06_OVHkernel ###
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
echo 'Loading Linux 5.10.0-29-amd64 ...'
linux /boot/vmlinuz-5.10.0-29-amd64 root=/dev/sda1 ro
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.10.0-29-amd64
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
menuentry 'Debian GNU/Linux, with Linux 5.10.0-29-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.0-29-amd64-advanced-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
echo 'Loading Linux 5.10.0-29-amd64 ...'
linux /boot/vmlinuz-5.10.0-29-amd64 root=/dev/sda1 ro
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.10.0-29-amd64
}
menuentry 'Debian GNU/Linux, with Linux 5.10.0-29-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.0-29-amd64-recovery-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
echo 'Loading Linux 5.10.0-29-amd64 ...'
linux /boot/vmlinuz-5.10.0-29-amd64 root=/dev/sda1 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.10.0-29-amd64
}
menuentry 'Debian GNU/Linux, with Linux 5.10.0-28-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.0-28-amd64-advanced-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
echo 'Loading Linux 5.10.0-28-amd64 ...'
linux /boot/vmlinuz-5.10.0-28-amd64 root=/dev/sda1 ro
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.10.0-28-amd64
}
menuentry 'Debian GNU/Linux, with Linux 5.10.0-28-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.0-28-amd64-recovery-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
echo 'Loading Linux 5.10.0-28-amd64 ...'
linux /boot/vmlinuz-5.10.0-28-amd64 root=/dev/sda1 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.10.0-28-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-26-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-26-amd64-advanced-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
echo 'Loading Linux 4.19.0-26-amd64 ...'
linux /boot/vmlinuz-4.19.0-26-amd64 root=/dev/sda1 ro
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.19.0-26-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-26-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-26-amd64-recovery-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
echo 'Loading Linux 4.19.0-26-amd64 ...'
linux /boot/vmlinuz-4.19.0-26-amd64 root=/dev/sda1 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.19.0-26-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-25-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-25-amd64-advanced-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
echo 'Loading Linux 4.19.0-25-amd64 ...'
linux /boot/vmlinuz-4.19.0-25-amd64 root=/dev/sda1 ro
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.19.0-25-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-25-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-25-amd64-recovery-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
echo 'Loading Linux 4.19.0-25-amd64 ...'
linux /boot/vmlinuz-4.19.0-25-amd64 root=/dev/sda1 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.19.0-25-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-23-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-23-amd64-advanced-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
echo 'Loading Linux 4.19.0-23-amd64 ...'
linux /boot/vmlinuz-4.19.0-23-amd64 root=/dev/sda1 ro
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.19.0-23-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-23-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-23-amd64-recovery-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
echo 'Loading Linux 4.19.0-23-amd64 ...'
linux /boot/vmlinuz-4.19.0-23-amd64 root=/dev/sda1 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.19.0-23-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-21-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-21-amd64-advanced-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
echo 'Loading Linux 4.19.0-21-amd64 ...'
linux /boot/vmlinuz-4.19.0-21-amd64 root=/dev/sda1 ro
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.19.0-21-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-21-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-21-amd64-recovery-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
echo 'Loading Linux 4.19.0-21-amd64 ...'
linux /boot/vmlinuz-4.19.0-21-amd64 root=/dev/sda1 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.19.0-21-amd64
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Debian GNU/Linux 11 (bullseye) (on /dev/sda1)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
linux /boot/bzImage-3.14.32-xxxx-grs-ipv6-64 root=/dev/sda1 ro
}
submenu 'Advanced options for Debian GNU/Linux 11 (bullseye) (on /dev/sda1)' $menuentry_id_option 'osprober-gnulinux-advanced-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
menuentry 'GNU/Linux with OVH Kernel, OVH kernel 3.14.32-xxxx-grs-ipv6-64 (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/bzImage-3.14.32-xxxx-grs-ipv6-64--35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
linux /boot/bzImage-3.14.32-xxxx-grs-ipv6-64 root=/dev/sda1 ro
}
menuentry 'Debian GNU/Linux (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-5.10.0-28-amd64--35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
linux /boot/vmlinuz-5.10.0-28-amd64 root=/dev/sda1 ro
initrd /boot/initrd.img-5.10.0-28-amd64
}
menuentry 'Debian GNU/Linux, with Linux 5.10.0-28-amd64 (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-5.10.0-28-amd64--35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
linux /boot/vmlinuz-5.10.0-28-amd64 root=/dev/sda1 ro
initrd /boot/initrd.img-5.10.0-28-amd64
}
menuentry 'Debian GNU/Linux, with Linux 5.10.0-28-amd64 (recovery mode) (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-5.10.0-28-amd64-root=/dev/sda1 ro single-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
linux /boot/vmlinuz-5.10.0-28-amd64 root=/dev/sda1 ro single
initrd /boot/initrd.img-5.10.0-28-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-26-amd64 (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.19.0-26-amd64--35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
linux /boot/vmlinuz-4.19.0-26-amd64 root=/dev/sda1 ro
initrd /boot/initrd.img-4.19.0-26-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-26-amd64 (recovery mode) (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.19.0-26-amd64-root=/dev/sda1 ro single-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
linux /boot/vmlinuz-4.19.0-26-amd64 root=/dev/sda1 ro single
initrd /boot/initrd.img-4.19.0-26-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-25-amd64 (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.19.0-25-amd64--35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
linux /boot/vmlinuz-4.19.0-25-amd64 root=/dev/sda1 ro
initrd /boot/initrd.img-4.19.0-25-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-25-amd64 (recovery mode) (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.19.0-25-amd64-root=/dev/sda1 ro single-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
linux /boot/vmlinuz-4.19.0-25-amd64 root=/dev/sda1 ro single
initrd /boot/initrd.img-4.19.0-25-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-23-amd64 (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.19.0-23-amd64--35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
linux /boot/vmlinuz-4.19.0-23-amd64 root=/dev/sda1 ro
initrd /boot/initrd.img-4.19.0-23-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-23-amd64 (recovery mode) (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.19.0-23-amd64-root=/dev/sda1 ro single-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
linux /boot/vmlinuz-4.19.0-23-amd64 root=/dev/sda1 ro single
initrd /boot/initrd.img-4.19.0-23-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-21-amd64 (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.19.0-21-amd64--35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
linux /boot/vmlinuz-4.19.0-21-amd64 root=/dev/sda1 ro
initrd /boot/initrd.img-4.19.0-21-amd64
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-21-amd64 (recovery mode) (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.19.0-21-amd64-root=/dev/sda1 ro single-35xxxc5-efx5-41e7-9xxx86-731b9xxxx38' {
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
else
search --no-floppy --fs-uuid --set=root 35xxxc5-efx5-41e7-9xxx86-731b9xxxx38
fi
linux /boot/vmlinuz-4.19.0-21-amd64 root=/dev/sda1 ro single
initrd /boot/initrd.img-4.19.0-21-amd64
}
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###
etc/default/grub:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01233367,0xf333fefe,0x8933cdef,0x333efef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
dpkg --list | grep linux-image:
https://pastebin.com/vK7uwzPj
I ran out of ideas and would appreciate any help!
|
The debian package linux-image-amd64 is version 5.10.216-1 which corresponds to upstream kernel version 5.10.0-29 which you have as a initramfs in /boot and as an entry in /boot/grub/grub.cfg.
However, the first entry is pointing to the old 3.14.32-xxxx-grs-ipv6-64 kernel which is likely what is causing the issues with apache.
When booting your system you should select the second entry in the grub menu (Debian GNU/Linux). If your system automatically boots into the old kernel and you don't see any options you could change your /etc/default/grub file to point to the second entry which should be the kernel 5.10.0-29:
GRUB_DEFAULT=1
If all goes well your system should be operational after a reboot.
A common practise after upgrading the kernel is to remove the old kernels once you have verified the system is booting as it should. These commands can be used to list old kernels and remove them. Do the following steps after booting into the 5.10.0-29 kernel.
uname -mrs # check the current kernel version
dpkg --list | egrep -i --color 'linux-image|linux-headers'
aptitude purge linux-image-4.19.0-{14,16,21,23,25,26}-amd64 linux-image-5.10.0-28-amd64 # change according to the output of above command
update-grub
reboot
Make sure to adapt the /etc/default/grub file accordingly to point to the correct entry in /boot/grub/grub.cfg.
See this post on forums.debian.net for more details.
| AH00141: Could not initialize random number generator |
1,715,075,386,000 |
When trying to boot from a NixOS live usb with 23.11, gnome for x86_64:
On a Asus C236 WSI Motherboard with this BIOS:
$ ls -l /sys/class/dmi/id/bios*
-r--r--r-- 1 root root 4096 Apr 24 09:59 /sys/class/dmi/id/bios_date
-r--r--r-- 1 root root 4096 Apr 24 09:59 /sys/class/dmi/id/bios_release
-r--r--r-- 1 root root 4096 Apr 24 09:01 /sys/class/dmi/id/bios_vendor
-r--r--r-- 1 root root 4096 Apr 24 09:56 /sys/class/dmi/id/bios_version
$ cat /sys/class/dmi/id/bios*
10/21/2015
5.11
American Megatrends Inc.
P1.00
boot up screen gets stuck at first line with:
Probing EDD (edd=off to disable)... ok
|
At the NixOS boot menu, press Tab to edit the kernel command line. Add edd=off to the beginning and press Enter to load it.
See screenshot:
| nixos live usb boot stuck at Probing EDD (edd=off to disable)... ok |
1,715,075,386,000 |
I've got a device with bad RAM. Running memtest overnight shows all faulting addresses to be in the 0x7d0000000 - 0x7f0000000 range. I plan to replace the RAM, but until then, I've disabled a 2GB chunk around it with memmap=:
# cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-6.5.0-25-generic root=UUID=5277c53f-b2cd-4301-8fdf-0b2119430870 ro memmap=2G$0x0000000790000000 quiet splash vt.handoff=7
Those cmdline options do seem to be acknowledged by the kernel:
[ 0.000000] user-defined physical RAM map:
[ 0.000000] user: [mem 0x0000000000000000-0x000000000009efff] usable
[ 0.000000] user: [mem 0x000000000009f000-0x00000000000fffff] reserved
[ 0.000000] user: [mem 0x0000000000100000-0x0000000019e6a017] usable
[ 0.000000] user: [mem 0x0000000019e6a018-0x0000000019e7ae57] usable
[ 0.000000] user: [mem 0x0000000019e7ae58-0x000000002cb82fff] usable
[ 0.000000] user: [mem 0x000000002cb83000-0x000000002ed2ffff] reserved
[ 0.000000] user: [mem 0x000000002ed30000-0x000000002edacfff] ACPI data
[ 0.000000] user: [mem 0x000000002edad000-0x000000002f29bfff] ACPI NVS
[ 0.000000] user: [mem 0x000000002f29c000-0x000000002fd0efff] reserved
[ 0.000000] user: [mem 0x000000002fd0f000-0x000000002fd0ffff] usable
[ 0.000000] user: [mem 0x000000002fd10000-0x000000003cffffff] reserved
[ 0.000000] user: [mem 0x00000000e0000000-0x00000000efffffff] reserved
[ 0.000000] user: [mem 0x00000000fe000000-0x00000000fe010fff] reserved
[ 0.000000] user: [mem 0x00000000fec00000-0x00000000fec00fff] reserved
[ 0.000000] user: [mem 0x00000000fed00000-0x00000000fed03fff] reserved
[ 0.000000] user: [mem 0x00000000fee00000-0x00000000fee00fff] reserved
[ 0.000000] user: [mem 0x00000000ff000000-0x00000000ffffffff] reserved
[ 0.000000] user: [mem 0x0000000100000000-0x000000078fffffff] usable
[ 0.000000] user: [mem 0x0000000790000000-0x000000080fffffff] reserved
[ 0.000000] user: [mem 0x0000000810000000-0x00000008beffffff] usable
However, I still get segfaults, ostensibly in the reserved address range:
Mar 09 20:47:40 srv0 kernel: udisksd[656]: segfault at 7fe974786218 ip 00007fe974786218 sp 00007ffcd10d1848 error 7 in libbd_swap.so.3.0.0[7fe974785000+2000] likely on CPU 7 (core 3, socket 0)
According to this page, I should interpret that as udiskd trying to write to the reserved address 0x7fe974786218 (error 7). At first glance, the 0x7f address seems to match up with what memtest found to be bad RAM, but is off by orders of magnitude, since it points to a value of 140 TB. My machine has 32 GB.
What, if not a memory address, does the segfault at X value represent?
|
You're confusing address spaces here; this is virtual memory of the process address space of the udisks process. You reserved physical address spaces.
A segfault happens when a process tries to access a virtual memory address that is not mapped to any physical page, or that it's not allowed to access.
Physical and virtual addresses have nothing to do with each other, keeping a table to map virtual addresses to physical addresses is why your processor has a memory management unit. So the problem here is software accessing the wrong memory address – a bug.
Of course, that bug might not be a software bug, but caused by damaged RAM that you didn't reserve; nobody can know that! There's no guarantee that yesterday night's memtest still is relevant today, especially if there's problems on more than one physical address range. Honestly, what you're doing is quite hazardous – you know you have memory that might randomly corrupt data, you hope for the best that you caught all the offending memory and blocked it from usage. If the things you do with your computer matter, I wouldn't do that. Since you say you're planning to replace that memory, remove the whole RAM module now, and resume working if possible, or hurry getting replacement RAM.
| What does the "segfault at X" kernel log message mean if X is very large? |
1,715,075,386,000 |
I needed to enable SCSI support in CentOS 7.9 so I followed the instructions here:
https://wiki.centos.org/HowTos(2f)I_need_the_Kernel_Source.html
to add SCSI support and recompile, which worked as expected, but instead of uname -r reporting 3.10.0-1160.108.1.el7.x86_64, it only reports 3.10.0, and the vmlinuz files it creates in /boot are also named this way.
This despite all the paths in the rpmbuild directories having the full name.
The UTS_RELEASE entry in the include/generated/utsrelease.h file was 3.10.0 so I edited it and recompiled, but it's doing the same thing.
How do I recompile the kernel so that uname -r reports the correct version?
|
By default, uname -r will only give the output of VERSION, PATCHLEVEL & SUBLEVEL as defined by the kernel Makefile as all other settings would by default be blank. In this case, 3.10.0.
However, there is also EXTRAVERSION within the Makefile & LOCALVERSION which can be set during config. As such I would have expected LOCALVERSION to be set to -1160.108.1, but for some reason in this case, it is not.
You can change it by altering General setup -> Local version - append to kernel release. It is just free form text.
You should note that although you expect it to show 3.10.0-1160.108.1.el7.x86_64, I have not seen a single kernel which has ever added on the el7.x86_64 part.
| CentOS 7.9 not reporting full version number after recompiling kernel |
1,715,075,386,000 |
after attempting sudo apt upgrade on a fresh install of parrot os, new kernel update is present but trying to boot into it from grub gives gives me a kernel panic.
here is what i tried and with what errors ive been getting:
The following partially installed packages will be configured:
apache2 linux-headers-6.5.0-13parrot1-amd64 linux-headers-amd64
linux-image-6.5.0-13parrot1-amd64 linux-image-amd64
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
Setting up linux-headers-6.5.0-13parrot1-amd64 (6.5.13-1parrot1) ...
/etc/kernel/header_postinst.d/dkms:
dkms: running auto installation service for kernel 6.5.0-13parrot1-amd64.
Sign command: /lib/modules/6.5.0-13parrot1-amd64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Building module:
Cleaning build area...
'make' -j8 KVER=6.5.0-13parrot1-amd64 KSRC=/lib/modules/6.5.0-13parrot1-amd64/build........(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.5.0-13parrot1-amd64 (x86_64)
Consult /var/lib/dkms/realtek-rtl8188eus/5.3.9~git20230101.f8ead57/build/make.log for more information.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
dkms: autoinstall for kernel: 6.5.0-13parrot1-amd64 failed!
run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 11
Failed to process /etc/kernel/header_postinst.d at /var/lib/dpkg/info/linux-headers-6.5.0-13parrot1-amd64.postinst line 11.
dpkg: error processing package linux-headers-6.5.0-13parrot1-amd64 (--configure):
installed linux-headers-6.5.0-13parrot1-amd64 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-headers-amd64:
linux-headers-amd64 depends on linux-headers-6.5.0-13parrot1-amd64 (= 6.5.13-1parrot1); however:
Package linux-headers-6.5.0-13parrot1-amd64 is not configured yet.
dpkg: error processing package linux-headers-amd64 (--configure):
dependency problems - leaving unconfigured
Setting up linux-image-6.5.0-13parrot1-amd64 (6.5.13-1parrot1) ...
/etc/kernel/postinst.d/dkms:
dkms: running auto installation service for kernel 6.5.0-13parrot1-amd64.
Sign command: /lib/modules/6.5.0-13parrot1-amd64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Building module:
Cleaning build area...
'make' -j8 KVER=6.5.0-13parrot1-amd64 KSRC=/lib/modules/6.5.0-13parrot1-amd64/build.........(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.5.0-13parrot1-amd64 (x86_64)
Consult /var/lib/dkms/realtek-rtl8188eus/5.3.9~git20230101.f8ead57/build/make.log for more information.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
dkms: autoinstall for kernel: 6.5.0-13parrot1-amd64 failed!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
dpkg: error processing package linux-image-6.5.0-13parrot1-amd64 (--configure):
installed linux-image-6.5.0-13parrot1-amd64 package post-installation script subprocess returned error exit status 1
Setting up apache2 (2.4.57-2) ...
info: Switch to mpm prefork for package libapache2-mod-php8.2: No action required
info: Executing deferred 'a2enmod php8.2' for package libapache2-mod-php8.2
Can't locate if.pm in @INC (you may need to install the if module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/x86_64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at /usr/sbin/a2enmod line 15.
BEGIN failed--compilation aborted at /usr/sbin/a2enmod line 15.
dpkg: error processing package apache2 (--configure):
installed apache2 package post-installation script subprocess returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-amd64:
linux-image-amd64 depends on linux-image-6.5.0-13parrot1-amd64 (= 6.5.13-1parrot1); however:
Package linux-image-6.5.0-13parrot1-amd64 is not configured yet.
dpkg: error processing package linux-image-amd64 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-headers-6.5.0-13parrot1-amd64
linux-headers-amd64
linux-image-6.5.0-13parrot1-amd64
apache2
linux-image-amd64
Scanning application launchers
Removing duplicate launchers or broken launchers
Launchers are updated
E: Sub-process /usr/bin/dpkg returned an error code (1)
Setting up linux-headers-6.5.0-13parrot1-amd64 (6.5.13-1parrot1) ...
/etc/kernel/header_postinst.d/dkms:
dkms: running auto installation service for kernel 6.5.0-13parrot1-amd64.
/usr/sbin/dkms: line 2497: echo: write error: Broken pipe
Sign command: /lib/modules/6.5.0-13parrot1-amd64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Building module:
Cleaning build area...
'make' -j8 KVER=6.5.0-13parrot1-amd64 KSRC=/lib/modules/6.5.0-13parrot1-amd64/build.........(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.5.0-13parrot1-amd64 (x86_64)
Consult /var/lib/dkms/realtek-rtl8188eus/5.3.9~git20230101.f8ead57/build/make.log for more information.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
dkms: autoinstall for kernel: 6.5.0-13parrot1-amd64 failed!
run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 11
Failed to process /etc/kernel/header_postinst.d at /var/lib/dpkg/info/linux-headers-6.5.0-13parrot1-amd64.postinst line 11.
dpkg: error processing package linux-headers-6.5.0-13parrot1-amd64 (--configure):
installed linux-headers-6.5.0-13parrot1-amd64 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-headers-amd64:
linux-headers-amd64 depends on linux-headers-6.5.0-13parrot1-amd64 (= 6.5.13-1parrot1); however:
Package linux-headers-6.5.0-13parrot1-amd64 is not configured yet.
dpkg: error processing package linux-headers-amd64 (--configure):
dependency problems - leaving unconfigured
Setting up linux-image-6.5.0-13parrot1-amd64 (6.5.13-1parrot1) ...
/etc/kernel/postinst.d/dkms:
dkms: running auto installation service for kernel 6.5.0-13parrot1-amd64.
/usr/sbin/dkms: line 2497: echo: write error: Broken pipe
Sign command: /lib/modules/6.5.0-13parrot1-amd64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Building module:
Cleaning build area...
'make' -j8 KVER=6.5.0-13parrot1-amd64 KSRC=/lib/modules/6.5.0-13parrot1-amd64/build........(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.5.0-13parrot1-amd64 (x86_64)
Consult /var/lib/dkms/realtek-rtl8188eus/5.3.9~git20230101.f8ead57/build/make.log for more information.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
dkms: autoinstall for kernel: 6.5.0-13parrot1-amd64 failed!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
dpkg: error processing package linux-image-6.5.0-13parrot1-amd64 (--configure):
installed linux-image-6.5.0-13parrot1-amd64 package post-installation script subprocess returned error exit status 1
Setting up apache2 (2.4.57-2) ...
info: Switch to mpm prefork for package libapache2-mod-php8.2: No action required
info: Executing deferred 'a2enmod php8.2' for package libapache2-mod-php8.2
Can't locate if.pm in @INC (you may need to install the if module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/x86_64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at /usr/sbin/a2enmod line 15.
BEGIN failed--compilation aborted at /usr/sbin/a2enmod line 15.
dpkg: error processing package apache2 (--configure):
installed apache2 package post-installation script subprocess returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-amd64:
linux-image-amd64 depends on linux-image-6.5.0-13parrot1-amd64 (= 6.5.13-1parrot1); however:
Package linux-image-6.5.0-13parrot1-amd64 is not configured yet.
dpkg: error processing package linux-image-amd64 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-headers-6.5.0-13parrot1-amd64
linux-headers-amd64
linux-image-6.5.0-13parrot1-amd64
apache2
linux-image-amd64
im sure the error lies in the last lines:
Errors were encountered while processing:
linux-headers-6.5.0-13parrot1-amd64
linux-headers-amd64
linux-image-6.5.0-13parrot1-amd64
apache2
linux-image-amd64
i dont know what to do from here, sudo dpkg --configure -a & sudo apt --fix-broken install all result in the same issue, might be a configuration problem.
if you need any extra information let me know and thanks for your time
|
Non-configured linux-image and linux-headers are solved by:
Booting the previous kernel
Removing dkms
Upgrading the kernel
Reinstalling dkms
Building the rtl8188eus
To solve the following error:
dpkg: error processing package apache2 (--configure):
installed apache2 package post-installation script subprocess returned error exit status 2
Run the following commands:
sudo apt clean
sudo mv /var/lib/dpkg/info/apache2 /tmp/
sudo dpkg --remove --force-remove-reinstreq apache2
To solve :
W: Possible missing firmware /lib/firmware/*
Here is a detailed answer on U&L.
| kernel panic after after parrotOS upgrade |
1,715,075,386,000 |
I installed the v4l2loopback kernel module on my machine and enabled it with sudo modprobe v4l2loopback exclusive_caps=1.
I created a camera on /dev/video0 with the rust bindings and started piping a static image to the camera (command from the wiki):
sudo ffmpeg -loop 1 -re -i 60828015.jpg -f v4l2 -vcodec rawvideo -pix_fmt yuv420p /dev/video0
I'm running this on a VPS with no desktop environment, so I quickly spun up a Docker container with noVNC and a desktop environment to test everything (sudo docker run --rm -it --device /dev/video0 --privileged -p 8090:8080 theasp/novnc). Everything looks fine and if i run ffplay /dev/video0, I can successfully view the image in the camera. The problem now is with other applications.
Cheese doesn't even detect the camera. Chromium detects the camera but cannot use it:
[15749:15755:1024/025614.520951:ERROR:v4l2_capture_delegate.cc(1138)] Dequeued v4l2 buffer contains invalid length (11441 bytes).
Not sure what I'm doing wrong and why Chromium cannot read from the camera.
kernel version: 5.4.0-164-generic
v4l2loopback version: commit 5bb9bed on the main branch (latest one right now)
module paramaters: exclusive_caps=1
FFmpeg pipe logs:
ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, image2, from 'input.jpg':
Duration: 00:00:00.04, start: 0.000000, bitrate: 1854 kb/s
Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 360x287 [SAR 96:96 DAR 360:287], 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> rawvideo (native))
Press [q] to stop, [?] for help
[swscaler @ 0x55b19c9fab80] deprecated pixel format used, make sure you did set range correctly
Output #0, video4linux2,v4l2, to '/dev/video0':
Metadata:
encoder : Lavf58.29.100
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 360x287 [SAR 1:1 DAR 360:287], q=2-31, 30996 kb/s, 25 fps, 25 tbn, 25 tbc
Metadata:
encoder : Lavc58.54.100 rawvideo
frame= 2277 fps= 25 q=-0.0 size=N/A time=00:01:31.08 bitrate=N/A speed= 1x
|
From https://github.com/umlaeute/v4l2loopback/wiki/Faq
Depending on the color encoding, odd-sized frames can be problematic (eg YUV420p requires that the U and V planes are downsampled by a factor of 2, which works best if the width and height can be divided by 2). See also Issue #561
I changed the image size and the error disappeared.
| Chromium cannot read camera: Dequeued v4l2 buffer contains invalid length #561 |
1,715,075,386,000 |
I'm trying to build a driver for a USB to HDMI adapter...
Bus 001 Device 010: ID 534d:6021 MacroSilicon VGA Display Adapter
NOTE: "lsusb" output.
... but this error is occurring...
Fatal error: Invalid --compress-debug-sections option: `zstd'
...as can be seen in the full output below...
[eduardolac@eduardolac-pc ms912x]$ make all -j
make CHECK="/usr/bin/sparse" -C /lib/modules/6.5.5-1-MANJARO/build M=/home/eduardolac/Data1/Temp/20231016.1224.0/ms912x modules
make[1]: Entering directory '/usr/lib/modules/6.5.5-1-MANJARO/build'
CC [M] /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x/ms912x_registers.o
CC [M] /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x/ms912x_connector.o
CC [M] /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x/ms912x_transfer.o
CC [M] /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x/ms912x_drv.o
Assembler messages:
Fatal error: Invalid --compress-debug-sections option: `zstd'
make[3]: *** [scripts/Makefile.build:243: /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x/ms912x_connector.o] Error 1
make[3]: *** Waiting for unfinished jobs....
Assembler messages:
Fatal error: Invalid --compress-debug-sections option: `zstd'
make[3]: *** [scripts/Makefile.build:243: /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x/ms912x_registers.o] Error 1
Assembler messages:
Fatal error: Invalid --compress-debug-sections option: `zstd'
make[3]: *** [scripts/Makefile.build:243: /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x/ms912x_transfer.o] Error 1
Assembler messages:
Fatal error: Invalid --compress-debug-sections option: `zstd'
make[3]: *** [scripts/Makefile.build:243: /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x/ms912x_drv.o] Error 1
make[2]: *** [/usr/lib/modules/6.5.5-1-MANJARO/build/Makefile:2034: /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x] Error 2
make[1]: *** [Makefile:234: __sub-make] Error 2
make[1]: Leaving directory '/usr/lib/modules/6.5.5-1-MANJARO/build'
make: *** [Makefile:15: modules] Error 2
The "ld" available on my system does not support the "zstd" option for the "compress-debug-sections" parameter...
[eduardolac@eduardolac-pc ms912x]$ ld --help | grep "compress-debug-sections"
--compress-debug-sections=[none|zlib|zlib-gnu|zlib-gabi]
... but the "binutils" package (which contains "ld") that I have installed on my OS is version 2.41-3, which according to this documentation
( https://sourceware.org/binutils/docs/binutils.html ) already supports the "zstd" option for the "compress-debug-sections" parameter.
The Kernel I have installed is 6.5.X .
Please help me with this. üëÄ
Thanks! ü§ó
Further...
https://askubuntu.com/a/1488791/134723
https://github.com/rhgndf/ms912x/issues/5
https://github.com/rhgndf/ms912x
|
The problem occurs because the "ld" binary used in my case, for some reason, was provided by "Homebrew"...
[eduardolac@eduardolac-pc ms912x]$ pacman -Qo ld
error: No package owns /home/linuxbrew/.linuxbrew/bin/ld
So the solution, for me, was to remove "Homebrew", as I wasn't using it for anything...
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
And as a precaution I reinstalled binutils...
yay -Rdd binutils
yay -S binutils
So finally, just open and close the terminal and voilà...
[eduardolac@eduardolac-pc ~]$ ld --version
GNU ld (GNU Binutils) 2.41.0
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
Thanks! üòò
[Ref(s).: https://stackoverflow.com/a/64722984/3223785 ]
| “binutils”/Kernel 6.5.X - “Invalid –compress-debug-sections option: `zstd’” |
1,696,596,440,000 |
I'm on an Arch system with LUKS and BRTFS and I recently installed linux-zen, but it doesn't show up anywhere in grub. I've tried grub-mkconfig -o /boot/grub/grub.cfg, but it does nothing, even though it says it found linux image: /boot/vmlinuz-linux-zen.
The full output of grub-mkconfig is below:
Generating grub configuration file ...
Found theme: /boot/grub/themes/fallout-grub-theme/theme.txt
Found linux image: /boot/vmlinuz-linux-zen
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux-zen.img
Found fallback initrd image(s) in /boot: intel-ucode.img initramfs-linux-zen-fallback.img
Found linux image: /boot/vmlinuz-linux-lqx
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux-lqx.img
Found fallback initrd image(s) in /boot: intel-ucode.img initramfs-linux-lqx-fallback.img
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: intel-ucode.img initramfs-linux-fallback.img
Adding boot menu entry for UEFI Firmware Settings ...
Detecting snapshots ...
No snapshots found.
If you think an error has occurred, please file a bug report at "https://github.com/Antynea/grub-btrfs"
Unmount /tmp/grub-btrfs.dRwuoNA1Do .. Success
done
Here is my /etc/default/grub
# GRUB boot loader configuration
GRUB_DEFAULT="0"
GRUB_TIMEOUT="5"
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet nvidia-drm.modset=1"
GRUB_CMDLINE_LINUX=""
#START ME STUFF
GRUB_DISABLE_SUBMENU="y"
GRUB_DEFAULT="saved"
GRUB_SAVEDEFAULT="true"
#END ME STUFF
# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"
# Uncomment to enable booting from LUKS encrypted devices
GRUB_ENABLE_CRYPTODISK="y"
# Set to 'countdown' or 'hidden' to change timeout behavior,
# press ESC key to display menu.
GRUB_TIMEOUT_STYLE="menu"
# Uncomment to use basic console
#GRUB_TERMINAL_INPUT="console"
# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT="console"
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `videoinfo'
GRUB_GFXMODE="auto"
# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX="keep"
# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID="true"
# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY="true"
# Uncomment and set to the desired menu colors. Used by normal and wallpaper
# modes only. Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"
# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
GRUB_THEME="/boot/grub/themes/fallout-grub-theme/theme.txt"
# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"
# Uncomment to make GRUB remember the last selection. This requires
# setting 'GRUB_DEFAULT=saved' above.
#GRUB_SAVEDEFAULT="true"
# Uncomment to disable submenus in boot menu
#GRUB_DISABLE_SUBMENU="y"
# Probing for other operating systems is disabled for security reasons. Read
# documentation on GRUB_DISABLE_OS_PROBER, if still want to enable this
# functionality install os-prober and uncomment to detect and include other
# operating systems.
GRUB_DISABLE_OS_PROBER="false"
GRUB_THEME="/boot/grub/themes/fallout-grub-theme/theme.txt"
The other weird part is that my /boot/grub contains references to the zen kernel but that is not reflected in startup.
|
So my issue was the presence of systemd-boot. A simple sudo bootctl remove got me into grub, although there were some issues with my root device's UUID being set wrong, so be careful before uninstalling your bootloader.
| grub not adding newly installed kernel to list |
1,696,596,440,000 |
What is the method to calculate these parameters in uboot ? :
bootm_low=0
bootm_size=7ff00000
fdt_addr_r=0x40000000
fdt_high=0x100000
fdt_size_r=0x400000
fdtcontroladdr=7bc971c0
kernel_addr_r=0x18000000
kernel_comp_addr_r=0x30000000
kernel_comp_size=0x3C00000
kernel_size_r=0x10000000
loadaddr=0x8000000
pxefile_addr_r=0x10000000
ramdisk_addr_r=0x02100000
My boot command :
fatload mmc 0:1 $kernel_addr_r Image.gz
fatload mmc 0:1 $fdt_addr_r system.dtb
booti $kernel_addr_r - $fdt_addr_r
I have 4G or DRAM on an A53. My kernel has different behavior when I change one of these parameter.
I also use the fdt_high parameter because I can't boot my kernel without but I don't know how to calculate the right value.
Thanks for help
|
Solved.
It was a RAM configuration issue.
I have 2GB, not 4GB.
I changed the memory section in device tree and I use the default address values in uboot parameters and it works.
| uboot kernel and dtb calculation |
1,696,596,440,000 |
I am customizing a Linux system with a Linux kernel version of 6.4.0. I executed mdev -s in rcS and checked the startup print, which was also successful. When I entered the live environment, I saw that the name of the network card was enp2s0. However, after startup, I found that enp2s0 could not be found. I don't know what's going on? I have checked the kernel configuration and found that the network driver is compiled.
rcS:
echo PATH=/sbin:/bin:/usr/bin:/usr/sbin
echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/lib:/lib64
mount -a
source /etc/profile
mkdir /dev/pts -p
mount -t devpts devpts /dev/pts
mdev -s
if [ $? -eq 0 ]; then
echo "mdev -s executed successfully."
else
echo "mdev -s execution failed."
fi
ip addr add 192.168.5.2/24 dev enp2s0
Screenshot of error reporting:
|
The problem has been solved because the network card driver is incorrect. First, enter the live environment, execute lspci | grep -i ethernet to see what model of your network card is, and then compile it into the kernel.
Device Drivers->Network device support->Ethernet driver support->(the model of your network card)
| Unable to find network card after executing mdev - s? |
1,696,596,440,000 |
I am developing an all-flash storage application. I found that mount bind has strange behavior on NVMe device power off/on.
Distro: SUSE Linux Enterprise Server 15 SP4 5.14.21-150400.24.46-default
Mount partition /dev/nvme10n1p1 to /mnt/10n1p1
# mount --bind /dev/nvme10n1p1 /mnt/10n1p1
# lsblk /mnt/10n1p1
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme10n1p1 259:11 0 3.6T 0 part
# stat /dev/nvme10n1p1
File: /dev/nvme10n1p1
Size: 0 Blocks: 0 IO Block: 4096 block special file
Device: 5h/5d Inode: 23620 Links: 1 Device type: 103,b
# stat /mnt/10n1
File: /mnt/10n1
Size: 0 Blocks: 0 IO Block: 4096 block special file
Device: 5h/5d Inode: 23620 Links: 1 Device type: 103,b
Power off/on nvme device in short time to simulate hot-plug or power surge.
# ls -lat /sys/block | grep "nvme10n1"
.../0000:be:00.0/nvme/nvme2/nvme10n1
# lspci -vmms 0000:be:00.0
...PhySlot: 168
# date && echo 0|sudo tee /sys/bus/pci/slots/${PHYSLOT}/power
# sleep 5
# date && echo 1|sudo tee /sys/bus/pci/slots/${PHYSLOT}/power
After power off/on mount bind point to new drive which is just power on.
# lsblk /mnt/10n1
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme30n2 259:11 0 3.6T 0 disk
└─nvme30n2p1 259:51 0 3.6T 0 part
# stat /dev/nvme30n2
File: /dev/nvme30n2
Size: 0 Blocks: 0 IO Block: 4096 block special file
Device: 5h/5d Inode: 24836 Links: 1 Device type: 103,b
After advance test, I found that mount bind even could point to another drive which is power on in short time after original drive is power off.
# mount --bind /dev/nvme0n1p1 /mnt/0n1
# lsblk 0n1
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1p1 259:44 0 3.6T 0 part
# nvme id-ctrl /dev/nvme0n1 | grep sn
sn: : PHLJ043200234P0DGN
# nvme id-ctrl /dev/nvme1n1 | grep sn
sn: : PHLJ043105AU4P0DGN
# PHYSLOT_0=195
# PHYSLOT_1=194
# date && echo 0|sudo tee /sys/bus/pci/slots/${PHYSLOT_1}/power
# sleep 5
# date && echo 0|sudo tee /sys/bus/pci/slots/${PHYSLOT_0}/power
# sleep 5
# date && echo 1|sudo tee /sys/bus/pci/slots/${PHYSLOT_1}/power
# sleep 5
# date && echo 1|sudo tee /sys/bus/pci/slots/${PHYSLOT_0}/power
# lsblk /mnt/0n1
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme31n2p1 259:44 0 3.6T 0 part
# nvme id-ctrl /dev/nvme31n2 | grep sn
sn : PHLJ043105AU4P0DGN
# nvme id-ctrl /dev/nvme32n2 | grep sn
sn : PHLJ043200234P0DGN
I noticed that after power off/on the mount point's inode number differ from new drive device's inode number, however the mount point's inode and new drive device inode share same minor number. I think this is the reason that original mount point can access new drive device which cause data corruption. My guess is mount point hold a ref to inde of power offed drive which cause inode is not destructed. Then new drive power on and takes the reclaimed minor number which is same as original dirve. I'm not sure if this behavior is expected, or if it's a limitation or a bug of the mount bind.
|
Turns out this is a linux kernel bdev lifecycle bug, and is fixed in version 5.15.
Related patch linked here.
| Mount bind point to incorrect NVMe device after power off/on device |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.