From: Daan De Meyer Date: Thu, 4 May 2023 09:38:22 +0000 (+0200) Subject: Drop subvolume output format X-Git-Tag: v15~180^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a552e8fe8bee65cffba87af6fecc7f5eb53e4e61;p=thirdparty%2Fmkosi.git Drop subvolume output format We'll add this back eventually as a --subvolume option that applies to all output formats. --- diff --git a/mkosi.md b/mkosi.md index 3bbce09fd..a8e8c2b1a 100644 --- 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` diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 636cafb77..4a36b70c4 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -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.") diff --git a/mkosi/util.py b/mkosi/util.py index 00829469d..0f6b8a515 100644 --- a/mkosi/util.py +++ b/mkosi/util.py @@ -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"