]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
arch: Unconditionally assume initramfs package is installed 2151/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 10 Dec 2023 10:31:23 +0000 (11:31 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 10 Dec 2023 10:36:03 +0000 (11:36 +0100)
This doesn't prevent installing individual initramfs generators so
let's always set it and require users to specify mkinitcpio or dracut
if they really need one of these.

mkosi/distributions/arch.py

index 3c54a9e91bc3a1e1bf548be8edc726f724b0f078..80af9716fb9478e1a5c36ab01ee352e0b9a39fa6 100644 (file)
@@ -3,7 +3,6 @@
 from collections.abc import Sequence
 
 from mkosi.architecture import Architecture
-from mkosi.config import ConfigFeature
 from mkosi.distributions import Distribution, DistributionInstaller, PackageType
 from mkosi.installer.pacman import PacmanRepository, invoke_pacman, setup_pacman
 from mkosi.log import die
@@ -108,14 +107,13 @@ class Installer(DistributionInstaller):
 
     @classmethod
     def install_packages(cls, state: MkosiState, packages: Sequence[str], apivfs: bool = True) -> None:
-        options = ["--refresh", "--needed"]
-
-        # If we're generating a bootable image, we'll do so with a prebuilt initramfs, so no need for an
-        # initramfs generator.
-        if state.config.bootable != ConfigFeature.disabled:
-            options += ["--assume-installed", "initramfs"]
-
-        invoke_pacman(state, "--sync", options, packages, apivfs=apivfs)
+        invoke_pacman(
+            state,
+            "--sync",
+            ["--refresh", "--needed", "--assume-installed", "initramfs"],
+            packages,
+            apivfs=apivfs,
+        )
 
     @classmethod
     def remove_packages(cls, state: MkosiState, packages: Sequence[str]) -> None: