]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Drop subvolume output format
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 4 May 2023 09:38:22 +0000 (11:38 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 4 May 2023 17:51:25 +0000 (19:51 +0200)
We'll add this back eventually as a --subvolume option that applies
to all output formats.

mkosi.md
mkosi/__init__.py
mkosi/util.py

index 3bbce09fd744a5476d4402f52dd984126a6bb87f..a8e8c2b1a3c0045d0d5aa20faf8cec26511078c2 100644 (file)
--- a/mkosi.md
+++ b/mkosi.md
@@ -154,8 +154,6 @@ The following output formats are supported:
 
 * Plain directory, containing the OS tree (*directory*)
 
-* btrfs subvolume
-
 * Tar archive (*tar*)
 
 * CPIO archive (*cpio*) in the format appropriate for a kernel initrd
@@ -330,10 +328,9 @@ a boolean argument: either "1", "yes", or "true" to enable, or "0",
 `Format=`, `--format=`, `-t`
 
 : The image format type to generate. One of `directory` (for generating OS
-  images inside a local directory), `subvolume` (similar, but as a btrfs
-  subvolume), `tar` (similar, but a tarball of the image is generated), `cpio`
-  (similar, but a cpio archive is generated), `disk` (a block device image
-  with a GPT partition table).
+  images inside a local directory), `tar` (similar, but a tarball of the
+  image is generated), `cpio` (similar, but a cpio archive is generated),
+  `disk` (a block device image with a GPT partition table).
 
 `ManifestFormat=`, `--manifest-format=`
 
@@ -859,12 +856,10 @@ a boolean argument: either "1", "yes", or "true" to enable, or "0",
 
 `Ephemeral=`, `--ephemeral`
 
-: When used with the `shell`, `boot`, or `qemu` verbs, this option
-  runs the specified verb on a temporary snapshot of the output image
-  that is removed immediately when the container terminates. Taking
-  the temporary snapshot is more efficient on file systems that
-  support subvolume snapshots or 'reflinks' natively ("btrfs" or new
-  "xfs") than on more traditional file systems that do not ("ext4").
+: When used with the `shell`, `boot`, or `qemu` verbs, this option runs the specified verb on a temporary
+  snapshot of the output image that is removed immediately when the container terminates. Taking the
+  temporary snapshot is more efficient on file systems that support reflinks natively ("btrfs" or new "xfs")
+  than on more traditional file systems that do not ("ext4").
 
 `Ssh=`, `--ssh`
 
index 636cafb772c3b8c1dc93a3f26c4f3d28d754a69e..4a36b70c4f9c5b7e02b004a941ba52ec3ca65c41 100644 (file)
@@ -122,12 +122,6 @@ def mount_image(state: MkosiState) -> Iterator[None]:
         yield
 
 
-def prepare_tree_root(state: MkosiState) -> None:
-    if state.config.output_format == OutputFormat.subvolume:
-        with complete_step("Setting up OS tree root…"):
-            btrfs_subvol_create(state.root)
-
-
 def clean_paths(
         root: Path,
         globs: Sequence[str],
@@ -858,7 +852,7 @@ def hash_file(of: TextIO, path: Path) -> None:
 
 
 def calculate_sha256sum(state: MkosiState) -> None:
-    if state.config.output_format in (OutputFormat.directory, OutputFormat.subvolume):
+    if state.config.output_format == OutputFormat.directory:
         return None
 
     if not state.config.checksum:
@@ -949,7 +943,7 @@ def print_output_size(config: MkosiConfig) -> None:
     if not config.output_compressed.exists():
         return
 
-    if config.output_format in (OutputFormat.directory, OutputFormat.subvolume):
+    if config.output_format == OutputFormat.directory:
         log_step("Resulting image size is " + format_bytes(dir_size(config.output)) + ".")
     else:
         st = os.stat(config.output_compressed)
@@ -1736,7 +1730,7 @@ def acl_toggle_boot(config: MkosiConfig) -> Iterator[None]:
 def run_shell(args: MkosiArgs, config: MkosiConfig) -> None:
     cmdline: list[PathString] = ["systemd-nspawn", "--quiet"]
 
-    if config.output_format in (OutputFormat.directory, OutputFormat.subvolume):
+    if config.output_format == OutputFormat.directory:
         cmdline += ["--directory", config.output]
 
         owner = os.stat(config.output).st_uid
@@ -2129,7 +2123,6 @@ def run_verb(args: MkosiArgs, presets: Sequence[MkosiConfig]) -> None:
 
     if args.verb == Verb.qemu and last.output_format in (
         OutputFormat.directory,
-        OutputFormat.subvolume,
         OutputFormat.tar,
     ):
         die(f"{last.output_format} images cannot be booted in qemu.")
index 00829469d9e10a8249d929285e7b30a571a2dfc3..0f6b8a5153c30f1b792cf886323d555437da65e1 100644 (file)
@@ -176,7 +176,6 @@ def is_apt_distribution(d: Distribution) -> bool:
 
 class OutputFormat(str, enum.Enum):
     directory = "directory"
-    subvolume = "subvolume"
     tar = "tar"
     cpio = "cpio"
     disk = "disk"