buildroot编译内核启动报错:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[drm:i915_firmware_load_error_print] *ERROR* failed to load firmware i915/skl_dmc_ver1.bin (0)
[ 0.313887] [drm:i915_firmware_load_error_print] *ERROR* The driver is built-in, so to load the firmware you need to
[ 0.313887] include it either in the kernel (see CONFIG_EXTRA_FIRMWARE) or
[ 0.313887] in your initrd/initramfs image.
[ 0.618978] [drm:intel_guc_ucode_init] *ERROR* Failed to fetch GuC firmware from i915/skl_guc_ver4.bin (error -2)
[ 0.743019] [drm:i915_gem_init_hw] *ERROR* Failed to initialize GuC, error -5 (ignored)
[ 0.888525] hdaudio hdaudioC0D2: Unable to bind the codec
[ 1.004739] usb usb1-port5: over-current condition
[ 1.183738] usb usb1-port6: over-current condition
[ 1.242124] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 1.341052] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.4.283 #1
[ 1.412915] Hardware name: 360WS Default string/RT5140, BIOS 360WS-LY236-5140-20180130 01/30/2018
[ 1.519094] 0000000000000000 ffff880264287de0 ffffffff818d7847 ffff880263495000
[ 1.608012] ffffffff81b94590 ffff880264287e58 ffffffff818ca0dd ffffffff00000010
[ 1.696931] ffff880264287e68 ffff880264287e08 0000000400000001 ffff880264287e78
[ 1.785847] Call Trace:
[ 1.815075] [<ffffffff818d7847>] dump_stack+0x57/0x6d
[ 1.876534] [<ffffffff818ca0dd>] panic+0xbb/0x1ff
[ 1.933838] [<ffffffff81f3d2da>] mount_block_root+0x174/0x1ee
[ 2.003625] [<ffffffff81f3d443>] mount_root+0xef/0xf8
[ 2.065082] [<ffffffff81f3d586>] prepare_namespace+0x13a/0x172
[ 2.135903] [<ffffffff81f3cfa7>] kernel_init_freeable+0x1c4/0x1d9
[ 2.209846] [<ffffffff818f2532>] ? rest_init+0x79/0x79
[ 2.272348] [<ffffffff818f253b>] kernel_init+0x9/0xde
[ 2.333810] [<ffffffff818f7d15>] ret_from_fork+0x55/0x80
[ 2.398392] [<ffffffff818f2532>] ? rest_init+0x79/0x79
[ 2.460942] Kernel Offset: disabled
[ 2.502701] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
解决办法:
1)内核编译“Kernel binary format”选择bzImage镜像:
2)使能buildroot文件系统的RAM FS编译到内核bzImage;“initial RAM filesystem…”选择开启后,“cpio the root filesystem…”会被自动强制选中开启:
3)关联的,内核代码的General setup里“Initial RAM filesystem…”也会被自动强制选中开启,路径设置的是buildroot的/output/images/rootfs.cpio,被buildroot编译cpio归档的文件系统镜像:
4)grub启动bzImage项设置大致如下:
[shell /root]$cat /boot/grub/grub.conf
default 0
timeout 3
title buildroot
root (hd0,0)
kernel /bzImage root=/dev/sda1 ro quiet console=ttyS0,9600
ram filesystem内存文件系统编译进了bzImage内核镜像,启动分区为第一分区,其中“root=/dev/sda1”可有可无,不影响启动;