boot-utils.py: Fix searching for Linux kernel version numbers#69
Merged
nathanchance merged 1 commit intoAug 4, 2022
Merged
Conversation
CI reported a crash when attempting to boot arm64 kernels:
Traceback (most recent call last):
File ".../boot-qemu.py", line 727, in <module>
cfg = get_qemu_args(cfg)
File ".../boot-qemu.py", line 451, in get_qemu_args
linux_ver_code = get_linux_ver_code(gzip_kernel_cmd)
File ".../boot-qemu.py", line 338, in get_linux_ver_code
return create_version_code(linux_version)
File ".../boot-qemu.py", line 262, in create_version_code
major, minor, patch = [int(version[i]) for i in (0, 1, 2)]
File ".../boot-qemu.py", line 262, in <listcomp>
major, minor, patch = [int(version[i]) for i in (0, 1, 2)]
ValueError: invalid literal for int() with base 10: '%s'
Looking at the strings output reveals:
$ gzip -d -c Image.gz &| strings &| grep "Linux version "
Linux version %s (%s)
Linux version 4.19.254 (tuxmake@tuxmake) (Debian clang version 14.0.6-++20220622053050+f28c006a5895-1~exp1~20220622173135.152, Debian LLD 14.0.6) ClangBuiltLinux#1 SMP PREEMPT @1659593940
Use re.search() plus a regular expression for a more precise match. I
had originally tried to do this but I could not get it to work for some
reason. I tested this against all the kernels that had issues in CI with
no further issues.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
msfjarvis
approved these changes
Aug 4, 2022
Member
Author
|
Thanks for the review! |
nathanchance
added a commit
to nathanchance/continuous-integration2
that referenced
this pull request
Aug 4, 2022
See ClangBuiltLinux/boot-utils#69 for more information. Signed-off-by: Nathan Chancellor <nathan@kernel.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI reported a crash when attempting to boot arm64 kernels:
Looking at the strings output reveals:
Use
re.search()plus a regular expression for a more precise match. Ihad originally tried to do this but I could not get it to work for some
reason. I tested this against all the kernels that had issues in CI with
no further issues.