]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
mkosi-initrd: add --workspace-directory option
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Thu, 14 Aug 2025 08:33:42 +0000 (10:33 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 21 Aug 2025 11:29:22 +0000 (13:29 +0200)
Fixes #3852

mkosi/addon.py
mkosi/initrd.py
mkosi/resources/man/mkosi-addon.1.md
mkosi/resources/man/mkosi-initrd.1.md

index 1ee734e1ce5562e3cc6cb4d8d8eea007a4cd25c9..b7ea886bfc736b44b135db65b0666cd8a2c2dafa 100644 (file)
@@ -67,7 +67,7 @@ def main() -> None:
 
         if os.getuid() == 0:
             cmdline += [
-                "--workspace-dir=/var/tmp",
+                f"--workspace-dir={args.workspace_dir}",
                 "--output-mode=600",
             ]
 
index c01d3be091ab1d76ad20d6571feb8cb37fa52f54..a02590cf7b92cf9e5322c5e50777d293dc60edc7 100644 (file)
@@ -268,6 +268,13 @@ def initrd_common_args(parser: argparse.ArgumentParser) -> None:
         default=None,
         type=Path,
     )
+    parser.add_argument(
+        "--workspace-dir",
+        metavar="DIR",
+        help="Workspace directory",
+        default="/var/tmp",
+        type=Path,
+    )
     parser.add_argument(
         "--debug",
         help="Turn on debugging output",
@@ -374,7 +381,7 @@ def main() -> None:
 
         if os.getuid() == 0:
             cmdline += [
-                "--workspace-dir=/var/tmp",
+                f"--workspace-dir={args.workspace_dir}",
                 "--package-cache-dir=/var",
                 "--cache-only=metadata",
             ]
index 9d000fb0864f04aa59586d5cbcc3b6437b32c15f..fb6504f17f94fa913837c6dae5aad55c9f6835d0 100644 (file)
@@ -34,6 +34,10 @@ the running hardware can be included if a local configuration with the option
 :   Path to a directory where to place all generated artifacts. Defaults to the
     current working directory.
 
+`--workspace-dir=`
+:   Path to a directory where to store data required temporarily while
+    building the image. Defaults to `/var/tmp`.
+
 `--debug`
 :   Enable additional debugging output.
 
index 4dd5d0518974220397dd5a518e265c54e6404fbb..da65464e6bfd72782b242357c7c94fee307ef871 100644 (file)
@@ -35,6 +35,10 @@ initrds and Unified Kernel Images for the current running system.
 :   Path to a directory where to place all generated artifacts. Defaults to the
     current working directory.
 
+`--workspace-dir=`
+:   Path to a directory where to store data required temporarily while
+    building the image. Defaults to `/var/tmp`.
+
 `--generic`, `-g`
 :   Build a generic initrd without host-specific kernel modules, which should
     allow the local system to boot on different hardware, although it's tied to