From 047df10d57880e16eb06b79c4f6dc3a398e967c0 Mon Sep 17 00:00:00 2001 From: Anton Bambura Date: Mon, 10 Apr 2023 18:55:39 +0300 Subject: [PATCH] Support --no-cgpt Some people may use U-Boot instead of depthcharge and they don't want cgpt Reviewed-by: Luca Weiss Reviewed-by: Oliver Smith Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C168861285289.22824.11703157261469263638-0@git.sr.ht%3E --- pmb/install/_install.py | 7 ++++--- pmb/parse/arguments.py | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pmb/install/_install.py b/pmb/install/_install.py index 31bddad1..ba9e534f 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -606,7 +606,7 @@ def write_cgpt_kpart(args, layout, suffix): :param layout: partition layout from get_partition_layout() :param suffix: of the chroot, which holds the image file to be flashed """ - if not args.deviceinfo["cgpt_kpart"]: + if not args.deviceinfo["cgpt_kpart"] or not args.install_cgpt: return device_rootfs = mount_device_rootfs(args, suffix) @@ -712,12 +712,13 @@ def install_system_image(args, size_reserve, suffix, step, steps, logging.info(f"*** ({step}/{steps}) PREPARE INSTALL BLOCKDEVICE ***") pmb.chroot.shutdown(args, True) (size_boot, size_root) = get_subpartitions_size(args, suffix) - layout = get_partition_layout(size_reserve, args.deviceinfo["cgpt_kpart"]) + layout = get_partition_layout(size_reserve, args.deviceinfo["cgpt_kpart"] \ + and args.install_cgpt) if not args.rsync: pmb.install.blockdevice.create(args, size_boot, size_root, size_reserve, split, sdcard) if not split: - if args.deviceinfo["cgpt_kpart"]: + if args.deviceinfo["cgpt_kpart"] and args.install_cgpt: pmb.install.partition_cgpt( args, layout, size_boot, size_reserve) else: diff --git a/pmb/parse/arguments.py b/pmb/parse/arguments.py index 40d870a8..3ba36510 100644 --- a/pmb/parse/arguments.py +++ b/pmb/parse/arguments.py @@ -79,6 +79,8 @@ def arguments_install(subparser): " installation - will be handled in PLAIN TEXT during" " install and may be logged to the logfile, do not use an" " important password!") + ret.add_argument("--no-cgpt", help="do not use cgpt partition table", + dest="install_cgpt", action="store_false", default=True) # Image type group_desc = ret.add_argument_group(