[Bug 2076395] Re: flash-kernel is not using new kernel with a version string that has more than two "-"

Lukas Märdian 2076395 at bugs.launchpad.net
Tue Sep 17 11:19:13 UTC 2024


Unsubscribing ~ubuntu-sponsors, while waiting on a fix for comment #6
and adding tests as per comment #5

Please re-subscribe once the patch is ready for review.

-- 
You received this bug notification because you are a member of Ubuntu
Sponsors, which is subscribed to the bug report.
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 Ubuntu-sponsors mailing list