Support --no-cgpt

Some people may use U-Boot instead of depthcharge and they don't want cgpt

Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C168861285289.22824.11703157261469263638-0@git.sr.ht%3E
This commit is contained in:
Anton Bambura 2023-04-10 18:55:39 +03:00 committed by Oliver Smith
parent a3a82f623a
commit 047df10d57
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
2 changed files with 6 additions and 3 deletions

View File

@ -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:

View File

@ -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(