[Bug 2076395] Re: flash-kernel is not using new kernel with a version string that has more than two "-"
Loïc Minier
2076395 at bugs.launchpad.net
Fri Aug 9 09:34:27 UTC 2024
There are some tests for include_only_flavors in
test_functions:test_include_only_flavors(); these can be run with
FK_CHECKOUT=. ./test_functions
Actually these tests use versions with 1, 2 and 3 dashes such as
5.15.0-1023, 5.15.0-1023-generic, 5.15.0-1023-raspi-nolpae.
Would you mind adding a test case for your exact combination along with
the fix?
Thanks!
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to flash-kernel in Ubuntu.
https://bugs.launchpad.net/bugs/2076395
Title:
flash-kernel is not using new kernel with a version string that has
more than two "-"
Status in flash-kernel package in Ubuntu:
In Progress
Bug description:
When we have a testing kernel between releases in following version
string format "6.8.0-1006.2+testing20240708-2-flavor", flash-kernel
fails to detect this newly installed kernel even though it has correct
flavor suffix at the end of version string.
After a bit of skimming in the source code, I found the flavor
detection logic in `include_only_flavors` function:
```
include_only_flavors() {
# include_only_flavors(flav1, flav2, flav3)
# filter lines of input in uname -r format (X.Y.Z-N-flavor)
# and filter-out anything that is not in the listed input
# if the only flavor given is "any", then assume everything is a match
local cur_uname cur_flav allowed_flav
while read cur_uname; do
if [ "$*" = "any" ]; then
echo "$cur_uname"
else
# could use cur_flav=$(get_kfile_suffix "$cur_uname")
# but this is much faster.
cur_flav=${cur_uname#*-*-}
for allowed_flav in "$@"; do
if [ "${cur_flav}" = "${allowed_flav}" ]; then
echo "$cur_uname"
break
fi
done
fi
done
}
```
As you see above, this detection logic has a wrong assumptions about
the version string, but in fact the commented out alternative
`get_kfile_suffix` works with the use cases like we have.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/flash-kernel/+bug/2076395/+subscriptions
More information about the foundations-bugs
mailing list