How to send network packets to a particular pci address? - linux

I am working on a server that has multiple dual port NIC cards. Each port has a different address on the PCI bus.
I'm using nping to send packets through network interfaces given their logical names (such as eth0), but I want to be able to send packets through an interface given its PCI address (such as 0000:00:07.0). How can I achieve it ?
sudo lshw -C network gives:
*-network:0 UNCLAIMED
description: Ethernet controller
product: 82599ES 10-Gigabit SFI/SFP+ Network Connection
vendor: Intel Corporation
physical id: 0
bus info: pci#0000:01:00.0
version: 01
width: 64 bits
clock: 33MHz
capabilities: pm msi msix pciexpress vpd bus_master cap_list
configuration: latency=0
resources: memory:dfd20000-dfd3ffff ioport:8020(size=32) memory:dfd44000-dfd47fff memory:def00000-deffffff memory:dee00000-deefffff

You'll have to map the pci address to its logical name. Frankly, I've done that, but it seems that lshw does the trick.
Run sudo lshw -C network
You should get something like this (source):
*-network
description: Wireless interface
product: AR5212 802.11abg NIC
vendor: Atheros Communications, Inc.
physical id: 1
bus info: pci#03:00.0
logical name: ath0
version: 01
serial: 00:11:95:50:be:62
width: 32 bits
clock: 33MHz
capabilities: bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=ath_pci driverversion=0.9.6.0 (EXPERIMENTAL) ip=192.168.1.12 multicast=yes wireless=IEEE 802.11g
resources: iomemory:10800000-1080ffff irq:11
Here you have both the interface's name (logical name: ath0) and its bus info, including address (bus info: pci#03:00.0). Now all you have to do is to parse both, and lookup the logical name of the pci address that interests you.

Related

PCI driver doesn't assign memory behind bridge

I have device on bus PCI 09 behind bus 08:01 like this:
0000:08:01.0 -> ../../../devices/pci0000:00/0000:00:03.0/0000:07:00.0/0000:08:01.0/0000:09:00.0
My device in bus 09 off and after reboot CPU, I turn on device on bus 09.
So, I rescan PCI bus 0000:08:01.0. But it doesn't find my device.
bus 08:01 after reboot:
root#localhost:~# lspci -s 0000\:08\:01.0 -v
08:01.0 PCI bridge: PLX Technology, Inc. PEX 8614 12-lane, 12-Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0
Bus: primary=08, secondary=09, subordinate=09, sec-latency=0
Capabilities: [40] Power Management version 3
Capabilities: [48] MSI: Enable+ Count=1/4 Maskable+ 64bit+
Capabilities: [68] Express Downstream Port (Slot+), MSI 00
Capabilities: [a4] Subsystem: PLX Technology, Inc. PEX 8614 12-lane, 12-Port PCI Express Gen 2 (5.0 GT/s) Switch
Capabilities: [100] Device Serial Number ba-86-01-10-b5-df-0e-00
Capabilities: [fb4] Advanced Error Reporting
Capabilities: [148] Virtual Channel
Capabilities: [520] Access Control Services
Capabilities: [950] Vendor Specific Information: ID=0001 Rev=0 Len=010 <?>
Kernel driver in use: pcieport
I noticed there isn't "Prefetchable memory behind bridge" field like this:
#lspci -s 0000\:01\:00.0 -v
01:00.0 Class 0604: Device 10b5:8617 (rev ba)
Flags: bus master, fast devsel, latency 0, IRQ 9
Memory at c4b00000 (32-bit, non-prefetchable) [size=128K]
Bus: primary=01, secondary=02, subordinate=05, sec-latency=0
I/O behind bridge: None
Memory behind bridge: c0000000-c4afffff [size=75M]
Prefetchable memory behind bridge: 00000000c4c00000-00000000c96fffff [size=75M]
Capabilities: [40] Power Management version 3
Capabilities: [48] MSI: Enable- Count=1/4 Maskable+ 64bit+
Capabilities: [68] Express Upstream Port, MSI 00
Capabilities: [a4] Subsystem: Device 10b5:8617
Capabilities: [100] Device Serial Number ba-86-01-10-b5-df-0e-00
Capabilities: [fb4] Advanced Error Reporting
Capabilities: [138] Power Budgeting <?>
Capabilities: [148] Virtual Channel
Capabilities: [950] Vendor Specific Information: ID=0001 Rev=0 Len=010 <?>
Kernel driver in use: pcieport
CPU only find device in bus 09 when I turn on device before reboot.
Is there any way for the CPU to find the device on PCI bus after reboot? Or how can I assign memory behind bridge on bus 0000:08:01.0 without device when CPU boots?
thank for your answer, I'm just a newbie linux user.
I tried rescan bus PCI after boot but not found the device.
But in my project, I see an application on system using kernel 4.14 can rescan device on bus PCI and found it after reboot without on device initially.
PCI bus after CPU boots
# ls -l /sys/bus/pci/devices/
lrwxrwxrwx 1 root root 0 Jan 1 00:50 0000:00:00.0 -> ../../../devices/platform/bcm963xx-pcie.0/pci0000:00/0000:00:00.0
lrwxrwxrwx 1 root root 0 Jan 1 00:50 0000:01:00.0 -> ../../../devices/platform/bcm963xx-pcie.0/pci0000:00/0000:00:00.0/0000:01:00.0
lrwxrwxrwx 1 root root 0 Jan 1 00:50 0000:02:00.0 -> ../../../devices/platform/bcm963xx-pcie.0/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:00.0
lrwxrwxrwx 1 root root 0 Jan 1 00:50 0000:02:02.0 -> ../../../devices/platform/bcm963xx-pcie.0/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:02.0
lrwxrwxrwx 1 root root 0 Jan 1 00:50 0000:02:03.0 -> ../../../devices/platform/bcm963xx-pcie.0/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:03.0
Log when CPU boot
pci 0000:02:03.0: PCI bridge to [bus 05]
pci 0000:02:03.0: bridge window [mem 0xc3200000-0xc4afffff]
pci 0000:02:03.0: bridge window [mem 0xc7e00000-0xc96fffff 64bit pref]
I'm sure in bus 5, there is a device ready to communicate with CPU but CPU doesn't find it when boots.
But when I rescan bus 02:03 and use bcm_ll_pcie_init, the device found.
After rescan
lrwxrwxrwx 1 root root 0 Jan 1 01:13 0000:05:00.0 -> ../../../devices/platform/bcm963xx-pcie.0/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:03.0/0000:05:00.0
Log when I rescan bus 02:03
Maple netlink-based raw driver transport driver
bcm963xx-pcie: Core [0] PCIe Intr [PCIE_MSTR_UR_ATTN]
pci 0000:03:00.0: [14e4:6862] type 00 class 0x048000
pci 0000:03:00.0: reg 0x10: [mem 0x00000000-0x007fffff 64bit pref]
pci 0000:03:00.0: reg 0x18: [mem 0x00000000-0x00ffffff 64bit pref]
pci 0000:03:00.0: reg 0x20: [mem 0x00000000-0x0000ffff 64bit pref]
pci 0000:03:00.0: PME# supported from D0 D3hot
pcieport 0000:02:00.0: Checking PCIe ASPM for vendor 14e4 device 6862
pcieport 0000:02:00.0: Disabling PCIe ASPM for vendor 14e4 device 6862
pci 0000:04:00.0: [14e4:8470] type 00 class 0x020000
pci 0000:04:00.0: reg 0x10: [mem 0x00000000-0x00007fff 64bit pref]
pci 0000:04:00.0: reg 0x18: [mem 0x00000000-0x007fffff 64bit pref]
pci 0000:04:00.0: PME# supported from D0 D3hot D3cold
pci 0000:04:00.1: [14e4:8470] type 00 class 0x020000
pci 0000:04:00.1: reg 0x10: [mem 0x00000000-0x00007fff 64bit pref]
pci 0000:04:00.1: reg 0x18: [mem 0x00000000-0x007fffff 64bit pref]
pci 0000:04:00.1: PME# supported from D0 D3hot D3cold
pcieport 0000:02:02.0: Checking PCIe ASPM for vendor 14e4 device 8470
pcieport 0000:02:02.0: Disabling PCIe ASPM for vendor 14e4 device 8470
pci 0000:05:00.0: [14e4:6862] type 00 class 0x048000
pci 0000:05:00.0: reg 0x10: [mem 0x00000000-0x007fffff 64bit pref]
pci 0000:05:00.0: reg 0x18: [mem 0x00000000-0x00ffffff 64bit pref]
pci 0000:05:00.0: reg 0x20: [mem 0x00000000-0x0000ffff 64bit pref]
pci 0000:05:00.0: PME# supported from D0 D3hot
pcieport 0000:02:03.0: Checking PCIe ASPM for vendor 14e4 device 6862
pcieport 0000:02:03.0: Disabling PCIe ASPM for vendor 14e4 device 6862
You can see the device on PCI bus 05, 0000:05:00.0: [14e4:6862] found.
I also tried rescan like that in my system but it doesn't work, the device not found.
But I noticed my CPU doesn't have "Prefetchable memory behind bridge" like that working system as my post.
What do you think about it?

