Bug 11064

Summary: [Yocto 2.2.1] kernel version mismatched when using yocto-bsp to create custom qemu bsp
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Yi Zhao <yi.zhao>
Component: meta-yoctoAssignee: Armin Kuster <akuster>
Status: RESOLVED FIXED QA Contact: Yi Zhao <yi.zhao>
Severity: normal    
Priority: Medium+ CC: akuster, dl9pf, jose.perez.carranza, leonardo.sandoval.gonzalez, poky.bs.watcher, poky.watcher, richard.purdie, yi.zhao
Version: 2.2.1   
Target Milestone: 2.2.2   
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
log.do_kernel_version_sanity_check
none
log.do_kernel_version_sanity_check none

Description Yi Zhao 2017-02-17 07:15:20 UTC
Created attachment 3635 [details]
log.do_kernel_version_sanity_check

Git rev: morty/6a1f33cc40bfac33cf030fe41e1a8efd1e5fad6f

Steps:
Follow the link https://wiki.yoctoproject.org/wiki/Transcript:_Using_the_Yocto_BSP_tools_to_create_a_qemu_BSP to create a custom qemu BSP. e.g. myqemuarm:

$ yocto-bsp create myqemuarm qemu
Checking basic git connectivity...
Done.

Which qemu architecture would you like to use? [default: i386]
	1) i386    (32-bit)
	2) x86_64  (64-bit)
	3) ARM     (32-bit)
	4) PowerPC (32-bit)
	5) MIPS    (32-bit)
	6) MIPS64  (64-bit)
3
Would you like to use the default (4.8) kernel? (y/n) [default: y] 
Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n] [default: y] 
Getting branches from remote repo git://git.yoctoproject.org/linux-yocto-4.8.git...
Please choose a machine branch to base your new BSP branch on: [default: standard/base]
	1) standard/arm-versatile-926ejs
	2) standard/base
	3) standard/beagleboard
	4) standard/beaglebone
	5) standard/edgerouter
	6) standard/fsl-mpc8315e-rdb
	7) standard/mti-malta32
	8) standard/mti-malta64
	9) standard/qemuarm64
	10) standard/qemuppc
1
Would you like SMP support? (y/n) [default: y] 
Does your BSP have a touchscreen? (y/n) [default: n] 
Does your BSP have a keyboard? (y/n) [default: y] 

New qemu BSP created in meta-myqemuarm

Build the kernel:

$ bitbake linux-yocto
Parsing recipes: 100% |################################################################################################################################| Time: 0:00:24
Parsing of 864 .bb files complete (0 cached, 864 parsed). 1318 targets, 72 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.32.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-16.04"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "myqemuarm"
DISTRO            = "poky"
DISTRO_VERSION    = "2.2.1"
TUNE_FEATURES     = "arm armv5 thumb dsp"
TARGET_FPU        = "soft"
meta              
meta-poky         
meta-yocto-bsp    
meta-myqemuarm    = "morty:6a1f33cc40bfac33cf030fe41e1a8efd1e5fad6f"

Initialising tasks: 100% |#############################################################################################################################| Time: 0:00:01
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: linux-yocto-4.8.12+gitAUTOINC+ea8a679c95_c50f695341-r0.1 do_kernel_version_sanity_check: Package Version (4.8.12+gitAUTOINC+ea8a679c95_c50f695341) does not match of kernel being built (4.8.18). Please update the PV variable to match the kernel source.
ERROR: linux-yocto-4.8.12+gitAUTOINC+ea8a679c95_c50f695341-r0.1 do_kernel_version_sanity_check: Function failed: do_kernel_version_sanity_check (log file is located at /buildarea1/poky/build/tmp/work/myqemuarm-poky-linux-gnueabi/linux-yocto/4.8.12+gitAUTOINC+ea8a679c95_c50f695341-r0.1/temp/log.do_kernel_version_sanity_check.9962)
ERROR: Logfile of failure stored in: /buildarea1/poky/build/tmp/work/myqemuarm-poky-linux-gnueabi/linux-yocto/4.8.12+gitAUTOINC+ea8a679c95_c50f695341-r0.1/temp/log.do_kernel_version_sanity_check.9962
ERROR: Task (/buildarea1/poky/meta/recipes-kernel/linux/linux-yocto_4.8.bb:do_kernel_version_sanity_check) failed with exit code '1'
NOTE: Tasks Summary: Attempted 281 tasks of which 0 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /buildarea1/poky/meta/recipes-kernel/linux/linux-yocto_4.8.bb:do_kernel_version_sanity_check
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.


