Public bug reported:

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

** Changed in: flash-kernel (Ubuntu)
     Assignee: (unassigned) => Talha Can Havadar (tchavadar)

** Changed in: flash-kernel (Ubuntu)
       Status: New => In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2076395

Title:
  flash-kernel is not using new kernel with a version string that has
  more than two "-"

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/flash-kernel/+bug/2076395/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to