UBI layout volume not found

I am following Bootlin's embedded Linux training which aims to put an embedded Linux system on an Atmel SAMA5D4 Xplained board (theory slides, practical lab instructions) and I am stuck a putting the whole system on the NAND flash.
They ask me to put the DTB, the kernel, the root filesystem and a data filesystem in a UBI image to be written to the flash but I cannot access the UBI partitions once I flashed it (the access fails with error code 22, or -22 in an embedded Linux environment).
Detailed description
(to see my actual questions, go to the end of the question)
In U-Boot, the partitions are defined by mtdparts:
device nand0 <atmel_nand>, # parts = 8
#: name size offset mask_flags
0: bootstrap 0x00040000 0x00000000 1
1: uboot 0x00080000 0x00040000 1
2: env 0x00040000 0x000c0000 1
3: envbackup 0x00040000 0x00100000 1
4: dtb 0x00020000 0x00140000 0
5: kernel 0x00500000 0x00160000 0
6: rootfs 0x01000000 0x00660000 0
7: datafs 0x01000000 0x01660000 0
active partition: nand0,0 - (bootstrap) 0x00040000 # 0x00000000
defaults:
mtdids :
mtdparts:
With printenv mtdparts, I get:
mtdparts=mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256k(env)ro,256k(envbackup)ro,128k(dtb),5M(kernel),16M(rootfs),16M(datafs)
and printenv mtdids
mtdids=nand0=atmel_nand
The UBI image was created with ubinize and the following configuration:
[dtb]
peb=0x20000
min_io_size=0x800
mode=ubi
image=dtb.img
vol_id=0
vol_size=128KiB
vol_type=static
vol_name=dtb
vol_alignment=1
[kernel]
peb=0x20000
min_io_size=0x800
mode=ubi
image=zImage
vol_id=1
vol_size=5MiB
vol_type=static
vol_name=kernel
vol_alignment=1
[rootfs]
peb=0x20000
min_io_size=0x800
mode=ubi
image=root.img
vol_id=2
vol_size=16MiB
vol_type=static
vol_name=rootfs
vol_alignment=1
[datafs]
peb=0x20000
min_io_size=0x800
mode=ubi
image=files.img
vol_id=3
vol_size=16MiB
vol_type=static
vol_name=datafs
vol_alignment=1
and this command (the sama5-ubinize.cfg is the above configuration)
ubinize -o ubi.img -p 128KiB -m 2KiB sama5-ubinize.cfg
The PEB is indeed 128KB (0x2000) and the page size is 2048B (0x800). I added those parameters based on this answer.
Both UBI partitions have been make with the following commands:
mkfs.ubifs -e 124KiB -c 132 -m 2KiB -r nfsroot/ root.img
mkfs.ubifs -e 124KiB -c 132 -m 2KiB -r nfsroot/www/upload/files data.img
I then write the UBI image to the flash with the following commands (in U-Boot):
nand erase 0x140000 0xfec0000
tftp 0x21000000 ubi.img
nand write.trimffs 0x21000000 0x140000 0x880000
When trying to access the partitions from U-Boot with ubi part rootfs, I get the following error:
ubi0: attaching mtd1
ubi0: scanning is finished
UBI init error 22
For now I am booting Linux from a SD card. The Linux boot arguments are (from printenv bootargs):
bootargs=console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait
When booting Linux, I get the following log:
resetting ...
RomBOOT
AT91Bootstrap 3.8.9 (Mi Dez 12 21:06:49 CET 2018)
NAND: ONFI flash detected
NAND: Manufacturer ID: 0x2c Chip ID: 0xda
NAND: Page Bytes: 2048, Spare Bytes: 64
NAND: ECC Correctability Bits: 4, ECC Sector Bytes: 512
NAND: Disable On-Die ECC
NAND: Initialize PMECC params, cap: 4, sector: 512
NAND: Image: Copy 0xa0000 bytes from 0x40000 to 0x26f00000
NAND: Done to load image
<debug_uart>
U-Boot 2017.09 (Dec 12 2018 - 23:16:12 +0100)
CPU: SAMA5D36
Crystal frequency: 12 MHz
CPU clock : 528 MHz
Master clock : 132 MHz
DRAM: 256 MiB
NAND: 256 MiB
MMC: Atmel mci: 0, Atmel mci: 1
In: serial#ffffee00
Out: serial#ffffee00
Err: serial#ffffee00
Net: eth0: ethernet#f0028000
Error: ethernet#f802c000 address not set.
Hit any key to stop autoboot: 0
reading zImage
4279056 bytes read in 281 ms (14.5 MiB/s)
reading at91-sama5d3_xplained.dtb
34404 bytes read in 7 ms (4.7 MiB/s)
## Flattened Device Tree blob at 22000000
Booting using the fdt blob at 0x22000000
Loading Device Tree to 2fb39000, end 2fb44663 ... OK
Starting kernel ...
Booting Linux on physical CPU 0x0
Linux version 4.18.20 (dopsi#dopsi-ThinkPad-T430) (gcc version 8.1.0 (crosstool-NG 1.23.0.435-eb65)) #4 Sat Dec 15 14:07:41 CET 2018
CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt: Machine model: SAMA5D3 Xplained
Memory policy: Data cache writeback
CPU: All CPU(s) started in SVC mode.
random: get_random_bytes called from start_kernel+0x9c/0x3d8 with crng_init=0
Built 1 zonelists, mobility grouping on. Total pages: 65024
Kernel command line: console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 250120K/262144K available (6144K kernel code, 237K rwdata, 1588K rodata, 1024K init, 124K bss, 12024K reserved, 0K cma-reserved)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xd0800000 - 0xff800000 ( 752 MB)
lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0x(ptrval) - 0x(ptrval) (7136 kB)
.init : 0x(ptrval) - 0x(ptrval) (1024 kB)
.data : 0x(ptrval) - 0x(ptrval) ( 238 kB)
.bss : 0x(ptrval) - 0x(ptrval) ( 125 kB)
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
clocksource: pit: mask: 0xfffffff max_cycles: 0xfffffff, max_idle_ns: 14479245754 ns
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
Console: colour dummy device 80x30
Calibrating delay loop... 351.43 BogoMIPS (lpj=1757184)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x20100000 - 0x20100060
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 256 (order: -1, 3072 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
AT91: PM: standby: standby, suspend: ulp0
No ATAGs?
gpio-at91 fffff200.gpio: at address (ptrval)
gpio-at91 fffff400.gpio: at address (ptrval)
gpio-at91 fffff600.gpio: at address (ptrval)
gpio-at91 fffff800.gpio: at address (ptrval)
gpio-at91 fffffa00.gpio: at address (ptrval)
pinctrl-at91 ahb:apb:pinctrl#fffff200: initialized AT91 pinctrl driver
clocksource: tcb_clksrc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 115833966437 ns
at_hdmac ffffe600.dma-controller: Atmel AHB DMA Controller ( cpy set slave ), 8 channels
at_hdmac ffffe800.dma-controller: Atmel AHB DMA Controller ( cpy set slave ), 8 channels
AT91: Detected SoC family: sama5d3
AT91: Detected SoC: sama5d36, revision 2
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
at91_i2c f0014000.i2c: using dma0chan0 (tx) and dma0chan1 (rx) for DMA transfers
at91_i2c f0014000.i2c: AT91 i2c bus driver (hw version: 0x402).
at91_i2c f0018000.i2c: using dma0chan2 (tx) and dma0chan3 (rx) for DMA transfers
at91_i2c f0018000.i2c: AT91 i2c bus driver (hw version: 0x402).
at91_i2c f801c000.i2c: can't get DMA channel, continue without DMA support
at91_i2c f801c000.i2c: AT91 i2c bus driver (hw version: 0x402).
videodev: Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti#linux.it>
PTP clock support registered
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource tcb_clksrc
NET: Registered protocol family 2
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 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.
Initialise system trusted keyrings
workingset: timestamp_bits=30 max_order=16 bucket_order=0
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Key type asymmetric registered
Asymmetric key parser 'x509' registered
io scheduler noop registered (default)
io scheduler mq-deadline registered
io scheduler kyber registered
f001c000.serial: ttyS1 at MMIO 0xf001c000 (irq = 23, base_baud = 4125000) is a ATMEL_SERIAL
f0020000.serial: ttyS2 at MMIO 0xf0020000 (irq = 24, base_baud = 4125000) is a ATMEL_SERIAL
f0024000.serial: ttyS5 at MMIO 0xf0024000 (irq = 25, base_baud = 4125000) is a ATMEL_SERIAL
ffffee00.serial: ttyS0 at MMIO 0xffffee00 (irq = 38, base_baud = 8250000) is a ATMEL_SERIAL
console [ttyS0] enabled
brd: module loaded
loop: module loaded
atmel_spi f0004000.spi: Using dma0chan4 (tx) and dma0chan5 (rx) for DMA transfers
atmel_spi f0004000.spi: Atmel SPI Controller version 0x213 at 0xf0004000 (irq 19)
atmel_spi f8008000.spi: Using dma1chan0 (tx) and dma1chan1 (rx) for DMA transfers
atmel_spi f8008000.spi: Atmel SPI Controller version 0x213 at 0xf8008000 (irq 28)
libphy: Fixed MDIO Bus: probed
CAN device driver interface
at91_can f000c000.can: device registered (reg_base=(ptrval), irq=45)
libphy: MACB_mii_bus: probed
Micrel KSZ9031 Gigabit PHY f0028000.ethernet-ffffffff:07: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=f0028000.ethernet-ffffffff:07, irq=POLL)
macb f0028000.ethernet eth0: Cadence GEM rev 0x00020119 at 0xf0028000 irq 46 (12:34:56:ab:cd:ef)
macb f802c000.ethernet: invalid hw address, using random
libphy: MACB_mii_bus: probed
Micrel KSZ8081 or KSZ8091 f802c000.ethernet-ffffffff:01: attached PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=f802c000.ethernet-ffffffff:01, irq=POLL)
macb f802c000.ethernet eth1: Cadence MACB rev 0x0001010c at 0xf802c000 irq 47 (62:aa:eb:b7:c1:48)
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-atmel: EHCI Atmel driver
atmel-ehci 700000.ehci: EHCI Host Controller
atmel-ehci 700000.ehci: new USB bus registered, assigned bus number 1
atmel-ehci 700000.ehci: irq 50, io mem 0x00700000
atmel-ehci 700000.ehci: USB 2.0 started, EHCI 1.00
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.18
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 4.18.20 ehci_hcd
usb usb1: SerialNumber: 700000.ehci
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-atmel: OHCI Atmel driver
at91_ohci 600000.ohci: USB Host Controller
at91_ohci 600000.ohci: new USB bus registered, assigned bus number 2
at91_ohci 600000.ohci: irq 50, io mem 0x00600000
usb usb2: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 4.18
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: USB Host Controller
usb usb2: Manufacturer: Linux 4.18.20 ohci_hcd
usb usb2: SerialNumber: at91
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 3 ports detected
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver pl2303
usbserial: USB Serial support registered for pl2303
atmel_usba_udc 500000.gadget: MMIO registers at [mem 0xf8030000-0xf8033fff] mapped at (ptrval)
atmel_usba_udc 500000.gadget: FIFO at [mem 0x00500000-0x005fffff] mapped at (ptrval)
g_serial gadget: Gadget Serial v2.4
g_serial gadget: g_serial ready
at91_rtc fffffeb0.rtc: registered as rtc0
at91_rtc fffffeb0.rtc: AT91 Real Time Clock driver.
i2c /dev entries driver
at91-reset fffffe00.rstc: Starting after software reset
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
atmel_mci f0000000.mmc: version: 0x505
atmel_mci f0000000.mmc: using dma0chan6 for DMA transfers
atmel_mci f0000000.mmc: Atmel MCI controller at 0xf0000000 irq 18, 1 slots
atmel_mci f8000000.mmc: version: 0x505
atmel_mci f8000000.mmc: using dma1chan2 for DMA transfers
atmel_mci f8000000.mmc: Atmel MCI controller at 0xf8000000 irq 27, 1 slots
sdhci-pltfm: SDHCI platform and OF driver helper
atmel_aes f8038000.aes: version: 0x135
atmel_aes f8038000.aes: Atmel AES - Using dma1chan3, dma1chan4 for DMA transfers
atmel_sha f8034000.sha: version: 0x410
atmel_sha f8034000.sha: using dma1chan5 for DMA transfers
atmel_sha f8034000.sha: Atmel SHA1/SHA256/SHA224/SHA384/SHA512
atmel_tdes f803c000.tdes: version: 0x701
atmel_tdes f803c000.tdes: using dma1chan6, dma1chan7 for DMA transfers
mmc0: host does not support reading read-only switch, assuming write-enable
mmc0: new high speed SDHC card at address b368
mmcblk0: mmc0:b368 SD4GB 3.74 GiB
mmcblk0: p1 p2 p3
atmel_tdes f803c000.tdes: Atmel DES/TDES
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
nand: Micron MT29F2G08ABAEAWP
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
Bad block table found at page 131008, version 0x01
Bad block table found at page 130944, version 0x01
nand_read_bbt: bad block at 0x000000c80000
nand_read_bbt: bad block at 0x000000ca0000
6 fixed-partitions partitions found on MTD device atmel_nand
Creating 6 MTD partitions on "atmel_nand":
0x000000000000-0x000000040000 : "at91bootstrap"
0x000000040000-0x0000000c0000 : "bootloader"
0x0000000c0000-0x000000180000 : "bootloader env"
0x000000180000-0x000000200000 : "device tree"
0x000000200000-0x000000800000 : "kernel"
0x000000800000-0x000010000000 : "rootfs"
iio iio:device0: Resolution used: 12 bits
iio iio:device0: ADC Touch screen is disabled.
NET: Registered protocol family 10
Segment Routing with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20170425 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20170425)
can: broadcast manager protocol (rev 20170425 t)
can: netlink gateway (rev 20170425) max_hops=1
Loading compiled-in X.509 certificates
input: gpio_keys as /devices/platform/gpio_keys/input/input0
at91_rtc fffffeb0.rtc: setting system clock to 2007-01-01 01:05:49 UTC (1167613549)
cfg80211: Loading compiled-in X.509 certificates for regulatory database
cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
ALSA device list:
No soundcards found.
platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
g_serial gadget: high-speed config #2: CDC ACM config
random: fast init done
cfg80211: failed to load regulatory.db
VFS: Mounted root (squashfs filesystem) readonly on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
starting pid 761, tty '': '/etc/init.d/rcS'
EXT4-fs (mmcblk0p3): recovery complete
EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
starting pid 768, tty '/dev/ttyS0': '/bin/sh'
BusyBox v1.29.3 (2018-12-15 12:27:14 CET) built-in shell (ash)
Enter 'help' for a list of built-in commands.
It detects all but one partition, but I cannot access them either. When trying to attach any of them (with ubiattach -m 5 /dev/ubi_ctrl), I get the following error (the error stays the same for all partition numbers):
ubi0: attaching mtd5
ubi0: scanning is finished
ubi0 error: ubi_read_volume_table: the layout volume was not found
ubi0 error: ubi_attach_mtd_dev: failed to attach mtd5, error -22
ubiattach: UBI_IOCATT: Invalid argument
My questions
What exactly goes wrong my setup?
Should there be any preparation for the DTB and the Linux kernel before I put them in the UBI image?
Used tools and versions
U-Boot 2017.09
Linux 4.18
busybox 1.29.3
an Xubuntu 18.04 VM for development
Thanks for the very well described problem and questions. It's a pleasure to help you in such conditions :)
There are a few things don't seem right, or which at least are not in the spirit of Bootlin's lab.
You don't have the mtdparts settings in the kernel command line. As a consequence, you're working with the default partitions.
You're flashing your UBI image into the 5th MTD partition (from the offset you're using) but are trying to attach UBI to the 6th partition. No surprise that you have UBI attach issues.
When erasing and flashing the UBI images, you should use partition names instead of offsets. This will clarify things and reduce the risks of errors.
You should group the dtb, kernel, rootfs and datafs partitions into a single MTD partition called "ubi", which you will use to flash the UBI image and then to attach UBI. So instead of MTD partitions, you will have 4 UBI volumes, as described by your ubinize configuration file.
This should definitely help. Don't hesitate to come back if you're still facing issues after doing this.
Happy hacking and learning
Michael (from Bootlin)
I raised another thread as a followup
bootlin kernel doesn't boot from UBIFS
hope Michael can review it too