This is a regression bug which works on 2.2.
Comment 1 Yi Zhao 2017-03-17 07:19:18 UTC
This issue also happened on 2.3 M3.
Git rev: master/6e20b31d5d17133e0fca086e12a0ad06ab5c4cc8


ERROR: linux-yocto-4.8.18+gitAUTOINC+4fb6f24600_03e1ac6e03-r0.8 do_kernel_version_sanity_check: Package Version (4.8.18+gitAUTOINC+4fb6f24600_03e1ac6e03) does not match of kernel being built (4.8.20). Please update the PV variable to match the kernel source or set KERNEL_VERSION_SANITY_SKIP="1" in your recipe.
ERROR: linux-yocto-4.8.18+gitAUTOINC+4fb6f24600_03e1ac6e03-r0.8 do_kernel_version_sanity_check: Function failed: do_kernel_version_sanity_check (log file is located at /buildarea/jenkins-yocto/workspace/Yocto2.3-yocto-bsp_create_qemu_bsp/build_1/tmp/work/myqemux86-poky-linux/linux-yocto/4.8.18+gitAUTOINC+4fb6f24600_03e1ac6e03-r0.8/temp/log.do_kernel_version_sanity_check.10335)
ERROR: Logfile of failure stored in: /buildarea/jenkins-yocto/workspace/Yocto2.3-yocto-bsp_create_qemu_bsp/build_1/tmp/work/myqemux86-poky-linux/linux-yocto/4.8.18+gitAUTOINC+4fb6f24600_03e1ac6e03-r0.8/temp/log.do_kernel_version_sanity_check.10335
ERROR: Task (/buildarea/jenkins-yocto/poky/meta/recipes-kernel/linux/linux-yocto_4.8.bb:do_kernel_version_sanity_check) failed with exit code '1'
Comment 2 Leonardo Sandoval Gonzalez 2017-03-24 22:11:59 UTC
If you comment the the following lines on the new BSP, do you get the same result? I ran this on master and worked.

----- snip -----
# replace these SRCREVs with the real commit ids once you've had                                                                                                                             
# the appropriate changes committed to the upstream linux-yocto repo                                                                                                                         
SRCREV_machine_pn-linux-yocto_myqemu ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_myqemu ?= "${AUTOREV}"
#LINUX_VERSION = "4.8
----- snip -----

This code is located inside meta-myqemu/recipes-kernel/linux/linux-yocto_4.8.bbappend.

