From: Daan De Meyer Date: Sat, 22 Apr 2023 17:16:37 +0000 (+0200) Subject: Remove --cache-initrd X-Git-Tag: v15~207^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae935ac734d665d712ee6c5c8d2101abc0b7214b;p=thirdparty%2Fmkosi.git Remove --cache-initrd --- diff --git a/NEWS.md b/NEWS.md index b332d28af..bf70d6e37 100644 --- 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 diff --git a/mkosi.md b/mkosi.md index 51c685f72..3385e9b85 100644 --- 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 diff --git a/mkosi/__init__.py b/mkosi/__init__.py index c798db96b..6354d45a5 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -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) diff --git a/mkosi/config.py b/mkosi/config.py index a99d2e67c..33f7dff63 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -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