]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
repart: Set sector size using SectorSize=
authorMichael A Cassaniti <michael@cassaniti.id.au>
Wed, 16 Aug 2023 10:38:55 +0000 (20:38 +1000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 16 Aug 2023 11:29:44 +0000 (13:29 +0200)
mkosi/__init__.py
mkosi/config.py
mkosi/resources/mkosi.md

index ee69cfda0a880fda5dd3537a02d1d4ac068c3ed3..1b231d95489f28379981ccda467d686ed0282fc1 100644 (file)
@@ -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:
index c5b812924d8c89136b69cbca26242fbb7d937eed..d43b7b2ff9d95a24e9f69d992dd89d95760a8cb6 100644 (file)
@@ -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)}
 
index 0e2815c7778d9af983489d8652a70af1658e963a..3d7204634e8c693748afca5b17ee2d927ffa1130 100644 (file)
@@ -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