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

Launchpad Bug Tracker 2076395 at bugs.launchpad.net
Fri Aug 9 16:26:55 UTC 2024


You have been subscribed to a public bug by Ubuntu Foundations Team Bug Bot (crichton):

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.

** Affects: flash-kernel (Ubuntu)
     Importance: Undecided
     Assignee: Talha Can Havadar (tchavadar)
         Status: In Progress


** Tags: patch
-- 
flash-kernel is not using new kernel with a version string that has more than two "-"
https://bugs.launchpad.net/bugs/2076395
You received this bug notification because you are a member of Ubuntu Sponsors, which is subscribed to the bug report.



More information about the Ubuntu-sponsors mailing list