Bug 12641 - [2.5 M3 RC1] Kernel Development Build external modules (hello-mod) test case: Function failed do_rootfs
Summary: [2.5 M3 RC1] Kernel Development Build external modules (hello-mod) test case:...
Status: RESOLVED FIXED
Alias: None
Product: Kernel
Classification: Yocto Project Subprojects
Component: kernel-tooling (show other bugs)
Version: 2.5
Hardware: x86 x86_64
: Medium+ normal
Target Milestone: 0.0.0
Assignee: Juro Bystricky
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2018-04-02 01:06 UTC by Mazliana
Modified: 2018-05-07 00:37 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments
log.do_rootfs (6.78 KB, application/octet-stream)
2018-04-02 01:06 UTC, Mazliana
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mazliana 2018-04-02 01:06:46 UTC
Created attachment 4253 [details]
log.do_rootfs

POKY: 2.5.M3.rc1 <f49ee61422c867516db252054e993df29f775136>

USE CASE :
As a developer, I want to be able to build external modules (hello-mod).

STEPS TO REPRODUCE:
1. Have clone poky

2. Checkout branch with 2.5.3.rc1

3. Create new layer to work with your own linux kernel name meta-kerneltest(depend to you to name the layer)

4. Copy the hello-mod directory from meta-skeleton to meta-kerneltest

5. Inside build environment , ensure the following line is set on the same file 
PREFERRED_VERSION_linux-yocto_qemux86-64="[VERSION]%"

6. Set the hello module variable information on conf/local.conf (in your testing build environment), with the following line:
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-hello"

7. Edit the linux-yocto recipe append file and make sure you have only the following line, and save and close the file:
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

8. Clean the shared state:
$ cd [POKY_PATH]/build
$ bitbake virtual/kernel -c cleansstate

9.  Compile the hello module:
$ bitbake hello-mod

10. Create a minimal image:
$ bitbake core-image-minimal

11. Boot the image using QEMU:
$ runqemu nographic core-image-minimal
    11.1. Once the qemu terminal is ready, verify on it that the hello module was successfully added:
    $ modprobe hello
    11.2. Remove the hello module:
    $ rmmod hello1
    11.3. Power off and exit the qemu terminal:
    $ poweroff

*[VERSION] refer as linux-yocto kernel version (only the first two numbers, for example: 4.10)
* Can refer this link for the following step.
- Setup (Common Prerequisites) and TC_KD_10 – Building hello-mod
https://wiki.yoctoproject.org/wiki/Kernel_Development_Test_Cases

EXPECTED OUTCOME: 
1. Compilation process should be performed successfully.
2. Image should be compiled without errors.
3. Verify the message "Hello World!"is displayed after executing modprobe on the QEMU terminal.
4. Verify the message "Goodbye Cruel world!" is displayed after removing the module on the QEMU terminal.

ACTUAL OUTCOME:
1. In step run bitbake core-image-minimal, got error with function do_rootfs

METHOD USED:
Done try with both method but still got error related to do_rootfs.
1. Build using clean build folder.
2. Build using fresh poky and build folder
Comment 1 Juro Bystricky 2018-04-05 09:46:09 UTC
To successfully build the module, please follow the original steps, but place this line (step 6): 

MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "hello-mod"

in your local.conf instead of
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-hello"

My results were:

$ bitbake hello-mod
$ bitbake core-image-minimal
$ runqemu nographic core-image-minimal

<snip>

Poky (Yocto Project Reference Distro) 2.4+snapshot qemux86 /dev/ttyS0

qemux86 login: root
root@qemux86:~# modprobe hello
[   22.156996] hello: loading out-of-tree module taints kernel.
[   22.163419] Hello World!
root@qemux86:~# rmmod hello
[   34.223320] Goodbye Cruel World!
root@qemux86:~# 


I will investigate if this is a documentation error (obsolete documentation?) or an actual regression. I am also not sure the steps 5,7,8 are actually still needed...
Comment 2 Juro Bystricky 2018-04-05 16:13:58 UTC
https://patchwork.openembedded.org/patch/149929/
Comment 4 Mazliana 2018-05-07 00:37:10 UTC
This bug is fixed. Verify in 2.5 M4 rc1