From: Michael A Cassaniti Date: Thu, 28 Jul 2022 12:02:09 +0000 (+1000) Subject: Make inserted root or /usr partition at least as big as RootSize X-Git-Tag: v14~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c5755184e34759e805015d4b789f307671fa5fd;p=thirdparty%2Fmkosi.git Make inserted root or /usr partition at least as big as RootSize When using SquashFS in particular, the size of the partition inserted will always be the size of the SquashFS image. This change allows the partition size to be set which allows for future growth. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 760f7ffe2..6479d4c5f 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -3645,6 +3645,9 @@ def insert_partition( luks_extra = 16 * 1024 * 1024 if state.config.encrypt == "all" else 0 blob_size = os.stat(blob.name).st_size + if ident == PartitionIdentifier.root and not state.config.minimize: + # Make root partition at least as big as the specified size + blob_size = max(blob_size, state.config.root_size) part = state.partition_table.add(ident, blob_size + luks_extra, type_uuid, description, part_uuid) disk_size = state.partition_table.disk_size() @@ -6562,7 +6565,9 @@ def load_args(args: argparse.Namespace) -> MkosiConfig: if args.output_format.is_squashfs(): args.read_only = True - args.root_size = None + if args.root_size is None: + # Size will be automatic + args.minimize = True if args.compress is False: die("Cannot disable compression with squashfs", MkosiNotSupportedException) if args.compress is None: