date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,682,888,655,000 |
I am running Linux Mint 20.3 . Should I update the Linux Firmware that Update Manager is showing if I am not also updating the Kernel update offered? I hesitate to update the 5.4.0-42 Kernel because I am afraid it will replace the driver I am using for my Realtek RTL8125 2.6GbE Network Card (which I had a devil of a time installing).
|
If everything works fine, there's no need to update the Linux firmware package.
| Should I update the linux firmware if I am not updating the kernel? |
1,682,888,655,000 |
I'm trying to know the difference between changing something in the name of the kernel in the grub menu vs changing the content of the name of the kernel in the .conf file in the /boot/loader/entries.
If I change something in the grub, it does not affect the content of the .conf file and i do not know why.
Does anyone have a clue?
|
GRUB is almost completely read-only: the only thing it can write is environment variables into a pre-allocated file, /boot/grub/grubenv - and that only when you explicitly use the save_env command.
When you change something in the GRUB menu or GRUB shell, the change will be non-persistent: it will affect the on-going boot attempt only, and the next time the system is booted, the configuration will be unchanged.
To make persistent changes, you must boot an operating system that includes full-featured, write-capable drivers for the appropriate
disk controller
partitioning/LVM/RAID scheme
filesystem type
and then you'll be able to change the appropriate files the usual way.
(Or if you need to use an OS that cannot support the filesystem type, you technically could use a disk editor to poke at the file contents and filesystem metadata directly at a very low level, but that usually qualifies as pretty high-grade wizardry these days...)
| kernel name in grub menu vs kernel.conf |
1,682,888,655,000 |
There are a lot of configuration files in /etc. Some of them are used by installed applications like samba, but is there confs that are directly looked up by the kernel? For example passwd, groups, hostname and so on? And if so which of them are directly for the kernel?
|
A few words about the Linux kernel and its role.
By itself the kernel does literally nothing. I'm not joking. When you load it, it tries to initialize your hardware and then it tries to execute /sbin/init from the root filesystem (something which is mounted at /), that's it. There's a caveat though.
The kernel itself is a large amount of algorithms which provide API (translation of userspace calls into something which the hardware knows what to do with) for applications to work with and even then those applications don't use these APIs directly, they call them via a middle-man such as, e.g. glibc (C language APIs) or Mesa (OpenGL, Vulkan APIs).
Speaking of the caveat earlier.
The kernel can be instructed to do work via e.g. iptables, nftables to process network packets but then the kernel doesn't generate those packets, it either receives them from outside or sends them as a result of running applications requesting to send them. One minor exception is ping which sort of kinda looks like the kernel is doing work but in order for ping to work, userspace has to instruct the kernel how to configure network. When the kernel boots, there are no network protocols at all.
| What configuration files does linux kernel lookup directly in root filesystem? |
1,682,888,655,000 |
I can not get any reliable information about how do kernel logs get from Kernel Ring Buffer to /proc/kmgs and /dev/kmsg. Is there any source I could have possbily missed or does perhaps anyone know from their head?
|
/proc/kmsg is handled by fs/proc/kmsg.c, /dev/kmsg is handled by the kmsg driver in kernel/printk/printk.c.
In both cases, logs aren’t copied from the ring buffer to the reader until a process reads from the relevant file descriptor.
| How Do Logs Get From "Kernel Ring Buffer" to "/proc/kmgs" and "/dev/kmsg"? |
1,682,888,655,000 |
I have a new SSD, Crucial BX500, on my laptop Acer ES1-732. I have installed a Debian Bullseye distribution.
I often have some ata errors like these:
blk_update_request: I/O error, dev sda, sector 526848 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
ata1.00: status: { DRDY }
ata1.00: cmd ea/00:00:00:00:00/00:00:00:00:00/a0 tag 17
res 40/00:84:b0:0f:cc/00:00:1b:00:00/40 Emask 0x10 (ATA bus error)
ata1.00: failed command: FLUSH CACHE EXT
ata1: SError: { PHYRdyChg CommWake DevExch }
ata1.00: irq_stat 0x00000040, connection status changed
ata1.00: exception Emask 0x10 SAct 0x0 SErr 0x4050000 action 0xe frozen
ata1.00: status: { DRDY }
ata1.00: cmd 61/08:b8:f8:9e:cc/00:00:1b:00:00/40 tag 23 ncq dma 4096 out
res 50/00:00:00:00:00/00:00:00:00:00/a0 Emask 0x10 (ATA bus error)
ata1.00: failed command: WRITE FPDMA QUEUED
ata1: SError: { PHYRdyChg CommWake DevExch }
ata1.00: irq_stat 0x00000040, connection status changed
ata1.00: exception Emask 0x10 SAct 0x800000 SErr 0x4050000 action 0xe frozen
ata1.00: failed command: READ FPDMA QUEUED
ata1.00: status: { DRDY }
ata1.00: cmd 60/08:88:48:09:09/00:00:26:00:00/40 tag 17 ncq dma 4096 in
res 40/00:84:10:09:09/00:00:26:00:00/40 Emask 0x10 (ATA bus error)
ata1.00: failed command: READ FPDMA QUEUED
ata1: SError: { PHYRdyChg CommWake DevExch }
ata1.00: irq_stat 0x00000040, connection status changed
ata1.00: exception Emask 0x10 SAct 0x2060000 SErr 0x4050000 action 0xe frozen
I wonder why there are theses errors, and how to solve the problem. I tried to run badblocks and it didn't report any bad block.
The computer needs the following kernel parameter: pci=nocrs, to avoid a freeze during grub install.
Once installed, I tried to boot with and without this parameter, and it seems there are more often ata errors with pci=nocrs.
Despite these errors, the Linux system seems to work correctly, and I have never seen any crash or freeze, except when installing grub, but it also occurs with the hard drive that came with the laptop, not only with the new SSD.
I tried some kernel parameters: libata.force=noncq and libata.dma=0, but it didn't solve the problem, and strongly reduced the speed of the SSD.
|
The problem was solved by updating the firmware of the SSD.
Crucial website said there was no firmware update for this drive, but I installed Windows 10 and the "Crucial Storage Executive" software. And the software found a firmware update for my SSD.
| ata1.00 errors about a SSD |
1,682,888,655,000 |
we have VM machines (machines are RHEL 7.9), and recently machines RAM memory was update from 32G to 64G
is it possible to verify on which date? memory was update?
|
Your kernel logs at boot should give you the total memory. Did you search through them?
See this previous post in stack exchange.
On my system, I kind of just shotgun with
grep -i ram /var/log/*
Bib in comments notes:
grep -Ei memory.+available /var/log/*
may work better. It does on my test cases.
But on RHEL it may well be /var/log/messages
| how to verify when RAM memory was update on RHEL machine |
1,682,888,655,000 |
System Specs: i7-12700k, RTX 3060, 80 (2X32, 2X8) GB DDR4-3200 RAM, 1 TB M2 NVME SSD
OS: Ubuntu 20.04 LTS, kernel version 5.2.21-050221-generic
Context:
My Motherboard doesn't have WiFi, so I use TP-Link Archer T9UH USB WiFi adapter for WiFi. Unfortunaly, 5.2.21 is the latest kernel version supported by the open source driver for the WiFi adapter. I had installed the 510.60 version of the Nvidia Driver a few months ago. I did not see any issues for a few months. Yesterday, I noticed that the Nvidia Driver is not working.
When I entered: nvidia-smi in the terminal, I got this error:
Failed to initialize NVML: Driver/library version mismatch
I then tried to reinstall the Nvidia Driver 515.76, it broke and when I rebooted, I got a blank screen. Then I tried again, The installation seemed sucessful and when I rebooted, both my Wifi and the ethernet drivers were broken? Then I noticed that the Files was showing Filesystem root and efi as mounted drives, and the GUI was very buggy and slow. It froze and took 10 minutes to move small files when using the GUI.
I am in a but of a pickle. I don't even know where to start. How do I even diagnose the problems here?
I will add any command output in a Edit if needed.
EDIT:
I downloaded the Nvidia Driver 520.56.06 as mentioned by Artem, directly form the Nvidia website , and Installed it.
But Immediately after the installation, My screen went completely black except for a underscore cursor in top left side of the screen.
EDIT_1:
After force Rebooting, The Nvidia Drivers seem to be working. But, the WiFi and ethernet problems are persisting.
|
I have solved the Issue. All these problems occuring together is not a coincidence. I think the kernel version I was using, 5.2.21, was simply too old.
I downloaded the 5.4.x kernel, installed it and booted into it.
This was where I found the files: https://kernel.ubuntu.com/~kernel-ppa/mainline/
You would need 4 .deb packages with the correct cpu architecture (amd64 for Intel/AMD):
linux_headers-5.4.x-xxx_all.deb
linux_headers-5.4.x-xxx-generic/lowlatency_xxx.deb
linux_modules-5.4.x-xxx-generic/lowlatency_xxx.deb
linux-image-unsigned-5.4.x-xxx-generic/lowlatency_xxx.deb
download these manually if you have to and put all of these packages in a signle folder on the target system.
Then install the kernel packages by running the command:
sudo dpkg -i *.deb
Reboot and while rebooting, choose the correct kernel version.
check this by the following command:
uname -r
| Wifi, Ethernet, Graphics Drivers, file system are all buggy. Are these issues related? |
1,682,888,655,000 |
I'm working on a custom headless Linux system running debian Buster on an ARM processor.
Linux kernel 5.10.72
But recently I saw this when looking at my CPU usage:
I believe brcmf is related to the Wi-Fi driver/chip thats being used (the expansion module is a 1DX M.2 module by embedded artists.
I've tried getting perf to work on the system but I just can't.
the other 2 high use kworkers only pop up every now and then and i think they are unrelated, but they do seem to steel some of the CPU of the offending kworker.
The third section of the image is how it looks most of the time.
any advice?
edit with the request by Artem
dmesg output:
edit:
After running
echo l > /proc/sysrq-trigger
dmesg
The new output is:
[ 875.933977] sysrq: Show backtrace of all active CPUs
[ 875.939010] sysrq: CPU0:
[ 875.939017] Call trace:
[ 875.939031] dump_backtrace+0x0/0x1d0
[ 875.939038] show_stack+0x18/0x24
[ 875.939047] showacpu+0x64/0x80
[ 875.939056] flush_smp_call_function_queue+0xd8/0x250
[ 875.939063] generic_smp_call_function_single_interrupt+0x14/0x20
[ 875.939070] ipi_handler+0xa0/0xd0
[ 875.939078] handle_percpu_devid_fasteoi_ipi+0x98/0xb0
[ 875.939084] __handle_domain_irq+0xb0/0x130
[ 875.939092] gic_handle_irq+0xc0/0x140
[ 875.939098] el1_irq+0xcc/0x180
[ 875.939105] _raw_spin_unlock_irqrestore+0x18/0x50
[ 875.939113] sdhci_request+0xac/0xcc
[ 875.939121] __mmc_start_request+0x68/0x140
[ 875.939127] mmc_start_request+0x94/0xc0
[ 875.939133] mmc_wait_for_req+0x70/0x100
[ 875.939140] mmc_io_rw_extended+0x1d4/0x2d0
[ 875.939147] sdio_io_rw_ext_helper+0x194/0x240
[ 875.939153] sdio_readl+0x30/0x60
[ 875.939191] brcmf_sdiod_readl+0x8c/0x9c [brcmfmac]
[ 875.939217] brcmf_sdio_intr_rstatus+0x44/0xec [brcmfmac]
[ 875.939243] brcmf_sdio_dataworker+0x114/0x2430 [brcmfmac]
[ 875.939252] process_one_work+0x1bc/0x340
[ 875.939258] worker_thread+0x70/0x434
[ 875.939265] kthread+0x13c/0x150
[ 875.939271] ret_from_fork+0x10/0x30
|
I finally found a fix to it, It's the same fix as mengxp, but I will explain it a bit better.
Turns out the broadcom driver just doesn't work very well or something, the main issue is the host-wake interrupt. It generates millions of interrupts, however this dts parameter is optional.
So by removing
// interrupt-parent = <&gpio1>;
// interrupts = <13 IRQ_TYPE_LEVEL_LOW>; /* WL HOST WAKE COM pin 36*/
// interrupt-names = "host-wake";
these fields from the device tree the cpu load disappears. And Wi-Fi seems to work fine afterwards.
| kworker hogging CPU but I don't know why |
1,657,537,791,000 |
i have a debian11 ssd server which is installed in RAID 1 MIRRORING
i use the server as webhost and for better performance (whith high volume of users) i need to use RAID 0 so data wil be split across 2 drivers
2 x 1TB disks
QUESTION IS: How to convert from RAID 1 to RAID 0 without reinstalling
the server
|
In my (unfortunately deleted post) I showed the results of testing mdadam (included in Debian) RAID1, RAID0, RAID10, and single disk. The expected RAID1 performance -slightly slower write speed than single disk and nearly same read speed as RAID0- was not observed. After a deep search on the Internet I found an explanation that it is not an error, but a feature. The reason is to give kernel a chance to do two parallel reads for two independent program.
This is not the case in the BSD unix (FreeBSD, NET-BSD, OpenBSD) while it does not use mdadam subsystem.
But I must agree that while using SSD the disk performance (RAID0,1 none) may not be your main problem.
You did not described the server component: web-server (Apache/Lighttp/...), application module (PHP/python/...), database (mysql/postgres/...), number of CPU cores, amount of RAM, what kind of services it realises (static pages/dynamic pages/heavy downloads/...)
If I strictly answer your question: migration from RAID1 to RAID0 cannot be realised on-line. You have to stop the server, make backup to an external disk, then reconfigure the RAID0. It could be more easy, if you have some independent system disk. If not, you must reconfigure the RAID while installing the new Linux OS.
But with respect to comments above, it is highly recommended NOT to do this. The RAID1 is mainly used on server for better data protection.
| Debian: convert from RAID1 to RAID 0 |
1,657,537,791,000 |
Dual booting Regolith 1.6 and Windows 11 on separate drives (windows ssd / regolith hdd). The total boot time from GRUB to entering the password is about 1m40s which seems a little high even for a HDD.
Command output:
inxi -Fxz:
System: Kernel: 5.11.0-49-generic x86_64 bits: 64 compiler: gcc v: 10.2.1 Desktop: GNOME
Distro: Ubuntu 21.04 (Hirsute Hippo)
Machine: Type: Desktop System: MSI product: MS-7A37 v: 1.0 serial: <filter>
Mobo: MSI model: B350M MORTAR (MS-7A37) v: 1.0 serial: <filter> UEFI: American Megatrends
v: 1.MW date: 11/01/2021
Battery: Device-1: hidpp_battery_0 model: Logitech G604 Wireless Gaming Mouse
charge: 55% (should be ignored) status: Discharging
CPU: Info: 6-Core model: AMD Ryzen 5 1600X bits: 64 type: MT MCP arch: Zen rev: 1
L2 cache: 3 MiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 91204
Speed: 3800 MHz min/max: N/A Core speeds (MHz): 1: 3800 2: 3800 3: 3800 4: 3111 5: 3800
6: 3800 7: 3800 8: 3800 9: 3800 10: 3153 11: 3800 12: 3800
Graphics: Device-1: NVIDIA GP106 [GeForce GTX 1060 6GB] vendor: Micro-Star MSI driver: nvidia
v: 495.46 bus ID: 26:00.0
Display: x11 server: X.Org 1.20.11 driver: loaded: nvidia resolution: 1: 1920x1080
2: 1920x1080~60Hz 3: 1080x1920~60Hz
OpenGL: renderer: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2 v: 4.6.0 NVIDIA 495.46
direct render: Yes
Audio: Device-1: NVIDIA GP106 High Definition Audio vendor: Micro-Star MSI driver: snd_hda_intel
v: kernel bus ID: 26:00.1
Device-2: AMD Family 17h HD Audio vendor: Micro-Star MSI driver: snd_hda_intel v: kernel
bus ID: 28:00.3
Device-3: Kingston HyperX SoloCast type: USB driver: hid-generic,snd-usb-audio,usbhid
bus ID: 3-2:3
Device-4: C-Media Audio Adapter (Unitek Y-247A) type: USB
driver: hid-generic,snd-usb-audio,usbhid bus ID: 1-5:2
Device-5: Logitech Webcam C270 type: USB driver: snd-usb-audio,uvcvideo bus ID: 1-6:3
Sound Server: ALSA v: k5.11.0-49-generic
Network: Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Micro-Star MSI
driver: r8169 v: kernel port: f000 bus ID: 22:00.0
IF: enp34s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives: Local Storage: total: 3.17 TiB used: 381.22 GiB (11.8%)
ID-1: /dev/sda vendor: Kingston model: SA400S37480G size: 447.13 GiB
ID-2: /dev/sdb vendor: Seagate model: ST2000DM008-2FR102 size: 1.82 TiB
ID-3: /dev/sdc vendor: Seagate model: ST1000DM010-2EP102 size: 931.51 GiB
Partition: ID-1: / size: 393.18 GiB used: 10.67 GiB (2.7%) fs: ext4 dev: /dev/sdc2
ID-2: /boot/efi size: 335.7 MiB used: 32.3 MiB (9.6%) fs: vfat dev: /dev/sda1
Swap: ID-1: swap-1 type: partition size: 29.34 GiB used: 0 KiB (0.0%) dev: /dev/sdc3
Sensors: System Temperatures: cpu: 44.9 C mobo: N/A gpu: nvidia temp: 58 C
Fan Speeds (RPM): N/A gpu: nvidia fan: 0%
Info: Processes: 313 Uptime: 33m Memory: 15.57 GiB used: 2.33 GiB (15.0%) Init: systemd
runlevel: 5 Compilers: gcc: 10.3.0 clang: 12.0.0-3ubuntu1~21.04.2 Packages: 1641
Shell: Bash v: 5.1.4 inxi: 3.3.01
systemd-analyze:
Startup finished in 18.473s (firmware) + 4.941s (loader) + 1min 9.059s (kernel) + 37.129s (userspace) = 2min 9.603s
graphical.target reached after 37.124s in userspace
systemd-analyze blame | head -5
30.145s udisks2.service
7.706s NetworkManager-wait-online.service
4.216s networkd-dispatcher.service
3.106s NetworkManager.service
2.948s accounts-daemon.service
systemd-analyze critical-chain
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.
graphical.target @37.124s
└─udisks2.service @6.977s +30.145s
└─dbus.socket @6.714s
└─basic.target @6.714s
└─sockets.target @6.714s
└─uuidd.socket @6.714s
└─sysinit.target @6.656s
└─swap.target @6.656s
└─dev-disk-by\x2duuid-628081aa\x2d21b7\x2d4ec7\x2d821f\x2dd6f61598b307.swap @6.470s +185ms
└─dev-disk-by\x2duuid-628081aa\x2d21b7\x2d4ec7\x2d821f\x2dd6f61598b307.device @6.469s
blkid
/dev/sda1: LABEL_FATBOOT="SYSTEM" LABEL="SYSTEM" UUID="0A30-49D0" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="f40d85e0-0af4-4444-acdd-b2360bf3ff53"
/dev/sda2: LABEL="Windows" BLOCK_SIZE="512" UUID="01D80A5E8CC8C0C0" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="b7d369cd-24d2-4865-add7-fd2180184e98"
/dev/sda3: BLOCK_SIZE="512" UUID="08B621A3B621926C" TYPE="ntfs" PARTUUID="76907b38-167d-4f62-88af-88c16393922a"
/dev/sr0: BLOCK_SIZE="2048" UUID="2020-08-13-18-34-00-0" TYPE="iso9660"
/dev/sdb1: LABEL_FATBOOT="EFI" LABEL="EFI" UUID="67E3-17ED" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="eca237fd-5708-468d-a539-6e750c598a48"
/dev/sdb2: LABEL="Games" BLOCK_SIZE="512" UUID="86A9BF0D12EF743C" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="000004c1-6850-e4cf-37d7-d70182090000"
/dev/sdb3: LABEL="Software" BLOCK_SIZE="512" UUID="01D83B0FE0F09100" TYPE="ntfs" PARTLABEL="Software" PARTUUID="00000b39-17d0-e5cc-37d7-d77d72160000"
/dev/sdc1: LABEL="Media" BLOCK_SIZE="512" UUID="01D85F413D9927F0" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="0000007b-51e0-3d4d-415f-d801f6000000"
/dev/sdc2: UUID="4cf3641b-ffc4-41bf-9602-d093aa4c8684" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="7f296866-6ba3-4c15-a265-47aefa7086ed"
/dev/sdc3: UUID="628081aa-21b7-4ec7-821f-d6f61598b307" TYPE="swap" PARTUUID="dc63d6af-e6a4-4843-8e42-8ee63c578863"
/dev/sdc4: UUID="C4D3-E100" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="c8c8bed4-29ca-44db-a822-2565094fb27c"
cat /var/log/syslog (lines with the biggest time differences)
May 5 12:13:14 vain-pc kernel: [ 3.726308] input: Logitech G604 as /devices/pci0000:00/0000:00:01.3/0000:03:00.0/usb1/1-9/1-9:1.2/0003:046D:C539.000D/0003:046D:4085.000E/input/input30
May 5 12:13:14 vain-pc kernel: [ 3.726414] logitech-hidpp-device 0003:046D:4085.000E: input,hidraw13: USB HID v1.11 Keyboard [Logitech G604 ] on usb-0000:03:00.0-9/input2:1
May 5 12:13:14 vain-pc kernel: [ 34.365976] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
May 5 12:13:14 vain-pc kernel: [ 34.367804] ata2.00: configured for UDMA/100
May 5 12:13:14 vain-pc kernel: [ 59.694597] fbcon: Taking over console
May 5 12:13:14 vain-pc kernel: [ 59.694675] Console: switching to colour frame buffer device 128x48
May 5 12:13:14 vain-pc kernel: [ 65.093961] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
May 5 12:13:14 vain-pc kernel: [ 65.096164] ata2.00: configured for UDMA/100
May 5 12:13:14 vain-pc kernel: [ 65.205957] raid6: avx2x4 gen() 23728 MB/s
May 5 12:13:14 vain-pc kernel: [ 65.273956] raid6: avx2x4 xor() 7558 MB/s
May 5 12:13:14 vain-pc kernel: [ 65.341956] raid6: avx2x2 gen() 26037 MB/s
May 5 12:13:14 vain-pc kernel: [ 65.409956] raid6: avx2x2 xor() 16538 MB/s
May 5 12:13:14 vain-pc kernel: [ 65.477956] raid6: avx2x1 gen() 23465 MB/s
May 5 12:13:14 vain-pc kernel: [ 65.545956] raid6: avx2x1 xor() 16198 MB/s
May 5 12:13:14 vain-pc kernel: [ 65.613955] raid6: sse2x4 gen() 15787 MB/s
May 5 12:13:14 vain-pc kernel: [ 65.681957] raid6: sse2x4 xor() 7991 MB/s
May 5 12:13:14 vain-pc kernel: [ 65.749955] raid6: sse2x2 gen() 17775 MB/s
May 5 12:13:14 vain-pc kernel: [ 65.817956] raid6: sse2x2 xor() 11033 MB/s
May 5 12:13:14 vain-pc kernel: [ 65.885956] raid6: sse2x1 gen() 13313 MB/s
May 5 12:13:14 vain-pc kernel: [ 65.953956] raid6: sse2x1 xor() 9284 MB/s
Please let me know if there is any other info you would need from me. The only three partitions this linux install actually uses (from the blkid):
/dev/sdc2 - ext4 root
/dev/sdc3 - swap
/dev/sdc4 - fat32 EFI system
I am not sure if it's relevant but after I select the boot option from GRUB it black screens a bit and then most of the starting time is spent with the BIOS screen showing (but its not able to take the input from the key to go into BIOS settings, so it is just the image).
EDIT: Command sudo journalctl -xb -u udisks2 output:
-- Journal begins at Thu 2022-05-05 01:31:49 EEST, ends at Thu 2022-05-05 23:53:41 EEST. --
mai 05 23:42:06 vain-pc systemd[1]: Starting Disk Manager...
░░ Subject: A start job for unit udisks2.service has begun execution
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit udisks2.service has begun execution.
░░
░░ The job identifier is 150.
mai 05 23:42:06 vain-pc udisksd[891]: udisks daemon version 2.9.2 starting
mai 05 23:42:09 vain-pc udisksd[891]: failed to load module mdraid: libbd_mdraid.so.2: cannot open shared >
mai 05 23:42:09 vain-pc udisksd[891]: Failed to load the 'mdraid' libblockdev plugin
mai 05 23:42:36 vain-pc systemd[1]: Started Disk Manager.
░░ Subject: A start job for unit udisks2.service has finished successfully
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit udisks2.service has finished successfully.
░░
░░ The job identifier is 150.
mai 05 23:42:36 vain-pc udisksd[891]: Acquired the name org.freedesktop.UDisks2 on the system message bus
mai 05 23:42:36 vain-pc udisksd[891]: Cleaning up mount point /media/vain-dev/2020-08-13-18-34-00-0 (devic>
EDIT:
contents of udisks2.conf
[udisks2]
modules=*
modules_load_preference=ondemand
[defaults]
encryption=luks1
|
Here's a clue:
30.145s udisks2.service
Especially if this is what it seems to be:
/dev/sr0: BLOCK_SIZE="2048" UUID="2020-08-13-18-34-00-0" TYPE="iso9660"
You have a CDROM or DVD drive with a optical medium in there. It might simply take a lot of time to spin up. Try taking out the medium there, and you might save a lot of your udisk time.
It's also intriguing that your log tells you something about raid6, without you using RAID; do you maybe have some leftover RAID configuration?
| Regolith 1.6 (21.04) / Ubuntu 21.04 is taking too long to boot |
1,657,537,791,000 |
I am writing my own rootkit to learn about Linux kernels. I wanted to hook into a syscall and alter the credentials of the current task to be that of roots (i.e.euid=0). I saw you could do this with unused signals when running kill. If you hooked into kill you could grab the signal, check if it matches the one you set, and then run your function to alter the credentials giving the current user root.
However, this does not work when hooking into other syscalls like mkdir. This is because the current process when running mkdir is mkdir itself. However, the current process when running kill, is my zsh shell, therefore giving me root.
I wanted to get root when hooking mkdir but for the reasons mentioned above, this doesn't work and only changes mkdir to run as root, not my zsh instance.
I was reading some pages from LWN (https://static.lwn.net/images/pdf/LDD3/ch02.pdf) and it says "During the execution of a system call, such as open or read, the current process is the one that invoked the call." That leads me to believe the current process of mkdir should be zsh, as that is the process that invoked the call.
Here is my code hooking into mkdir
static asmlinkage long (*orig_mkdir)(const struct pt_regs *);
asmlinkage int fh_sys_mkdir(const struct pt_regs *regs)
{
void set_root(void);
printk(KERN_INFO "Intercepting mkdir call");
char __user *pathname = (char *)regs->di;
char dir[255] = {0};
long err = strncpy_from_user(dir, pathname, 254);
if (err > 0)
{
printk(KERN_INFO "rootkit: trying to create directory with name: %s\n", dir);
}
if ( (strcmp(dir, "GetR00t") == 0) )
{
//execl(SHELL, "sh", NULL);
printk(KERN_INFO "rootkit: giving root...\n");
set_root();
return 0;
}
printk(KERN_INFO "ORIGINAL CALL");
return orig_mkdir(regs);
}
Here is how I am altering the credentials to achieve root.
void set_root(void)
{
printk(KERN_INFO "set_root called");
printk(KERN_INFO "The process is \"%s\" (pid %i)\n", current->comm, current->pid);
struct cred *root;
root = prepare_creds();
if (root == NULL)
{
printk(KERN_INFO "root is NULL");
return;
}
printk(KERN_INFO "Setting privileges... ");
/* Run through and set all the various *id's of the current user and set them all to 0 (root) */
root->uid.val = root->gid.val = 0;
root->euid.val = root->egid.val = 0;
root->suid.val = root->sgid.val = 0;
root->fsuid.val = root->fsgid.val = 0;
/* Set the credentials to root */
printk(KERN_INFO "Commiting creds");
commit_creds(root);
}
Here is the logs showing the pid when i run kill and when i run mkdir:
$ sudo tail /var/log/syslog
[...SNIP...]
Jan 22 10:44:43 kali kernel: [ 6170.003662] The process is "mkdir" (pid 3338) //PID of current process when mkdir is ran
Jan 22 10:46:14 kali kernel: [ 6260.534752] The process is "zsh" (pid 1396) // PID of current process when kill is ran
Here is a demo of how it works:
┌──(kali㉿kali)-[~/Documents]
└─$ mkdir GetR00t
┌──(kali㉿kali)-[~/Documents]
└─$
----------------------------------------
┌──(kali㉿kali)-[~/Documents]
└─$ kill -64 1
┌──(root💀kali)-[~/Documents]
└─#
|
The kill command is built into zsh, therefore that is the process involved. mkdir is a separate command.
| why when hooking syscalls from the kernel, is the pid of kill, zsh, but the pid of mkdir is mkdir? |
1,657,537,791,000 |
Yesterday I installed updates, wanted to copy something with Ctrl+Shift+C and accidentally terminated a kernel update with Ctrl+C. I then started the update process again, but since the following reboot, the system fails to start and I get this error message from Grub:
error: file `/boot/vmlinuz-5.10-x86_64' not found.
error: you need to load the kernel first.
Press any key to continue...
Failed to load both default and fallback entries.
Press any key to continue...
Then I get thrown into the Grub menu. The "Advanced options for Manjaro Linux" menu contains the entries "Manjaro Linux (Kernel: 5.10.70-1-MANJARO x64)" and "Manjaro Linux (Kernel: 5.10.70-1-MANJARO x64 - fallback initramfs)". Both just lead back to the same error.
If I run ls (hd1,gpt2)/boot (system partition) in the Grub command line, the only relevant entry is:
linux510-x86_64.kver
With ls (hd1,gpt1)/boot (boot partition), the output looks much better, the relevant entries are:
linux510-x86_64.kver
vmlinuz-5.10-x86_64
initramfs-5.10-x86_64.img
initramfs-5.10-x86_64-fallback.img
linux515-x86_64.kver
vmlinuz-5.15-x86_64
initramfs-5.15-x86_64.img
initramfs-5.15-x86_64-fallback.img
The 5.15 kernel is one that I installed using a live boot USB and chroot, so something must have worked there… But it's still not booting.
I don't know all the attempts that I made anymore, mainly because every reboot today has reset my browser history, but some of them are:
reinstalling all linux510* packages
installing another kernel version with mhwd-kernel
running various combinations of grub-mkconfig, mkinitcpio, grub-install and update-grub inside manjaro-chroot (In the last few rounds their outputs all looked successful.)
I have not tried rolling back the updates, because last time I tried that, it just made the mess bigger.
I'm using the regular (non-beta) version of Manjaro and have not messed around much with Grub before. I'm not even using any dual-boot setups, unlike apparently most people with similar problems. I could list some of the package updates, if that helps, but for now I won't, because there are >1400 of them. Some version numbers of installed packages:
manjaro-release 21.2pre-1
grub 2.06-1
linux510 5.10.79-1
The live USB is also Manjaro, but an older version, with only the necessary updates installed.
Why does Grub not find the file that is apparently there? And of course: How can I fix this?
|
My system is now fixed, but I don't know which of the steps that I took were actually necessary. What was probably the most important part was completely uninstalling the active kernel and reinstalling it then, instead of "just" reinstalling it in place. mhwd-kernel -r linux510 does not work if the 5.10 kernel is currently in use, but this works:
yay -Rdd linux510 linux510-acpi_call linux510-bbswitch linux510-broadcom-wl linux510-headers linux510-nvidia linux510-r8168 linux510-rtl8723bu linux510-tp_smapi linux510-vhba-module linux510-virtualbox-host-modules
The dd part makes it ignore all dependency issues.
I also uninstalled the 5.15 kernel again that I had installed during troubleshooting. Then I reinstalled the 5.10 kernel with something similar to this:
yay -S linux510 linux510-extramodules
After this, the /boot directory contained the files initramfs-5.10-x86_64-fallback.img, initramfs-5.10-x86_64.img, intel-ucode.img and vmlinuz-5.10-x86_64 that weren't there before.
I also used this command:
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
In there, I did not use the EFI directory /boot/EFI, even though it does exist. I don't know if this command was necessary.
I also used these commands:
grub-mkconfig -o /boot/grub/grub.cfg
mkinitcpio -P
update-grub
I don't know which of these, if any, were necessary. Afterwards, I rebooted, selected the entry starting with "UEFI" in Bios and the system started normally again.
| Grub doesn't find kernel |
1,657,537,791,000 |
I have a ksh script I am developing for work. (I am on the newer side to shell-scripting)
I have root access but the future-users of this script will not. Say the other user is named User1.
Within the script are commands to other executables in the system. These executables throw "permission denied" for User1 when User1 runs the script. How can I temporarily allow User1 to access the executables in the script? Not just access, but actually run the commands.
I have tried using many variations of umask
This has helped with creating and reading files within the script, but doesn't have any affect on executing the necessary commands. I have also tried using chmod but that command in itself is not accessible by User1 either, and therefore throws an error when the script is run. Is there any way you can think of to go about this?
Some Background:
AIX(Putty)
$ oslevel; 7.2.0.0
ksh93
The Script:
#!/bin/ksh
# My Script Introduction
........
# commands from /bin that deny permission to User1
.....
exit
KSH syntax only please. Thank you so much in advance for any help or insight you can provide me.
|
I figured out a work around.
The commands that User1 cannot access are scripts themselves. So I am manually implementing the logic from those scripts into my script. This allows allow User1 to do the desired behavior of the commands without actually calling the commands.
Thank you all for your time.
| Allow user to run nonpermissive commands in shell script (KSH) |
1,625,638,646,000 |
The linux kernel has support for IPv6 SLAAC (stateless address auto-configuration) and is able to process received router advertisement messages.
BUT: As much as I can understand, the kernel is not processing two things of the router advertisement:
'M'/'O' flag to indicate the existence of a DHCPv6 server in the network (this is stored in the inet6_dev, but never used)
DNS option to pass a DNS server in the RA (this is ignored completely)
Is there a way to retrieve this information from the userspace?
|
It seams like there is no way to retrieve this information from the kernel via netlink
But
I figured out way to retrieve this information through another way thanks to user A.B
I used a raw socket that only listens to icmpv6-router-advertisement messages. This will retrieve the exact same messages as the will kernel.
For example code I recommend you to take a look at the rdnss/icmp.c file in the ndisc6 project as A.B mentioned.
https://github.com/nomis/ndisc6/blob/master/rdnss/icmp.c
| Retrieve "managed" flag of router advertisement from build-in IPv6 SLAAC support |
1,625,638,646,000 |
how can I use seccomp and prctl syscall vs bcc to interception syscalls?
Is there another way to achieve this goal with bcc ??
I know that it is possible with pure ebpf code in C but it is too difficult to understand and use and I want to use bcc for it.
|
BCC is about observability (mostly), it will help you trace and inspect the system calls but won't allow you to block them like seccomp does. If this is what you're after, eBPF can do that on recent kernels, but you want to search for the eBPF-based LSM (see kernel's documentation on the topic).
A few additional pointers:
Kernel's doc for seccomp.
https://ebpf.io/ to better understand what eBPF is and does.
| seccomp vs bcc for syscall interception |
1,625,638,646,000 |
Given the following code:
struct udev *udev_obj = udev_new();
struct udev_enumerate *udev_enum = udev_enumerate_new(udev_obj);
udev_enumerate_add_match_subsystem(udev_enum, "sound");
udev_enumerate_scan_devices(udev_enum);
struct udev_list_entry *udev_entries = udev_enumerate_get_list_entry(udev_enum);
struct udev_list_entry *udev_entry = NULL;
udev_list_entry_foreach(udev_entry, udev_entries) {
printf("%s\n", udev_list_entry_get_name(udev_entry));
}
My ThinkPad X1 Carbon with no external sound peripherals outputs:
/sys/devices/pci0000:00/0000:00:1f.3/sound/card0
/sys/devices/pci0000:00/0000:00:1f.3/sound/card0/hwC0D0
/sys/devices/pci0000:00/0000:00:1f.3/sound/card0/hwC0D2
/sys/devices/pci0000:00/0000:00:1f.3/sound/card0/pcmC0D0c
/sys/devices/pci0000:00/0000:00:1f.3/sound/card0/pcmC0D0p
/sys/devices/pci0000:00/0000:00:1f.3/sound/card0/pcmC0D10p
/sys/devices/pci0000:00/0000:00:1f.3/sound/card0/pcmC0D3p
/sys/devices/pci0000:00/0000:00:1f.3/sound/card0/pcmC0D7p
/sys/devices/pci0000:00/0000:00:1f.3/sound/card0/pcmC0D8p
/sys/devices/pci0000:00/0000:00:1f.3/sound/card0/pcmC0D9p
/sys/devices/pci0000:00/0000:00:1f.3/sound/card0/controlC0
/sys/devices/virtual/sound/seq
/sys/devices/virtual/sound/timer
I understand that C0 = card 0, D0 = device 0, and c = capture/p = playback. However:
What is the difference between card0/hw/pcm/control/seq/timer?
Why is there so many odd combinations, e.g card 0, device 3 and then card 0, device 7, etc. It does not seem to logically increment by one
What is the parent device here and how would I obtain it with libudev?
|
1.)
card0 is a single sound card, motherboard-integrated sound chip or e.g. USB sound device, that may have a number of inputs and outputs.
hw virtual files are for hardware dependent items; basically if a sound chip or a specific part of it has some extra features that are not covered by the standard ALSA interface, those will most likely be accessible through these virtual files.
pcm virtual files are the actual input and output channels of sound data.
control channel is for volume settings and similar "standard" sound card controls.
seq is used if you have a sound card that has MIDI sequencer functionality, or MIDI interfaces for external MIDI instruments, or a software synthesizer like timidity that can interface with ALSA.
and timer is important when you are scheduling a number of different sounds to play in harmony, and in many other things involved with sound. So ALSA provides a timer interface that's optimized for audio-related purposes.
2.)
Only the person or team that designed the motherboard of the computer will know that for sure. But a modern HD-Audio compliant audio chip can have a large number of inputs and outputs, configurable by system firmware; perhaps the motherboard designer just picked the inputs/outputs that were physically easiest to wire to where each signal needed to go (e.g. on the correct side of the sound chip, or something).
Note that your system has just one sound input channel (the laptop's internal microphone(s)), but several outputs: one is the internal speakers/headphone output, but the others are probably providing sound to the HDMI output and/or for the DisplayPort alternate modes of any USB Type-C ports: and since DisplayPort can allow daisy-chaining of displays, there may be two or more sound output channels for each USB Type-C port.
3.)
In your case, card0 is the parent device in ALSA sense, and 0000:00:1f.3 is its PCI(e) bus ID. This part of your question is not very clear: what exactly are you trying to do with libudev?
Depending on what you wish to do, something like udevadm info -q all -a -p /sys/devices/pci0000:00/0000:00:1f.3/sound/card0/pcmC0D0p might give you an idea of the relationships between the components.
That particular bus ID is typical to Intel chipset-integrated HD Audio sound chips.
| Explanation of Linux/Udev Audio Device Naming |
1,625,638,646,000 |
I'm running Ubuntu 20.04.2 LTS on a Dell Inc. Precision T3610/09M8Y8 and my linux version is 5.8.0-44-generic. I have been successfully compiling and installing the Linux net-next kernel for a few months now. However, now whenever I install a kernel compiled with make olddefconfig, I get the following error:
Loading Linux 5.11.0+ ...
Loading initial ramdisk ...
error: out of memory.
Booting into safe mode reveals the following
0.602008] VFS: Cannot open root device ''UUID=311542e2-03db-45a0-aa79-991341cb3708'' or unknown-block(0,0); error -6
0.602840] Please append a correct, ''root='' boot option: here are the available partitions:
0.603646] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
0.604488] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 5.11.0+ #3
0.605314] Hardware name: Dell Inc. Precision T3610/09M8Y8, BIOS A07 04/29/2014
0.606155] Call Trace:
0.606837] dump_stack+0x7d/0x9c
0.606837] panic=0x101/0x2e3
0.606837] mount_block_root+0x299/0x31d
0.606837] mount_root+0x6a/0x6d
0.606837] prepare_namespace+0x13f/0x170
0.606837] kernel_init_freeable+0x23a/0x260
0.606837] ? rest_init+0xba/0xba
0.606837] kernel_init+0xe/0x116
0.606837] ret_from_fork+0x22/0x30
0.606837] Kernel Offset: 0x11c00000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
0.606837] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ] ---
I've looked at the other kernels that run successfully in GRUB, and they all have the same set root='hd0,gpt2' as the kernels I'm trying to boot into and failing.
I've looked at other posts such as https://askubuntu.com/questions/41930/kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unknown-block0-0/ and not syncing: VFS: Unable to mount root fs on unknown-block(0,0) but neither of those solved my issue.
The solutions involved running some variation of the following commands:
dpkg --configure -a
update initramfs -u
I think the issue is the machine cannot find the initramfs for the compiled kernels, because when I installed kernel 5.11.0-051100-generic from .deb using dpkg, everything worked fine. I've also tried copying the .config file over from the 5.11 kernel, to no success. I was able to successfully compile and run kernels a few weeks ago, so I don't know why every compiled kernel fails now.
How do I fix this issue? Is there a way to update the initramfs for a custom kernel (I am trying to install the linux net-next branch, but have also tried the generic linux 5.11.0+ branch and received the same error)?
|
I installed Ubuntu version 18.04.5 LTS and was able to boot into a compiled kernel. It seems to be an issue that occurred when I updated Ubuntu 20.04.2
| Ubuntu Kernel panic when installing compiled kernel, not present when installing kernel from .deb |
1,625,638,646,000 |
I just installed Debian linux on my windows 10 computer thru rufus on an USB stick. After finishing the installation (With GRUB installed and linux not recognizing my windows installation) I restarted my computer and tried to boot. After booting my computer shows this error message: (Linux-server is my computers network name)
Debian GNU/Linux 10 Linux-server tty1
Linux-server login: [ 4.108321] noveau 0000:01:00.0: DRM: failed
to create kernel channel, -22
GRUB apears to start normally after turning on my computer but Windows does not appear
I do not care about the files on windows or linux and just want to get Linux running
Also the machine has a Intel i7 processor and a Nvidia grafics card, it was running windows 10 when linux was installed and the installation was perfect with just 2 things that I thought ware out of place.
The installation wizard was not able to setup the internet (My comuter uses wifi but it is not built in AND was beeing used thru an asus wifi stick (My computer has an Ethernet port but I do not use it)
Windows 10 was not detected when the GRUB installation message popped up (I think that is why windows is not bootable)
Sorry for my English and any responces will be Hightly appreciated.
|
It sounds like your wifi device may require proprietary drivers. Figure out which wifi driver is useful to your card. For example, firmware-iwlwifi is for Intel wireless cards. Once, you've found it, it's probably in non-free. Here are two options:
Use the unofficial non-free debian installer, or
Use ethernet for installation, then append non-free contrib to your /etc/apt/sources.list, right after main. Run apt update and then apt install firmware-iwlwifi (or what the package is for your device). Then you can unplug the ethernet and continue with wifi.
grub uses the os-prober extension to find other installations. Ensure that's installed with apt install os-prober, then grub-mkconfig -o /boot/grub/grub.cfg
Finally regarding this message:
noveau 0000:01:00.0: DRM: failed to create kernel channel,
If you don't mind more proprietary drivers, installing nvidia-driver usually works pretty well when you have an nvidia card. If you have an older card, then consider nvidia-legacy-340xx-driver or nvidia-legacy-390xx-driver. See apt show <package> for a list of which cards are supported by each driver.
| Debian linux not working after installation |
1,625,638,646,000 |
I was trying to get the uid of the process runner which is calling my syscall. I use linux/cred.h and its macro called current_uid() .
The problem is that it returns a type which is unknown for me, kuid_t. So I can't save the return value to an int type static variable. Here are parts of the code and error:
static int getuid(void){
return current_uid();
}
static int caller_uid = getuid();
error:
error: incompatible types when returning type ‘kuid_t’ {aka ‘const struct <anonymous>’} but ‘int’ was expected
current_cred()->xxx; \
|
kuid_t is defined in linux/uidgid.h it's just a simple struct with one uid_t member.
typedef struct {
uid_t val;
} kuid_t;
You should be able to get the uid_t value using current_uid().val and uid_t is just an usigned int.
| Problem in gaining uid of the system caller in a system call LKM using cred.h |
1,625,638,646,000 |
I want to create a image file that contains two partitions:
100MB FAT Boot partition that contains my kernel zImage and dtb(device tree blob) files.
900MB EXT4 Rootfs partition that contains my root file system.
Then I want to be able to flash that image file to any sdcard to boot may linux board.
How can I do this and what tools I need? (I prefer cli based tools rather than GUI)
Note: I have my kernel zImage and DTB and rootfs already and I need to make an sdcard bootable image of all of them to easily burn it on any sdcard. But for now I don't have an sdcard. I'll buy my sdcards later. first I want to have the image ready and when I buy them I'll flash the image on all of them swiftly.
|
It's an easy task! Just follow these 15 steps.
steps:
Allocate a file space with fallocate -l 500M sd.img.
Use fdisk(dos partition table) or gdisk(gpt(guided partition table)) to create partition table sudo fdisk sd.img.
After opening fdisk, create a partition by pressing n and then press p to create a primary partition and then just press enter to leave everything by default, except the "Last sector" option. enter +100M to create a 100MB partition.
Redo the third step to create the second partition.
Enter w to save and exit.
Create loop device of your image using sudo kpartx -av sd.img.
Format the partitions sudo mkfs.fat /dev/mapper/loop0p1 and sudo mkfs.ext4 /dev/mapper/loop0p2.
Create a mounting points sudo mkdir /mnt/temp_part1/ & sudo mkdir /mnt/temp_part2/.
Mount the partitions sudo mount /dev/mapper/loop0p1 /mnt/temp_part1/ and sudo mount /dev/mapper/loop0p2 /mnt/temp_part2/ .
copy your content into the mounting points.
sync sudo sync.
Unmount them sudo umount /dev/mapper/loop0p1 /mnt/temp_part1/ and sudo umount /dev/mapper/loop0p2 /mnt/temp_part2/
Delete loop devices sudo kpartx -d sd.img
Flash your image on your sdcard using any flasher software on any OS. I use BalenaEtcher.
Enjoy your SD Card!
| How to create linux sdcard image? |
1,625,638,646,000 |
I tried to compile an Android 8 kernel to contain a driver for TP-Link TL-WN722N USB Wi-Fi card for a smartphone, the kernel is flashed successfully, but when I plug the Wi-Fi card via OTG to the phone, it's not recognised by software.
Here are some debugging I have done:
The Wi-Fi card is showing in lsusb -t output, but no driver binding to it.
I can see the module is loaded in /proc/modules and lsmod:
wlan 5801121 0 - Live 0x00000000000000 (O)
The driver I have picked using make menuconfig before compile was called ATH9K and ATH9K_HTC, so I am not sure why it's wlan here, and the offset being all zeros is a bit weird. Also, this is the only item in the output, I guess all other native modules are compiled directly into the kernel, not externally.
There are many things look not very right, but I'm not sure where actually is the problem, any suggestions will be appreciated.
|
I finally got it working, it turns out the Atheros device requires a .fw firmware file to be placed in right directory to work, I noticed this because an error of loading firmware failed message shows in dmesg every time I plug in the wifi card.
I also tried to bind driver to device like @nobody suggested, but I'm not sure if that's working, the driver is not showed in the device folder after binding.
| Why is a loaded module not being driver of the device? |
1,597,835,709,000 |
I've a software that uses a few nasty algorithms to determine, wether it runs in a docker container or not. One example is, that it scans /proc/1/cgroup for non root paths (i.e. /docker/SOME-UUID instead of / behind a group name)
My question is, if it is possible, to inject a fake /proc/1/cgroup (or similar files) file into the process to circumvent the check?
I've thought about using chroot, but would be interested, if there are nicer alternatives.
|
You can use a bind mount for that:
mount --bind /replacement/file /proc/1/cgroup
That should be done within the container name space.
| Emulate /proc folder |
1,597,835,709,000 |
I need to compile all staging drivers. I am using make allyesconfig and I have also set CONFIG_BROKEN=y and CONFIG_COMPILE_TEST=y .
Right now, make modules C=1 M=drivers/staging prints MODPOST drivers/staging/Module.symvers only.
(Is that the right command?)
Can someone help me out with this?
Thanks in advance.
|
make mrproper
make allmodconfig
make -j3 all
make C=1 M=drivers/staging
You need to interrupt make all with a sigint once it starts compiling init
Also, make allmodconfig enables all modules. A lot of drivers are built as modules whereas make allyesconfig will just enable all config options.
Also, I've used make -j3 all because I use a 4 core processor. You can do make -j$(nproc) all
I terminate the process with a SIGINT or a Ctrl+C once I started observing CC flags continuously.
Also, make mrproper instead of make clean because make clean only cleans object files and make mrproper cleans everything.
This worked for me, let me know if I am wrong. :)
| Compiling drivers/staging |
1,597,835,709,000 |
I am running Ubuntu 18.04 on kernel 5.3 but for some testing purpose with real time kernel I have to downgrade to 4.4.
After downloading and installing the 4.4 kernel, I booted into it and everything is super laggy. I tried figuring out what is the problem but I did not find anything useful, I also tried installing it different ways from different tutorials but that did not change anything (I tried fresh install each time). If I then again boot into 5.3 kernel, everything is fine.
I noticed that in 4.4, the Xorg seems to be taking quite a lot of CPU %. Should I downgrade it or?
Any input on the topic is highly appreciated.
|
It is likely that your newer kernel has additional graphics APIs that your newer userland is taking advantage of and that your older kernel does not. In addition, Ubuntu may have backported additional APIs that are required that your older kernel does not have.
As a result, your graphics may not be accelerated (or may be only partially accelerated), and if you're using a desktop that uses OpenGL or Vulkan APIs, some or all of the operations may be being done on the CPU, which is far, far slower.
In general, if you're using a certain version of Ubuntu, you'll need to use its kernel or a newer upstream one, and possibly a much newer upstream one, for good performance. In fact, unless you are an advanced user and cognizant of what you're doing, you're far better off using the distro kernel. Downgrading to an older kernel, like you're doing, isn't going to work. Consider using a virtual machine for testing instead.
| Ubuntu 18.04 lag after kernel downgrade 5.3->4.4 |
1,597,835,709,000 |
I'm using USB Wi-Fi adapter TL-WN722N. With linux kernels up to 5.4.38, it used to work fine. After 5.4.38 -> 5.4.48 upgrade, it does not light up and won't show up in /sys/class/net. Why could this be?
Kernel config is virtually the same. Here's the exact diff:
--- #<buffer .config<linux-5.4.38-gentoo>>
+++ #<buffer .config<linux>>
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
-# Linux/x86 5.4.38-gentoo Kernel Configuration
+# Linux/x86 5.4.48-gentoo Kernel Configuration
#
#
@@ -12,7 +12,6 @@
CONFIG_CC_CAN_LINK=y
CONFIG_CC_HAS_ASM_GOTO=y
CONFIG_CC_HAS_ASM_INLINE=y
-CONFIG_CC_HAS_WARN_MAYBE_UNINITIALIZED=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y
CONFIG_THREAD_INFO_IN_TASK=y
Notes:
I always had relevant bits built into kernel, not installed as modules
|
According to the kernel bugtracker, the problem was introduced in 5.4.47 and resolved in 5.7.9.
| Wireless adapter not recognized on linux-5.4.48 |
1,597,835,709,000 |
I have an application that creates a TUN device, then checks all packets coming in on that interface and writes them back to the TUN unchanged in case the checks succeed. (Think of a firewall) The source of the packets is the same device on which my firewall application is running. This machine (VM, 10.0.2.15) can reach another machine (Host, 192.168.1.151) using the main routing table (no setup required). My problem is now, that whenever I send packets via my firewall application the kernel seems to drop them. Specfically, when I run tcpdump on my TUN interface I see the following:
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tun0, link-type RAW (Raw IP), capture size 262144 bytes
12:24:21.548119 IP 10.0.2.15 > 192.168.1.151: ICMP echo request, id 9967, seq 1, length 64
12:24:21.548248 IP 10.0.2.15 > 192.168.1.151: ICMP echo request, id 9967, seq 1, length 64
12:24:22.555972 IP 10.0.2.15 > 192.168.1.151: ICMP echo request, id 9967, seq 2, length 64
12:24:22.556087 IP 10.0.2.15 > 192.168.1.151: ICMP echo request, id 9967, seq 2, length 64
You can see that every packet is recorded twice. Once when it goes into my application and once it comes out. However, from there it seems to vanish. Doing a tcpdump on the interface it should go out towards my host doesn't show anything.
I have configured the following on my VM machine:
# enable forwarding and disable reverse path filtering
sudo sysctl net.ipv4.conf.default.rp_filter=0
sudo sysctl net.ipv4.conf.all.rp_filter=0
sudo sysctl net.ipv4.ip_forward=1
# routes for the packets to take
sudo ip rule add to 192.168.1.151/32 lookup 11 prio 11
sudo ip rule add iif tun0 lookup main priority 10
Table 11 tells the packets to go into my TUN device. This works as shown by tcpdump.
I have also set iptables FORWARD and OUTPUT chains defaults to ACCEPT.
Also, I tested traffic flow using netcat with UDP to exclude problems of packets not finding their way back.
What am I missing? What could be reasons the kernel drops my packets?
|
I have an application that creates a TUN device, then checks all packets coming in on that interface and writes them back to the TUN unchanged in case the checks succeed.
My problem is now, that whenever I send packets via my firewall application the kernel seems to drop them.
The kernel sees packets coming in that it sent out, so it concludes there must be a routing loop somewhere in the network, and to prevent the network from being flooded, drops the packets.
You already tried to disable that behavior with rp_filter, but you probably also need to set accept_local, because your TUN interface has a local address.
A better approach would be to really use your application as a firewall, have it create two TUN interfaces, one incoming and one outgoing, and move one or both to the network namespace/VM where it is needed.
In that way, you avoid what looks like routing loops.
| Routing all packets trough TUN device before forwarding |
1,597,835,709,000 |
I know it's generally a bad idea to disable all kernel logging and in any other situation I would not be attempting to do this, but for my current applications having a period of time where the kernel does no logging would be ideal. If there a way to completely disable kernel logging? I'm trying to do this on a gentoo linux system
Note, the system is not equipped with rsyslog or syslog-nd it is purely a syslog(8) system
|
For anyone that stumbles across this, using killall syslogd did the job!
| Temporarily disable all kernel logging? |
1,597,835,709,000 |
There's a process in my system (a standard desktop installation with upwards of 150 quiescent processes at any time) that is sporadically resetting a config file's permissions that I have explicitly set so that it could be read by multiple users.
Even though I have ways to prevent that from happening (eg, changing the file's owner), I really want to find the process that is doing the change, if only so that I can terminate it with extreme prejudice.
I know the kernel has at least 2 mechanisms for this, inotify and the more recent fanotify. However, the latter only intercepts changes to file contents, not to the inode, while the former does detect such changes but doesn't report the process responsible.
So is there another kernel mechanism which i don't know about? Or some other roundabout way of "trapping" the process as it's going to change the file's permissions, or after it has done so?
|
First try list the open files if you can diagnose , which display the user too along with which program does that.
lsof /path/file-name
Check out these for more details :
Check which process modify file
| How to find which running process is modifying a file's permissions (Linux)? [duplicate] |
1,597,835,709,000 |
If I installed a new kernel via rpm, I can see the kernel source ( /usr/src/kernel/4.xxx-xxxx-xxxx ) for me to build the driver. It seems covered by kernel-devel rpm.
ex:
kernel-ml-4.14.15-1.el7.elrepo.x86_64.rpm
kernel-ml-devel-4.14.15-1.el7.elrepo.x86_64.rpm
Now, I want to install/build the new kernel from the upstream source, what should I do to also have the kernel source be installed as kernel-ml-devel-4.14.15-1.el7.elrepo.x86_64.rpm did?
Doing these will install the kernel source? or just install a new kernel?
make; make modules; make install; make modules_install
|
Now, I want to install/build the new kernel from the upstream source, what should I do to also have the kernel source be installed as kernel-ml-devel-4.14.15-1.el7.elrepo.x86_64.rpm did?
As you want to rebuild your kernel from scratch, your entry point will be the sources :-)
So, just download a kernel from kernel.org, untar it to /usr/src and follow the guide.
kernel-devel RPM must be able to find out the path to your sources.
If not, and depending on the driver you want to compile, there's several way to recompile it by your own. First thing to look is the documentation of your driver...
Here is a good paper about this.
| How to install kernel source from upstream kernel |
1,597,835,709,000 |
After updating to kernel 5.5.10-200.fc31, Fedora 31 can't decrypt the root file system on boot. After entering the decryption passphrase, the filesystem fails to decrypt. The same happens with kernel 5.5.11. However, if I boot with kernel 5.5.8 there's no problem. These are the error messages I get with 5.5.11 when running 'journalctl':
localhost.localdomain systemd-cryptsetup[436]: device-mapper: reload ioctl on failed: Invalid argument
localhost.localdomain kernel: device-mapper: table: 253:0: crypt: unknown target type
localhost.localdomain kernel: device-mapper: ioctl: error adding target to table
localhost.localdomain systemd-cryptsetup[436]: Failed to activate with specified passphrase: Invalid argument
localhost.localdomain systemd[1]: systemd-cryptsetup@luks\.... .service: Main process exited, code=exited, status=1/FAILURE
localhost.localdomain systemd[1]: systemd-cryptsetup@luks\.... .service: Failed with result 'exit-code'.
localhost.localdomain systemd[1]: Failed to start cryptography setup for luks-....
localhost.localdomain systemd[1]: Dependency failed for Local Encrypted Volumes.
localhost.localdomain systemd[1]: Job cryptsetup.target/start failed with result 'dependency'
I left out the luks ids as I'm typing this up by hand.
Any help appreciated!
|
You should head over to https://bugzilla.redhat.com and report this as a bug. It is very unlikely that we here can help.
Only advise (for now) is to delete the oldest offending kernel(s), so you only keep the very last one and one (or two) working kernels, that way an update won't erase a working kernel.
| Fedora 31 kernels 5.5.10 and 5.5.11 fail when trying to decrypt luks root filesystem after kernel update, but kernel 5.5.8 works |
1,597,835,709,000 |
I'm building a system image with v4.19.106 kernel and BusyBox for BeagleBone Black using buildroot 2020.02. If I boot the board from the resulting SD card, I see a strange behaviour: system load stays between 0.60 and 0.75 while CPU usage is below 1%, with no services running, when there's no Ethernet cable connected. As soon as I plug in a cable, the load goes down to 0.00-0.01.
With the cable unplugged I see this line in top -H:
PID USER TIME+ S WCHAN COMMAND
42 root 0:03.03 D msleep [kworker/0:3+events_power_efficient]
Snippet from ip link output:
4: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
link/ether 4c:3f:d3:91:f2:66 brd ff:ff:ff:ff:ff:ff
Snippet from ifconfig output:
eth0 Link encap:Ethernet HWaddr 4C:3F:D3:91:F2:66
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:49
When I plug in the cable, I see this message:
# [ 3811.689083] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
After that there's no process with Process Status D in top -H, and the load goes down.
Snippet from ip link output with the cable plugged in:
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 4c:3f:d3:91:f2:66 brd ff:ff:ff:ff:ff:ff
Snippet from ifconfig output the cable plugged in:
eth0 Link encap:Ethernet HWaddr 4C:3F:D3:91:F2:66
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:66 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7605 (7.4 KiB) TX bytes:0 (0.0 B)
Interrupt:49
Unplugging the cable brings back the high load.
My eth0 config in /etc/network/interfaces:
auto eth0
iface eth0 inet dhcp
If I use allow-hotplug eth0, the interface stays down when the cable is unplugged at boot (and the load stays normal), but it doesn't come up afterwards when I connect a cable, just when I run ifup eth0.
How can I prevent the high load when a cable is unplugged, and get a working connection when it gets plugged in? Are there any kernel configs or device tree entries I should check?
Update:
The issue is present on an image built with the default configuration for the board (beaglebone_defconfig). It uses v4.19.79-ti-r30 kernel from the beagleboard repo (with omap2plus_defconfig).
Another confusing bit is that the issue does not appear after every boot. Power cycling the board usually makes it appear if it was not present, while reboot not necessarily. (I'm not sure if it really makes a difference which method I use, or it just appeared so in my limited number of trials.)
|
The problem is caused by the SMSC LAN8710A PHY chip on BeagleBone Black. When it is put into power saving mode, it fails to detect if a cable has been connected. To work around this issue, the kernel driver regularly wakes the PHY chip to test for connection, and the details of this workaround have changed between v3.8.13-bone80 (used in Debian 7.11) and the v4.4.9 (used in Debian 8.4). The new method is still in use in Linux kernel v5.6.4.
The msleep function visible in top -H is called from lan87xx_read_status() in drivers/net/phy/smsc.c.
I resolved the issue by adding a node for the PHY chip to the device tree with a flag that disables the power saving mode:
&davinci_mdio {
ethernetphy0: ethernet-phy@0 {
reg = <0>;
smsc,disable-energy-detect;
};
};
(The CONFIG_PM kernel config option is ignored by the driver, this is the only way to disable this behaviour.)
| High load when Ethernet cable is unplugged |
1,597,835,709,000 |
we have linux rhel 7.2 server
we we boot the machine we see that machine stuck on that screen
any advice why linux not start up?
this screen what we get after some time
|
As it says:
A start job is running for LSB ( 3 out of 5 min ).
It requires 5 minutes to finish. After that, your machine will continue booting.
Did you wait the job run time to finish ?
Do you have still problem after job finished?
| linux machine start but stuck before startup completed and no ssh access |
1,597,835,709,000 |
This is my first post, so please tell me if I have anything to correct in regards to where I'm posting, the format, or anything else
In short, my wifi card, an Intel Centrino Wireless-N 2200, as outlined with lshw -class netowkr, has stopped working, and I honestly don't know how to fix it. I've provided the outputs of several commands that might help in troubleshooting this issue, so please let me know if there is any other information needed.
This is on a Thinkpad x230, and pressing Fn + F5 to toggle the wifi has not worked.
I saw mention that turning on airplane mode on Fedora is a common bug that can result in breaking the wifi capabilities.
Things I have tried:
-sudo rfkill unblock all
-rebooting
-upgrading from kernel 5.5.6 to 5.5.7 and 5.5.8. The issue is present in all kernel versions
-sudo rmmod iwldvm, followed by sudo modprobe iwldvm. After this, rfkill shows it is not hard blocked, but any attempts to enable wifi fail
-Using the GUI to enable wifi
-Disabling wlan in BIOS, then re-enabling
-Enabling all wireless related settings in BIOS. Wifi working does not seem to be tied to if bluetooth and wwan are enabled
-followed this link, installed the related driver, and ran cp iwlwifi-2000-6.ucode /lib/firmware as outlined in the driver's attached README
Here's my specifications as listed in system settings
KDE Plasma Version: 5.17.5
KDE Frameworks Version: 5.67.0
Qt Version: 5.13.2
Kernel Version: 5.5.8-200.fc31.x86_64
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-3230M CPU @ 2.60GHz
Memory: 7.6 GiB of RAM
output of lsmod | grep iwldvm
mac80211 991232 1 iwldvm
iwlwifi 339968 1 iwldvm
cfg80211 843776 3 iwldvm,iwlwifi,mac80211
output of lspci
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
00:16.0 Communication controller: Intel Corporation 7 Series/C216 Chipset Family MEI Controller #1 (rev 04)
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (Lewisville) (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 7 Series/C216 Chipset Family High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 7 Series/C216 Chipset Family PCI Express Root Port 1 (rev c4)
00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4)
00:1c.2 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 3 (rev c4)
00:1d.0 USB controller: Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation QM77 Express Chipset LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 7 Series/C216 Chipset Family SMBus Controller (rev 04)
02:00.0 System peripheral: Ricoh Co Ltd PCIe SDXC/MMC Host Controller (rev 07)
03:00.0 Network controller: Intel Corporation Centrino Wireless-N 2200 (rev c4)
04:00.0 USB controller: Fresco Logic FL1100 USB 3.0 Host Controller (rev 10)
output of rfkill list
Soft blocked: no
Hard blocked: yes
output of sudo lshw -class network
description: Ethernet interface
product: 82579LM Gigabit Network Connection (Lewisville)
vendor: Intel Corporation
physical id: 19
bus info: pci@0000:00:19.0
logical name: enp0s25
version: 04
serial: 3c:97:0e:e5:70:44
capacity: 1Gbit/s
width: 32 bits
clock: 33MHz
capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k firmware=0.13-3 latency=0 link=no multicast=yes port=twisted pair
resources: irq:34 memory:f2600000-f261ffff memory:f263b000-f263bfff ioport:6080(size=32)
*-network DISABLED
description: Wireless interface
product: Centrino Wireless-N 2200
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:03:00.0
logical name: wlp3s0
version: c4
serial: f6:94:19:7d:1f:d8
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=iwlwifi driverversion=5.5.6-201.fc31.x86_64 firmware=18.168.6.1 latency=0 link=no multicast=yes wireless=IEEE 802.11
resources: irq:38 memory:f1d00000-f1d01fff
output of iwconfig
Mode:Managed Access Point: Not-Associated Tx-Power=off
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:off
lo no wireless extensions.
enp0s25 no wireless extensions.
output of ifconfig
ether 3c:97:0e:e5:70:44 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xf2600000-f2620000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 172 bytes 14234 (13.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 172 bytes 14234 (13.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
output of dmesg | grep iwlwifi
[ 33.276721] iwlwifi 0000:03:00.0: loaded firmware version 18.168.6.1 op_mode iwldvm
[ 33.400753] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUG enabled
[ 33.400755] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUGFS enabled
[ 33.400756] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEVICE_TRACING disabled
[ 33.400757] iwlwifi 0000:03:00.0: Detected Intel(R) Centrino(R) Wireless-N 2200 BGN, REV=0x104
[ 33.413914] iwlwifi 0000:03:00.0: reporting RF_KILL (radio disabled)
[ 33.413929] iwlwifi 0000:03:00.0: RF_KILL bit toggled to disable radio.
[ 33.453658] iwlwifi 0000:03:00.0 wlp3s0: renamed from wlan0
output of rfkill list after running sudo rmmod iwldvm and sudo modprobe iwldvm
Soft blocked: no
Hard blocked: no
```
output of ```dmesg | grep iwl``` after running ```sudo rmmod iwldvm``` and ```sudo modprobe iwldvm```
```[ 33.272948] iwlwifi 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control
[ 33.276721] iwlwifi 0000:03:00.0: loaded firmware version 18.168.6.1 op_mode iwldvm
[ 33.400753] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUG enabled
[ 33.400755] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUGFS enabled
[ 33.400756] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEVICE_TRACING disabled
[ 33.400757] iwlwifi 0000:03:00.0: Detected Intel(R) Centrino(R) Wireless-N 2200 BGN, REV=0x104
[ 33.413914] iwlwifi 0000:03:00.0: reporting RF_KILL (radio disabled)
[ 33.413929] iwlwifi 0000:03:00.0: RF_KILL bit toggled to disable radio.
[ 33.437715] ieee80211 phy0: Selected rate control algorithm 'iwl-agn-rs'
[ 33.453658] iwlwifi 0000:03:00.0 wlp3s0: renamed from wlan0
[ 1445.153172] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUG enabled
[ 1445.153174] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUGFS enabled
[ 1445.153175] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEVICE_TRACING disabled
[ 1445.153177] iwlwifi 0000:03:00.0: Detected Intel(R) Centrino(R) Wireless-N 2200 BGN, REV=0x104
[ 1445.166854] iwlwifi 0000:03:00.0: RF_KILL bit toggled to disable radio.
[ 1445.190566] ieee80211 phy1: Selected rate control algorithm 'iwl-agn-rs'
[ 1445.207598] iwlwifi 0000:03:00.0 wlp3s0: renamed from wlan0
[ 1445.237679] iwlwifi 0000:03:00.0: RF_KILL bit toggled to disable radio.
[ 1445.249022] iwlwifi 0000:03:00.0: Failed to run INIT ucode: -132
[ 1445.249053] iwlwifi 0000:03:00.0: Unable to initialize device.
[ 1445.262729] iwlwifi 0000:03:00.0: RF_KILL bit toggled to disable radio.
[ 1445.275168] iwlwifi 0000:03:00.0: Failed to run INIT ucode: -132
[ 1445.275201] iwlwifi 0000:03:00.0: Unable to initialize device.
[ 1445.400046] iwlwifi 0000:03:00.0: Failed to run INIT ucode: -132
[ 1445.400079] iwlwifi 0000:03:00.0: Unable to initialize device.
[ 1445.426083] iwlwifi 0000:03:00.0: Failed to run INIT ucode: -132
[ 1445.426116] iwlwifi 0000:03:00.0: Unable to initialize device.
[ 1456.015945] iwlwifi 0000:03:00.0: Failed to run INIT ucode: -132
[ 1456.015979] iwlwifi 0000:03:00.0: Unable to initialize device.
[ 1456.042995] iwlwifi 0000:03:00.0: Failed to run INIT ucode: -132
[ 1456.043028] iwlwifi 0000:03:00.0: Unable to initialize device.
[ 1466.007525] iwlwifi 0000:03:00.0: RF_KILL bit toggled to disable radio.
[ 1466.019910] iwlwifi 0000:03:00.0: Failed to run INIT ucode: -132
[ 1466.019944] iwlwifi 0000:03:00.0: Unable to initialize device.
[ 1466.033553] iwlwifi 0000:03:00.0: RF_KILL bit toggled to disable radio.
[ 1466.045896] iwlwifi 0000:03:00.0: Failed to run INIT ucode: -132
[ 1466.045929] iwlwifi 0000:03:00.0: Unable to initialize device.
[ 1476.003372] iwlwifi 0000:03:00.0: RF_KILL bit toggled to disable radio.
[ 1476.014742] iwlwifi 0000:03:00.0: Failed to run INIT ucode: -132
[ 1476.014768] iwlwifi 0000:03:00.0: Unable to initialize device.
[ 1476.028464] iwlwifi 0000:03:00.0: RF_KILL bit toggled to disable radio.
[ 1476.040817] iwlwifi 0000:03:00.0: Failed to run INIT ucode: -132
[ 1476.040849] iwlwifi 0000:03:00.0: Unable to initialize device.
[ 1486.012307] iwlwifi 0000:03:00.0: RF_KILL bit toggled to disable radio.
[ 1486.024693] iwlwifi 0000:03:00.0: Failed to run INIT ucode: -132
[ 1486.024725] iwlwifi 0000:03:00.0: Unable to initialize device.
[ 1486.038299] iwlwifi 0000:03:00.0: RF_KILL bit toggled to disable radio.
[ 1486.049637] iwlwifi 0000:03:00.0: Failed to run INIT ucode: -132
[ 1486.049669] iwlwifi 0000:03:00.0: Unable to initialize device.
[ 1496.012191] iwlwifi 0000:03:00.0: RF_KILL bit toggled to disable radio.
[ 1496.023517] iwlwifi 0000:03:00.0: Failed to run INIT ucode: -132
[ 1496.023550] iwlwifi 0000:03:00.0: Unable to initialize device.
[ 1496.037163] iwlwifi 0000:03:00.0: RF_KILL bit toggled to disable radio.
[ 1496.048489] iwlwifi 0000:03:00.0: Failed to run INIT ucode: -132
[ 1496.048519] iwlwifi 0000:03:00.0: Unable to initialize device.
after restarting, rfkill gets reset to hard block: yes
|
Even though the wireless hardware switch was enabled this whole time, switching it on and off a few times fixed the issue
| Wifi card not working, rfkill hard blocked, modprobe doesnt work, reinstalled legacy drivers, rebooted, etc |
1,597,835,709,000 |
I have this script:
#!/bin/bash
# If the cache is greater than 5G, echo 3 > /proc/sys/vm/drop_caches
CACHE=`grep -w "Cached" /proc/meminfo | awk '{ print $2 }'`
if [[ $CACHE -gt 5000000 ]]
then
sh -c "echo 3 > /proc/sys/vm/drop_caches"
else
exit 0
fi
I'm running it via cron and seeing it kick off successfully, but it never actually writes the value and is always set to 0. Thus this:
total used free shared buffers cached
Mem: 64382 27024 37357 0 159 7125
Never changes.
I should add that manually running works fine. /etc/crontab:
04 14 * * * root /bin/sh /opt/drop_caches.sh
(I just put a testing time in there).
|
I have figured out the issue.
Since I was calling /bin/sh which is dash, it does not accept [[ ]]. I have tweaked [[ ]].
[[ $CACHE -gt 5000000 ]]
I instead used:
[ $CACHE -gt 5000000 ]
And it's working fine now.
| Cron job: echo 3 > /proc/sys/vm/drop_caches not actualy being written to /proc/sys/vm/drop_caches |
1,597,835,709,000 |
I know how interrupt handling works (switching mode, saving registers, changing stack ...). However, I am curious, what if an interrupt happens while we are still in kernel mode, and not in user mode?
|
Exactly the same. However if we are processing an interrupt then possibly nothing, or nothing until we finish.
What we do in all cases:
unconditionally save mode, and set mode to supervisor mode (done by hardware. Triggered by interrupt)
unconditionally save state and switch stack
run interrupt code
unconditionally switch stack back, restore state and restore mode
The phrase "set mode to supervisor mode", could be read as any of these:
ensure that mode is supervisor mode.
write a one into the S bit of the status register
Interrupting an interrupt
There are possibly multiple (but finite) interrupt priority levels. There will be a stack for each level. An interrupt can only be interrupted by a higher priority of interrupt. Lower priority interrupts, can be blocked by higher priority. This solves most of the problems, not stacks can't get corrupted.
However lower priority interrupts can be blocked (including user processes. These are the lowest interrupt priority). Therefore,
It is important to ensure that interrupts are fast (not much code), especially for higher priority interrupts: Get the job done and exit, have a lower priority interrupt (such as a user process) do the bit that takes time.
Stacks
A kernel can use the same stack as the process, when a process calls into the kernel (synchronise call: using a syscall in the code of a program).
A kernel will also have a stack for each interrupt priority level. See section on interrupting an interrupt.
| Handling an interrupt while being on kernel [closed] |
1,597,835,709,000 |
I have successfully compiled jacksonliam/mjpg-streamer. After compiling it, I ran into issues. The end result is that the source works, but I don't know how to resolve port conflicts under Debian Linux.
...
Port 8080 it seems is used on the source for using the webcam for getting online and promoting the webcam mjpeg-streamer source for webcam use.
I found that Apache2 and NodeJS both use the 8080 port. So, I erased them. I removed them from my machine.
I still do not know how to access the camera via web page b/c of not knowing how to initialize the port in question. I hope this makes sense.
P.S. I have covered a bunch of online tutorials regarding the basics of less, ncat, ss, etc. I am not completely sure what this means or how to search my files/directories for the 8080 port is taken up or not. Are there particular commands I need to know on how to see if my port 8080 is accessible?
|
You can use netstat or ss to get the list of programs and users that are using a socket.
So for ss do
ss -lpe |grep 8080
for netstat do
netstat -ntpl |grep 8080
If nothing returns then nothing using 8080.
Both commands should return similar info in a bit different format. If you see an app using port 8080 you need to go to that apps config and change the port and restart the app (if you need that app) or if you dont need the app disable it.
(replace appUsing8080 with the app name you found using that port with above commands)
systemctl disable appUsing8080
systemctl stop appUsing8080
| How can I use port 8080 on a BeagleBone Black with Debian Linux, kernel 4.14.x, when trying to use a web camera? |
1,582,545,076,000 |
I am following an online tutorial on how to enable VMX operations on x86 architecture. The tutorial has broken the procedure into steps and has posted the code assembled from all the parts into a kernel module. It has also provided a Makefile to compile it. Both of them can be viewed here. While compiling it I am getting the following error:
make -C /lib/modules/4.4.0-81-generic/build M=/home/sbhtwr/Desktop/hypervisor modules EXTRA_CFLAGS="-g -DDEBUG"
make[1]: Entering directory '/usr/src/linux-headers-4.4.0-81-generic'
CC [M] /home/sbhtwr/Desktop/hypervisor/vmx.o
/home/sbhtwr/Desktop/hypervisor/vmx.c: In function ‘__rdmsr1’:
/home/sbhtwr/Desktop/hypervisor/vmx.c:82:8: error: expected ‘:’ or ‘)’ before ‘_ASM_EXTABLE_HANDLE’
_ASM_EXTABLE_HANDLE(1b, 2b, ex_handler_rdmsr_unsafe)
^
/home/sbhtwr/Desktop/hypervisor/vmx.c:82:28: error: invalid suffix "b" on integer constant
_ASM_EXTABLE_HANDLE(1b, 2b, ex_handler_rdmsr_unsafe)
^
/home/sbhtwr/Desktop/hypervisor/vmx.c:82:32: error: invalid suffix "b" on integer constant
_ASM_EXTABLE_HANDLE(1b, 2b, ex_handler_rdmsr_unsafe)
^
scripts/Makefile.build:264: recipe for target '/home/sbhtwr/Desktop/hypervisor/vmx.o' failed
make[2]: *** [/home/sbhtwr/Desktop/hypervisor/vmx.o] Error 1
Makefile:1420: recipe for target '_module_/home/sbhtwr/Desktop/hypervisor' failed
make[1]: *** [_module_/home/sbhtwr/Desktop/hypervisor] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.4.0-81-generic'
Makefile:6: recipe for target 'modules' failed
make: *** [modules] Error 2
I am unable to resolve the error. I feel that some definitions are missing from my copy of linux headers (Although compiler does not explicitly state that as the reason!). I maybe wrong though. Please see NOTE below.
NOTE:
I tried to search the header files on linux repository online for the definition of _ASM_EXTABLE_HANDLE and found it here. I then tried to find asm.h in my local copy of linux headers and found that the definition was missing. So I copy pasted the definition into the module and re-compiled it. There were no errors this time, but a warning:
WARNING: "ex_handler_rdmsr_unsafe" [/home/sbhtwr/Desktop/hypervisor/vmx.ko] undefined!
I found the definition of ex_handler_rdmsr_unsafe here. So I copy pasted the definition of the function into the module, which lead to some more errors indicating missing definitions of functions (which are used in ex_handler_rdmsr_unsafe).
The tutorial page can be found here.
|
It seems that the definitions for _ASM_EXTABLE_HANDLE and ex_handler_rdmsr_unsafe are included in the linux headers 4.15.0-72-generic. Previously I was running Ubuntu 16.04 LTS with linux headers 4.4.0-81-generic. Upgrading to Ubuntu 18.04 LTS (which also upgraded the linux headers to 4.15.0-72-generic) fixed the issue.
| Error while trying to compile kernel module |
1,582,545,076,000 |
I want to get into kernel development, and the first practical step is obviously to run a Linux kernel to develop.
I think the best solution for me would be to dual boot windows and Linux, with Linux as a daily driver and kernel dev environment/ test bed. I would keep windows as a backup option seeing as how last time I ran this setup I managed to brick my Linux system when I was trying to install video drivers... I would want to avoid running Linux from windows since I'm not sure I have the processing power to run both, especially if I wanted an IDE within Linux...
My questions about this setup are as follows:
Is there a fundamental problem I'm missing where Linux could corrupt my windows system if something goes wrong? I would be running my own edited version of the kernel, and I'm worried that a particularly unstable change could result in disk corruption, but I don't know if this is a relevant concern.
Are there windows native tools for recovering a Linux system on the same device?
If not then what Linux tools are available for recovery if I ran a third operating system on the side for recovery purposes?
Edit: For background I have a degree in CS (with a course in OS, including an IPC kernel module), but I'm doing malware analysis/ RE and I want to get into development, and mainline kernel development would give me a competitive edge. I want to get into something low level where correctness/ optimization counts as a business concern. Security/ speed/ power efficiency/ multithread/multiprocessing or some other form of optimization where I can put my low level experience/ passion to use.
|
Maybe you are a bit confused by the different possibilities when it comes to "combining" different OSs, like Windows and Linux.
"Dual Boot", or "Multi-Boot" is what you, and many others, need, even when they boot only into different versions of the same OS.
Using a VM would make sense, but only later, when you start to test lots of new kernels and modules. You could boot into a stable Linux, and then virtually boot into one or more test versions -- even at the same time.
But first problem is to separate your running Windows from any additional installation, and vice versa.
You don't even need a second disk, but you need a free partition, a couple of GB at least.
"(Multi-)Booting", "boot loader" (grub) and "partition" are things to look up in wikipedia for a start, and then, depending on things like UEFI or not, you can make a plan.
A lot can go wrong when you have to install a second OS on your system, and have to install a new boot loader. But once your "grub" is working, you don't have to worry about linux and windows interfering.
That is one of the main ideas of partitions: to make separate block devices. A kernel crash plus whatever filesystem corruption will be only on the mounted partitions. (You can mount the windows partition(s) also, but then you don't play with it.).
"recovery" would mostly mean to keep a bootable USB drive ready, to repair the boot loader.
"If not then what linux tools are available for recovery if I ran a third operating system on the side for recovery purposes?"
How do you mean that? Normally (outside a VM) OS are run one after the other.
A bootable USB is both the "third OS" and the linux (or windows) tool for recovery purposes.
| Linux kernel development dual booting Linux/Windows |
1,582,545,076,000 |
I am writing a kernel module. Reads bytes from user space and writes back.
static ssize_t dev_read(struct file *filep, char *buffer, size_t len, loff_t *offset) {
Node *msg;
int error_count = 0;
// Entering critical section
down(&sem); //wait state
msg = pop(&l, 0);
// No message? No wait!
if(!msg) {
up(&sem);
return -EAGAIN;
}
len = msg->length;
error_count = copy_to_user(buffer, msg->string, msg->length);
if (error_count == 0) {
current_size -= msg->length;
remove_element(&l, 0);
up(&sem);
return 0;
} else {
up(&sem);
printk(KERN_INFO "opsysmem: Failed to send %d characters to the user\n", error_count);
return -EFAULT; // Failed -- return a bad address message (i.e. -14)
}
}
static ssize_t dev_write(struct file *filep, const char *buffer, size_t len, loff_t *offset) {
Node *n;
// buffer larger than 2 * 1024 bytes
if(len > MAX_MESSAGE_SIZE || len == 0) {
return -EINVAL;
}
n = kmalloc(sizeof(Node), GFP_KERNEL);
if(!n) {
return -EAGAIN;
}
n->string = (char*) kmalloc(len, GFP_KERNEL);
n->length = len;
copy_from_user(n->string, buffer, len);
// Enter critical section
down(&sem); //wait state
// buffer is larger than the total list memory (2MiB)
if(current_size + len > MAX_LIST_SIZE) {
up(&sem);
return -EAGAIN;
}
current_size += len;
push(&l, n);
up(&sem);
// Exit critical section
return len;
}
Destroy function which should deallocate the linked list
static void __exit opsysmem_exit(void) {
// Deallocate the list of messages
down(&sem);
destroy(&l);
up(&sem);
device_destroy(opsysmemClass, MKDEV(majorNumber, 0)); // remove the device
class_unregister(opsysmemClass); // unregister the device class
class_destroy(opsysmemClass); // remove the device class
unregister_chrdev(majorNumber, DEVICE_NAME); // unregister the major number
printk(KERN_INFO "charDeviceDriver: Goodbye from the LKM!\n");
}
My linked list and destroy function look like this:
static void destroyNode(Node *n) {
if(n) {
destroyNode(n->next);
kfree(n->string);
n->string = NULL;
kfree(n);
n = NULL;
}
}
static void destroy(list *l){
if(l) {
destroyNode(l->node);
}
}
typedef struct Node {
unsigned int length;
char* string;
struct Node *next;
} Node;
typedef struct list{
struct Node *node;
} list;
The problem is the following:
I write to the device driver and I want to rmmod the driver and the opsysmem_exit should be called to kfree() all the memory.
This works when I have a small number of nodes.
If I run a very large amount of nodes (1000+) and I try to rmmode, the vm just freezes.
Do you have any idea why and what else I should do to diagnose this?
Is my function creating too many levels of recursion?
There does not seem to be a problem if I write 2000000 nodes and then I read them back. As far as the list is empty when I rmmod, everything works.
EDIT 1:
I noticed that if I do rmmod without deallocating the memory, the kernel does not crash. However, all the memory allocated is leaked as shown by kedr
|
I have just solved it. Murray Jensen was right. It was the recursion that was killing my kernel.
Could somebody explain why I spent 7 hours to learn this? What is the maximum recursion depth C is capable of in reality? I read an article this morning ad it was saying 523756 I read it here, scroll down to C.
Here's my deallocator. Zero leaks as you may have noticed.
static void destroy2(list *l) {
Node *_current = l->node;
Node *_next;
while(_current) {
_next = _current->next;
kfree(_current->string);
kfree(_current);
_current = _next;
}
}
Another bad thing about the recursive approach I have in the main post is that randomly it would skip kfree-ing 2 to 4 nodes.
For anyone interested in my leak check report: I am using an open-source tool I discovered on github at https://github.com/euspecter/kedr. Comes with no guarantee, but it is very helpful. You don't need to recompile your kernel.
| Kernel space memory deallocation freezes kernel |
1,582,545,076,000 |
If I have 3 pthreads: A, B, C, all originating from the same process, running in user space and one thread, thread B does a blocking read from a kernel module and is put to sleep, will threads A and C also be put to sleep as a result?
According to the documentation, wait_event_interruptible puts the calling process to sleep, not thread.
|
After testing personally, it appears only the calling thread is put to sleep, not any other threads. While one thread was waiting during a blocked read, the other threads were still active.
| Do all threads originating from the same process sleep on wait_event_interruptible()? |
1,582,545,076,000 |
I'm trying to debug netfilter synproxy module with systemtap.
This is probe point I'm trying to add.
# stap -l 'module("ipt_SYNPROXY").statement("*")' | grep send_client_synack
module("ipt_SYNPROXY").statement("synproxy_send_client_synack@net/ipv4/netfilter/ipt_SYNPROXY.c:72")
And this is how stap script look like
probe module("ipt_SYNPROXY").statement("synproxy_send_client_synack@net/ipv4/netfilter/ipt_SYNPROXY.c:72"){
//some code
}
I'm getting below error when I try to run it
semantic error: no line records for net/ipv4/netfilter/ipt_SYNPROXY.c:72 [man error::dwarf]
semantic error: resolution failed in DWARF builder
semantic error: while resolving probe point: identifier 'module' at netfilter.stp:915:7
source: probe module("ipt_SYNPROXY").statement("synproxy_send_client_synack@net/ipv4/netfilter/ipt_SYNPROXY.c:72"){
^
semantic error: no match
I tried some of other probe points and realized that not all probe point give this error. For example below probe works fine
probe module("ipt_SYNPROXY").statement("ipv4_synproxy_hook@net/ipv4/netfilter/ipt_SYNPROXY.c:314"){
//some code
}
My kernel version 4.14.128 that I compiled myself. I suspects I miss something while compiling it.
|
I realized it is an issue regarding gcc while compiling kernel. I applied below patch and it fixed.
https://lkml.org/lkml/2015/4/23/605
| Systemtap can not resolve probe point although it is shown in probe list |
1,582,545,076,000 |
As a novice in linux kernel compilation, it's my first time to compile a Linux kernel for myself (I'm trying to use other TCP congestion control algorithms).
I followed the steps in How to Compile a Linux Kernel. When trying to run make, I get an error:
✘ XPS-13-9360 ~/linux_compile/linux-5.1.18 make
CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
DESCEND objtool
CC /home/soar/linux_compile/linux-5.1.18/tools/objtool/arch/x86/decode.o
In file included from /usr/include/gelf.h:32:0,
from arch/x86/../../elf.h:22,
from arch/x86/decode.c:26:
/usr/include/libelf.h:46:4: error: unknown type name ‘Elf32_Word’
Elf32_Word ch_type; /* Compression format. */
^~~~~~~~~~
/usr/include/libelf.h:47:4: error: unknown type name ‘Elf32_Word’
Elf32_Word ch_size; /* Uncompressed data size. */
^~~~~~~~~~
/usr/include/libelf.h:48:4: error: unknown type name ‘Elf32_Word’
Elf32_Word ch_addralign; /* Uncompressed data alignment. */
^~~~~~~~~~
/usr/include/libelf.h:53:4: error: unknown type name ‘Elf64_Word’
Elf64_Word ch_type; /* Compression format. */
^~~~~~~~~~
/usr/include/libelf.h:54:4: error: unknown type name ‘Elf64_Word’
Elf64_Word ch_reserved;
^~~~~~~~~~
/usr/include/libelf.h:55:4: error: unknown type name ‘Elf64_Xword’
Elf64_Xword ch_size; /* Uncompressed data size. */
^~~~~~~~~~~
/usr/include/libelf.h:56:4: error: unknown type name ‘Elf64_Xword’
Elf64_Xword ch_addralign; /* Uncompressed data alignment. */
^~~~~~~~~~~
/usr/include/libelf.h:253:8: error: unknown type name ‘Elf32_Ehdr’
extern Elf32_Ehdr *elf32_getehdr (Elf *__elf);
^~~~~~~~~~
/usr/include/libelf.h:255:8: error: unknown type name ‘Elf64_Ehdr’
extern Elf64_Ehdr *elf64_getehdr (Elf *__elf);
^~~~~~~~~~
/usr/include/libelf.h:258:8: error: unknown type name ‘Elf32_Ehdr’
extern Elf32_Ehdr *elf32_newehdr (Elf *__elf);
^~~~~~~~~~
/usr/include/libelf.h:260:8: error: unknown type name ‘Elf64_Ehdr’
extern Elf64_Ehdr *elf64_newehdr (Elf *__elf);
^~~~~~~~~~
/usr/include/libelf.h:269:8: error: unknown type name ‘Elf32_Phdr’
extern Elf32_Phdr *elf32_getphdr (Elf *__elf);
^~~~~~~~~~
/usr/include/libelf.h:271:8: error: unknown type name ‘Elf64_Phdr’
extern Elf64_Phdr *elf64_getphdr (Elf *__elf);
^~~~~~~~~~
/usr/include/libelf.h:274:8: error: unknown type name ‘Elf32_Phdr’
extern Elf32_Phdr *elf32_newphdr (Elf *__elf, size_t __cnt);
^~~~~~~~~~
/usr/include/libelf.h:276:8: error: unknown type name ‘Elf64_Phdr’
extern Elf64_Phdr *elf64_newphdr (Elf *__elf, size_t __cnt);
^~~~~~~~~~
/usr/include/libelf.h:283:43: error: unknown type name ‘Elf32_Off’; did you mean ‘Elf32_Chdr’?
extern Elf_Scn *elf32_offscn (Elf *__elf, Elf32_Off __offset);
^~~~~~~~~
Elf32_Chdr
/usr/include/libelf.h:285:43: error: unknown type name ‘Elf64_Off’; did you mean ‘Elf64_Chdr’?
extern Elf_Scn *elf64_offscn (Elf *__elf, Elf64_Off __offset);
^~~~~~~~~
Elf64_Chdr
/usr/include/libelf.h:325:8: error: unknown type name ‘Elf32_Shdr’
extern Elf32_Shdr *elf32_getshdr (Elf_Scn *__scn);
^~~~~~~~~~
/usr/include/libelf.h:327:8: error: unknown type name ‘Elf64_Shdr’
extern Elf64_Shdr *elf64_getshdr (Elf_Scn *__scn);
^~~~~~~~~~
In file included from arch/x86/../../elf.h:22:0,
from arch/x86/decode.c:26:
/usr/include/gelf.h:44:9: error: unknown type name ‘Elf64_Half’
typedef Elf64_Half GElf_Half;
^~~~~~~~~~
/usr/include/gelf.h:47:9: error: unknown type name ‘Elf64_Word’
typedef Elf64_Word GElf_Word;
^~~~~~~~~~
/usr/include/gelf.h:48:9: error: unknown type name ‘Elf64_Sword’
typedef Elf64_Sword GElf_Sword;
^~~~~~~~~~~
/usr/include/gelf.h:51:9: error: unknown type name ‘Elf64_Xword’
typedef Elf64_Xword GElf_Xword;
^~~~~~~~~~~
/usr/include/gelf.h:52:9: error: unknown type name ‘Elf64_Sxword’
typedef Elf64_Sxword GElf_Sxword;
^~~~~~~~~~~~
/usr/include/gelf.h:55:9: error: unknown type name ‘Elf64_Addr’
typedef Elf64_Addr GElf_Addr;
^~~~~~~~~~
/usr/include/gelf.h:58:9: error: unknown type name ‘Elf64_Off’
typedef Elf64_Off GElf_Off;
^~~~~~~~~
/usr/include/gelf.h:62:9: error: unknown type name ‘Elf64_Ehdr’
typedef Elf64_Ehdr GElf_Ehdr;
^~~~~~~~~~
/usr/include/gelf.h:65:9: error: unknown type name ‘Elf64_Shdr’
typedef Elf64_Shdr GElf_Shdr;
^~~~~~~~~~
/usr/include/gelf.h:70:9: error: unknown type name ‘Elf64_Section’
typedef Elf64_Section GElf_Section;
^~~~~~~~~~~~~
/usr/include/gelf.h:73:9: error: unknown type name ‘Elf64_Sym’
typedef Elf64_Sym GElf_Sym;
^~~~~~~~~
/usr/include/gelf.h:77:9: error: unknown type name ‘Elf64_Syminfo’
typedef Elf64_Syminfo GElf_Syminfo;
^~~~~~~~~~~~~
/usr/include/gelf.h:80:9: error: unknown type name ‘Elf64_Rel’
typedef Elf64_Rel GElf_Rel;
^~~~~~~~~
/usr/include/gelf.h:83:9: error: unknown type name ‘Elf64_Rela’
typedef Elf64_Rela GElf_Rela;
^~~~~~~~~~
/usr/include/gelf.h:86:9: error: unknown type name ‘Elf64_Phdr’
typedef Elf64_Phdr GElf_Phdr;
^~~~~~~~~~
/usr/include/gelf.h:92:9: error: unknown type name ‘Elf64_Dyn’
typedef Elf64_Dyn GElf_Dyn;
^~~~~~~~~
/usr/include/gelf.h:96:9: error: unknown type name ‘Elf64_Verdef’
typedef Elf64_Verdef GElf_Verdef;
^~~~~~~~~~~~
/usr/include/gelf.h:99:9: error: unknown type name ‘Elf64_Verdaux’
typedef Elf64_Verdaux GElf_Verdaux;
^~~~~~~~~~~~~
/usr/include/gelf.h:102:9: error: unknown type name ‘Elf64_Verneed’
typedef Elf64_Verneed GElf_Verneed;
^~~~~~~~~~~~~
/usr/include/gelf.h:105:9: error: unknown type name ‘Elf64_Vernaux’
typedef Elf64_Vernaux GElf_Vernaux;
^~~~~~~~~~~~~
/usr/include/gelf.h:109:9: error: unknown type name ‘Elf64_Versym’
typedef Elf64_Versym GElf_Versym;
^~~~~~~~~~~~
/usr/include/gelf.h:113:9: error: unknown type name ‘Elf64_auxv_t’
typedef Elf64_auxv_t GElf_auxv_t;
^~~~~~~~~~~~
/usr/include/gelf.h:117:9: error: unknown type name ‘Elf64_Nhdr’
typedef Elf64_Nhdr GElf_Nhdr;
^~~~~~~~~~
/usr/include/gelf.h:121:9: error: unknown type name ‘Elf64_Move’
typedef Elf64_Move GElf_Move;
^~~~~~~~~~
/usr/include/gelf.h:125:9: error: unknown type name ‘Elf64_Lib’
typedef Elf64_Lib GElf_Lib;
^~~~~~~~~
/usr/include/gelf.h:232:8: error: unknown type name ‘Elf32_Word’; did you mean ‘GElf_Word’?
Elf32_Word *__xshndx);
^~~~~~~~~~
GElf_Word
/usr/include/gelf.h:238:6: error: unknown type name ‘Elf32_Word’; did you mean ‘GElf_Word’?
Elf32_Word __xshndx);
^~~~~~~~~~
GElf_Word
arch/x86/decode.c: In function ‘is_x86_64’:
arch/x86/decode.c:43:19: error: request for member ‘e_machine’ in something not a structure or union
switch (elf->ehdr.e_machine) {
^
arch/x86/decode.c:44:7: error: ‘EM_X86_64’ undeclared (first use in this function); did you mean ‘is_x86_64’?
case EM_X86_64:
^~~~~~~~~
is_x86_64
arch/x86/decode.c:44:7: note: each undeclared identifier is reported only once for each function it appears in
arch/x86/decode.c:46:7: error: ‘EM_386’ undeclared (first use in this function); did you mean ‘EM_X86_64’?
case EM_386:
^~~~~~
EM_X86_64
In file included from arch/x86/decode.c:28:0:
arch/x86/decode.c:49:51: error: request for member ‘e_machine’ in something not a structure or union
WARN("unexpected ELF machine type %d", elf->ehdr.e_machine);
^
arch/x86/../../warn.h:58:14: note: in definition of macro ‘WARN’
objname, ##__VA_ARGS__)
^~~~~~~~~~~
arch/x86/decode.c:52:1: error: control reaches end of non-void function [-Werror=return-type]
}
^
cc1: all warnings being treated as errors
mv: cannot stat '/home/soar/linux_compile/linux-5.1.18/tools/objtool/arch/x86/.decode.o.tmp': No such file or directory
/home/soar/linux_compile/linux-5.1.18/tools/build/Makefile.build:96: recipe for target '/home/soar/linux_compile/linux-5.1.18/tools/objtool/arch/x86/decode.o' failed
make[4]: *** [/home/soar/linux_compile/linux-5.1.18/tools/objtool/arch/x86/decode.o] Error 1
/home/soar/linux_compile/linux-5.1.18/tools/build/Makefile.build:139: recipe for target 'arch/x86' failed
make[3]: *** [arch/x86] Error 2
Makefile:50: recipe for target '/home/soar/linux_compile/linux-5.1.18/tools/objtool/objtool-in.o' failed
make[2]: *** [/home/soar/linux_compile/linux-5.1.18/tools/objtool/objtool-in.o] Error 2
Makefile:66: recipe for target 'objtool' failed
make[1]: *** [objtool] Error 2
Makefile:1699: recipe for target 'tools/objtool' failed
make: *** [tools/objtool] Error 2
In libelf.h:
and elf.h
then I found it's been reported before, but it's still without any solution. What can I do?
|
Actually I figure out this by myself.
It's look like the compiler could not find the header as my view.
use the env command, the CPATH is not in /usr/include/ but /home/user/.local/include:$CPATH,so I change the CPATH to /usr/include/, using the method of lkraemer,but it's still could not work out, and the env reveal that the CPATH has been /usr/include/. I think it will be difficult to solve and shutdown my ubuntu and take a break. But I turn on my ubuntu this morning, it works out.
| Compile linux kernel error |
1,582,545,076,000 |
I'm a student working with the Linux kernel, and was wondering how to access methods and macros in the kernel header files from outside the kernel in an OS. I apologize if this is an ignorant question, Linux is not my area of expertise.
|
You either install the complete kernel source (with the headers), or you install a package from your distro that only contains the kernel headers. Then you can access them in any way you want, on the file system, as files.
| How to access kernel header files? [closed] |
1,582,545,076,000 |
Does the kernel just not use system calls, or is the assembly being assembled before being on a new system? I might need some more info on assemblers, but I'm just confused that if instructions such as mov [register] are system calls, how would one use this without having to refer to the kernel of a relying operating system?
For example, let's say I'm making an assembly program with a GNU/Linux distro and using it's system calls. How does Linux itself use assembly if it has no kernel to make system calls to?
|
mov [register] and similar are not system calls, but assembler instructions.
System calls are basically a user-space program calling specific sub-routines in the kernel, using a mechanism built into the processor and set up by the kernel, that allows the called sub-routine to have a higher privilege level than regular user-space program code.
Assembler instructions are basically a human-friendly representation of actual bytes of machine code. And the machine code is not interpreted nor compiled, but implemented inside the processor either with the processor microcode, or directly at the hardware level, using large groups of logic gates.
A single system call invocation in assembler language is usually multiple lines of code. First the parameters for the system call are loaded in appropriate processor registers and/or to the stack, and then a special instruction like int 0x80 or syscall is used to actually make the system call.
In the 32-bit x86 architecture, the int 0x80 is used as the system call instruction. The kernel has prepared a table of software interrupt handler routines for the processor. This table is not directly accessible by regular user-space code, but using the int instruction the userspace code can trigger one of the routines pointed to by the table. int 0x80 simply tells the processor to switch into kernel mode and jump into the routine whose address is in slot #128 of that table. That routine is Linux's system call interface for 32-bit x86 architecture: it checks the parameters specified, identifies which process made the call and then jumps to the appropriate sub-routine.
In the 64-bit version of the x86 architecture, there is a dedicated syscall instruction for the same purpose. Actually the 32-bit x86 architecture now has it too, but either it did not exist yet when the 32-bit Linux system call convention was designed by Linus Torvalds, or the instruction had a hardware bug in some processor models, so it did not get used. But since all 64-bit x86 processors have the syscall instruction and it definitely works, it is used.
| How is the Linux kernel partially written in assembly when system calls are required? [closed] |
1,554,674,616,000 |
I'm compiling a kernel just for learning purpose, and I almost get all things working, bluetooth, hdmi, usb, card reader, webcam, wifi... etc. But I can't make touchpad works, all that I know about it is...
xinput:
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ USB OPTICAL MOUSE id=10 [slave pointer (2)]
⎜ ↳ SYN1B81:01 06CB:2970 Touchpad id=12 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Power Button id=8 [slave keyboard (3)]
↳ Sleep Button id=9 [slave keyboard (3)]
↳ HD WebCam: HD WebCam id=11 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=13 [slave keyboard (3)]
cat /proc/bus/input/devices:
I: Bus=0018 Vendor=06cb Product=2970 Version=0100
N: Name="SYN1B81:01 06CB:2970 Touchpad"
P: Phys=i2c-SYN1B81:01
S: Sysfs=/devices/pci0000:00/INT3432:00/i2c-0/i2c-SYN1B81:01/0018:06CB:2970.0002/input/input11
U: Uniq=
H: Handlers=event7
B: PROP=5
B: EV=1b
B: KEY=6420 10000 0 0 0 0
B: ABS=2e0800000000003
B: MSC=20
dmesg | grep SYN1B81:01:
[ 11.112159] i2c_hid i2c-SYN1B81:01: i2c-SYN1B81:01 supply vdd not found, using dummy regulator
[ 11.112178] i2c_hid i2c-SYN1B81:01: Linked as a consumer to regulator.0
[ 11.112181] i2c_hid i2c-SYN1B81:01: i2c-SYN1B81:01 supply vddl not found, using dummy regulator
[ 11.133437] input: SYN1B81:01 06CB:2970 Mouse as /devices/pci0000:00/INT3432:00/i2c-0/i2c-SYN1B81:01/0018:06CB:2970.0002/input/input7
[ 11.133526] input: SYN1B81:01 06CB:2970 Touchpad as /devices/pci0000:00/INT3432:00/i2c-0/i2c-SYN1B81:01/0018:06CB:2970.0002/input/input8
[ 11.133598] hid-generic 0018:06CB:2970.0002: input,hidraw1: I2C HID v1.00 Mouse [SYN1B81:01 06CB:2970] on i2c-SYN1B81:01
[ 11.133664] probe of i2c-SYN1B81:01 returned 1 after 21592 usecs
[ 11.224691] input: SYN1B81:01 06CB:2970 Touchpad as /devices/pci0000:00/INT3432:00/i2c-0/i2c-SYN1B81:01/0018:06CB:2970.0002/input/input11
[ 11.224837] hid-multitouch 0018:06CB:2970.0002: input,hidraw1: I2C HID v1.00 Mouse [SYN1B81:01 06CB:2970] on i2c-SYN1B81:01
So this is basically all that I know about it, lspci -k doesn't show the touchpad, and lsmod just list two modules related i2c_hid and hid_multitouch I've tested the others disabling them and seeing if it was related if touch. And this is the latest config file that I compiled and I don't know how to get support for this touch, I already enabled everything related with i2c, usb, hid that have elan, elantech, synaptics, designware and nothing worked.
|
After reading about i2c I find out what I was missing, basically:
CONFIG_X86_INTEL_LPSS
PINCTRL
CONFIG_MFD_TPS68470
CONFIG_I2C_DESIGNWARE_CORE
CONFIG_I2C_DESIGNWARE_PLATFORM
CONFIG_I2C_DESIGNWARE_SLAVE
| How do I Get Support for Acer E5-573-54zv Touchpad on a Custom Kernel |
1,554,674,616,000 |
I'm using Yocto in kernel 4.14 (computer 1). I have two USB port :
Host : with a USB key (mass storage device) plugged
OTG : connected to another computer (computer 2)
################ ###############
|USB_KEY|----## COMPUTER 1 ##----## COMPUTER 2##---|screen, keyboard, ...
################ ###############
^ ^
USB link 1 USB link 2
I am trying to access the USB key connected on the computer 1 from the computer 2.
I use g_ether gadget with the USB link 2 and I should use another gadget module like a mass storage gadget.
Can the computer 1 passthrough to a mass storage gadget?
Thanks
|
And the solution was :
g_multi
Edit :
g_multi is the gadget usb called "Multifunction Composite Gadget" in Kernel.
This module have two options :
< > Multifunction Composite Gadget
[ ] RNDIS + CDC Serial + Storage configuration
[ ] CDC Ethernet + CDC Serial + Storage configuration
In my case I use the first option. But I have no reson to use the CDC Serial.
To enable it :
modprobe g_multi file=/dev/sda # sda is your USB mass storage device
This command will creates both usb0 network interface and mass storage device on host device. It also creates CDC Serial.
Now I use the USB gadget set up though configfs.
See the documentaion :
Gadget configfs documentation
With this "new" USB gadget system you will choose which all gadgets you want.
| Gadget mass storage passthrough |
1,554,674,616,000 |
I've been trying to understand how fork() works and finally arrived at copy_pte_range(). Most of the functions are understandable but few are quite questionable.
Kernel: 4.14.84
static int copy_pte_range(struct mm_struct *dst_mm, struct mm_struct *src_mm,
pmd_t *dst_pmd, pmd_t *src_pmd, struct vm_area_struct *vma,
unsigned long addr, unsigned long end)
{
pte_t *orig_src_pte, *orig_dst_pte;
pte_t *src_pte, *dst_pte;
spinlock_t *src_ptl, *dst_ptl;
int progress = 0;
int rss[NR_MM_COUNTERS];
swp_entry_t entry = (swp_entry_t){0};
again:
init_rss_vec(rss);
dst_pte = pte_alloc_map_lock(dst_mm, dst_pmd, addr, &dst_ptl);
if (!dst_pte)
return -ENOMEM;
src_pte = pte_offset_map(src_pmd, addr);
src_ptl = pte_lockptr(src_mm, src_pmd);
spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING);
orig_src_pte = src_pte;
orig_dst_pte = dst_pte;
arch_enter_lazy_mmu_mode();
do {
/*
* We are holding two locks at this point - either of them
* could generate latencies in another task on another CPU.
*/
if (progress >= 32) {
progress = 0;
if (need_resched() ||
spin_needbreak(src_ptl) || spin_needbreak(dst_ptl))
break;
}
if (pte_none(*src_pte)) {
progress++;
continue;
}
entry.val = copy_one_pte(dst_mm, src_mm, dst_pte, src_pte,
vma, addr, rss);
if (entry.val)
break;
progress += 8;
} while (dst_pte++, src_pte++, addr += PAGE_SIZE, addr != end);
arch_leave_lazy_mmu_mode();
spin_unlock(src_ptl);
pte_unmap(orig_src_pte);
add_mm_rss_vec(dst_mm, rss);
pte_unmap_unlock(orig_dst_pte, dst_ptl);
cond_resched();
if (entry.val) {
if (add_swap_count_continuation(entry, GFP_KERNEL) < 0)
return -ENOMEM;
progress = 0;
}
if (addr != end)
goto again;
return 0;
}
Questions
1. In the do {} while(), what is the purpose of progress variable?
2. After do {} while(), there is pte_unmap(orig_src_pte); Why is it needed? This is the process of fork(). Based on my knowledge, the parent pte(orig_src_pte) should still be mapped because the process is based on Copy-on-Write so I guess it doesn't have to be unmapped.
|
The progress variable measures the cost of the operations performed under locks, and avoids holding those locks for too long. At most every 32 calls to pte_none, or 4 calls to copy_one_pte (which is expensive), or a combination thereof, the function checks whether a reschedule is needed, or if the locks are requested elsewhere; if so, it releases the locks and allows a reschedule. The function continues where it left off, thanks to the jump to again.
The unmap call doesn’t unmap the original PTE in the source process, it undoes the effects of the src_pte = pte_offset_map(src_pmd, addr); line at the start of the function.
| Two questions about copy_pte_range() in kernel |
1,554,674,616,000 |
I have the same Gentoo version installed on 16 machines. Using the same 3 DVDs created in the same way with the same CentOS version and 2 same brand portable DVD-ROMs, I have managed to get the installation on 15 of them. The 16th is showing up this error Kernel panic - not syncing:VFS: unable to mount root fs on unknown block(2,0) after selecting boot from the DVD in the bios boot menu and booting up until I select the install option. Once the option is selected, the error message appears. I wanted to know if there is an error guide for the unknown block numbers or would like to find the root cause for this.
There is no difference between the machines' BIOS versions, but I don't know how the first Gentoo install was performed.
|
It somehow appears that the machine didn't like the DVD format. When presented with a FAT32 formatted USB stick, everything worked just fine. Can't explain why this happened though, since nothing was different from the other machines.
| Kernel panic - not syncing:VFS: unable to mount root fs on unknown block(2,0) |
1,554,674,616,000 |
In my case, I am allocating memory like this:
struct ion_allocation_data arg_alloc;
arg_alloc.len = len;
arg_alloc.heap_mask = heap_mask;
arg_alloc.flags = flags;
arg_alloc.fd = 0;
ret = ioctl(client, ION_IOC_ALLOC_V1, &arg_alloc);
In kernel sources I found that heap id is calculated as:
heap_id = 1 << MAGIC_NUMBER;
MAGIC_NUMBER here is heap id (which is not equal to heap type).
This MAGIC_NUMBER is calculated during kernel's boot, thanks to Laura Abbott:
SHA 2f87f50b
by Laura Abbott, 04/18/2017 09:27 PM
committed by Greg Kroah-Hartman, 04/18/2017 09:43 PM
parent eb9751db
staging: android: ion: Rework heap registration/enumeration
The current model of Ion heap registration is based on the outdated
model of board files. The replacement for board files (devicetree)
isn't a good replacement for what Ion wants to do. In actuality, Ion
wants to show what memory is available in the system for something else
to figure out what to use. Switch to a model where Ion creates its
device unconditionally and heaps are registed as available regions.
Currently, only system and CMA heaps are converted over to the new
model. Carveout and chunk heaps can be converted over when someone wants
to figure out how.
Signed-off-by: Laura Abbott
Signed-off-by: Greg Kroah-Hartman
I want to use DMA heap. Type of this heap is defined in enumeration:
typedef enum
{
ION_HEAP_TYPE_SYSTEM,
ION_HEAP_TYPE_SYSTEM_CONTIG,
ION_HEAP_TYPE_CARVEOUT,
ION_HEAP_TYPE_CHUNK,
ION_HEAP_TYPE_DMA,
ION_HEAP_TYPE_CUSTOM, /*
* must be last so device specific heaps always
* are at the end of this enum
*/
} ion_heap_type;
Now is a problem, ION_HEAP_TYPE_DMA is enumerated here as 4, and this number in not heap id. Right heap id mask, which corresponds to this heap type, in my case, is equal to (1 << 1) (once more, thanks to Laura).
So, again, the question is: "How to allocate ION's memory of predefined heap type? How to allocate the same memory on different platforms?".
|
ION's driver contains ioctl's command "ION_IOC_HEAP_QUERY" argument which may be used to get information about heaps (name, type, id, etc.), enabled on concrete platform.
Example of implementation was found on the following link:
int ion_query_heap_cnt(int fd, int* cnt) {
int ret;
struct ion_heap_query query;
memset(&query, 0, sizeof(query));
ret = ion_ioctl(fd, ION_IOC_HEAP_QUERY, &query);
if (ret < 0) return ret;
*cnt = query.cnt;
return ret;
}
int ion_query_get_heaps(int fd, int cnt, void* buffers) {
int ret;
struct ion_heap_query query = {
.cnt = cnt, .heaps = (uintptr_t)buffers,
};
ret = ion_ioctl(fd, ION_IOC_HEAP_QUERY, &query);
return ret;
}
Example of use for this API is found here:
static int find_ion_heap_id(int ion_client, char* name)
{
int i, ret, cnt, heap_id = -1;
struct ion_heap_data *data;
ret = ion_query_heap_cnt(ion_client, &cnt);
if (ret)
{
AERR("ion count query failed with %s", strerror(errno));
return -1;
}
data = (struct ion_heap_data *)malloc(cnt * sizeof(*data));
if (!data)
{
AERR("Error allocating data %s\n", strerror(errno));
return -1;
}
ret = ion_query_get_heaps(ion_client, cnt, data);
if (ret)
{
AERR("Error querying heaps from ion %s", strerror(errno));
}
else
{
for (i = 0; i < cnt; i++) {
struct ion_heap_data *dat = (struct ion_heap_data *)data;
if (strcmp(dat[i].name, name) == 0) {
heap_id = dat[i].heap_id;
break;
}
}
if (i > cnt)
{
AERR("No System Heap Found amongst %d heaps\n", cnt);
heap_id = -1;
}
}
free(data);
return heap_id;
}
Following function may be simply rewritten to get heap_id from heap_type.
After we've got heap_id we need to calculate:
heap_mask = (1 << heap_id);
| How to allocate ION's memory of predefined heap type? |
1,554,674,616,000 |
I'm trying to enable kdump on a server but in the grub configuration file, there are two entries for the crashkernel parameter for each OS entry. I know that this parameter is used to allocate memory to the crash kernel. I'm trying to understand what is the significance of having two entries for the crashkernel parameter in grub.conf.
#splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.32-754.6.3.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-754.6.3.el6.x86_64 ro root=/dev/VG01/LV_ROOT LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto crashkernel=auto
initrd /initramfs-2.6.32-754.6.3.el6.x86_64.img
title Red Hat Enterprise Linux Server (2.6.32-696.30.1.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-696.30.1.el6.x86_64 ro root=/dev/VG01/LV_ROOT LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto crashkernel=auto
initrd /initramfs-2.6.32-696.30.1.el6.x86_64.img
title Red Hat Enterprise Linux Server (2.6.32-642.13.1.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-642.13.1.el6.x86_64 ro root=/dev/VG01/LV_ROOT LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto crashkernel=auto
initrd /initramfs-2.6.32-642.13.1.el6.x86_64.img
|
Have you installed, removed and then re-installed the kdump RPM package?
My guess would be that the post-installation script has simply been run twice, for the above-mentioned or some other reason.
Specifying the option twice should have no special meaning, so feel free to delete the extra entries.
| Why there are two entries for crashkernel parameter in the grub.conf file? |
1,554,674,616,000 |
I'm trying to install Ubuntu 18.04 on my ASUS F556U laptop without success. I already asked other questions on the subject, thinking that the problems were by UEFI mode. Well surpassed that, I already discovered that the problem is of the laptop, a professional I assure to me that it can be problem of Targeta Grafica, is not compatible with Linux. Well, since I can not install 18.04 install 16.04 but when updating it is broken and there is an error in the screen that I can not distinguish well, which I show: PCIe Bus Error: severity = Corrected, type = Physical Layer, id
When installing 16.04 it works perfectly, but it notifies me of. I've been with the problem for almost two months, and now I can not buy another laptop, if it does not work for Linux. I already tried other Linux distributions, and it gives me the same error. Now it gives me another problem, a message saying that I have little space in the root file system, only 924 MB, when I leave 150 GB. I show you screenshots of the errors you asked me to send to Ubuntu
The partner @oldfred helped me with his comments in another question I asked, but ASUS does not give me support for UBUNTU, to be able to update the BIOS. I do not know if I am adding PCI = NOMSI correctly, because when I update, the error of the first image that I am attaching is shown on the screen.
I was also told to update the UEFI, but since ASUS does not support me, I do not know how to do it from Ubuntu
|
Thanks for the support.
I resolve myself thanks to the answer of another question that answered @oldfred.
Almost all systems need to have UEFI/BIOS updated to latest available from vendor. So first thing to check is if UEFI/BIOS is latest version from vendor. Normally there is only one version and it may say Windows. But Microsoft requires vendors to allow users to turn off UEFI Secure Boot. But even if UEFI Secure boot is on, Ubuntu should install. But proprietary drivers may require you to turn off Secure Boot.
Many Asus models need a boot parameter pci=nomsi. On initial boot you can manually add it to grub menu. But if a parameter is always required you will want to make it permanent by editing this and then updating grub.
https://wiki.ubuntu.com/Kernel/KernelBootParameters
sudo nano /etc/default/grub
sudo update-grub
Change this in /etc/default/grub:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
to
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=nomsi"
Similar systems with issue: ASUS X540U pci=noaer instead of pci=nomsi and it also worked
https://ubuntuforums.org/showthread.php?t=2391201
Problems Installing on ASUS F555U needed boot option pci=nomsi
http://ubuntuforums.org/showthread.php?t=2303665
Asus x555u w/o pci=nomsi - space issue on drive and runaway log files filling drive
https://ubuntuforums.org/showthread.php?t=2327103&page=3
https://ubuntuforums.org/showthread.php?t=2327570
Source:
https://askubuntu.com/questions/1079540/how-to-install-ubuntu-on-asus-f556u-journalerror-error
Thanks for the support.
I resolve myself thanks to the answer of another question that answered @oldfred.
Source
I hope it serves other users, for me it was two months of unsuccessful attempts until it appeared @oldfred
| How to install Ubuntu on ASUS F556U, JournalError error? [closed] |
1,554,674,616,000 |
If I do operations in Thunderbird with many (thousands of) mails, I hear a crashing voice from my HDDs. It sounds really not beautiful.
It happens only if I do something with a lot of mails (for example, moving some thousands into the trashbox). It is also very slow.
How to deal with this problem?
|
A quick strace shows that Thunderbird uses an fsync call to synchronize its local databases after every mail operation. It forces the system to write out all of its write cache.1
Doing this, they make thunderbird more stable, because the probability of the damage of the local databases will significantly decrease due to a possible system crash (or thunderbird crash); however they wear the HDDs of the users and make the capacity of the whole system lesser optimal.
Similar behavior can be seen in many other software, too, not only in the opensource world. For example, ext4 writes out the write cache in every 5 seconds, making their own fs sub-optimal. Or the PostgreSQL database also does the same after every committed transaction. These can be easily turned off in both cases, but I couldn't find the same for Thunderbird.
My research has shown no way to turn this feature off, and recompiling thunderbird just for this little feature had been clearly an overkill. Instead, a simple way to forbid all fsync call for thunderbird is easily available, while the Thunderbird doesn't even know, what is going on.
The same mechanism works quite well also for other processes liking to overload the hdds for zero to little results. The workaround requires a C compiler with the development packages.
The trick is to hook the fsync() calls available for thunderbird with a mock, doing nothing.
Insert this into a small .c file, for example into nosync.c:
int fsync(int arg) {
return 0;
}
int fdatasync(int arg) {
return 0;
}
We compile it into a small shared library with the command gcc -s -Os -Wall -shared -o nosync.so nosync.c.
After that, thunderbird should be called by the command LD_PRELOAD=/path/to/nosync.so thunderbird
Wow! No more HDD killing.
Of course, it removes the extra protection from the internal Firefox databases. It can be particularly dangerous only if you have important data in your local account. However, Firefox holds today more typically everything in an IMAP account, its local databases are only essentially cache. Thus, this regular fsync is not required.
1 Thunderbird is a multi-threaded process, so a little script to strace all of its threads (strace can follow only only a single pid).
| Thunderbird overloads my HDD in large operations, what to do? |
1,554,674,616,000 |
the documentation for Live Kernel Patch uses the phrase "if the architecture has reliable stacks (HAVE_RELIABLE_STACKTRACE)." Does it mean that hardware also has a say in it or just enabling the config option HAVE_RELIABLE_STACKTRACE allows us to insert live kernel patch.
Also I am getting the fllowing error on inserting live patch :
livepatch: This architecture doesn't have support for the livepatch consistency model.
This is just because of HAVE_RELIABLE_STACKTRACE or is there something else I need to do ?
I am doing all this on Ubuntu 14.04 X86 arch. I also have a BeagleBone black to play around with.
Thanks
|
HAVE_RELIABLE_STACKTRACE isn’t a selectable configuration option, it’s a configuration flag set by the build if the architecture and configuration support it. The only setup which enables this flag is 64-bit x86 with UNWINDER_FRAME_POINTER and STACK_VALIDATION.
This means that your BeagleBone Black can’t benefit from this option. It may be possible to develop the required features for it, but that hasn’t been done.
| does it suffice to enable HAVE_RELIABLE_STACKTRACE option in config file and building the kernel to enable Live Kernel Patching ? |
1,554,674,616,000 |
I've a kernel-panic problem (I think) trying to use the liveCD of gNewSense 4.0 for i386.
The error is the following:
[8.598401] xhci_queue_intr_tx: 78 callbacks suppressed.
.
.
.
It's showing the same error with different codes (70 for example) as long as my laptop is turned on.
I'll give you some information about my hardware:
uname -m
x86_64
sudo lshw -short
[sudo] password for lucasdavid:
H/W path Device Class Description
=====================================================
system Inspiron 14-3467 (078A)
/0 bus 0PW5P4
/0/0 memory 64KiB BIOS
/0/3d memory 6GiB System Memory
/0/3d/0 memory 4GiB SODIMM Synchronous 2400 MHz (0,4 ns)
/0/3d/1 memory 2GiB SODIMM Synchronous 2400 MHz (0,4 ns)
/0/41 memory 128KiB L1 cache
/0/42 memory 512KiB L2 cache
/0/43 memory 3MiB L3 cache
/0/44 processor Intel(R) Core(TM) i3-6006U CPU @ 2.00GHz
/0/100 bridge Sky Lake Host Bridge/DRAM Registers
/0/100/2 display Sky Lake Integrated Graphics
/0/100/4 generic Intel Corporation
/0/100/14 bus Intel Corporation
/0/100/14/0 usb2 bus xHCI Host Controller
/0/100/14/1 usb1 bus xHCI Host Controller
/0/100/14/1/1 input USB Optical Mouse
/0/100/14/1/2 multimedia USB PnP Sound Device
/0/100/14/1/5 multimedia Integrated_Webcam_HD
/0/100/14/1/6 generic USB2.0-CRW
/0/100/14/1/8 communication Bluetooth wireless interface
/0/100/14.2 generic Intel Corporation
/0/100/15 generic Intel Corporation
/0/100/15.1 generic Intel Corporation
/0/100/16 communication Intel Corporation
/0/100/17 storage Intel Corporation
/0/100/1c bridge Intel Corporation
/0/100/1c/0 wlp1s0 network QCA9565 / AR9565 Wireless Network Adapter
/0/100/1c.5 bridge Intel Corporation
/0/100/1c.5/0 enp2s0 network RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller
/0/100/1f bridge Intel Corporation
/0/100/1f.2 memory Memory controller
/0/100/1f.3 multimedia Intel Corporation
/0/100/1f.4 bus Intel Corporation
/0/1 scsi0 storage
/0/1/0.0.0 /dev/sda disk 1TB ST1000LM035-1RK1
/0/1/0.0.0/1 volume 599MiB Windows FAT volume
/0/1/0.0.0/2 /dev/sda2 volume 3071MiB Windows FAT volume
/0/1/0.0.0/3 /dev/sda3 volume 516GiB EXT4 volume
/0/1/0.0.0/4 /dev/sda4 volume 11GiB Linux swap volume
/0/1/0.0.0/5 /dev/sda5 volume 399GiB EXT4 volume
/0/2 scsi1 storage
/0/2/0.0.0 /dev/cdrom disk DVD+-RW DU-8A5LH
/1 power DELL 78V9D72
I think the problem is with some usb, so more information:
lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 009: ID 0cf3:e005 Atheros Communications, Inc.
Bus 001 Device 005: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 004: ID 0bda:5769 Realtek Semiconductor Corp.
Bus 001 Device 003: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller
Bus 001 Device 002: ID 1bcf:0823 Sunplus Innovation Technology Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
That's all!
|
This distribution doesn't have proper drivers for 2 USB and network card that comes with my laptop. I've just installed Trisquel and it works perfectly now!
| gNewSense livecd gives me an Error (callbacks suppressed) |
1,554,674,616,000 |
Recently I did an update and which seemed to contained an horrendous amount of bugs. After fixing most of these now i a faced with pacman telling linux 4.16.2-2 is being used. However uname is reporting linux 4.15.17-1.
I have obviously tried rebooting and updating grub but the image is nowhere to be found.
edit: Also mkinitcpio seems to only see the old kernel too.
|
I think i may have solved it.
For some reason when installing the linux package, pacman reports it is reinstalling linux416-4.16.2-2 at the beginning but the logs show from mkinitcpi 4.15.17-1 is installing. But when specifically selecting linux416-4.16.2-2 it shows it installing for the first time and logs seem correct.
This is very weird they must be an issue with the package. Its even stranger that pacman -Syy still did not select the new kernel either.
Going to reboot now, fingers crossed it works! edit: it works like a charm :)
| Manjaro update: kernel not updating [closed] |
1,554,674,616,000 |
Trying to get more than 4GB RAM on 32 bit CPUs with PAE, but can't.
~# grep -o pae /proc/cpuinfo
pae
pae
pae
pae
~# uname -a
Linux debian 4.9.0-6-686-pae #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) i686 GNU/Linux
~# grep HIGHMEM /boot/config-4.9.0-6-686-pae
# CONFIG_NOHIGHMEM is not set
# CONFIG_HIGHMEM4G is not set
CONFIG_HIGHMEM64G=y
CONFIG_HIGHMEM=y
# CONFIG_DEBUG_HIGHMEM is not set
~# dmidecode -t memory | grep Enabled
Enabled Error Correcting Capabilities:
Enabled Size: 1024 MB (Single-bank Connection)
Enabled Size: 1024 MB (Single-bank Connection)
Enabled Size: 1024 MB (Single-bank Connection)
Enabled Size: 1024 MB (Single-bank Connection)
Enabled Size: 1024 MB (Single-bank Connection)
Enabled Size: 1024 MB (Single-bank Connection)
Still got
~# free -h
total used free shared buff/cache available
Mem: 3.8G 29M 3.6G 10M 244M 3.5G
Swap: 9G 0B 9G
Maybe someone can help, where do I look?
|
To diagnose memory problems, the best place to start is the kernel boot messages; the kernel prints out everything it finds concerning the system’s memory. Start with the output of dmesg, looking for “memory”.
As you discovered, in your case this shows
[ 0.000000] WARNING: BIOS bug: CPU MTRRs don't cover all of memory, losing 2176MB of RAM.
[ 0.000000] WARNING: CPU: 0 PID: 0 at /build/linux-rtbsTs/linux-4.9.82/arch/x86/kernel/cpu/mtrr/cleanup.c:978 mtrr_trim_uncached_memory+0x2f5/0x326
which suggests that the BIOS isn’t setting things up properly for a 6GiB system.
| Have PAE still got 4GB |
1,522,037,959,000 |
I found an old PC with a AMD Athlon XP and 256 MB of RAM, so i tried to install Debian 9 and use it as a test server.
The install was completed without problems, but when i tried to boot the system from for the first time the problems started to show up. I managed to fix certain problems with searches on StackExchange or by playing with the BIOS:
System trying to load a Floppy drive even if is not installed (disabled Floppy support in the Bios)
"ACPI Error: Method Execution failed" (disabled ACPI on the Bios)
"ALERT! UUID=... does not exist. Dropping to a shell!" (replaced "root=UUID=..." by "root=/" on the GRUB launch parameters)
After fixing all of those, there's still one that I'm unable to fix:
Call trace:
[< ca2f6c82 >] ? dump_stack+0x55/0x73
[< ca16879a >] ? panic0x94/0x1d8
[< ca06c15e >] ? do_exit+0x9fe/0xa00
[< ca06c196 >] ? SyS_exit+0x16/0x20
[< ca00372a >] ? do_fast_syscall_32+0x9a/0x160
[< ca5b6d62 >] ? sysenter_past_esp+0x47/0x75
Kernel Offset 0x9000000 from 0xc1000000 (relocation range:0xc0000000-0xce7effff)
--[ end Kernel panic - not syncing: Attempted to kill init! exit code 0x00000100
And after a few minutes:
random: crng init done
The partitions were created manually with this format:
sda1 - /boot - 200mb
sda2 - / - 39.5gb
sda3 - swap - 2gb
Just in case, I used the network installer for x86/i386 from here.
¿What can I do to fix/bypass this kernel panic error?
|
The solution was to install a non-PAE kernel.
For some strange reason, the Debian 9 installer used the PAE kernel for recent PC's even if this is an old one that does not have PAE support (ironically, the non-PAE kernels say "for older PCs" in their description and in this case it was not used).
To start, I booted the installer in "Recovery Mode" with /dev/sda2 selected and /dev/sda1 mounted as /boot.
After reaching the command line, I updated the package cache (sudo apt-get update) and did an apt-cache search for the "linux-image" packages (aka the kernels):
apt-cache search linux-image
The result was (reduced):
linux-image-4.9.0-6-686 - Linux 4.9 for older PCs
linux-image-4.9.0-6-686-dbg - Debug symbols for linux-image-4.9.0-5-686
linux-image-4.9.0-6-686-pae - Linux 4.9 for modern PCs
linux-image-4.9.0-6-686-pae-dbg - Debug symbols for linux-image-4.9.0-5-686-pae
linux-image-4.9.0-6-686-rt-pae - Linux 4.9 for modern PCs, PREEMPT_RT
linux-image-4.9.0-6-686-rt-pae-dbg - Debug symbols for linux-image-4.9.0-5-686-rt-pae
So I installed linux-image-4.9.0-6-686 to diagnose what was failing, the result was that the system booted and the login screen showed up.
After that I removed the old kernels and started using the system.
| Debian 9 install on an old PC shows Kernel Panic and does not boot |
1,522,037,959,000 |
I have a CentOS machine with CentOS 5.4.
The installed kernel is 2.6.18-164.15.1.el5.centos.plus. We have a big amount of data inside the machine and we need to backup, the machine has a USB 3.0 connection but to make use of it we need to update kernel to at least version 2.6.31 (which is the first to support USB 3.0)
It seems to be possible with kernel-lt packages from el-repo as stated here, but, if you look at ELrepo the packages for EL5 are not there.
I have been looking in the internet and I found a place where the packages are available:
http://mirrors.coreix.net/elrepo-archive-archive/kernel/el5/x86_64/RPMS/
Either if I activate the el-repo repositories and I fire:
yum search kernel-lt
That search returns me the following packages:
kernel-lt.x86_64 : The Linux kernel. (The core of any Linux-based operating system.) kernel-lt-devel.x86_64 : Development package for building kernel modules to match the kernel. kernel-lt-doc.noarch : Various bits of documentation found in the kernel source. kernel-lt-headers.x86_64 : Kernel C header files for use by glibc.
When I tried to install that four packages with "yum install" the result is:
Nothing to do
I would be very proud if somebody can give me some light on how to do it.
Thanks for all in advance
Manuel Luis Aznar
|
In the end I installed the four packages and the kernel was installed; but, in GRUB you have to press SPACE in order to boot the installed kernel.
I suppose you can change GRUB to boot the installed kernel too.
| Update Machine Kernel 2.6.18 with CentOS 5.4 to at least Kernel 2.6.31 |
1,522,037,959,000 |
I am working on my school research on Dirty CoW (if you don't know what it is and you think the implementation might be relevant to my problem, see P.S. below).
I have found some solutions (i.e. https://github.com/scumjr/dirtycow-vdso) that use Dirty CoW to inject some shellcode into vDSO. The one in the link is for desktop Linux, but there are also solutions for Android (basically identical, except for a few changes).
I am trying to analyze the existing solutions and I have come to a problem - where is vDSO stored in Android?
The manual pages (http://man7.org/linux/man-pages/man7/vdso.7.html) say, that you can locate the file using
find arch/$ARCH/ -name '*vdso*.so*' -o -name '*gate*.so*'
By running a similar command on my Ubuntu 64bit (find / -name '*vdso*' -o -name '*gate*.*so'), following lines are present in the output:
/lib/modules/4.13.0-32-generic/vdso
/lib/modules/4.13.0-32-generic/vdso/vdsox32.so
/lib/modules/4.13.0-32-generic/vdso/vdso32.so
/lib/modules/4.13.0-32-generic/vdso/vdso64.so
/lib/modules/4.13.0-21-generic/vdso
/lib/modules/4.13.0-21-generic/vdso/vdsox32.so
/lib/modules/4.13.0-21-generic/vdso/vdso32.so
/lib/modules/4.13.0-21-generic/vdso/vdso64.so
And by using objdump and hexdump on one of them I can see that it is the one, that is mapped in the memory (I wrote a program, that finds it and dumps it into a file).
However, when I run
adb root
adb shell find -name '*vdso*' -o -name '*gate*.so*'
on my Android 4.4-r4 x86, the only output is /proc/sys/vm/vdso_enabled (and the file content is 1).
I know there is vDSO in the processes' memory, I wrote a dumping program ran from ADB for that as well. And I also adjusted the Dirty CoW exploit to inject my shellcode into the vDSO. I can see that the shellcode is in the vDSO from an app that I wrote and also from the dumping program that I mentioned earlier. My shellcode is only present in vDSO until I restart the device.
How does vDSO work in Android? Is there a file where it is stored? It seems not, because if it was there, the injected code would be there after the reboot as well. But how does the shellcode propagate to the other processes?
I am very grateful for your answers.
P.S.: Dirty CoW is a vulnerability of Linux kernel that lets you write into read only files (or anything that you can map into your memory) by causing a race condition of two threads - the first one has a loop where it is writing any text into memory (either into /proc/self/mem or using ptrace using mmap to find the right place) and the other one is telling the system (also in a loop) that the same part of memory is no longer needed (using madvise(MADV_DONTNEED)).
|
The vDSO isn’t stored in a separate file on disk, it’s part of the kernel and is mapped into each process’s address space by the kernel. The .so files you found are only used for debugging purposes. The find command in the documentation is given as an example when building the kernel, to find the generated vDSO in the kernel build tree; there’s no requirement that the separate .sos be present in /lib/modules or anywhere else for that matter.
The shellcode injected by the exploit you’re working on propagates because there’s single copy of the vDSO in memory, so any successful write to it shows up in all current and future processes’ mapping of the vDSO...
| vDSO file path in Android x86 kernel |
1,522,037,959,000 |
I am facing booting problem after upgrading kernel to 4.13.3 on CentOS 6 having LUKS encryption (cryptsetup-luks-1.2.0-11.el6.x86_64). I tried compiling the same kernel on another CentOS6 which does not have LUKS volume, that works without any issue. But I am facing issue on the servers having LUKS volume. During booting, the system is asking encryption password and after that there is no progress. I have attached the screenshot. Kindly suggest.
|
Somehow the mod_crypt and mod_dm modules were not included in initramfs while running make. The issue is resolved after creating initramfs with mod_crypt and mod_dm modules
# mkinitrd initramfs-4.13.3.img 4.13.3 --with=mod_crypt --with=mod_dm
| System Boot Problem - LUKS+kernel-4.13.3 [closed] |
1,522,037,959,000 |
I am on proxy server. Trying to install the magenta kernel using the getting started manual.
when I run this command ./scripts/download-toolchain, I get the following error log messages:
sudo ./scripts/download-toolchain
curl Downloading https://fuchsia-build.storage.googleapis.com/magenta/toolchain/x86_64-elf/Linux-x86_64/509cd48809f5252ffc8ef0c72dbf208151750f66
curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
Tried adding curl --insecure but ended up getting a tar/bz2 error.
Also, tried to build the tool-chains manually, but while building the kernel using this command make -j32 magenta-pc-x86-64 returned numerous error.
Please help me to proceed further. Thank you in advance.
Request: Can some one please add the new tags for fuchsia and magenta-kernel, I dont have enough reputation to do so.
|
Working behind proxy is a real pain. Nevertheless, if you face the same problem at your workplace, make sure your proxy is configured and there are company specific (ca) certificates. Add them and update your system and things similar to this will work. (Do not waste time building toolchains manually: things wont work and you end up investing too much time)
| Fuchsia OS : Magenta Kernel: Installation on ubuntu 16.04 |
1,522,037,959,000 |
I would like to show a tux logo on am335x processor using a fbcon + framebuffer driver. At the moment i have ti-linux 3.14 configured to use DRM and ti,lcdc driver. Also i have devicetree lcd panel node written with usage of tilcdc driver. Is possible to display logo using only ti,lcdc driver or should i use da8xx-fb driver? Or mix usage of these drivers or something?
|
Here and found some information how to do it other way thanks to psplash https://e2e.ti.com/support/arm/sitara_arm/f/791/t/398816. But this is not solution for my question. It's only a workaround in userspace. I would like to have kernel solution.
| Is DRM+ti,lcdc driver capable of showing tux logo when kernel is booting? |
1,522,037,959,000 |
I am a first-timer user of linux, and I have been able to fix all issues I have met until this one.
Upon trying to upgrade the kernel version to something above 4.1 from Debian backport, I am met with the following message:
The following packages have unmet dependencies:
linux-image-4.7.0-0.bpo.1-amd64: Depends: linux-base (>=4.3~) but 3.5 is to be installed
E: Unable to correct problems, you have held broken packages.
scouring the internet has told me, that some users fixed it by doing a clean install from scratch, but I feel like I wouldn't learn anything from it, if it is fixable - and I have done 5 clean installs already since yesterday.
|
The simplest way to upgrade to a backported kernel it to add Jessie backports to your repositories, if it's not already there:
echo deb http://http.debian.net/debian jessie-backports main > /etc/apt/sources.list.d/jessie-backports.list
(as root), then
apt-get update
apt-get -t jessie-backports install linux-image-amd64
will upgrade your kernel. Note that the kernels provided are now signed, which may cause issues if you're booting in BIOS compatibility mode; in that case, install linux-image-4.7.0-0.bpo.1-amd64-unsigned instead:
apt-get -t jessie-backports install linux-image-4.7.0-0.bpo.1-amd64-unsigned
You might also need additional firmware; add contrib and non-free:
echo deb http://http.debian.net/debian jessie-backports main contrib non-free > /etc/apt/sources.list.d/jessie-backports.list
then
apt-get update
apt-get -t jessie-backports install firmware-linux firmware-linux-nonfree firmware-iwlwifi
Enabling backports is safe: newer packages are not picked up automatically from backports, you need to explicitly select them using -t jessie-backports as above.
| Debian kernel update (Required for my wireless firmware to work) issues - unmet dependencies linux-base |
1,522,037,959,000 |
I'm working on kernel 2.6.37, i have made some loadable module instead of static to optimize kernel,
My task is to load some module after running a application which i'm doing successfully,
In any embedded system, at initialization of system a script modpobe the modules from designated file such as etc/modules. so i have removed module name to not load at filesystem initialization rather need to be loaded after application starts. more like runlevel priority changed from 35 to 99.
Now my wifi kernel module takes 1-2sec to load so i tried to remove wifi module name and it's dependencies but wifi modules is loading at file system initialization. upon checking the rcS script, udev script is running a udevadm trigger which is loading the module rather it should be done by modprobe.
/sbin/udevadm trigger --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux --subsystem-nomatch=platform
can anyone suggest how to avoid wifi module loading ?
|
these is not perfect answer for my question but more of a workaround,
i made some module blacklist[it will stop autoload at file system initialization] and modprobe after my application runs.
cat /etc/modprobe.d/blacklist.conf
#blacklist those modules who need to stop from autoloading
blacklist wl18xx
if anyone has better answer please do share.
thanks & regards,
GBiradar
| how to stop wifi module triggering from udevadm trigger? |
1,522,037,959,000 |
I just print the kernel rpms that need to install on my redhat machine (version 6.5)
# yum list-security --security | grep kernel-[0-9]
RHSA-2014:1143 security kernel-2.6.18-371.12.1.el5.x86_64
RHSA-2014:1959 security kernel-2.6.18-400.el5.x86_64
RHSA-2014:2008 security kernel-2.6.18-400.1.1.el5.x86_64
RHSA-2015:0164 security kernel-2.6.18-402.el5.x86_64
RHSA-2015:0783 security kernel-2.6.18-404.el5.x86_64
RHSA-2015:1042 security kernel-2.6.18-406.el5.x86_64
RHSA-2016:0045 security kernel-2.6.18-408.el5.x86_64
RHSA-2016:0450 security kernel-2.6.18-409.el5.x86_64
in case I want to install all security kernel rpms ( as displayed )
is that mean that all 8 initrd & vmlinuz kernels files will be installed under /boot ?
I am asking this question because I have small free available size on /boot
remark - the yum command that installed all the security packages is:
yum -y update --security
example what I have now under /boot:
# ls /boot
System.map-2.6.18-371.11.1.el5 grub lost+found vmlinuz-2.6.18-371.11.1.el5
config-2.6.18-371.11.1.el5 initrd-2.6.18-371.11.1.el5.img symvers- 2.6.18-371.11.1.el5.gz
|
in case I want to install all security kernel rpms ( as displayed ) is that mean that all 8 initrd & vmlinuz kernels files will be installed under /boot ?
I am asking this question because I have small free available size on
/boot
Basically yum would only install the latest kernel security update, as there's no point in installing older updates. And depending what you have configued for installonlypkgs and installonly_limit options in /etc/yum.conf it will only install the new kernel, then remove the old kernel package. Although the default is to keep the newest 3 kernels, if I remember correctly.
| linux + dose each security kernel rpm will install the relevant initrd and vmlinuz files under /boot |
1,522,037,959,000 |
how to verify in linux 7 , what is the current index that have the current kernel version
for example
I want to know if the kernel - 3.10.0-327.18.2.el7.x86_64
is located in index=0 or index=1 or index=2 etc
is it possible to verify what is the index number? on linux 7
uname -r
3.10.0-327.18.2.el7.x86_64
grubby --info=ALL
index=0
kernel=/boot/vmlinuz-3.10.0-327.18.2.el7.x86_64
args="ro rd.lvm.lv=rootvg/swap rd.lvm.lv=rootvg/slash vconsole.font=latarcyrheb-sun16 crashkernel=auto vconsole.keymap=us vga=0x314 net.ifnames=0 ipv6.disable=1 rd.shell LANG=en_US.UTF-8"
root=/dev/mapper/rootvg-slash
initrd=/boot/initramfs-3.10.0-327.18.2.el7.x86_64.img
title=Red Hat Enterprise Linux Server (3.10.0-327.18.2.el7.x86_64) 7.2 (Maipo)
index=1
kernel=/boot/vmlinuz-3.10.0-327.10.1.el7.x86_64
args="ro rd.lvm.lv=rootvg/swap rd.lvm.lv=rootvg/slash vconsole.font=latarcyrheb-sun16 crashkernel=auto vconsole.keymap=us vga=0x314 net.ifnames=0 ipv6.disable=1 rd.shell LANG=en_US.UTF-8"
root=/dev/mapper/rootvg-slash
initrd=/boot/initramfs-3.10.0-327.10.1.el7.x86_64.img
title=Red Hat Enterprise Linux Server (3.10.0-327.10.1.el7.x86_64) 7.2 (Maipo)
index=2
kernel=/boot/vmlinuz-3.10.0-327.4.5.el7.x86_64
args="ro rd.lvm.lv=rootvg/swap rd.lvm.lv=rootvg/slash vconsole.font=latarcyrheb-sun16 crashkernel=auto vconsole.keymap=us vga=0x314 net.ifnames=0 ipv6.disable=1 rd.shell LANG=en_US.UTF-8"
root=/dev/mapper/rootvg-slash
initrd=/boot/initramfs-3.10.0-327.4.5.el7.x86_64.img
title=Red Hat Enterprise Linux Server (3.10.0-327.4.5.el7.x86_64) 7.2 (Maipo)
index=3
kernel=/boot/vmlinuz-0-rescue-b2c5e6a1c5ea4cb5be82100bd7dc3469
args="ro rd.lvm.lv=rootvg/swap rd.lvm.lv=rootvg/slash vconsole.font=latarcyrheb-sun16 crashkernel=auto vconsole.keymap=us vga=0x314 net.ifnames=0 ipv6.disable=1 rd.shell"
root=/dev/mapper/rootvg-slash
initrd=/boot/initramfs-0-rescue-b2c5e6a1c5ea4cb5be82100bd7dc3469.img
title=Red Hat Enterprise Linux Server, with Linux 0-rescue- b2c5e6a1c5ea4cb5be82100bd7dc3469
index=4
non linux entry
|
$ sudo grubby --info=ALL | grep -B1 '^kernel=' | grep -B1 `cat /proc/cmdline | awk -v RS=" " '/^BOOT_IMAGE=/ {print substr($0,12)}'`$ | head -n1
index=0
$
Reference:
https://superuser.com/questions/462737/where-can-i-find-the-linux-kernel-file
https://stackoverflow.com/questions/30524468/how-to-extract-value-of-root-variable-from-kernel-commandline
https://unix.stackexchange.com/questions/124462/detecting-pattern-at-the-end-of-a-line-with-grep
| grub2 + how to print the current index according to grubby --info=ALL |
1,463,635,451,000 |
So I have two nics, but I can't get the second to load, here is the output from
lspci -vvv
04:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
Subsystem: Super Micro Computer Inc Unknown device 0000
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 169
Region 0: Memory at fb900000 (32-bit, non-prefetchable) [size=128K]
Region 2: I/O ports at e000 [size=32]
Region 3: Memory at fb920000 (32-bit, non-prefetchable) [size=16K]
Capabilities: [c8] Power Management version 2
Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [d0] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
Address: 0000000000000000 Data: 0000
Capabilities: [e0] Express Endpoint IRQ 0
Device: Supported: MaxPayload 256 bytes, PhantFunc 0, ExtTag-
Device: Latency L0s <512ns, L1 <64us
Device: AtnBtn- AtnInd- PwrInd-
Device: Errors: Correctable- Non-Fatal- Fatal- Unsupported-
Device: RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
Device: MaxPayload 128 bytes, MaxReadReq 512 bytes
Link: Supported Speed 2.5Gb/s, Width x1, ASPM L0s L1, Port 0
Link: Latency L0s <128ns, L1 <64us
Link: ASPM Disabled RCB 64 bytes CommClk+ ExtSynch-
Link: Speed 2.5Gb/s, Width x1
Capabilities: [a0] MSI-X: Enable+ Mask- TabSize=5
Vector table: BAR=3 offset=00000000
PBA: BAR=3 offset=00002000
I found out to use Intels e1000e drivers but when I use make install, I get the following:
[root@lan3 src]# make install
Makefile:67: *** Kernel header files not in any of the expected locations.
Makefile:68: *** Install the appropriate kernel development package, e.g.
Makefile:69: *** kernel-devel, for building kernel modules and try again. Stop.
[root@lan3 src]#
[root@lan3 src]# yum install kernel-devel
Loaded plugins: fastestmirror, kmod
Loading mirror speeds from cached hostfile * addons: centos.mirror.nac.net
* base: centos.chi.host-engine.com
* extras: mirror.metrocast.net
* updates: mirror.trouble-free.net
Setting up Install Process
Package kernel-devel-2.6.18-409.el5.x86_64 already installed and latest version
Nothing to do
[root@lan3 src]#
Changing OS's is not an Option, I realize its old, but its a standard Intel Gigabit Nic. Any help is appreciated!
UPDATES:
# uname -r
2.6.18-194.11.1.el5
ifconfig doesn't show the NIC at all.
|
The solution!
Install elrepo repository. && install kernel independant e1000e drivers from elrepo && tell kernel to use new drivers && reboot.
rpm -Uvh http://www.elrepo.org/elrepo-release-5-5.el5.elrepo.noarch.rpm && yum install kmod-e1000e && sudo nano /etc/modprobe.conf && reboot
Replace
#alias eth0 e100e
alias eth0 kmod-e1000e
| Missing NIC in CentOS 5 - AsteriskNow 1.7.1 |
1,463,635,451,000 |
I need to run the yum update on my Linux redHat machine
during the yum update , I sow that yum perform some patch kernel update
therefore I little worry to perform a reboot , because the patches of the kernel update
I need advice what I need to verify or configure regarding the patches of the kernel update , in order to start up normally my Linux machine
|
Two things to keep in mind with RHEL (which is what I'm assuming you mean by "red hat"):
1) It's an Enterprise platform, which means they intentionally try to keep things as similar as possible for as long as possible. The updates you're getting are to fix issues with the older kernel. Occasionally they'll backport new features or rebase a package but the goal is to change as little as humanly possible. This is why they had to create thing like software collections. People kept complaining that the software versions on RHEL were getting very old by the time a platform was halfway through its lifecycle.
2) You're allowed more than one kernel to be installed, for the exact reason you're worried about the update. The default is to keep the current kernel and the two previous kernel installed and available as alternative boot options. If the new kernel creates issues for you, just force a reboot and select one of the older kernels next time. Once you figure out what the issue was with the new kernel (hardly ever happens to begin with, but it's usually some proprietary software being in the initrd) you can remediate and reboot as appropriate.
| Linux red-hat + kernel patch update |
1,463,635,451,000 |
I am trying to get my android kernel working but I have a kernel module that is needed in order to get access to the file system of the device. Unfortunately there is no source code available so there are only the pre-compiled module and the kernel source. The kernel now tries to load the module without success. In the Module.symvers file in the kernel root directory the symbol that is needed is missing but the manufacturer of the device delivered a Module.symvers file from the root of the kernel source tree which includes all symbols that are needed.
How can I include those symbols in my kernel to get the module working?
|
The problem was the config file of the kernel. It disabled some features so the module would not load.
| Add symbols of LKM to kernel |
1,463,635,451,000 |
I developed a module which works as an emulator for a block device. When I write into the block device, I get this in dmesg and the module crashes. I cannot get any hint about what is going on?
[82013.054224] CPU: 9 PID: 15452 Comm: my_blk/0 Tainted: G B I E 3.19.0+ #1
[82013.054226] Hardware name: Dell Inc. PowerEdge R730xd/0599V5, BIOS 1.0.4 08/28/2014
[82013.054229] ffffffff81aa8fb8 ffff881fe1613778 ffffffff817a7f98 0000000000000000
[82013.054234] 0000000000000009 ffff881fe16137a8 ffffffff813c45b5 ffff880030243600
[82013.054239] ffff881fe0a4c798 ffff883feb3ced00 ffff881fe00c3900 ffff881fe16137b8
[82013.054244] Call Trace:
[82013.054251] [<ffffffff817a7f98>] dump_stack+0x4f/0x7b
[82013.054257] [<ffffffff813c45b5>] check_preemption_disabled+0xf5/0x110
[82013.054262] [<ffffffff813c4607>] debug_smp_processor_id+0x17/0x20
[82013.054276] [<ffffffffc03599dd>] megasas_build_io_fusion+0x54d/0x5a0 [megaraid_sas]
[82013.054287] [<ffffffffc0359af1>] megasas_build_and_issue_cmd_fusion+0x71/0x110 [megaraid_sas]
[82013.054296] [<ffffffffc034cf35>] megasas_queue_command+0x145/0x1b0 [megaraid_sas]
[82013.054301] [<ffffffff8154ae03>] scsi_dispatch_cmd+0x103/0x370
[82013.054306] [<ffffffff8154dcbf>] scsi_request_fn+0x4af/0x6c0
[82013.054311] [<ffffffff81374177>] __blk_run_queue+0x37/0x50
[82013.054315] [<ffffffff81374dd1>] queue_unplugged+0x41/0xf0
[82013.054320] [<ffffffff8137a042>] blk_flush_plug_list+0x1d2/0x210
[82013.054325] [<ffffffff8137a098>] blk_finish_plug+0x18/0x50
[82013.054331] [<ffffffff8127e54b>] ext4_writepages+0x55b/0xd10
[82013.054336] [<ffffffff812144ad>] ? __mnt_drop_write+0x2d/0x50
[82013.054342] [<ffffffff8109d624>] ? finish_task_switch+0x64/0x110
[82013.054348] [<ffffffff81187ea0>] do_writepages+0x20/0x40
[82013.054352] [<ffffffff8117c1a9>] __filemap_fdatawrite_range+0x59/0x60
[82013.054356] [<ffffffff8117c1e7>] filemap_write_and_wait_range+0x37/0x80
[82013.054360] [<ffffffff8127376a>] ext4_sync_file+0x12a/0x390
///// calling some functions in my_blk
[82013.054397] [<ffffffff81097b19>] kthread+0xc9/0xe0
[82013.054402] [<ffffffff81097a50>] ? flush_kthread_worker+0x90/0x90
[82013.054407] [<ffffffff817af7bc>] ret_from_fork+0x7c/0xb0
[82013.054412] [<ffffffff81097a50>] ? flush_kthread_worker+0x90/0x90
|
This problem happens when I set CONFIG_PREEMPT=y in my kernel configurations. To solve the problem on linux 3.19.0, I had to apply following patch, which change smp_processor_id() to raw_smp_processor_id() in drivers/scsi/megaraid/megaraid_sas_io_fusion.c. The patch is in the following link:
http://permalink.gmane.org/gmane.linux.scsi/100408
| CPU: 13 PID: 15452 Comm: ssd_blk/0 Tainted: G B I E 3.19.0+ #1 |
1,463,635,451,000 |
I am using ARM Foundation Model to emulate a arm-v8 environment(I need both TrustZone and KVM), and I run a kvm-enabled linux on it as the Host OS, the kernel version is 3.14.0(I clone it following the guide on virtualopensystems.
However, when try to run a guest OS, I met with some problems(both kvm-tools and qemu-system-aarch64). Here are what I met:
All the tools and ther kernel source code are from the guide mentioned above, and I use the prebuilt binaries. But I compiled the kernel myself.
KVM Tools:
I use the prebuilt kvm tools found in the website of virtualopensystems, lkvm-static
When I boot the guest kernel, it hung at bootconsole [earlycon0] disabled. I did some google work but didn't find not too much. Some say it might because of the wrong devicetree, but I there is no dtb file in the guide.
qemu-system-aarch64
Also, I use the prebuilt binaries
When I boot the guest kernel, it seemed 'normal' until it gave messages like the following:
hwclock: can't open '/dev/misc/rtc': No such file or directory
modprobe: can't change directory to '3.14.0': No such file or directory
openvt: can't open '/dev/tty1': No such file or directory
The complete log of QEMU would be in the last of this question.
Another thing needs to be mentioned, the .config file of the Host OS is NOT the original one. The original .config file has the KVM feature but lacks the support for DMA-relevant functions, which is needed for my own sake.
So I replaced it with the .config in the kernel of 3.18-rc. Of course, they are not same at all, and when I run make, I have to manually decide some configurations, I decide them all as default. And after compilation, the TrustZone feature is normal, and /dev/kvm is also generated, but when I try to run a guest OS, I met with the problems above.
Could anyone please give me some suggestions?
Thanks a lot.
Tgn Yang
=========================================================
Here are the output when using qemu:
root@FVP:/data/qemu-kvm ./qemu-system-aarch64 --enable-kvm --nographic --kernel
Image --drive if=none,file=disk_oe64.img,id=fs --device virtio-blk-device,drive=fs -m 512 -M virt --cpu host --append "earlyprintk conosole=ttyAMA0 mem=512M rootwait root=/dev/vda rw"
Initializing cgroup subsys cpu
Linux version 3.14.0 (hamayun@hamayun-laptop) (gcc version 4.8.1 (Ubuntu/Linaro4.8.1-10ubuntu7) ) #1 SMP PREEMPT Tue Apr 29 15:37:35 CEST 2014
CPU: AArch64 Processor [410fd000] revision 0
No earlyprintk arguments passed.
Memory limited to 512MB
psci: probing function IDs from device-tree
PERCPU: Embedded 11 pages/cpu @ffffffc01ffe7000 s16128 r8192 d20736 u45056
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129280
Kernel command line: earlyprintk conosole=ttyAMA0 mem=512M rootwait root=/dev/vda rw
PID hash table entries: 2048 (order: 2, 16384 bytes)
Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)
Inode-cache hash table entries: 32768 (order: 6, 262144 bytes)
software IO TLB [mem 0x5b000000-0x5f000000] (64MB) mapped at [ffffffc01b000000-ffffffc01effffff]
Memory: 436272K/524288K available (4122K kernel code, 357K rwdata, 1748K rodata, 243K init, 284K bss, 88016K reserved)
Virtual kernel memory layout:
vmalloc : 0xffffff8000000000 - 0xffffffbbffff0000 (245759 MB)
vmemmap : 0xffffffbc00e00000 - 0xffffffbc01500000 ( 7 MB)
modules : 0xffffffbffc000000 - 0xffffffc000000000 ( 64 MB)
memory : 0xffffffc000000000 - 0xffffffc020000000 ( 512 MB)
.init : 0xffffffc00063d000 - 0xffffffc000679f00 ( 244 kB)
.text : 0xffffffc000080000 - 0xffffffc00063ca14 ( 5875 kB)
.data : 0xffffffc00067a000 - 0xffffffc0006d37d0 ( 358 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptible hierarchical RCU implementation.
RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
NR_IRQS:64 nr_irqs:64 0
Architected cp15 timer(s) running at 100.00MHz (virt).
sched_clock: 56 bits at 100MHz, resolution 10ns, wraps every 2748779069440ns
Calibrating delay loop (skipped), value calculated using timer frequency.. 200.00 BogoMIPS (lpj=1000000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes)
hw perfevents: enabled with arm/armv8-pmuv3 PMU driver, 1 counters available
Brought up 1 CPUs
SMP: Total of 1 processors activated.
devtmpfs: initialized
atomic64 test passed
regulator-dummy: no parameters
NET: Registered protocol family 16
vdso: 2 pages (1 code, 1 data) at base ffffffc000681000
hw-breakpoint: found 16 breakpoint and 16 watchpoint registers.
Serial: AMBA PL011 UART driver
9000000.pl011: ttyAMA0 at MMIO 0x9000000 (irq = 33, base_baud = 0) is a PL011 rev1
console [ttyAMA0] enabled
bio: create slab <bio-0> at 0
SCSI subsystem initialized
Switched to clocksource arch_sys_counter
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP: reno registered
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
kvm [1]: HYP mode not available
futex hash table entries: 256 (order: 2, 16384 bytes)
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
nfs4filelayout_init: NFSv4 File Layout Driver Registering...
fuse init (API version 7.22)
9p: Installing v9fs 9p2000 file system support
msgmni has been set to 852
io scheduler noop registered
io scheduler cfq registered (default)
Serial: AMBA driver
blk-mq: CPU -> queue map
CPU 0 -> Queue 0
vda: unknown partition table
TCP: cubic registered
NET: Registered protocol family 17
9pnet: Installing 9P2000 support
Key type dns_resolver registered
regulator-dummy: disabling
kjournald starting. Commit interval 5 seconds
EXT3-fs (vda): using internal journal
EXT3-fs (vda): mounted filesystem with writeback data mode
VFS: Mounted root (ext3 filesystem) on device 254:0.
devtmpfs: mounted
Freeing unused kernel memory: 240K (ffffffc00063d000 - ffffffc000679000)
INIT: version 2.88 booting
Mounting local filesystems...
Starting udev
udevd[384]: starting version 182
Activating swap
Starting Bootlog daemon: bootlogd.
Initializing random number generator...
random: dd urandom read with 5 bits of entropy available
udev-cache: checking for /dev/shm/udev-regen... found.
Populating dev cache
Populating volatile Filesystems.
Checking for -/run/lock-.
Creating directory -/run/lock-.
Checking for -/var/volatile/log-.
Creating directory -/var/volatile/log-.
Checking for -/var/volatile/tmp-.
Creating directory -/var/volatile/tmp-.
Target already exists. Skipping.
Checking for -/var/lock-.
Creating link -/var/lock- pointing to -/run/lock-.
Checking for -/var/log-.
Creating link -/var/log- pointing to -/var/volatile/log-.
Checking for -/var/run-.
Creating link -/var/run- pointing to -/run-.
Checking for -/var/tmp-.
Creating link -/var/tmp- pointing to -/var/volatile/tmp-.
Checking for -/tmp-.
Creating link -/tmp- pointing to -/var/tmp-.
Checking for -/var/lock/subsys-.
Creating directory -/var/lock/subsys-
Checking for -/var/log/wtmp-.
Creating file -/var/log/wtmp-.
Checking for -/var/run/utmp-.
Creating file -/var/run/utmp-.
Checking for -/etc/resolv.conf-.
Creating link -/etc/resolv.conf- pointing to -/var/run/resolv.conf-.
Checking for -/var/run/resolv.conf-.
Creating file -/var/run/resolv.conf-.
Checking for -/var/log/boot-.
Creating file -/var/log/boot-.
Target already exists. Skipping.
Checking for -/var/run/sepermit-.
Creating directory -/var/run/sepermit-.
Checking for -/var/run/sshd-.
Creating directory -/var/run/sshd-.
Checking for -/var/log/lastlog-.
Creating file -/var/log/lastlog-.
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
System time was Thu Jan 1 00:00:06 UTC 1970.
Setting the System Clock using the Hardware Clock as reference...
hwclock: can't open '/dev/misc/rtc': No such file or directory
System Clock set. System local time is now Thu Jan 1 00:00:06 UTC 1970.
Thu Jun 18 11:03:04 UTC 2015
Saving the System Clock time to the Hardware Clock...
hwclock: can't open '/dev/misc/rtc': No such file or directory
Hardware Clock updated to Thu Jun 18 11:03:04 UTC 2015.
INIT: Entering runlevel: 5
Configuring network interfaces... ifconfig: SIOCGIFFLAGS: No such device
Starting OpenBSD Secure Shell server: sshd
generating ssh RSA key...
generating ssh ECDSA key...
generating ssh DSA key...
generating ssh ED25519 key...
done.
Starting rpcbind daemon...done.
starting statd: done
System time was Thu Jun 18 11:03:36 UTC 2015.
Setting the System Clock using the Hardware Clock as reference...
hwclock: can't open '/dev/misc/rtc': No such file or directory
System Clock set. System local time is now Thu Jun 18 11:03:36 UTC 2015.
modprobe: can't change directory to '3.14.0': No such file or directory
NFS daemon support not enabled in kernel
Starting syslogd/klogd: done
openvt: can't open '/dev/tty1': No such file or directory
Starting auto-serial-console: done
Stopping Bootlog daemon: bootlogd.
INIT: no more processes left in this runlevel
|
It turns out to be the matter of Image, I recompile the kernel and then it is OK.
But there is some problems of lkvm-tools, it couldn't initialize the ioctl normally.
| Unable to boot a kvm guest via qemu/kvm-tools |
1,463,635,451,000 |
I am trying to install the kernel header files on Debian via the terminal,
but it does not seem to exist in apt-get.
The reason I need the kernel header files is because I need to
install WiFi adapter drivers for an RTL wifi chip, and when running
the install.sh that comes with the drivers it ends with
an error that says that it can not find build in /lib/modules/3.4.90+/.
I have read articles that suggest that I need to compile and build the kernel from scratch but that seems a bit unnecessary to me.
I have also tried sudo apt-get install linux-headers-$(uname -r) but an lower version of the kernel is installed instead.
Could anyone point me in the right direction?
EDIT:
I'm on ARM Debian and the WiFi module uses a RTL8188 chip.
I downloaded the Linux image from www.armhf.com
|
All I had to do was to copy the folder 3.4.90+ in the path /lib/modules from the original Olimex Debian Image to the same path on the NAND flash.
After that I just installed firmware-realtek and wpa_supplicant and I was up and running.
| Install Debian kernel header files 3.4.90+ via terminal for ARMHF |
1,463,635,451,000 |
I'm trying to boot my first custom kernel from Linus's latest repo:
During the decompressing stage I get the following error:
Could not find overlay #6 ### dt-test ### of
unittest_destroy_tracked_overlays: overlay destroyed failed for #6
I have not been able to fix this - any ideas?
Note: I'm new to the kernel side of Linux and trying the eudyptula challenge so if this is easy to solve a pointer in the general direction rather than the solution would be nice.
|
I cloned a second copy from Linus and this ran without any issues - not sure what I did wrong the first time.
| Error when booting new kernel - overlays [closed] |
1,463,635,451,000 |
If I start User Mode Linux with this command:
./kernel32-3.19.8 ubda=./Debian-Wheezy-x86-root_fs mem=128m
On Debian GNU/Linux 8 (jessie) with one CPU core, why do I see 4 processes in top:
1608 root 20 0 132m 42m 42m S 0.7 33.4 0:12.01 kernel32-3.19.8
1615 root 20 0 132m 42m 42m S 0.0 33.4 0:00.00 kernel32-3.19.8
1616 root 20 0 132m 42m 42m S 0.0 33.4 0:00.02 kernel32-3.19.8
1617 root 20 0 132m 42m 42m S 0.0 33.4 0:00.00 kernel32-3.19.8
|
From User Mode Linux: skas mode:
If you run ps, you will notice only four processes per UML rather than the dozens that you see in tt mode. They are
The UML kernel thread, which runs in the separate kernel address space, executes kernel code, and does system call interception on UML processes
The UML userspace thread, which runs all UML process code and switches between host address spaces on each UML context switch
The ubd driver asynchronous IO thread
The write SIGIO emulation thread
| Why does user mode linux spawn 4 processes? |
1,463,635,451,000 |
I need to start GNU* clustering, But I have problem, Which level:
DB level? (replication)
file system? (distributed)
process level ? (such as intel fortran for civilization softwares)
new process ? (such as above with some differnces)
I know DB level have per db backend seperated rrplication. Distrinuted file systems in linux is btrFS and freebsd uses zfs.But i have serious problem with process clustering and its softwares.
Anyway , Question is, What's kernel level of process level?If I strt it , Do I have to forced to use a distributed fs?
|
cman is new cluster project and redhat says:
The Red Hat Cluster Suite cluster infrastructure provides the basic functions for a group of computers (called nodes or members) to work together as a cluster. Once a cluster is formed using the cluster infrastructure, you can use other Red Hat Cluster Suite components to suit your clustering needs (for example, setting up a cluster for sharing files on a GFS file system or setting up service failover). The cluster infrastructure performs the following functions:
1. Cluster management
2. Lock management
3. Fencing
4. Cluster configuration management
Cluster Management
Cluster management manages cluster quorum and cluster membership. CMAN (an abbreviation for cluster manager) performs cluster management in Red Hat Cluster Suite for Red Hat Enterprise Linux 5. CMAN is a distributed cluster manager and runs in each cluster node; cluster management is distributed across all nodes in the cluster ( “CMAN/DLM Overview”).
CMAN keeps track of cluster quorum by monitoring the count of cluster nodes. If more than half the nodes are active, the cluster has quorum. If half the nodes (or fewer) are active, the cluster does not have quorum, and all cluster activity is stopped. Cluster quorum prevents the occurrence of a "split-brain" condition — a condition where two instances of the same cluster are running. A split-brain condition would allow each cluster instance to access cluster resources without knowledge of the other cluster instance, resulting in corrupted cluster integrity.
Quorum is determined by communication of messages among cluster nodes via Ethernet. Optionally, quorum can be determined by a combination of communicating messages via Ethernet and through a quorum disk. For quorum via Ethernet, quorum consists of 50 percent of the node votes plus 1. For quorum via quorum disk, quorum consists of user-specified conditions.
CMAN keeps track of membership by monitoring messages from other cluster nodes. When cluster membership changes, the cluster manager notifies the other infrastructure components, which then take appropriate action. For example, if node A joins a cluster and mounts a GFS file system that nodes B and C have already mounted, then an additional journal and lock management is required for node A to use that GFS file system. If a cluster node does not transmit a message within a prescribed amount of time, the cluster manager removes the node from the cluster and communicates to other cluster infrastructure components that the node is not a member. Again, other cluster infrastructure components determine what actions to take upon notification that node is no longer a cluster member. For example, Fencing would fence the node that is no longer a member.
home page of cman is here.
| GNU\Linux clustreing , Which level? Which application? [closed] |
1,463,635,451,000 |
Pfsense is an open source Firewall based on openBSD kernel.
Where can I find the code and how to modify it to build my firewall?
|
As indicated on the website the actual code is available via GitHub for you to look at.
https://www.pfsense.org/get-involved/
https://github.com/pfsense/
The other choice is to examine the relevant web server configuration file to find the location the web front-end files so that you can track down other relevant files to modify for your project (I've done similar things with other software appliance type devices before but you need to understand that it's a slippery slope. If it's not designed well then you can end up in a mess and you might even have been better of starting from scratch though I doubt that it's the case here...).
Obviously, you can modify it in a million different ways once you have access to the actual files including direct modification and via a WYSIWYG editor.
You subsequent comment/s seem to be jumping from one place to another...
This is something that you can't learn simply be reading by thinking about it from the start and then picturing how the whole thing will work without adequate background knowledge.
Even if you have adequate background knowledge there are a lot of practical issues that you need to deal with (you'll figure this out) such as how everything fits together. It's not a single thing you're asking. You're asking for how to seemingly solve many sub-problems as well.
Like I said the best way to do this is to learn by doing. Namely, working on the problem and researching at the same time.
Moreover, based on what I'm seeing you don't really know what you're getting yourself into. I've done this. One minute you'll be stuck working on a piece of HTML, the next you could be working on a CGI script in BASH, Perl, or Python, and the next working on something at the operating system level in C/C++.
Saying that you know one language or another is not going to help you in this context. Flexibility, resilience, and desire are the keys if you want to complete your project successfully.
If you want to do this the best way to get involved may be simply to get involved with existing projects (such as pfSense) and then fork it to suit your needs, ask members involved in these projects to help you, etc...
Else start from scratch by yourself and then attempt to break the problem down and ask questions here and on other online forums until problem completion.
For kernel level modifications there are already many different resources out there. As stated before though, based on the way you've phrased things you could simply be building a custom web interface for a firewall appliance based on a BSD core or else a firewall/operating system from scratch. You need to figure out how far you want to take it and then just work on it.
Based on what I know of other people, if you sit on it and just read you'll figure out the scale of what you're contemplating and then pull back or out of the project entirely. Just start working on it...
http://www.freesoftwaremagazine.com/articles/writing_a_kernel_module_for_freebsd
https://www.freebsd.org/doc/en_US.ISO8859-1/books/
http://www.nostarch.com/bsddrivers.htm
This is a Linux resource but core theories are the same. It may be useful to you.
http://www.oreilly.com/openbook/linuxdrive3/book/
| Pfsense source code to build firewall |
1,463,635,451,000 |
Attempting to boot Funtoo with a debian-sources-3.16.2-3 kernel, in a system where the root file-system lives in a zpool, drops off to the rescue shell after failing to import the pool properly. Does ZFS-on-Linux support linux-kernel versions 3.16.y?
The official related FAQ states:
The current spl/zfs-0.6.3 release supports Linux 2.6.26 - 3.15
kernels.
However, in a related post, someone wrote:
ZoL provides the latest code to all supported kernels and
distributions. This ranges from Linux 2.6.26.y to the 3.16.y in 0.6.3
and will include 3.17.y in 0.6.4.
|
Turns out I had a typo in the the real_root=ZFS= parameter in grub.cfg. After fixing it, the system boot successfully.
So,
zfs-0.6.3 does support kernel versions 3.16.y
there is a "typo" in the related FAQ
| ZFS support for linux kernel versions 3.16 |
1,463,635,451,000 |
Using debian and centos, i get the same error when plugging my USB mic in. In Windows (xp thru 8.1) it works fine.
[ 304.237543] usb 2-1.6.2: USB disconnect, device number 6
[ 305.220785] usb 2-1.6.2: new full-speed USB device number 9 using ehci-pci
[ 305.331189] usb 2-1.6.2: New USB device found, idVendor=a012, idProduct=b012
[ 305.331195] usb 2-1.6.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 305.331198] usb 2-1.6.2: Product: DYNEX USB MIC Device
[ 305.331201] usb 2-1.6.2: Manufacturer: DYNEX
[ 305.331204] usb 2-1.6.2: SerialNumber: 12000002
[ 305.338744] input: DYNEX DYNEX USB MIC Device as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6.2/2-1.6.2:1.2/input/input21
[ 305.338893] hid-generic 0003:A012:B012.000A: input,hidraw3: USB HID v1.00 Device [DYNEX DYNEX USB MIC Device] on usb-0000:00:1d.0-1.6.2/input2
[ 305.366189] cannot submit urb 0, error -28: not enough bandwidth
[ 304.237543] usb 2-1.6.2: USB disconnect, device number 6
[ 305.220785] usb 2-1.6.2: new full-speed USB device number 9 using ehci-pci
[ 305.331189] usb 2-1.6.2: New USB device found, idVendor=a012, idProduct=b012
[ 305.331195] usb 2-1.6.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 305.331198] usb 2-1.6.2: Product: DYNEX USB MIC Device
[ 305.331201] usb 2-1.6.2: Manufacturer: DYNEX
[ 305.331204] usb 2-1.6.2: SerialNumber: 12000002
[ 305.338744] input: DYNEX DYNEX USB MIC Device as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6.2/2-1.6.2:1.2/input/input21
[ 305.338893] hid-generic 0003:A012:B012.000A: input,hidraw3: USB HID v1.00 Device [DYNEX DYNEX USB MIC Device] on usb-0000:00:1d.0-1.6.2/input2
[ 305.366189] cannot submit urb 0, error -28: not enough bandwidth
What i noticed is that with centos, the issue existed from the start, with debian, the mic initially worked until i allowed the update process to continue. after rebooting, i began to see this issue. I assume due to the output that this is due to a kernel change, possibly with the ehci/uhci but i'm not positive.
The MIC on my webcam works (although a little delayed due to some other errors) and a line in mic works, im only having this issue with this particular USB mic.
Attempting some other solutions, i completely removed pulseaudio as many blame world hunger on pulse, but even with just Alsa, the problem still remained. This furthers my belief that the issue is with the kernel and/or modules as opposed to other software.
Does anyone have any thoughts?
|
I have not previously used distributions like this, im a long time slackware/linuxfromscratch user and I was under the impression that these used kernels with a multitude of modules to ensure full compatibility (especially considering they recommend against rolling your own kernel) I downloaded the latest from kernel.org and compiled it, it resolved the problem as soon as I booted it. I haven't had time to dig into what specifically caused the issue (i think snd_usb) but the new kernel definitely took care of it.
to add a little info to the original, i rebuilt the system around 7 times and noticed that upon initial boot after install the mic worked. it would stop working after the first reboot 5/7 times. 2/7 times it was dead on boot with the above errors. this is without loading any software/updates in any case.
| MIC not working due to USB bandwidth |
1,399,643,182,000 |
I am tryting to make initrd file system following [this tutorial][1]
My host system is RHEL 6 64 bit.
I am unable to get the required command: genext2fs
No rpm is available for it, neither yum is helping me.
I hope there is an alternate to this command.
|
If you want genext2fs, it's easy to find; build it from source. But you probably don't want it. Create an initramfs instead. That's the normal method these days.
| Is there any alternative to genext2fs in RHEL? |
1,399,643,182,000 |
I 'm running Angstrom distribution (console only) on BeagleBoard-xM. Image was build on Narcissus, with Bootloader Files (x-load/u-boot/scripts) added.
I noticed that usr/src directory is empty. I intend to install kernel source packages. For this reason, I downloaded Linux kernel 2.6.32 from https://www.kernel.org. What should be my next steps? I 've been searching for days, but I didn't find anything.
Any help would really be appreciated.
|
Just untar (tar xf kernel-sources.tar.whatever) it into /usr/src - or anywhere else for that matter.
Just remember that if you want to use the symlinks /lib/modules/kernel/{build,source} that point to the kernel build and source tree, respectively, as created by make modules_install, you'll need to either keep the sources at the same place, or update the symlinks accordingly.
That said, if you are planning anything else than just one-off kernel compilation, clone Linus' or any other git tree and use that instead of the tarballs. It can be interesting even for "just" configuring the kernel, since you can get .config versioning for free.
| How to install kernel sources |
1,399,643,182,000 |
How do I get a usb keyboard to work? I have already selected and compiled the USB HID transport layer and I don't know what else to do.
|
Presuming you have your other USB stuff right (ehci/uhci, etc):
Device Drivers -> HID support -> USB HID support -> USB HID Transport Layer
| USB_HID is not working |
1,399,643,182,000 |
I updated my Dell OEM linux machine from 14.04 to 16.04. Something went wrong during the upgrade and when I tried to login it got stuck in a loop I managed to fix it using the tty terminal and manually connect to wifi using wpa_supplicant. My apt-get is now stuck with 33 not fully installed or removed. when I run apt-get autoremove or apt-get install -f i get the same errors. It quits with this error message.
Errors were encountered while processing:
ufw
gufw
linux-firmware
linux-image-4.4.0-98-generic
linux-image-extra-4.4.0-98-generic
linux-image-generic
linux-generic
linux-generic-lts-xenial
linux-image-4.4.0-53-generic
linux-image-4.4.0-57-generic
linux-image-4.4.0-59-generic
linux-image-4.4.0-72-generic
linux-image-4.4.0-75-generic
linux-image-4.4.0-78-generic
linux-image-4.4.0-79-generic
linux-image-4.4.0-83-generic
linux-image-4.4.0-92-generic
linux-image-4.4.0-93-generic
linux-image-4.4.0-96-generic
linux-image-4.4.0-97-generic
linux-image-extra-4.4.0-53-generic
linux-image-extra-4.4.0-57-generic
linux-image-extra-4.4.0-59-generic
linux-image-extra-4.4.0-72-generic
linux-image-extra-4.4.0-75-generic
linux-image-extra-4.4.0-78-generic
linux-image-extra-4.4.0-79-generic
linux-image-extra-4.4.0-83-generic
linux-image-extra-4.4.0-92-generic
linux-image-extra-4.4.0-93-generic
linux-image-extra-4.4.0-96-generic
linux-image-extra-4.4.0-97-generic
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
Here is the full output of sudo apt-get autoremove
https://pastebin.com/18zbyBAK
|
I ended up copying off my home data and reinstalling 16.04
| apt-get broken after partial update to 16.04 from 14.04 |
1,399,643,182,000 |
we have today strange behavior with our Linux server rhel 7.6
from some reason server goes down
and from the messages file we can see that server stop be available on Oct 16 18:17:22
after some time we start the server at - Oct 18 04:42:46 , ( power on )
Oct 16 18:17:22 linux avahi-daemon[1140]: Invalid response packet from host 45.52.7.60.
Oct 16 18:17:22 linux avahi-daemon[1140]: Invalid response packet from host 45.52.91.79.
Oct 16 18:17:22 linux avahi-daemon[1140]: Invalid response packet from host 45.52.56.84.
Oct 16 18:17:22 linux avahi-daemon[1140]: Invalid response packet from host 45.52.84.118.
Oct 16 18:17:22 linux avahi-daemon[1140]: Invalid response packet from host 45.52.46.210.
Oct 16 18:17:22 linux avahi-daemon[1140]: Invalid response packet from host 45.52.81.152.
Oct 16 18:17:22 linux avahi-daemon[1140]: Invalid response packet from host 45.52.84.119.
Oct 16 18:17:22 linux avahi-daemon[1140]: Invalid response packet from host 45.52.130.225.
Oct 16 18:17:22 linux avahi-daemon[1140]: Invalid response packet from host 45.52.81.103.
Oct 16 18:17:22 linux avahi-daemon[1140]: Invalid response packet from host 45.52.92.110.
Oct 16 18:17:22 linux avahi-daemon[1140]: Invalid response packet from host 45.52.236.182.
Oct 16 18:17:22 linux avahi-daemon[1140]: Invalid response packet from host 45.52.77.79.
Oct 16 18:17:22 linux avahi-daemon[1140]: Invalid response packet from host 45.52.73.52.
Oct 16 18:17:22 linux avahi-daemon[1140]: Invalid response packet from host 45.52.88.172.
Oct 16 18:17:22 linux avahi-daemon[1140]: Invalid response packet from host 45.52.61.224.
Oct 16 18:17:22 linux avahi-daemon[1140]: Invalid response packet from host 45.52.98.223.
Oct 16 18:17:22 linux avahi-daemon[1140]: Invalid response packet from host 45.52.78.250.
Oct 18 04:42:46 linux rsyslogd: [origin software="rsyslogd" swVersion="7.4.7" x-pid="1122" x-info="http://www.rsyslog.com"] start
Oct 18 04:42:42 linux kernel: Initializing cgroup subsys cpuset
Oct 18 04:42:42 linux kernel: Initializing cgroup subsys cpu
Oct 18 04:42:42 linux kernel: Initializing cgroup subsys cpuacct
Oct 18 04:42:42 linux kernel: Linux version 3.10.0-327.el7.x86_64 ([email protected]) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Thu Oct 29 17:29:29 EDT 2015
Oct 18 04:42:42 linux kernel: Command line: BOOT_IMAGE=/vmlinuz-3.10.0-327.el7.x86_64
Oct 18 04:42:42 linux kernel: Disabled fast string operations
Oct 18 04:42:42 linux kernel: e820: BIOS-provided physical RAM map:
since we not have much details why server goes down unexpected ,
then the only thing that we see are the avahi-daemon
so my question is - dose avahi-daemon service could be the reason for the machine unexpected shutdown?
in spite this is not logical but only avahi-daemon message are the message before machine goes down
|
Those avahi-daemon service could be the reason for the machine unexpected shutdown?
No, 100%.
Considering nothing had been logged just before the server went down, it could most likely indicate a hardware failure, power loss or someone simply pressed the reset button.
If your server contains an IPMI/BMC chip you can check its hardware log using ipmitool.
Also, you don't have to have avahi-daemon installed on your server.
| rhel 7.x machines unexpected failure and message file |
1,399,643,182,000 |
In CentOS - the output of rpm -qa | grep -i kernel shows one version (3.10.XX) :
kernel-3.10.0-862.14.4.el7.x86_64
kernel-3.10.0-693.21.1.el7.x86_64
kernel-tools-3.10.0-957.5.1.el7.x86_64
kernel-devel-3.10.0-862.14.4.el7.x86_64
kernel-3.10.0-862.11.6.el7.x86_64
kernel-tools-libs-3.10.0-957.5.1.el7.x86_64
kernel-devel-3.10.0-957.5.1.el7.x86_64
kernel-headers-3.10.0-957.5.1.el7.x86_64
kernel-3.10.0-957.1.3.el7.x86_64
kernel-devel-3.10.0-862.11.6.el7.x86_64
kernel-devel-3.10.0-693.21.1.el7.x86_64
kernel-devel-3.10.0-957.1.3.el7.x86_64
kernel-3.10.0-957.5.1.el7.x86_64
However the output of uname -mrs shows different version (4.18.XX)
Linux 4.18.16-x86_64-linode118 x86_64
does this make any sense ?
|
I believe this is a feature provided by your cloud hosting provider, Linode. They have a document named How to Change your Linode's Kernel that contains the following information:
Your Linode is capable of running one of three kinds of kernels:
An upstream kernel that is maintained and provided by your Linux distribution’s authors (this is also referred to as the
distribution-supplied kernel).
The Linode kernel. Linode maintains an up-to-date kernel: Linode’s engineering team monitors for new versions of the Linux kernel and then packages them for users shortly after they are available. These kernels are not installed on your filesystem–instead, the Linode Manager supplies them at boot time to your system.
A kernel that you compile from source.
That explains why the installed kernel package is different from the running kernel, as reported by uname.
The same document also contains the following about the choice of kernel:
Most distributions that can be deployed from the Linode Manager boot
the upstream kernel by default. CentOS 6, OpenSUSE Leap 42.3,
Slackware, and Ubuntu 14.04, and older distributions are exceptions to
this rule, and they boot the Linode kernel by default.
For your own system, you can verify this by following the instructions in the document I have linked to. Briefly, the configuration should be visible at Settings > Advanced Configurations > [Current Configuration] > Edit > Boot Settings > Kernel.
| Kernel version in uname differs from version in rpm |
1,399,643,182,000 |
In the kernel source tree /tools, there are many submodules. What are the tools available in this folder? I know perf tool. What else are they? How to build them? Are they, by default, integrated into the kernel? What are they used for?
|
make help in that directory gives a brief summary:
Possible targets:
acpi - ACPI tools
cgroup - cgroup tools
cpupower - a tool for all things x86 CPU power
firewire - the userspace part of nosy, an IEEE-1394 traffic sniffer
freefall - laptop accelerometer program for disk protection
gpio - GPIO tools
hv - tools used when in Hyper-V clients
iio - IIO tools
kvm_stat - top-like utility for displaying kvm statistics
leds - LEDs tools
lguest - a minimal 32-bit x86 hypervisor
net - misc networking tools
perf - Linux performance measurement and analysis tool
selftests - various kernel selftests
spi - spi tools
objtool - an ELF object analysis tool
tmon - thermal monitoring and tuning tool
turbostat - Intel CPU idle stats and freq reporting tool
usb - USB testing tools
virtio - vhost test module
vm - misc vm tools
x86_energy_perf_policy - Intel energy policy tool
This doesn’t cover everything available though. In a little more detail:
accounting/getdelays displays various pieces of information relating to task and process scheduling, including context switches (voluntary and involuntary), I/O accounting and delay accounting;
cgroup/cgroup_event_listener is a simple cgroup event listener;
firewire/nosy-dump interacts with the snoop mode driver for TI PCILynx 1394 (Firewire) controllers;
gpio contains a few tools related to GPIO (general-purpose I/O pins, typically on single-board computers such as the Raspberry Pi), including lsgpio which lists the available GPIO chips and lines;
hv contains a number of tools useful in Hyper-V guests;
iio contains industrial I/O-related tools;
kvm/kvm_stat/kvm_stat prints counts of KVM kernel module trace events, i.e. a view of KVM guest activity from the host side;
laptop/dslm/dslm is a simple disk sleep monitor;
laptop/freefall/freefall appears to implement disk protection on HP and Dell laptops (detecting when the laptop is falling, parking the heads, and unparking them when the alarm stops);
leds/uledmon is mostly a userspace LED demonstration program;
lguest contains a minimal 32-bit x86 hypervisor;
net contains a few BPF debugging tools (you’ll need libbfd to build bpf_jit_disasm);
nfsd contains a script to inject NFS daemon faults;
objtool contains an ELF object analysis tool;
pcmcia/crc32hash is a user-space implementation of the kernel’s CRC32 algorithm;
perf contains the perf tool you already know;
power/acpi contains a number of ACPI-related tools;
power/cpupower contains the cpupower tool, library etc., for monitoring and controlling the CPU power management;
power/x86/turbostat/turbostat reports processor topology, frequency, idle power statistics, temperature and power on x86 CPUs;
power/x86/x86_energy_perf_policy/x86_energy_perf_policy displays and sets the x86 energy performance policy;
spi/spidev_test is a SPI testing tool;
testing contains a number of kernel testing tools;
thermal/tmon contains a comprehensive thermal monitoring tool (useful in particular to determine the relationships between cooling devices and thermal behaviour);
time/udelay_test.sh is a udelay() test script;
usb contains a number of USB testing tools, along with usb/usbip, which is a nice client/server tool allowing USB devices to be exported from one host to another;
virtio contains a vhost test module;
vm/page-types displays detailed page information from the virtual memory subsystem.
These tools aren’t part of the kernel build by default, and need to be built explicitly using the appropriate target or directory, as indicated by make help. Many of them have detailed documentation you can read to find out more.
| What are the tools in /tools folder? |
1,399,643,182,000 |
I was looking inside the Linux kernel source code, and I noticed a folder named 'arch.' And I was wondering, what is that folder for? Is it for Arch Linux, or something?
|
It holds architecture-specific code.
All the architecture specific code is in this directory and in the include/asm- directories. Each architecture has its own directory underneath this directory. For example, the code for a PowerPC based computer would be found under arch/ppc. You will find low-level memory management, interrupt handling, early initialization, assembly routines, and much more in these directories.
If you look, you can see the different directories for architectures like x86, ARM etc....
| In the Linux kernel, what is the arch folder for? |
1,399,643,182,000 |
This might be a silly question. Can a program written for Linux (for example written in Golang), invoke a system call to execute another program directly, or does it have to call the shell first and let it run the other program? I don't mean replacing the current program. Let's say I have program1 which is a web-server and constantly running, can it execute program2 by directly reaching out to the kernel and using a relevant system call, or is it going through the shell first? If it's not using the shell, are there specific cases where you have to use the shell in a program to do some stuff? If so what would that be? Would appreciate any infos.
|
Can I run a program without using the shell as an intermediary?
Yes: in exactly the same way that it would launch a shell.
Use exec: but this replaces the current process.
Use fork: to create a new process, then exec to replace it. There are other useful syscalls that the shell uses. pipe: to make a pipe. dup: to attach pipe to stdin or stdout.
There are often higher level libraries to do this. These allow your code to work on other OSes (such as Microsoft's Windows). They will combine several of these syscalls (e.g. to synthesise a create_process call).
It may seem that forking a process then replacing it will be slow. It is not. It is faster than creating a thread on MS-Windows. fork is very efficient: it defers most of the work, so often never has to do it.
Is there any time where I would have to use a shell, when running a program from another?
Only if it is a shell script. However, you may wish to use its services: globing, redirection, etc. I think golang has good enough libraries to do this though, so you should not need the shell.
| Can a program execute another program without the shell as an intermediate? |
1,399,643,182,000 |
from our linux VM rhel 7.5 server with 126G memory
we have strange memory behavior that consume all available memory as the following
free -g
total used free shared buff/cache available
Mem: 126 122 0 1 2 1
Swap: 10 10 0
we have bash script that calculate exactly the consuming of memory and this are the results
5.2 MiB + 2.3 MiB = 7.6 MiB sshd (4)
10.2 MiB + 159.0 KiB = 10.4 MiB polkitd
12.6 MiB + 315.0 KiB = 12.9 MiB gsd-color
16.6 MiB + 5.0 KiB = 16.6 MiB node_exporter
11.3 MiB + 27.1 MiB = 38.4 MiB systemd-journald
40.4 MiB + 15.9 MiB = 56.3 MiB rsyslogd
73.3 MiB + 1.4 MiB = 74.7 MiB python2.7 (3)
226.4 MiB + 2.7 MiB = 229.2 MiB gnome-shell
1.4 GiB + 1.1 MiB = 1.4 GiB df.pll
15.7 GiB + 9.2 MiB = 15.7 GiB java (9)
22.1 GiB + 2.0 MiB = 22.1 GiB KLP-server
---------------------------------
39.6 GiB
and from the top command we can see that memory actually consume around 40G
so how it can be that we see from free -g only 1G available?
what we can see also
is that:
vmware-toolbox-cmd stat balloon
81632 MB
|
vmware-toolbox-cmd stat balloon
81632 MB
is the answer: your system is using approximately 40GiB of memory, and 80GiB are reserved by the VMware ballooning mechanism, resulting in the 122GiB “used” reported by free.
The memory reserved by the balloon isn’t consumed by a process, so it doesn’t appear in ps or top’s output.
| why free command say different from the real consuming memory |
1,399,643,182,000 |
On our Linux RHEL servers fs.file-max is set to 100000
sysctl -p | grep fs.file-max
fs.file-max = 100000
From my understanding the file-max kernel parameter refers to open file descriptors, and file-nr gives us the current number of open file descriptors. But lsof lists all open files, including files which are not using file descriptors – such as current working directories, memory mapped library files, and executable text files.
Is the following lsof really a good indication that we have reached the fs.file-max value?
lsof | wc -l
or
[[ `lsof | wc -l` -gt 100000 ]] && echo "please increase the fs.file-max"
other relevant links - How to display open file descriptors but not using lsof command
|
This
[[ `lsof | wc -l` -gt 100000 ]] && echo "please increase the fs.file-max"
will be misleading. See reference below.
Based on RHEL 5 Tuning, the output of cat /proc/sys/fs/file-nr can be used. We can compare the first and last fields of the output. The first field shows total allocated file handles and the last field shows the maximum file handles that can be allocated. So setup a check so that once, say 90% is reached, a warning is displayed:
[[ $(echo "$(cat /proc/sys/fs/file-nr | cut -f1) / $(cat /proc/sys/fs/file-nr | cut -f3) * 100" | bc -l) -ge 90 ]] \
&& echo "90% reached. Please increase the fs.file-max"
Some difference between lsof and file-nr output:
The file-max kernel parameter refers to open file descriptors, and file-nr gives us the current number of open file descriptors. But lsof lists all open files, including files which are not using file descriptors – such as current working directories, memory mapped library files, and executable text files.
See Reference
| how to know if we reached the max value of fs.file-max |
1,399,643,182,000 |
Does anyone know the last version of the kernel before the fs headers was moved to the root? I think it used to be /sys/fs/.
My memory (from 2010-ish) is less vague than a google search (nothing), it was something like 2.4.26 or 2.6.24 (or 2.6.18).
[EDIT #1]
If Stephens answer is correct, then that is the kernel headers only, not the drivers themselves. There used to be 2 seperate filesystem related forlders in the source. The refactor may have consolidated them.
I know for a fact that they were moved, because I was looking at adding ext3fs/ext4fs/reiserfs to FreeMiNT around 2010, and I found that its ext2fs structure was identical to the linux sources, up to a certain version, consisting of only modified linux source files, meaning that any new drivers could be uplift with filesystem structure intact, and placed into FreeMiNT source tree and they would be in the correct place to start both modification, and compilation
[EDIT #2]
So it appears the "move" I was refering to was in fact the filesystem headers, not the drivers, but also that the files within the drivers changed (title changed to reflect this). So in what version did those changes happen.
|
The technically correct answer to the OP is "they" were never moved (same goes for the drivers in the original title, not just the headers).
However, specifically regarding the ext2 filesystem driver, ext2.h was created as of Linux Kernel 2.5.3, while the 2nd folder refered to was actually the standard header include folder (where the headers were revised and/or refactored). Finally, the "filename changes" mentioned were due to the final inclusion of ACL (Access Control List) and the XATTR (eXtended ATTRibutes) files which were introduced in 2.5.46, while the sys/fs/ reference was actually sys/xfs/ from the FreeMiNT source tree.
2.5.3 - uploaded 30-Jan-2002 19:19
2.5.45 - uploaded 31-Oct-2002 00:51
2.5.46 - uploaded 04-Nov-2002 22:51
The reason for the additon of fs/ext2/ext2.h can be found in a comment in that file:
Ok, these declarations are also in <linux/kernel.h> but none of the ext2 source programs needs to include it so they are duplicated here.
The result of this question has proved (to me at least) how useless Google has become for this sort of research, and how much of the "internet" (specifically the web) has disappeared or been restructured to detrimental effect. If it were not for Stephens answer and subsequent comments and that link, I would not have been able to get this far (there needs to be better/alternate credit systems on StackExchange). Thank god for FTP servers and the massive size of removeable media.
| When Linux Kernel Source moved filesystem headers? |
1,399,643,182,000 |
we set the following kernel parameters in file 99-custom.conf
more /etc/sysctl.d/99-custom.conf
net.ipv4.tcp_low_latency = 1
net.ipv4.tcp_adv_win_scale = 1
net.ipv4.tcp_max_syn_backlog = 30000
net.ipv4.tcp_max_tw_buckets = 2000000
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_fin_timeout = 5
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.accept_source_route = 2
net.ipv4.tcp_mtu_probing = 1
in order to set on the fly, the parameters above we can use sysctl -p /etc/sysctl.d/99-custom.conf
but after reboot of course the values will disappear.
so, one way to solved this is to set the following in /etc/rc.local
as
more /etc/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run chmod +x /etc/rc.d/rc.local to ensure
# that this script will be executed during boot.
touch /var/lock/subsys/local
sysctl -p /etc/sysctl.d/99-custom.conf
is above the right way?
|
If the directory /etc/sysctl.d/ exists in your Linux distribution as standard, then most likely it already has a startup script or systemd unit that does the equivalent of:
for i in /etc/sysctl.d/*.conf
do
sysctl -p "$i"
done
In other words, it is likely that there already is a script or some other feature that uses sysctl -p to read all *.conf files in the /etc/sysctl.d/ directory. But it might happen very early in the boot process, when the system is still running from initramfs, so you might need to update your initramfs after adding any files to /etc/sysctl.d/. Check your distribution's documentation on how to do this; the exact commands will vary between distributions.
But if you have created the /etc/sysctl.d/ directory yourself, then the system will not automatically read the files for you. If you only care about the one /etc/sysctl.d/99-custom.conf file, then the way you have done it in /etc/rc.local certainly does the job for now.
However, you might be creating a trap for yourself.
As sysadmin automation solutions like Ansible and Salt become more and more common, it has become a common pattern to replace (or augment) singular configuration files (like /etc/<something>.conf) with a corresponding directory into which you can drop any number of partial configuration files: for example /etc/<something>.d/*.conf. Normally, when such a directory is created, the system that reads that configuration is modified to read all the configuration files in that directory that match the pattern (so any editor backup files etc. are avoided automatically). This is sometimes called a drop-in directory, as you can just drop configuration snippets in there and run the command to reload the configuration/restart the service in question. That can make automated configuration management very easy.
If you create your own /etc/sysctl.d/ directory but only configure /etc/rc.local to read just the one /etc/sysctl.d/99-custom.conf, you might forget about this fact. Then, some day, some new sysctl settings need to be added, and you or one of your co-workers sees /etc/sysctl.d/, thinks "ah, it has the new drop-in directory scheme, so I can just add my new settings to /etc/sysctl.d/98-more-custom.conf and I'm done"... and then gets a nasty surprise when the new settings are ignored after a reboot.
So, if you actually created the /etc/sysctl.d/ directory, I would suggest that you replace the single sysctl -p /etc/sysctl.d/99-custom.conf line in /etc/rc.local with the four lines at the beginning of this answer. That way, your /etc/sysctl.d/ directory will work as expected even if more *.conf files are added to it.
If /etc/sysctl.d/ was created as standard by the OS installer, but the *.conf files within it won't get used on boot, even after rebuilding your initramfs, you might want to send a bug report to the maintainers of the distribution about the incomplete implementation of the /etc/sysctl.d/*.conf drop-in directory pattern.
| kernel parameters + what is the right way to refresh the kernel parameter from custom.conf after reboot |
1,399,643,182,000 |
we have old RHEL 7.2 server, and we notice about very strange kernel messages
not sure if below line defined a problem
[ffffea00a5a00000-ffffea00a5bfffff] PMD -> [ffff880015000000-ffff8800151fffff] on node 0
but I share also the full message and hope to get more details about them
[Thu Oct 27 10:20:59 2022] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
[Thu Oct 27 10:20:59 2022] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
[Thu Oct 27 10:20:59 2022] Node 1 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
[Thu Oct 27 10:20:59 2022] Node 1 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
[Thu Oct 27 10:20:59 2022] 11230501 total pagecache pages
[Thu Oct 27 10:20:59 2022] 55992 pages in swap cache
[Thu Oct 27 10:20:59 2022] Swap cache stats: add 1175357, delete 1119365, find 4949217/4971174
[Thu Oct 27 10:20:59 2022] Free swap = 13818588kB
[Thu Oct 27 10:20:59 2022] Total swap = 16351228kB
[Thu Oct 27 10:20:59 2022] 33652606 pages RAM
[Thu Oct 27 10:20:59 2022] 0 pages HighMem/MovableOnly
[Thu Oct 27 10:20:59 2022] 587996 pages reserved
[Thu Oct 27 10:21:00 2022] init_memory_mapping: [mem 0x2a40000000-0x2c3fffffff]
[Thu Oct 27 10:21:00 2022] [mem 0x2a40000000-0x2c3fffffff] page 1G
[Thu Oct 27 10:21:00 2022] [ffffea00a5a00000-ffffea00a5bfffff] PMD -> [ffff880015000000-ffff8800151fffff] on node 0
[Thu Oct 27 10:21:00 2022] [ffffea00a9000000-ffffea00a93fffff] PMD -> [ffff881002c00000-ffff881002ffffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00a9400000-ffffea00a99fffff] PMD -> [ffff881003800000-ffff881003dfffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00a9a00000-ffffea00a9bfffff] PMD -> [ffff881000200000-ffff8810003fffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00a9c00000-ffffea00a9dfffff] PMD -> [ffff881004200000-ffff8810043fffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00a9e00000-ffffea00a9ffffff] PMD -> [ffff881003e00000-ffff881003ffffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00aa000000-ffffea00aa9fffff] PMD -> [ffff881004600000-ffff881004ffffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00aaa00000-ffffea00aabfffff] PMD -> [ffff881005200000-ffff8810053fffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00aac00000-ffffea00aadfffff] PMD -> [ffff881005000000-ffff8810051fffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00aae00000-ffffea00ab9fffff] PMD -> [ffff881005400000-ffff881005ffffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00aba00000-ffffea00acbfffff] PMD -> [ffff881006200000-ffff8810073fffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00acc00000-ffffea00acffffff] PMD -> [ffff881007600000-ffff8810079fffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00ad000000-ffffea00ad1fffff] PMD -> [ffff881007400000-ffff8810075fffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00ad200000-ffffea00adffffff] PMD -> [ffff881007a00000-ffff8810087fffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00ae000000-ffffea00ae1fffff] PMD -> [ffff881008a00000-ffff881008bfffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00ae200000-ffffea00ae3fffff] PMD -> [ffff881008800000-ffff8810089fffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00ae400000-ffffea00ae5fffff] PMD -> [ffff881008c00000-ffff881008dfffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00ae600000-ffffea00ae7fffff] PMD -> [ffff881009200000-ffff8810093fffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00ae800000-ffffea00ae9fffff] PMD -> [ffff881009000000-ffff8810091fffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00aea00000-ffffea00aebfffff] PMD -> [ffff881009400000-ffff8810095fffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00aec00000-ffffea00aedfffff] PMD -> [ffff881009800000-ffff8810099fffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00aee00000-ffffea00aeffffff] PMD -> [ffff881009600000-ffff8810097fffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00af000000-ffffea00af1fffff] PMD -> [ffff881009c00000-ffff881009dfffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00af200000-ffffea00af3fffff] PMD -> [ffff881009a00000-ffff881009bfffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00af400000-ffffea00af5fffff] PMD -> [ffff88100a200000-ffff88100a3fffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00af600000-ffffea00af7fffff] PMD -> [ffff881009e00000-ffff881009ffffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00af800000-ffffea00b03fffff] PMD -> [ffff88100a400000-ffff88100adfffff] on node 1
[Thu Oct 27 10:21:00 2022] [ffffea00b0400000-ffffea00b09fffff] PMD -> [ffff88100b000000-ffff88100b5fffff] on node 1
[Thu Oct 27 10:21:01 2022] [ffffea00b0a00000-ffffea00b0bfffff] PMD -> [ffff881004400000-ffff8810045fffff] on node 1
[Thu Oct 27 10:21:01 2022] [ffffea00b0c00000-ffffea00b0dfffff] PMD -> [ffff88100b800000-ffff88100b9fffff] on node 1
[Thu Oct 27 10:21:01 2022] init_memory_mapping: [mem 0x2c40000000-0x2e3fffffff]
[Thu Oct 27 10:21:01 2022] [mem 0x2c40000000-0x2e3fffffff] page 1G
[Thu Oct 27 10:21:01 2022] [ffffea00b0e00000-ffffea00b0ffffff] PMD -> [ffff88100b600000-ffff88100b7fffff] on node 1
[Thu Oct 27 10:21:01 2022] [ffffea00b1000000-ffffea00b1dfffff] PMD -> [ffff88100ba00000-ffff88100c7fffff] on node 0
[Thu Oct 27 10:21:01 2022] [ffffea00b1e00000-ffffea00b33fffff] PMD -> [ffff88100cc00000-ffff88100e1fffff] on node 0
[Thu Oct 27 10:21:01 2022] [ffffea00b3400000-ffffea00b4ffffff] PMD -> [ffff88100e400000-ffff88100fffffff] on node 0
[Thu Oct 27 10:21:01 2022] [ffffea00b5000000-ffffea00b51fffff] PMD -> [ffff88100c800000-ffff88100c9fffff] on node 0
[Thu Oct 27 10:21:01 2022] [ffffea00b5200000-ffffea00b59fffff] PMD -> [ffff881010000000-ffff8810107fffff] on node 0
[Thu Oct 27 10:21:01 2022] [ffffea00b5a00000-ffffea00b5bfffff] PMD -> [ffff881010c00000-ffff881010dfffff] on node 0
[Thu Oct 27 10:21:01 2022] [ffffea00b5c00000-ffffea00b5dfffff] PMD -> [ffff881010a00000-ffff881010bfffff] on node 0
[Thu Oct 27 10:21:01 2022] [ffffea00b5e00000-ffffea00b61fffff] PMD -> [ffff881011000000-ffff8810113fffff] on node 0
[Thu Oct 27 10:21:01 2022] [ffffea00b6200000-ffffea00b69fffff] PMD -> [ffff881011800000-ffff881011ffffff] on node 0
[Thu Oct 27 10:21:01 2022] [ffffea00b6a00000-ffffea00b7ffffff] PMD -> [ffff881012200000-ffff8810137fffff] on node 0
[Thu Oct 27 10:21:01 2022] [ffffea00b8000000-ffffea00b81fffff] PMD -> [ffff881013a00000-ffff881013bfffff] on node 0
[Thu Oct 27 10:21:01 2022] [ffffea00b8200000-ffffea00b83fffff] PMD -> [ffff881013e00000-ffff881013ffffff] on node 0
[Thu Oct 27 10:21:01 2022] [ffffea00b8400000-ffffea00b85fffff] PMD -> [ffff881013c00000-ffff881013dfffff] on node 0
[Thu Oct 27 10:21:01 2022] [ffffea00b8600000-ffffea00b87fffff] PMD -> [ffff881014400000-ffff8810145fffff] on node 0
[Thu Oct 27 10:21:01 2022] [ffffea00b8800000-ffffea00b89fffff] PMD -> [ffff881014000000-ffff8810141fffff] on node 0
|
These messages are debug information printed during page table setup; they show information about the “page middle directory” which is one of the data structures used by the x86 MMU to map virtual addresses to physical addresses.
These messages don’t indicate a problem.
| RHEL + kernel messages + how to identify if kernel message are indicated on a problem |
1,399,643,182,000 |
Is the process scheduler "visible" at user space? Can I see it with ps? Maybe is it one of the kernel threads? If yes, how is it called? How can I "see" it?
It doesn’t exist as a separate thread, or module, it’s implemented as
a function
Ok, but how and where and in which way is this function run? Is there a way to track it and see it?
|
As explained in What's the process scheduler in Linux? the scheduler is a kernel function, __schedule; it doesn’t appear as a separate thread or process.
The function comment explains how it is run:
* The main means of driving the scheduler and thus entering this function are:
*
* 1. Explicit blocking: mutex, semaphore, waitqueue, etc.
*
* 2. TIF_NEED_RESCHED flag is checked on interrupt and userspace return
* paths. For example, see arch/x86/entry_64.S.
*
* To drive preemption between tasks, the scheduler sets the flag in timer
* interrupt handler scheduler_tick().
*
* 3. Wakeups don't really cause entry into schedule(). They add a
* task to the run-queue and that's it.
*
* Now, if the new task added to the run-queue preempts the current
* task, then the wakeup sets TIF_NEED_RESCHED and schedule() gets
* called on the nearest possible occasion:
*
* - If the kernel is preemptible (CONFIG_PREEMPTION=y):
*
* - in syscall or exception context, at the next outmost
* preempt_enable(). (this might be as soon as the wake_up()'s
* spin_unlock()!)
*
* - in IRQ context, return from interrupt-handler to
* preemptible context
*
* - If the kernel is not preemptible (CONFIG_PREEMPTION is not set)
* then at the next:
*
* - cond_resched() call
* - explicit schedule() call
* - return from syscall or exception to user-space
* - return from interrupt-handler to user-space
The function can’t be traced; its instrumentation is disabled (see the notrace entry in its declaration).
| Where is the process scheduler running? Can I track it? |
1,399,643,182,000 |
What makes benchmarks like kernel-build, pbzip, pfscan memory-intensive applications?
|
Compilation is actually rather read/write intensive than just consuming large amounts of memory so it is a good measurement for IO-speeds of your memory.
But the bottleneck is probably either your disk or your CPU so there is better RAM benchmarks
| How kernel building is a memory intensive application? [closed] |
1,399,643,182,000 |
During process execution, when the memory map of a process is like so:
This might be a silly question, but what is responsible for reserving the Kernel space in the address space? Are user processes responsible for this? privileged processes? all processes?
From my understanding, the kernel memory space is reserved by the process running but it is only accessible by the CPU when instructed to execute under ring 0. Is this correct ?
|
The kernel takes care of this, on behalf of processes. The kernel’s address space is indeed only accessible when the CPU is in privileged mode, ring 0 on x86.
See also Do the virtual address spaces of all the processes have the same content in their "Kernel" parts?, What's the use of having a kernel part in the virtual memory space of Linux processes?, What's inside the kernel part of virtual memory of 64 bit linux processes?, and When do we jump into kernel part of our process virtual memory other than when we use system calls? (In Linux).
| The Kernel space in the address space is reserved for us by what? |
1,399,643,182,000 |
We have hadoop cluster
We notice that on many DB servers, that the THPs are disabled ( include HDFS servers )
Can you explain why it is so important to disable THP on DB servers?
what could be if THP is enabled?, on DB servers.
|
it depends on the workload and THP mostly gives worse performance. A good article is at Percona
| why it so important do disable THP ( transparent huge pages ) on database servers? [duplicate] |
1,399,643,182,000 |
First off: I am running Linux Mint 18.2 on an External HDD with Gnome 3 as my desktop.
Recently, I was trying to figure out how to compress my OS so I could move it to a different system. So, I ran:
sudo gzip -r -1 /
Of course not adding the -k option, a lot of my files got compressed into *.gz files. I was going to use find to find them all and decompress them, but that was too complicated for me to understand which options to use and what not.
So, I went through manually and decompressed as many as I could. I believe I got them all. But there was a problem with my kernel.
It ended up compressing some of the files and I couldn't get them decompressed. So, I took what I could get, which was mostly kernel 4.8.0-53-generic, and the parts I didn't have I took from the kernel in a bootable USB stick.
Now, I can get my system to boot to recovery, and that's it. What's more is X11 is having issues which I assume is also causing the issues I am seeing for lightdm.
I tried running
sudo apt-get update && sudo apt-get upgrade
In an effort to fix what I could but came up empty. I am now out of ideas. What else can I do to attempt to fix my system?
Re-installation is out of the question due to the amount of time I have put into this system, unless there is a way to reinstall and keep my configuration, apps, and files intact and in use.
Many Thanks!
EDIT : By issues for lightdm and x11, I mean I have no GUI. Just a command line.
|
As you're unclear about the actual problem and damage, the best option is reinstalling the operating system.
Diagnosing a full operating system is not that easy and specially when you don't know the actual damage.
So, boot the system with a live disk, backup all your files and reinstall the system..
The issue you're seeing is a X11 and lightdm issue, but it's not actually clear what has gone. Trying to diagnose a broken system is always good, but if you like to save time the best way is reinstallation.
And infuture always keep a backup and be extra careful while typing anything as root user.
| Linux Mint kernel damage |
1,399,643,182,000 |
Hello can someone tell me how to install kernel 4.4 on current debian testing ? I have a bug that might be solved by the kernel 4.4 so I want to give it a shot but can't find the name of the package to install it.
|
Assuming you're looking for the amd64 kernel, the package is linux-image-4.4.0-1-amd64.
| How to install kernel 4.4 on debian testing? |
1,399,643,182,000 |
so my Mint 17 hasn't been booting, and I tried reinstalling the kernel from a live USB drive.
I followed the steps detailed in this guide to edit /etc/default/grub to accept the last saved kernel (while mounting the Mint partition and chrooting), but after updating grub, it still recognizes the older version (3.13.0-24-generic) instead of the new (3.13.0-55-generic) when the old version is no longer on my computer.
I'm not sure if this matters, but my grub starts in recovery mode. Using set prefix, set root, insmod, normal, I get back to normal grub 2.02. The one difference I notice is my /boot/grub folder is mostly empty, so while most people type set prefix=(hdx,y)/boot/grub, I type set prefix=(hdx,y)/boot/grub.bak. The system also starts off saying normal.mod is missing from /boot/grub. Would relocating some files help with the kernel or is it ok that I start in rescue grub?
Thanks for any help anybody can offer.
|
You need to tell grub what default kernel to use in grub.conf. For mint, may be something like 'set default="0".
For the linux types I have used, the very top entry in the grub.conf is entry 0. So if you had three kernels listed, and you want to boot on the 3rd one, use 'default=2' or for mint, maybe 'set default=2'.
This link may or may not be useful: http://community.linuxmint.com/tutorial/view/910
| Grub Refuses New Kernel |
1,429,949,980,000 |
I'm trying to make a new virtual machine but, VirtualBox has this error then closes:
Failed to create a new session.
Callee RC:
NS_ERROR_FACTORY_NOT_REGISTERED (0x80040154)
In the terminal this is shown to me:
$ virtualbox
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (3.16.3-1-ARCH) or it failed to
load. Please reinstall the kernel module virtualbox-host-modules or
if you don't use our stock kernel compile the modules with
sudo dkms autoinstall
You will not be able to start VMs until this problem is fixed.
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Qt WARNING: libpng warning: iCCP: known incorrect sRGB profile
Callee RC:
NS_ERROR_FACTORY_NOT_REGISTERED (0x80040154)
|
It seems that you haven't loaded the kernel module "vboxdrv". Use 'modprobe' to load the module and then try.
In case if something goes wrong try installing again the required packages. There is a pretty good documentation on arch linux.
| VirtualBox can not create new virtual machines! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.