From e4373768af1ad9c9ca51997a9795d1bc5d1d50d5 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 22 Oct 2026 14:27:24 +0200 Subject: [PATCH] issue 1841/S14: declare the fallback kernel and its headers after the boot-entries unit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ADR 0508 §9: every DKMS module is built for the fallback kernel too, and its entry is in place first. --- .../cmd/kernel-tools/bootentries_test.go | 19 +++++++++++++++++++ .../kernel/cmd/kernel-tools/manifest_test.go | 2 +- modules/kernel/module.json | 10 ++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/modules/kernel/cmd/kernel-tools/bootentries_test.go b/modules/kernel/cmd/kernel-tools/bootentries_test.go index ada33169..f6df9c78 100644 --- a/modules/kernel/cmd/kernel-tools/bootentries_test.go +++ b/modules/kernel/cmd/kernel-tools/bootentries_test.go @@ -236,3 +236,22 @@ func TestTheBootEntriesUnitAndHookAreTheModules(t *testing.T) { t.Fatalf("apply: %v", apply) } } + +// The fallback kernel and its headers are declared after the boot-entries service, so the entry is placed +// before the kernel is installed and every DKMS module is built for it (ADR 0508 §9). +func TestTheFallbackKernelAndItsHeadersAreDeclaredAfterTheBootEntriesUnit(t *testing.T) { + m := manifest(t) + at := map[string]int{} + for i, r := range m.Resources { + at[r["id"].(string)] = i + } + for id, pkg := range map[string]string{"linux-lts": "linux-lts", "linux-lts-headers": "linux-lts-headers"} { + r := m.resource(t, id) + if r["type"] != "package" || r["package"] != pkg || r["absent"] == true { + t.Errorf("%s: %v", id, r) + } + if at[id] < at["boot-apply"] || at[id] < at["boot-hook"] { + t.Errorf("%s is declared before the boot-entries unit and hook", id) + } + } +} diff --git a/modules/kernel/cmd/kernel-tools/manifest_test.go b/modules/kernel/cmd/kernel-tools/manifest_test.go index 359ea904..aad91fc6 100644 --- a/modules/kernel/cmd/kernel-tools/manifest_test.go +++ b/modules/kernel/cmd/kernel-tools/manifest_test.go @@ -24,7 +24,7 @@ func TestTheDefaultIsMadviseAndTheUnitFollowsTheSetting(t *testing.T) { for _, r := range m.Resources { ids = append(ids, r["id"].(string)) } - if strings.Join(ids, " ") != "state huge-pages unit apply boot-entries boot-unit boot-hook boot-apply" { + if strings.Join(ids, " ") != "state huge-pages unit apply boot-entries boot-unit boot-hook boot-apply linux-lts linux-lts-headers" { t.Fatalf("order: %v", ids) } script := m.resource(t, "huge-pages") diff --git a/modules/kernel/module.json b/modules/kernel/module.json index ea26522d..50cddebe 100644 --- a/modules/kernel/module.json +++ b/modules/kernel/module.json @@ -89,6 +89,16 @@ "health": { "kind": "unit" } + }, + { + "id": "linux-lts", + "type": "package", + "package": "linux-lts" + }, + { + "id": "linux-lts-headers", + "type": "package", + "package": "linux-lts-headers" } ], "build": {