I believe, by default these should be commented, but I need to dig more before proposing this change.
Comment 4 Yi Zhao 2017-03-28 02:11:31 UTC
(In reply to comment #2)
> If you comment the the following lines on the new BSP, do you get the same
> result? I ran this on master and worked.
> 
> ----- snip -----
> # replace these SRCREVs with the real commit ids once you've had            
> 
> # the appropriate changes committed to the upstream linux-yocto repo        
> 
> SRCREV_machine_pn-linux-yocto_myqemu ?= "${AUTOREV}"
> SRCREV_meta_pn-linux-yocto_myqemu ?= "${AUTOREV}"
> #LINUX_VERSION = "4.8
> ----- snip -----
> 
> This code is located inside
> meta-myqemu/recipes-kernel/linux/linux-yocto_4.8.bbappend.
> 
> I believe, by default these should be commented, but I need to dig more
> before proposing this change.

Hi,

I commented the above lines then the test could pass both on master and morty. But I never commented these lines in previous testing and it worked well.
Can you confirm that we should comment these lines in testing ?

Thanks,
Yi
Comment 5 Leonardo Sandoval Gonzalez 2017-03-28 16:38:33 UTC
(In reply to comment #4)
> (In reply to comment #2)
> > If you comment the the following lines on the new BSP, do you get the same
> > result? I ran this on master and worked.
> > 
> > ----- snip -----
> > # replace these SRCREVs with the real commit ids once you've had            
> > 
> > # the appropriate changes committed to the upstream linux-yocto repo        
> > 
> > SRCREV_machine_pn-linux-yocto_myqemu ?= "${AUTOREV}"
> > SRCREV_meta_pn-linux-yocto_myqemu ?= "${AUTOREV}"
> > #LINUX_VERSION = "4.8
> > ----- snip -----
> > 
> > This code is located inside
> > meta-myqemu/recipes-kernel/linux/linux-yocto_4.8.bbappend.
> > 
> > I believe, by default these should be commented, but I need to dig more
> > before proposing this change.
> 
> Hi,
> 
> I commented the above lines then the test could pass both on master and
> morty. But I never commented these lines in previous testing and it worked
> well.
> Can you confirm that we should comment these lines in testing ?
> 
> Thanks,
> Yi

Right, this is not the right approach but helped us to figure out the real problem. I have sent two series, master and morty series, the later needs a v2.
Comment 6 Leonardo Sandoval Gonzalez 2017-03-28 20:37:04 UTC
Sent a v2 for morty branch

https://lists.yoctoproject.org/pipermail/poky/2017-March/010934.html
Comment 7 Yi Zhao 2017-06-02 02:58:04 UTC
This issue still happens on 2.2.2 rc1 build.
Git rev: morty/d05941ae4567def4a288894717e5f550da246107
Comment 8 Armin Kuster 2017-06-07 00:50:33 UTC
I think what happened here are the bsp hashes did not get updated when going to 4.8.18.

the bsps are still at 4.8.12.
Comment 9 Leonardo Sandoval Gonzalez 2017-06-07 14:52:16 UTC
(In reply to comment #8)
> I think what happened here are the bsp hashes did not get updated when going
> to 4.8.18.
> 
> the bsps are still at 4.8.12.

Armin, the problem is that the patch (comment 6) has not been merged into morty so problem is still present on morty (not in master).
Comment 10 Armin Kuster 2017-06-17 16:49:42 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > I think what happened here are the bsp hashes did not get updated when going
> > to 4.8.18.
> > 
> > the bsps are still at 4.8.12.
> 
> Armin, the problem is that the patch (comment 6) has not been merged into
> morty so problem is still present on morty (not in master).

ok got it now.
Comment 11 Armin Kuster 2017-06-17 18:38:56 UTC
in akuster/morty-next
Comment 12 Leonardo Sandoval Gonzalez 2017-06-19 13:51:29 UTC
Thanks Armin!

patch merged (poky id cf781e2f9b406075d97d363443eba4a74171a8c0)

Yi, can you please test it again? patch is now at the stable branch (2.2.x).
Comment 13 Yi Zhao 2017-06-22 03:04:18 UTC
Created attachment 3837 [details]
log.do_kernel_version_sanity_check
Comment 14 Yi Zhao 2017-06-22 03:04:39 UTC
(In reply to comment #12)
> Thanks Armin!
> 
> patch merged (poky id cf781e2f9b406075d97d363443eba4a74171a8c0)
> 
> Yi, can you please test it again? patch is now at the stable branch (2.2.x).

Still can NOT work with lastest morty branch (b4cf48ecee9e2c0fd4aad96911aecd1b805cfa5a) :

ERROR: linux-yocto-4.8.18+gitAUTOINC+c84532b647_f6329fd287-r0.1 do_kernel_version_sanity_check: Package Version (4.8.18+gitAUTOINC+c84532b647_f6329fd287) does not match of kernel being built (4.8.24). Please update the PV variable to match the kernel source.
ERROR: linux-yocto-4.8.18+gitAUTOINC+c84532b647_f6329fd287-r0.1 do_kernel_version_sanity_check: Function failed: do_kernel_version_sanity_check (log file is located at /home/build/poky/build/tmp/work/myqemuarm-poky-linux-gnueabi/linux-yocto/4.8.18+gitAUTOINC+c84532b647_f6329fd287-r0.1/temp/log.do_kernel_version_sanity_check.27224)
ERROR: Logfile of failure stored in: /home/build/poky/build/tmp/work/myqemuarm-poky-linux-gnueabi/linux-yocto/4.8.18+gitAUTOINC+c84532b647_f6329fd287-r0.1/temp/log.do_kernel_version_sanity_check.27224
ERROR: Task (/home/build/poky/meta/recipes-kernel/linux/linux-yocto_4.8.bb:do_kernel_version_sanity_check) failed with exit code '1'


The full log is attached.
Comment 15 Leonardo Sandoval Gonzalez 2017-06-22 13:54:14 UTC
(In reply to comment #14)
> (In reply to comment #12)
> > Thanks Armin!
> > 
> > patch merged (poky id cf781e2f9b406075d97d363443eba4a74171a8c0)
> > 
> > Yi, can you please test it again? patch is now at the stable branch (2.2.x).
> 
> Still can NOT work with lastest morty branch
> (b4cf48ecee9e2c0fd4aad96911aecd1b805cfa5a) :
> 
> ERROR: linux-yocto-4.8.18+gitAUTOINC+c84532b647_f6329fd287-r0.1
> do_kernel_version_sanity_check: Package Version
> (4.8.18+gitAUTOINC+c84532b647_f6329fd287) does not match of kernel being
> built (4.8.24). Please update the PV variable to match the kernel source.
> ERROR: linux-yocto-4.8.18+gitAUTOINC+c84532b647_f6329fd287-r0.1
> do_kernel_version_sanity_check: Function failed:
> do_kernel_version_sanity_check (log file is located at
> /home/build/poky/build/tmp/work/myqemuarm-poky-linux-gnueabi/linux-yocto/4.8.
> 18+gitAUTOINC+c84532b647_f6329fd287-r0.1/temp/log.
> do_kernel_version_sanity_check.27224)
> ERROR: Logfile of failure stored in:
> /home/build/poky/build/tmp/work/myqemuarm-poky-linux-gnueabi/linux-yocto/4.8.
> 18+gitAUTOINC+c84532b647_f6329fd287-r0.1/temp/log.
> do_kernel_version_sanity_check.27224
> ERROR: Task
> (/home/build/poky/meta/recipes-kernel/linux/linux-yocto_4.8.bb:
> do_kernel_version_sanity_check) failed with exit code '1'
> 
> 
> The full log is attached.

Yi, sorry the for the iteration. 

Armin, we need the patch from comment 6 to be on morty. Can you help me merging it? It is actually present at master (poky hash e6adeac7aa) but not in morty.
Comment 16 Leonardo Sandoval Gonzalez 2017-06-22 14:06:35 UTC
(In reply to comment #15)
> (In reply to comment #14)
> > (In reply to comment #12)
> > > Thanks Armin!
> > > 
> > > patch merged (poky id cf781e2f9b406075d97d363443eba4a74171a8c0)
> > > 
> > > Yi, can you please test it again? patch is now at the stable branch (2.2.x).
> > 
> > Still can NOT work with lastest morty branch
> > (b4cf48ecee9e2c0fd4aad96911aecd1b805cfa5a) :
> > 
> > ERROR: linux-yocto-4.8.18+gitAUTOINC+c84532b647_f6329fd287-r0.1
> > do_kernel_version_sanity_check: Package Version
> > (4.8.18+gitAUTOINC+c84532b647_f6329fd287) does not match of kernel being
> > built (4.8.24). Please update the PV variable to match the kernel source.
> > ERROR: linux-yocto-4.8.18+gitAUTOINC+c84532b647_f6329fd287-r0.1
> > do_kernel_version_sanity_check: Function failed:
> > do_kernel_version_sanity_check (log file is located at
> > /home/build/poky/build/tmp/work/myqemuarm-poky-linux-gnueabi/linux-yocto/4.8.
> > 18+gitAUTOINC+c84532b647_f6329fd287-r0.1/temp/log.
> > do_kernel_version_sanity_check.27224)
> > ERROR: Logfile of failure stored in:
> > /home/build/poky/build/tmp/work/myqemuarm-poky-linux-gnueabi/linux-yocto/4.8.
> > 18+gitAUTOINC+c84532b647_f6329fd287-r0.1/temp/log.
> > do_kernel_version_sanity_check.27224
> > ERROR: Task
> > (/home/build/poky/meta/recipes-kernel/linux/linux-yocto_4.8.bb:
> > do_kernel_version_sanity_check) failed with exit code '1'
> > 
> > 
> > The full log is attached.
> 
> Yi, sorry the for the iteration. 
> 
> Armin, we need the patch from comment 6 to be on morty. Can you help me
> merging it? It is actually present at master (poky hash e6adeac7aa) but not
> in morty.

Answering to myself: patch is on morty-next as mentioned by Armin 

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=akuster/morty-next&id=3ce6fdf19a28d25e58a2c353e87dffd753daf67d

Sorry for the noise.
Comment 17 Leonardo Sandoval Gonzalez 2017-08-04 19:05:26 UTC
Armin, once patch land on master, assign this bug to me so I can test it again.
Comment 18 Leonardo Sandoval Gonzalez 2017-08-04 19:07:40 UTC
by mistake, I set it to needinfo, but the status should be new.
Comment 19 Armin Kuster 2017-08-31 15:21:02 UTC
got dropped somewhere and is now back in my morty-next. 

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=akuster/morty-next&id=3d5c96d6dc25c1d444f0e168070adc9d6a9dddce
Comment 20 Yi Zhao 2017-09-13 01:18:50 UTC
With 2.2.2 rc2 testing, there is no such issue. This bug can be marked as fixed.