]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Remove --cache-initrd
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 22 Apr 2023 17:16:37 +0000 (19:16 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 24 Apr 2023 10:44:50 +0000 (12:44 +0200)
NEWS.md
mkosi.md
mkosi/__init__.py
mkosi/config.py

diff --git a/NEWS.md b/NEWS.md
index b332d28af301a546b515729ea13f01e9874fd4a3..bf70d6e37f0d18beabe0294372035573d4d2ec6e 100644 (file)
--- a/NEWS.md
+++ b/NEWS.md
@@ -80,6 +80,8 @@
   `debian-archive-keyring` or `ubuntu-archive-keyring` are now required to be installed to build Debian or
   Ubuntu images respectively.
 - `--base-image` is split into `--base-tree` and `--overlay`.
+- Removed `--cache-initrd`, instead, use a prebuilt initrd with `Initrds=` to avoid rebuilding the initrd all
+  the time.
 
 ## v14
 
index 51c685f7228213d91d01394066f9f945248f7dde..3385e9b85bad9866ab276fce1e6d7fe47dda4389 100644 (file)
--- a/mkosi.md
+++ b/mkosi.md
@@ -477,13 +477,6 @@ a boolean argument: either "1", "yes", or "true" to enable, or "0",
   `/etc/os-release` or similar, in particular the `IMAGE_ID=` field of
   it).
 
-`CacheInitrd=`, `--cache-initrd`
-
-: If specified, and incremental mode is used, mkosi will build the initrd
-  in the cache image and reuse it in the final image. Note that this means
-  that any changes that are only applied to the final image and not the
-  cached image won't be included in the initrd.
-
 `SplitArtifacts=`, `--split-artifacts`
 
 : If specified and building a disk image, pass `--split=yes` to systemd-repart
index c798db96bf037f22d9930b0037e2173aaeab81b2..6354d45a5e74926e164f0410fad62c0a905db916 100644 (file)
@@ -1322,11 +1322,8 @@ def configure_initrd(state: MkosiState) -> None:
         state.root.joinpath("etc/initrd-release").symlink_to("/etc/os-release")
 
 
-def run_kernel_install(state: MkosiState, cached: bool) -> None:
-    if not state.config.cache_initrd and state.for_cache:
-        return
-
-    if state.config.cache_initrd and cached:
+def run_kernel_install(state: MkosiState) -> None:
+    if state.for_cache:
         return
 
     if state.config.initrds:
@@ -1541,7 +1538,7 @@ def build_image(state: MkosiState, *, manifest: Optional[Manifest] = None) -> No
         run_build_script(state)
         install_build_dest(state)
         install_extra_trees(state)
-        run_kernel_install(state, cached)
+        run_kernel_install(state)
         install_boot_loader(state)
         configure_ssh(state)
         run_postinst_script(state)
index a99d2e67ced13c6c4b7b873ff6d6d20919e8495a..33f7dff6333bc7f9936c36c93885647b39c52d13 100644 (file)
@@ -539,11 +539,6 @@ class MkosiConfigParser:
             section="Output",
             parse=config_parse_boolean,
         ),
-        MkosiConfigSetting(
-            dest="cache_initrd",
-            section="Output",
-            parse=config_parse_boolean,
-        ),
         MkosiConfigSetting(
             dest="split_artifacts",
             section="Output",
@@ -1106,13 +1101,6 @@ class MkosiConfigParser:
             nargs="?",
             action=action,
         )
-        group.add_argument(
-            "--cache-initrd",
-            metavar="BOOL",
-            help="When using incremental mode, build the initrd in the cache image and don't rebuild it in the final image",
-            nargs="?",
-            action=action,
-        )
         group.add_argument(
             "--split-artifacts",
             metavar="BOOL",
@@ -1532,7 +1520,6 @@ class MkosiConfig:
     image_id: Optional[str]
     tar_strip_selinux_context: bool
     incremental: bool
-    cache_initrd: bool
     packages: list[str]
     remove_packages: list[str]
     with_docs: bool