Merge pull request 'kernel: declare amd-ucode only (issue 1977, L10)' (#673) from fix/1977-amd-only into main
This commit was merged in pull request #673.
This commit is contained in:
@@ -57,13 +57,13 @@ built for the fallback kernel too) after its boot-entries service, so the entry
|
|||||||
|
|
||||||
Before this, `amd-ucode` was installed by hand on two machines and no initramfs carried it, so a machine booted from
|
Before this, `amd-ucode` was installed by hand on two machines and no initramfs carried it, so a machine booted from
|
||||||
its default entry ran the CPU's older microcode (one machine: revision 0x0a201016 while the package held 0x0a20102e). The module
|
its default entry ran the CPU's older microcode (one machine: revision 0x0a201016 while the package held 0x0a20102e). The module
|
||||||
declares the packages and makes mkinitcpio's own `microcode` hook part of every image, so every boot entry loads it,
|
declares the package and makes mkinitcpio's own `microcode` hook part of every image, so every boot entry loads it,
|
||||||
a default entry written by hand included, and no entry is edited. The fallback entry's own microcode lines stay (a second
|
a default entry written by hand included, and no entry is edited. The fallback entry's own microcode lines stay (a second
|
||||||
early archive is harmless).
|
early archive is harmless).
|
||||||
|
|
||||||
| | what | notes |
|
| | what | notes |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| packages | `amd-ucode`, `intel-ucode` | both on every machine; the `autodetect` hook keeps only the running CPU's microcode in the default image |
|
| package | `amd-ucode` | on every machine. `intel-ucode` is not declared yet (its install failed an apply on a stale package database, issue 1977): an Intel machine fails the unit by the image check, which names the images, and gets the package in the change that adds it |
|
||||||
| file | `/etc/mkinitcpio.conf.d/mesh-microcode.conf` | read by mkinitcpio after `mkinitcpio.conf`: appends `microcode` to `HOOKS` unless it names it |
|
| file | `/etc/mkinitcpio.conf.d/mesh-microcode.conf` | read by mkinitcpio after `mkinitcpio.conf`: appends `microcode` to `HOOKS` unless it names it |
|
||||||
| file | `${dir:state}/initramfs` | the script, `apply`: when the drop-in differs from the one the images were last built with (`${dir:state}/initramfs-built`) it runs `mkinitcpio -P` and then records the drop-in; otherwise it says "as it was". Before building it takes a preset's `ALL_config="/etc/mkinitcpio.conf"` line out (that line makes mkinitcpio skip `mkinitcpio.conf.d`; a copy of the preset goes to `${dir:state}/taken-over/`; another `ALL_config` is left and named); after building, an image without `kernel/x86/microcode/` in its first 64 KiB fails the unit, which names it. A failed mkinitcpio fails the unit, says so and records nothing |
|
| file | `${dir:state}/initramfs` | the script, `apply`: when the drop-in differs from the one the images were last built with (`${dir:state}/initramfs-built`) it runs `mkinitcpio -P` and then records the drop-in; otherwise it says "as it was". Before building it takes a preset's `ALL_config="/etc/mkinitcpio.conf"` line out (that line makes mkinitcpio skip `mkinitcpio.conf.d`; a copy of the preset goes to `${dir:state}/taken-over/`; another `ALL_config` is left and named); after building, an image without `kernel/x86/microcode/` in its first 64 KiB fails the unit, which names it. A failed mkinitcpio fails the unit, says so and records nothing |
|
||||||
| file | `/etc/systemd/system/mesh-kernel-initramfs.service` | oneshot, sandboxed: the file system read-only but for `/boot`, `/etc/mkinitcpio.d` and the module's state, a private `/tmp`, no home, no network |
|
| file | `/etc/systemd/system/mesh-kernel-initramfs.service` | oneshot, sandboxed: the file system read-only but for `/boot`, `/etc/mkinitcpio.d` and the module's state, a private `/tmp`, no home, no network |
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ func TestTheDefaultIsMadviseAndTheUnitFollowsTheSetting(t *testing.T) {
|
|||||||
for _, r := range m.Resources {
|
for _, r := range m.Resources {
|
||||||
ids = append(ids, r["id"].(string))
|
ids = append(ids, r["id"].(string))
|
||||||
}
|
}
|
||||||
if strings.Join(ids, " ") != "state huge-pages unit apply boot-entries boot-unit boot-hook boot-apply linux-lts linux-lts-headers modules-load modules-keep modules-cleanup amd-ucode intel-ucode microcode-hook initramfs initramfs-unit initramfs-apply" {
|
if strings.Join(ids, " ") != "state huge-pages unit apply boot-entries boot-unit boot-hook boot-apply linux-lts linux-lts-headers modules-load modules-keep modules-cleanup amd-ucode microcode-hook initramfs initramfs-unit initramfs-apply" {
|
||||||
t.Fatalf("order: %v", ids)
|
t.Fatalf("order: %v", ids)
|
||||||
}
|
}
|
||||||
script := m.resource(t, "huge-pages")
|
script := m.resource(t, "huge-pages")
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ func TestAC1TheManifestDeclaresTheMicrocodePackagesDropInScriptAndService(t *tes
|
|||||||
for _, r := range m.Resources {
|
for _, r := range m.Resources {
|
||||||
ids = append(ids, r["id"].(string))
|
ids = append(ids, r["id"].(string))
|
||||||
}
|
}
|
||||||
if !strings.HasSuffix(strings.Join(ids, " "), "modules-cleanup amd-ucode intel-ucode microcode-hook initramfs initramfs-unit initramfs-apply") {
|
if !strings.HasSuffix(strings.Join(ids, " "), "modules-cleanup amd-ucode microcode-hook initramfs initramfs-unit initramfs-apply") {
|
||||||
t.Fatalf("order: %v", ids)
|
t.Fatalf("order: %v", ids)
|
||||||
}
|
}
|
||||||
for id, pkg := range map[string]string{"amd-ucode": "amd-ucode", "intel-ucode": "intel-ucode"} {
|
for id, pkg := range map[string]string{"amd-ucode": "amd-ucode"} {
|
||||||
if r := m.resource(t, id); r["type"] != "package" || r["package"] != pkg {
|
if r := m.resource(t, id); r["type"] != "package" || r["package"] != pkg {
|
||||||
t.Fatalf("%s: %v", id, r)
|
t.Fatalf("%s: %v", id, r)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Module kernel, novox/hq issue 1977. mkinitcpio reads this after /etc/mkinitcpio.conf: it adds the microcode
|
# Module kernel, novox/hq issue 1977. mkinitcpio reads this after /etc/mkinitcpio.conf: it adds the microcode
|
||||||
# hook, which puts the CPU's current microcode (amd-ucode, intel-ucode) at the front of every initramfs, so
|
# hook, which puts the CPU's current microcode (amd-ucode) at the front of every initramfs, so
|
||||||
# every boot entry loads it, the default one too. HOOKS that name it already are left as they are.
|
# every boot entry loads it, the default one too. HOOKS that name it already are left as they are.
|
||||||
# Written by the mesh; change the module.
|
# Written by the mesh; change the module.
|
||||||
case "$(declare -p HOOKS)" in
|
case "$(declare -p HOOKS)" in
|
||||||
|
|||||||
@@ -125,11 +125,6 @@
|
|||||||
"type": "package",
|
"type": "package",
|
||||||
"package": "amd-ucode"
|
"package": "amd-ucode"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "intel-ucode",
|
|
||||||
"type": "package",
|
|
||||||
"package": "intel-ucode"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "microcode-hook",
|
"id": "microcode-hook",
|
||||||
"type": "file",
|
"type": "file",
|
||||||
|
|||||||
Reference in New Issue
Block a user