Qemu x86 and Linux 3.12.17 Kernel panic when booting

I have an issue regarding the execution of a custom Openwrt system with Linux 3.12.17 in Qemu 2.0.0. During the boot process, I have a message telling me that the bootloader cannot find my root partition device, which is /dev/sda as you can see in the following image :
Shell:~$ sudo fdisk -l
[sudo] password for :
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000f25bd
Device Boot Start End Blocks Id System
/dev/sda1 * 16065 1028159 506047+ 83 Linux
/dev/sda2 1028160 41592284 20282062+ 83 Linux
/dev/sda3 41592285 976773167 467590441+ f W95 Ext'd (LBA)
/dev/sda5 41608350 45608534 2000092+ 82 Linux swap / Solaris
/dev/sda6 45620266 976773167 465576451 83 Linux
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sdb: 256.1 GB, 256060514304 bytes
255 heads, 63 sectors/track, 31130 cylinders, total 500118192 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 1 500118191 250059095+ ee GPT
Here is the command that I use to launch the Qemu emulator :
qemu-system-x86_64 -m 512 \
-kernel bin/x86/openwrt-x86-sgc_qemu-vmlinuz \
--append "root=/dev/sda rw" \
-nographic -usb \
-hda bin/x86/openwrt-x86-sgc_qemu-rootfs-ext4.img
Here is the full boot log :
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Initializing cgroup subsys cpuacct
Linux version 3.12.17 (g602882#rmm-p1303101) (gcc version 4.5.2 (GCC) ) #4 SMP PREEMPT Wed Mar 8 15:47:13 CET 2017
e820: BIOS-provided physical RAM map:
BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
BIOS-e820: [mem 0x0000000000100000-0x000000001fffdfff] usable
BIOS-e820: [mem 0x000000001fffe000-0x000000001fffffff] reserved
BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved
BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
Notice: NX (Execute Disable) protection cannot be enabled: non-PAE kernel!
SMBIOS 2.4 present.
e820: last_pfn = 0x1fffe max_arch_pfn = 0x100000
PAT not supported by CPU.
found SMP MP-table at [mem 0x000f0b30-0x000f0b3f] mapped at [c00f0b30]
init_memory_mapping: [mem 0x00000000-0x000fffff]
init_memory_mapping: [mem 0x1f800000-0x1fbfffff]
init_memory_mapping: [mem 0x18000000-0x1f7fffff]
init_memory_mapping: [mem 0x00100000-0x17ffffff]
init_memory_mapping: [mem 0x1fc00000-0x1fffdfff]
ACPI: RSDP 000f09a0 00014 (v00 BOCHS )
ACPI: RSDT 1ffffbc1 00034 (v01 BOCHS BXPCRSDT 00000001 BXPC 00000001)
ACPI: FACP 1ffff1c0 00074 (v01 BOCHS BXPCFACP 00000001 BXPC 00000001)
ACPI: DSDT 1fffe040 01180 (v01 BOCHS BXPCDSDT 00000001 BXPC 00000001)
ACPI: FACS 1fffe000 00040
ACPI: SSDT 1ffff234 008DD (v01 BOCHS BXPCSSDT 00000001 BXPC 00000001)
ACPI: APIC 1ffffb11 00078 (v01 BOCHS BXPCAPIC 00000001 BXPC 00000001)
ACPI: HPET 1ffffb89 00038 (v01 BOCHS BXPCHPET 00000001 BXPC 00000001)
511MB LOWMEM available.
mapped low ram: 0 - 1fffe000
low ram: 0 - 1fffe000
Zone ranges:
DMA [mem 0x00001000-0x00ffffff]
Normal [mem 0x01000000-0x1fffdfff]
Movable zone start for each node
Early memory node ranges
node 0: [mem 0x00001000-0x0009efff]
node 0: [mem 0x00100000-0x1fffdfff]
Using APIC driver default
ACPI: PM-Timer IO Port: 0xb008
ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)
Using ACPI (MADT) for SMP configuration information
ACPI: HPET id: 0x8086a201 base: 0xfed00000
smpboot: Allowing 1 CPUs, 0 hotplug CPUs
e820: [mem 0x20000000-0xfeffbfff] available for PCI devices
setup_percpu: NR_CPUS:8 nr_cpumask_bits:8 nr_cpu_ids:1 nr_node_ids:1
PERCPU: Embedded 13 pages/cpu #dfbed000 s30592 r0 d22656 u53248
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129948
Kernel command line: root=/dev/sda rw
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Initializing CPU#0
allocated 1048552 bytes of page_cgroup
please try 'cgroup_disable=memory' option if you don't want memory cgroups
Memory: 509692K/523888K available (4990K kernel code, 415K rwdata, 1928K rodata, 576K init, 452K bss, 14196K reserved)
virtual kernel memory layout:
fixmap : 0xfff16000 - 0xfffff000 ( 932 kB)
vmalloc : 0xe07fe000 - 0xfff14000 ( 503 MB)
lowmem : 0xc0000000 - 0xdfffe000 ( 511 MB)
.init : 0xc172b000 - 0xc17bb000 ( 576 kB)
.data : 0xc14dfc22 - 0xc172ae00 (2348 kB)
.text : 0xc1000000 - 0xc14dfc22 (4991 kB)
Checking if this processor honours the WP bit even in supervisor mode...Ok.
Preemptible hierarchical RCU implementation.
RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
NR_IRQS:2304 nr_irqs:256 16
console [ttyS0] enabled
tsc: Fast TSC calibration using PIT
tsc: Detected 3092.840 MHz processor
Calibrating delay loop (skipped), value calculated using timer frequency.. 6185.68 BogoMIPS (lpj=12371360)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
Initializing cgroup subsys memory
Initializing cgroup subsys devices
Initializing cgroup subsys freezer
Initializing cgroup subsys blkio
Initializing cgroup subsys perf_event
mce: CPU supports 10 MCE banks
Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0
Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0
tlb_flushall_shift: 6
Freeing SMP alternatives memory: 24K (c17bb000 - c17c1000)
ACPI: Core revision 20130725
ACPI: All ACPI Tables successfully acquired
ftrace: allocating 25039 entries in 49 pages
Enabling APIC mode: Flat. Using 1 I/O APICs
..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
smpboot: CPU0: Intel QEMU Virtual CPU version 2.0.0 (fam: 06, model: 06, stepping: 03)
Performance Events: Broken PMU hardware detected, using software events only.
Failed to access perfctr msr (MSR c1 is 0)
Brought up 1 CPUs
smpboot: Total of 1 processors activated (6185.68 BogoMIPS)
devtmpfs: initialized
NET: Registered protocol family 16
cpuidle: using governor ladder
cpuidle: using governor menu
ACPI: bus type PCI registered
PCI: PCI BIOS revision 2.10 entry at 0xfd3c2, last bus=0
PCI: Using configuration type 1 for base access
pcimode=0x0
bio: create slab <bio-0> at 0
ACPI: Added _OSI(Module Device)
ACPI: Added _OSI(Processor Device)
ACPI: Added _OSI(3.0 _SCP Extensions)
ACPI: Added _OSI(Processor Aggregator Device)
ACPI: Interpreter enabled
ACPI: (supports S0 S5)
ACPI: Using IOAPIC for interrupt routing
PCI: Ignoring host bridge windows from ACPI; if necessary, use "pci=use_crs" and report a bug
ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
acpi PNP0A03:00: ACPI _OSC support notification failed, disabling PCIe ASPM
acpi PNP0A03:00: Unable to request _OSC control (_OSC support mask: 0x08)
acpi PNP0A03:00: fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge.
PCI host bridge to bus 0000:00
pci_bus 0000:00: root bus resource [bus 00-ff]
pci_bus 0000:00: root bus resource [io 0x0000-0xffff]
pci_bus 0000:00: root bus resource [mem 0x00000000-0xffffffff]
pci 0000:00:01.3: quirk: [io 0xb000-0xb03f] claimed by PIIX4 ACPI
pci 0000:00:01.3: quirk: [io 0xb100-0xb10f] claimed by PIIX4 SMB
ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *10 11)
ACPI: PCI Interrupt Link [LNKB] (IRQs 5 *10 11)
ACPI: PCI Interrupt Link [LNKC] (IRQs 5 10 *11)
ACPI: PCI Interrupt Link [LNKD] (IRQs 5 10 *11)
ACPI: PCI Interrupt Link [LNKS] (IRQs *9)
ACPI: Enabled 16 GPEs in block 00 to 0F
vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
vgaarb: loaded
vgaarb: bridge control possible 0000:00:02.0
SCSI subsystem initialized
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti#linux.it>
PTP clock support registered
PCI: Using ACPI for IRQ routing
NET: Registered protocol family 8
NET: Registered protocol family 20
HPET: 3 timers in total, 0 timers will be used for per-cpu timer
hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
hpet0: 3 comparators, 64-bit 100.000000 MHz counter
Switched to clocksource hpet
pnp: PnP ACPI init
ACPI: bus type PNP registered
pnp: PnP ACPI: found 8 devices
ACPI: bus type PNP unregistered
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 3, 32768 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.
pci 0000:00:00.0: Limiting direct PCI/PCI transfers
pci 0000:00:01.0: PIIX3: Enabling Passive Release
pci 0000:00:01.0: Activating ISA DMA hang workarounds
ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 11
NatSemi SCx200 Driver
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Registering unionfs 2.6 (for 3.12.26)
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
Installing knfsd (copyright (C) 1996 okir#monad.swb.de).
NTFS driver 2.1.30 [Flags: R/W].
jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
fuse init (API version 7.22)
msgmni has been set to 995
alg: No test for stdrng (krng)
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 38, base_baud = 921600) is a 16550A
Linux agpgart interface v0.103
[drm] Initialized drm 1.1.0 20060810
SCSI Media Changer driver v0.25
physmap platform flash device: 08000000 at c0000000
physmap-flash physmap-flash.0: map_probe failed
Intel(R) SPI FLASH CONTROLLER Driver built on Mar 8 2017 # 15:45:49
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk#qualcomm.com>
Intel (R) UDMA Driver - 1.0.0
Copyright (c) 2012 Intel Corperation.
UDMA Network Device Driver init
e100: Intel(R) PRO/100 Network Driver, 3.5.24-k2-NAPI
e100: Copyright(c) 1999-2006 Intel Corporation
e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
e1000: Copyright (c) 1999-2006 Intel Corporation.
ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 10
GBE working in Real Phy Mode
e1000 0000:00:03.0 eth0: (PCI:33MHz:32-bit) 52:54:00:12:34:56
e1000 0000:00:03.0 eth0: Intel(R) PRO/1000 Network Connection
GBE working in Real Phy Mode
e1000 0000:00:04.0 eth1: (PCI:33MHz:32-bit) 52:54:00:12:34:57
e1000 0000:00:04.0 eth1: Intel(R) PRO/1000 Network Connection
ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 10
GBE working in Real Phy Mode
tsc: Refined TSC clocksource calibration: 3092.828 MHz
Switched to clocksource tsc
e1000 0000:00:05.0 eth2: (PCI:33MHz:32-bit) 52:54:00:12:34:58
e1000 0000:00:05.0 eth2: Intel(R) PRO/1000 Network Connection
ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 11
GBE working in Real Phy Mode
e1000 0000:00:06.0 eth3: (PCI:33MHz:32-bit) 52:54:00:12:34:59
e1000 0000:00:06.0 eth3: Intel(R) PRO/1000 Network Connection
GBE working in Real Phy Mode
e1000 0000:00:07.0 eth4: (PCI:33MHz:32-bit) 52:54:00:12:34:5a
e1000 0000:00:07.0 eth4: Intel(R) PRO/1000 Network Connection
GBE working in Real Phy Mode
e1000 0000:00:08.0 eth5: (PCI:33MHz:32-bit) 52:54:00:12:34:5b
e1000 0000:00:08.0 eth5: Intel(R) PRO/1000 Network Connection
GBE working in Real Phy Mode
e1000 0000:00:09.0 eth6: (PCI:33MHz:32-bit) 52:54:00:12:34:5c
e1000 0000:00:09.0 eth6: Intel(R) PRO/1000 Network Connection
e1000e: Intel(R) PRO/1000 Network Driver - 2.3.2-k
e1000e: Copyright(c) 1999 - 2013 Intel Corporation.
ixgbe: Intel(R) 10 Gigabit PCI Express Network Driver - version 3.15.1-k
ixgbe: Copyright (c) 1999-2013 Intel Corporation.
ixgb: Intel(R) PRO/10GbE Network Driver - version 1.0.135-k2-NAPI
ixgb: Copyright (c) 1999-2008 Intel Corporation.
PPP generic driver version 2.4.2
NET: Registered protocol family 24
i8042: PNP: PS/2 Controller [PNP0303:KBD,PNP0f13:MOU] at 0x60,0x64 irq 1,12
serio: i8042 KBD port at 0x60,0x64 irq 1
serio: i8042 AUX port at 0x60,0x64 irq 12
mousedev: PS/2 mouse device common for all mice
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input2
rtc_cmos 00:00: RTC can wake from S4
rtc_cmos 00:00: rtc core: registered rtc_cmos as rtc0
rtc_cmos 00:00: alarms up to one day, 114 bytes nvram, hpet irqs
softdog: Software Watchdog Timer: 0.08 initialized. soft_noboot=0 soft_margin=60 sec soft_panic=0 (nowayout=0)
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
oprofile: using NMI interrupt.
IPv4 over IPSec tunneling driver
TCP: cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 10
mip6: Mobile IPv6
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
NET: Registered protocol family 15
8021q: 802.1Q VLAN Support v1.8
sctp: Hash tables configured (established 16384 bind 16384)
lib80211: common routines for IEEE802.11 drivers
Key type dns_resolver registered
Using IPI No-Shortcut mode
registered taskstats version 1
rtc_cmos 00:00: setting system clock to 2017-03-08 14:51:21 UTC (1488984681)
VFS: Cannot open root device "sda" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.12.17 #4
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
00000000 00000000 df45beec c14da955 df45bf34 df45bf04 c14da68e 00000000
df45bf34 fffffffa df75e000 df45bf60 c172bd4e c1605306 df45bf34 c16052b5
c1605282 c176906d df45bf34 fffffffa c16053a2 dffecbc0 00008000 6e6b6e75
Call Trace:
[<c14da955>] dump_stack+0x4b/0x7e
[<c14da68e>] panic+0x88/0x184
[<c172bd4e>] mount_block_root+0x17f/0x18f
[<c10e2a19>] ? SyS_mknod+0x1a/0x1c
[<c172be22>] mount_root+0xc4/0xce
[<c10e2b31>] ? SyS_unlink+0x15/0x17
[<c172bf3d>] prepare_namespace+0x111/0x142
[<c172ba87>] kernel_init_freeable+0x186/0x193
[<c14d7308>] kernel_init+0xd/0xb9
[<c14dea3b>] ret_from_kernel_thread+0x1b/0x30
[<c14d72fb>] ? rest_init+0x77/0x77
What is very weird is that I have the same version of OpenWRT system with a Linux 2.6.32 and it works well. Do I have additionnal kernel options to configure for linux 3.12.X for making it works with Qemu 2.0.0 ?
Thank you in advanced for your helps and comments.
There may be something wrong with your bin/x86/openwrt-x86-sgc_qemu-rootfs-ext4.img file. Where did you get that file from?
Also, you're specifying a disk device as the root filesystem for the kernel (root=/dev/sda) . This is wrong. You're suppose to specify a partition not a disk device. So you probably meant to say "root=/dev/sda1". It's safer to specify a UUID instead of a partition name (e.g. root=UUID=3552064b-7e4d-4e3a-ae48-943b333267d9 ) in case your root partition isn't actually /dev/sda1.
You can extract the UUID for your virtual root partition by creating loopback devices from your disk image:
losetup -P /dev/loop1 bin/x86/openwrt-x86-sgc_qemu-rootfs-ext4.img.
You should see new devices created called /dev/loop1p1 , /dev/loop1p2 , etc. Your virtual partition /dev/sda1 will be created as /dev/loop1p1, /dev/sda2 will be /dev/loop1p2 etc. You can then determine the UUID using parted or gparted on /dev/loop1
You may also need to specify something like "format=raw" in your qemu command, if the disk image is a raw disk image, or you may need to convert it first to a qcow2 image (qemu-image convert).

