Kernel panic of "not syncing" occurs when booting on qemu with extracted code by devtool #yocto #devtool #qemu


Hao Qian
 

Hi,

I'm trying to add some drivers to linux kernel and confirm it with qemu.

I clone the poky repository, build and boot as below steps:
----------------------------------------------------------------------------
1. clone poky (poky only)
$ git clone git://git.yoctoproject.org/poky
2. initialize build folder by oe-init-build-env
$ source poky/oe-init-build-env ./build
3. extract linux repository (but do no modifications)
$ devtool modify virtual/kernel
4. build with default configurations
$ bitbake core-image-minimal
5. boot on qemux86-64
$ runqemu nographic
----------------------------------------------------------------------------
and I can boot linux without any panic at this time.


However, when I try to re-build and boot again, I got a panic at boot time 100%.
What I did are listed below:
----------------------------------------------------------------------------
6. re-build with clean
$ bitbake virtual/kernel -c clean && bitbake core-image-minimal -c
clean && bitbake core-image-minimal
(I also tried replacing "-c clean" with "-c cleanall", adding "rm
-rf tmp/ cache/ sstate/", but got same panic error)
7. boot on qemux86-64
$ runqemu nographic
(also tried "runqemu qemux86-64 nographic")
----------------------------------------------------------------------------

The log of panic is:
============= panic log ===============
[ 2.177811] rtc_cmos 00:00: setting system clock to
2020-04-03T22:35:00 UTC (1585953300)
[ 2.186697] md: Waiting for all devices to be available before autodetect
[ 2.186838] md: If you don't use raid, use raid=noautodetect
[ 2.189483] md: Autodetecting RAID arrays.
[ 2.189595] md: autorun ...
[ 2.189665] md: ... autorun DONE.
[ 2.190837] VFS: Cannot open root device "vda" or
unknown-block(0,0): error -6
[ 2.190993] Please append a correct "root=" boot option; here are
the available partitions:
[ 2.191290] 0b00 1048575 sr0
[ 2.191310] driver: sr
[ 2.191485] VFS: Unable to mount root fs on unknown-block(0,0)
[ 2.191606] User configuration error - no valid root filesystem found
[ 2.191797] Kernel panic - not syncing: Invalid configuration from
end user prevents continuing
[ 2.192134] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.2.32 #1
[ 2.192279] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014
[ 2.192613] Call Trace:
[ 2.193218] dump_stack+0x6d/0x9a
[ 2.193337] panic+0x101/0x2d7
[ 2.193445] mount_block_root+0x2cf/0x2f2
[ 2.193538] mount_root+0x7d/0x80
[ 2.193612] prepare_namespace+0x13f/0x177
[ 2.193701] kernel_init_freeable+0x236/0x25a
[ 2.193798] ? rest_init+0xb0/0xb0
[ 2.193872] kernel_init+0xe/0x100
[ 2.193946] ret_from_fork+0x35/0x40
[ 2.194488] Kernel Offset: 0x2e00000 from 0xffffffff81000000
(relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[ 2.194918] ---[ end Kernel panic - not syncing: Invalid
configuration from end user prevents continuing ]---
======================================

P.S. panic will not happen if I didn't extract linux repository
with "devtool modify" command.


I've tried to search answers on yocto-mailing-list, stackoverflow, nxp
community and other websites, but can not find any solution for this
problem.

Could anyone please help to fix this problem, or just offers some advices?

Best regards,
Qian

Join yocto@lists.yoctoproject.org to automatically receive all group messages.