From: Michael A Cassaniti Date: Wed, 16 Aug 2023 10:38:55 +0000 (+1000) Subject: repart: Set sector size using SectorSize= X-Git-Tag: v16~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=297b557bfe4c7a7a04a286977c623a76c3b5da95;p=thirdparty%2Fmkosi.git repart: Set sector size using SectorSize= --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index ee69cfda0..1b231d954 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -1341,6 +1341,8 @@ def make_image(state: MkosiState, skip: Sequence[str] = [], split: bool = False) cmdline += ["--defer-partitions", ",".join(skip)] if split and state.config.split_artifacts: cmdline += ["--split=yes"] + if state.config.sector_size: + cmdline += ["--sector-size", state.config.sector_size] if state.config.repart_dirs: for d in state.config.repart_dirs: diff --git a/mkosi/config.py b/mkosi/config.py index c5b812924..d43b7b2ff 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -661,6 +661,7 @@ class MkosiConfig: image_version: Optional[str] split_artifacts: bool repart_dirs: list[Path] + sector_size: Optional[str] overlay: bool use_subvolumes: ConfigFeature @@ -998,6 +999,12 @@ class MkosiConfigParser: paths=("mkosi.repart",), help="Directory containing systemd-repart partition definitions", ), + MkosiConfigSetting( + dest="sector_size", + section="Output", + parse=config_parse_string, + help="Set the disk image sector size", + ), MkosiConfigSetting( dest="overlay", metavar="BOOL", @@ -2192,6 +2199,7 @@ def summary(args: MkosiArgs, config: MkosiConfig) -> str: Image Version: {config.image_version} Split Artifacts: {yes_no(config.split_artifacts)} Repart Directories: {line_join_list(config.repart_dirs)} + Sector Size: {none_to_default(config.sector_size)} Overlay: {yes_no(config.overlay)} Use Subvolumes: {yes_no_auto(config.use_subvolumes)} diff --git a/mkosi/resources/mkosi.md b/mkosi/resources/mkosi.md index 0e2815c77..3d7204634 100644 --- a/mkosi/resources/mkosi.md +++ b/mkosi/resources/mkosi.md @@ -543,6 +543,11 @@ they should be specified with a boolean argument: either "1", "yes", or "true" t image root, so any `CopyFiles=` source paths in partition definition files will be relative to the image root directory. +`SectorSize=`, `--sector-size=` + +: Override the default sector size that systemd-repart uses when building a disk + image. + `Overlay=`, `--overlay` : When used together with `BaseTrees=`, the output will consist only out of