Bug 13938 - devtool modify virtual/kernel fails when EXTRAVERSION field is empty in Makefile
Summary: devtool modify virtual/kernel fails when EXTRAVERSION field is empty in Makefile
Status: NEW
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: unspecified
Hardware: All Multiple
: Medium normal
Target Milestone: Future
Assignee: Eilís Ní Fhlannagáin
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2020-06-11 07:04 UTC by Mathew Prokos
Modified: 2025-05-29 16:09 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mathew Prokos 2020-06-11 07:04:13 UTC
Using devtool modify virtual/kernel fails when EXTRAVERSION field is empty.

linux/Makefile
----- snip ----
VERSION = 4
PATCHLEVEL = 9
SUBLEVEL = 99
EXTRAVERSION =
NAME = Roaring Lionus
----- snip -----


With this version string the standard.py get_staging_kver function fails with

Traceback (most recent call last):
  File "/srctrees/imx7ulp/mainline_integ/platforms/yocto/poky/scripts/devtool", line 334, in <module>
    ret = main()
  File "/srctrees/imx7ulp/mainline_integ/platforms/yocto/poky/scripts/devtool", line 321, in main
    ret = args.func(args, config, basepath, workspace)
  File "/srctrees/imx7ulp/mainline_integ/platforms/yocto/poky/scripts/lib/devtool/standard.py", line 801, in modify
    staging_kerVer = get_staging_kver(srcdir)
  File "/srctrees/imx7ulp/mainline_integ/platforms/yocto/poky/scripts/lib/devtool/standard.py", line 736, in get_staging_kver
    kerver.append(word.split('= ')[1].split('\n')[0])
IndexError: list index out of range
Comment 1 Tim Orling 2020-06-11 09:52:55 UTC
The code throwing the error exists in master.

At first glance, any stable mainline kernel will have an empty EXTRAVERSION field, so this needs to be addressed.

The user is likely on a prior release (rocko? 4.9 kernel and MACHINE imx7ulp). The fix will need to be backported, but rocko is out of support for quite a while now. meta-freescale has newer releases (up through dunfell) with newer kernels.
Comment 2 Tim Orling 2020-07-30 07:24:49 UTC
I am unable to replicate the error on linux-yocto for Dunfell and latest tree.

Mathew can you please provide more details about exactly which layers you are using (your conf/bblayers.conf) and the release/version/commithash for those layers.

Also please include the MACHINE and other relevant settings from your conf/local.conf
Comment 3 Tim Orling 2020-08-06 08:05:57 UTC
Haven't heard anything from the original reporter since June. I cannot reproduce this error, so closing as "works for me".

Also removing the Backport whiteboard, since we do not have any action at this time.

If you are still experiencing this issue, please reopen the bug and provide the requested additional information.
Comment 4 Mathew Prokos 2020-08-06 16:06:05 UTC
This is not using a yocto kernel. Any kernel which has an empty EXTRAVERSION field will hit this issue which is any stable kernel version.
Comment 5 Mathew Prokos 2020-08-06 16:11:17 UTC
I am using dunfell and zeus to reproduce this issue. The python code in the error explains it best.

kerver.append(word.split('= ')[1].split('\n')[0])

Taking an index of 1 after a split when there is no version will cause 
"IndexError: list index out of range"
Comment 6 Mathew Prokos 2020-08-06 16:13:13 UTC
I can apply a patch to either standard.py or to the linux kernel but this seems like something that should be handled given its common to find this field empty in stable kernel releases.
Comment 7 Mathew Prokos 2020-08-06 16:15:11 UTC
Comments added above
Comment 8 Tim Orling 2020-08-13 08:27:59 UTC
Please give us a reproducer. Enough detail that we can produce your exact failure. I tested this on multiple kernels without an EXTRAVERSION and saw no trouble.

What yocto release are you using?
What layers do you have?
Which MACHINE are you using?
What is the basis of your kernel recipe? linux-custom?
What is your SRC_URI for the kernel recipe?
Comment 9 Mathew Prokos 2020-08-15 09:09:31 UTC
I was not able to reproduce this right away either. It only gets triggered when the workshareddir is not empty. 

bitbake virtual/kernel -c do_shared_workdir
devtool modify virtual/kernel
Comment 10 Tim Orling 2022-04-07 16:28:16 UTC
Assigning to Saul as he might have time to work on it.
Comment 11 Randy MacLeod 2024-10-31 15:09:22 UTC
Bulk move of 5.1 bugs to 5.2. -- YP bug review (Randy)
Comment 12 Randy MacLeod 2025-05-29 16:09:53 UTC
Set to future. Please move back to a milestone should you have time to work on this.