Bug 11687

Summary: Can not run QEMU machines under UNFS
Product: [Runtime] General Runtime Reporter: Yi Zhao <yi.zhao>
Component: General RuntimeAssignee: Robert Yang <liezhi.yang>
Status: VERIFIED FIXED QA Contact: Yi Zhao <yi.zhao>
Severity: normal    
Priority: Medium+ CC: brian.avery, jose.perez.carranza, libertad.gonzalez.de.la.cruz, liezhi.yang, yi.zhao
Version: 2.4   
Target Milestone: 2.4 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: Regression (Used to work)
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
runqemu.log
none
Screenshot none

Description Yi Zhao 2017-06-19 07:32:04 UTC
Created attachment 3829 [details]
runqemu.log

Image location: http://autobuilder.yoctoproject.org/pub/releases/yocto-2.4_M1.rc1/machines/qemu/

Toolchain location: http://autobuilder.yoctoproject.org/pub/releases/yocto-2.4_M1.rc1/toolchain/

Git rev: master/6964efddd31c479386d1643c1025bc102710392f

Steps:
1. Download qemu rootfs.tar.bz2 and kernel
2. Download toolchain sdk
3. Install toolchain sdk and set environment
4. Extract the rootfs.tar.bz2
   $ runqemu-extract-sdk core-image-sato-qemux86-64.tar.bz2 rootfs
5. Run runqemu
   $ runqemu core-image-sato-qemux86-64.qemuboot.conf rootfs

A kernel panic error occurs when booting:

#########################################
[    4.837226] md: ... autorun DONE.
[  101.345418] VFS: Unable to mount root fs via NFS, trying floppy.
[  101.346673] VFS: Cannot open root device "nfs" or unknown-block(2,0): error -6
[  101.346810] Please append a correct "root=" boot option; here are the available partitions:
[  101.347199] 0100            4096 ram0
[  101.347217]  (driver?)
[  101.347351] 0101            4096 ram1
[  101.347355]  (driver?)
[  101.347471] 0102            4096 ram2
[  101.347475]  (driver?)
[  101.347589] 0103            4096 ram3
[  101.347593]  (driver?)
[  101.347706] 0104            4096 ram4
[  101.347710]  (driver?)
[  101.347824] 0105            4096 ram5
[  101.347827]  (driver?)
[  101.347971] 0106            4096 ram6
[  101.347974]  (driver?)
[  101.348134] 0107            4096 ram7
[  101.348138]  (driver?)
[  101.348253] 0108            4096 ram8
[  101.348256]  (driver?)
[  101.348371] 0109            4096 ram9
[  101.348374]  (driver?)
[  101.348488] 010a            4096 ram10
[  101.348492]  (driver?)
[  101.348607] 010b            4096 ram11
[  101.348610]  (driver?)
[  101.348726] 010c            4096 ram12
[  101.348729]  (driver?)
[  101.348873] 010d            4096 ram13
[  101.348879]  (driver?)
[  101.349083] 010e            4096 ram14
[  101.349087]  (driver?)
[  101.349207] 010f            4096 ram15
[  101.349210]  (driver?)
[  101.349330] 1600         4194302 hdc
[  101.349347]  driver: ide-cdrom
[  101.349497] VFS: Unable to mount root fs on unknown-block(2,0)
[  101.349602] User configuration error - no valid root filesystem found
[  101.349759] Kernel panic - not syncing: Invalid configuration from end user prevents continuing
[  101.350031] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.10.17-yocto-standard #1
[  101.350031] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.10.2-0-g5f4c7b1-prebuilt.qemu-project.org 04/01/2014
[  101.350031] Call Trace:
[  101.350031]  dump_stack+0x63/0x81
[  101.350031]  panic+0xd5/0x202
[  101.350031]  ? printk+0x48/0x50
[  101.350031]  mount_block_root+0x208/0x234
[  101.350031]  ? set_debug_rodata+0x12/0x12
[  101.350031]  mount_root+0x101/0x10a
[  101.350031]  prepare_namespace+0x164/0x19c
[  101.350031]  kernel_init_freeable+0x229/0x242
[  101.350031]  ? rest_init+0x90/0x90
[  101.350031]  kernel_init+0xe/0x100
[  101.350031]  ret_from_fork+0x2c/0x40
[  101.350031] Kernel Offset: disabled
[  101.350031] ---[ end Kernel panic - not syncing: Invalid configuration from end user prevents continuing
####################################################


I attached the full log for runqemu
Comment 1 David Lopez Barriba 2017-06-19 16:54:10 UTC
Created attachment 3831 [details]
Screenshot

I found this on Eclipse , cannot run qemu from eclipse and shows the same "kernel panic" error.

Image location: http://autobuilder.yoctoproject.org/pub/releases/yocto-2.4_M1.rc1/machines/qemu/

Toolchain location: http://autobuilder.yoctoproject.org/pub/releases/yocto-2.4_M1.rc1/toolchain/
Comment 2 brian avery 2017-06-22 01:33:02 UTC
So, in 2.3 when you ran unfs (userspace nfs) from qemu you got the following response from unfsd:
On your target please remember to add the following options for NFS     
nfsroot=IP_ADDRESS:/big/src/myBugs/RUN/11687/2.3/ROOTFS,nfsvers=3,port=3049,mountprog=21111,nfsprog=11111,udp,mountport=3048
-and we called qemu-system-x86_64 with the following nfs options:
nfsroot=192.168.7.1:<absPath>/ROOTFS,nfsvers=3,port=3049,mountprog=21111,nfsprog=11111,udp,mountport=3048
THIS WORKS!!!
In 2.4 the unfsd program tells us:
On your target please remember to add the following options for NFS                                                                                        nfsroot=IP_ADDRESS:/big/src/myBugs/RUN/11687/2.4M1/ROOTFS,nfsvers=3,port=3049,udp,mountport=3048
Yet, we still call qemu-system-x86_64 with the following nfs options:
nfsroot=192.168.7.1:<absPath>/ROOTFS,nfsvers=3,port=3049,mountprog=21111,nfsprog=11111,udp,mountport=3048
THIS FAILS/KERNEL PANICS!
If I hack runqemu to NOT add the mountprog=21111,nfsprog=11111 and call qemu-system-x86_64 with the following nfs options:
nfsroot=192.168.7.1:<absPath>/ROOTFS,nfsvers=3,port=3049,udp,mountport=3048
THIS WORKS

We can either  parse the output from "add the following nfs options..."  or just remove them since we changed runqemu-export-rootfs in commit 6bb9860ef7ba9c84fe9bd3a81aa6555f67ebd38e to no longer set the rpcports.
Comment 3 brian avery 2017-06-22 03:30:35 UTC
When I say "remove them" I mean remove mountprog=21111,nfsprog=11111, from the nfsroot line.
Comment 5 Yi Zhao 2017-07-31 06:37:21 UTC
Verified with 2.4 M2 rc2.
Git rev: master/8e15e9b6e478f6368034519b2a8fd3c7ea71d23b