kernel fallback-package doesn't work as described

Bug #2016347 reported by dann frazier
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
curtin
New
Undecided
Unassigned

Bug Description

The documentation for kernel['fallback-package'] says:

---
fallback-package: <kernel package-name to be used as fallback>

Specify a kernel package name to be used if the default package is not available.
---

This sounds like it solves a use-case I have. I share a MAAS preseed file across multiple machines and Ubuntu releases w/ symlinks. Some Ubuntu releases have an "linux-nvidia" optimized kernel, others do not. When I'm deploying a release that does have this kernel, I want to use it. But for releases that do not have this kernel, I want to fallback to "linux-generic". So, it seems like I could just do:

kernel:
  fallback-package: linux-generic
  package: linux-nvidia

But that's not really how the code works. It appears that if "package" is set, curtin assumes the user wants that kernel package, and only that kernel package will do. "fallback-package" only comes into play if "package" is unset.

I do not think the documentation accurately reflects that behavior. In fact, the provided example shows combined usage of "fallback-package" and "package" - which reinforces the incorrect usage.

The options I see are:
  (1) Fix the code to reflect the docs. Try kernel['fallback-package'] if kernel['package'] is unavailable.
  (2) Fix the docs to reflect the code. Explain that kernel['fallback-package'] is ignored if kernel['package'] is specified.

(1) makes the most sense to me, as it gives the user the most flexibility and seems easiest to explain. kernel['package'] lets you override the autodetected default. kernel['fallback-package'] is what to try if the default is not available. Of course, I'm biased, because that (1) would help my use case :)

Related branches

dann frazier (dannf)
summary: - kernel fallback-package needs clarification
+ kernel fallback-package doesn't work as described
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.