diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index 0d69c3c0dcef..48dc9b31b685 100644 --- a/nixos/doc/manual/release-notes/rl-2411.section.md +++ b/nixos/doc/manual/release-notes/rl-2411.section.md @@ -487,6 +487,8 @@ place. The GUI components related to the project are non-free and not packaged. +- Compatible string matching for `hardware.deviceTree.overlays` has been changed to a more correct behavior. See [below](#sec-release-24.11-migration-dto-compatible) for details. + ## Other Notable Changes {#sec-release-24.11-notable-changes} @@ -611,3 +613,22 @@ in { ]; }; ``` + +### `hardware.deviceTree.overlays` compatible string matching {#sec-release-24.11-migration-dto-compatible} + +The original compatible string implementation in older NixOS versions relied on substring matching, +which is incorrect for overlays with multiple compatible strings and other cases. + +The new behavior is consistent with what other tools already do - the overlay is considered applicable if, +and only if, _any_ of the compatible strings in the overlay match _any_ of the compatible strings in the DT. + +To provide some examples: + +| Overlay `compatible` | DT `compatible` | Pre-24.11 behavior | Correct behavior | Notes | +|----------------------|-----------------|--------------------|------------------|--------------------------------------------| +| `"foo"` | `"foo", "bar"` | match | match | Most common use case does not change | +| `"foo"` | `"foobar"` | match | no match | Substrings should not be matched | +| `"foo bar"` | `"foo", "bar"` | match | no match | Separators should not be matched to spaces | +| `"foo", "bar"` | `"baz", "bar"` | no match | match | One compatible string matching is enough | + +Note that this also allows writing overlays that explicitly apply to multiple boards.