modprobe: ERROR: could not insert 'snd_aloop': No such device

I'm trying to make a Jack-ALSA bridge on gentoo, but I cannot load the snd_aloop module.
Kernel:
$ uname -a
Linux MalfattiTux 4.6.7-rt-rt11 #1 SMP Thu Sep 22 14:54:42 BRT 2016 x86_64 Intel(R) Core(TM) i7-4710HQ CPU # 2.50GHz GenuineIntel GNU/Linux
snd_aloop compiled as a module:
$ cat /usr/src/linux-4.6.7-rt11/.config | grep ALOOP
CONFIG_SND_ALOOP=m
snd_aloop info:
$ sudo modinfo snd_aloop
filename: /lib/modules/4.6.7-rt-rt11/kernel/sound/drivers/snd-aloop.ko
license: GPL
description: A loopback soundcard
author: Jaroslav Kysela <perex#perex.cz>
depends: snd-pcm
intree: Y
vermagic: 4.6.7-rt-rt11 SMP mod_unload modversions
parm: index:Index value for loopback soundcard. (array of int)
parm: id:ID string for loopback soundcard. (array of charp)
parm: enable:Enable this loopback soundcard. (array of bool)
parm: pcm_substreams:PCM substreams # (1-8) for loopback driver. (array of int)
parm: pcm_notify:Break capture when PCM format/rate/channels changes. (array of int)
Settings for the snd_aloop module:
$ cat /etc/modprobe.d/alsa.conf | grep aloop
options snd-aloop id=Loopback index=0 pcm_substreams=2 enable=1
alias snd-card-0 snd-aloop
Audio devices:
$ sudo lspci | grep -i audio
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)
$ sudo lspci -k -s 00:03.0
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
Subsystem: Lenovo Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel
$ sudo lspci -k -s 00:1b.0
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)
Subsystem: Lenovo 8 Series/C220 Series Chipset High Definition Audio Controller
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel
All looks ok. But then:
$ sudo modprobe snd_aloop
modprobe: ERROR: could not insert 'snd_aloop': No such device
I also tried compiling it not as a module, but included in the kernel. Then, I had loopback devices, but I had no control over them (like number of substreams, for example).
Is there any specific setting needed for this module to work on gentoo?
Thanks :)
The index option of a sound driver specifies the card number it should use.
However, this does not work if another driver is already loaded at the same index.
So you have to set matching index options on all drivers that are used (and might be used in the future, such as USB audio).
A better idea is to drop all index options, and to use the slots options of the snd module to specify that only a specific driver can use a specific index:
options snd slots=snd-aloop,snd-hda-intel,snd-hda-intel
or if the loopback driver should not be the first (default) one:
options snd slots=snd-hda-intel,snd-hda-intel,snd-aloop

Linux RHEL - Find disk type

I have Oracle Linux Server release 5.6 (Red Hat Enterprise Linux Server release 5.6) and I want to check if the disk type is SATA, SCSI, ATA or SAS or any other disk type.
I installed lshw (hardware lister) and executing "lshw -class storage" gives the below output
description: SCSI storage controller
product: 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI
vendor: LSI Logic / Symbios Logic
physical id: 10
bus info: pci#0000:00:10.0
logical name: scsi0
version: 01
width: 64 bits
clock: 33MHz
capabilities: scsi bus_master rom scsi-host
configuration: driver=mptspi latency=64 maxlatency=255 mingnt=6
resources: irq:17 ioport:1400(size=256) memory:d8820000-d883ffff memory:d8800000-d881ffff memory:84008000-8400bfff(prefetchable)
Does this mean this is a SCSI disk type?
How do you find out if the disk type is SAS?
Thanks!

Resources