* Plain directory, containing the OS tree (*directory*)
-* btrfs subvolume
-
* Tar archive (*tar*)
* CPIO archive (*cpio*) in the format appropriate for a kernel initrd
`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=`
`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`
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],
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:
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)
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
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.")