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:
parent
a3a82f623a
commit
047df10d57
|
@ -606,7 +606,7 @@ def write_cgpt_kpart(args, layout, suffix):
|
||||||
:param layout: partition layout from get_partition_layout()
|
:param layout: partition layout from get_partition_layout()
|
||||||
:param suffix: of the chroot, which holds the image file to be flashed
|
: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
|
return
|
||||||
|
|
||||||
device_rootfs = mount_device_rootfs(args, suffix)
|
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 ***")
|
logging.info(f"*** ({step}/{steps}) PREPARE INSTALL BLOCKDEVICE ***")
|
||||||
pmb.chroot.shutdown(args, True)
|
pmb.chroot.shutdown(args, True)
|
||||||
(size_boot, size_root) = get_subpartitions_size(args, suffix)
|
(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:
|
if not args.rsync:
|
||||||
pmb.install.blockdevice.create(args, size_boot, size_root,
|
pmb.install.blockdevice.create(args, size_boot, size_root,
|
||||||
size_reserve, split, sdcard)
|
size_reserve, split, sdcard)
|
||||||
if not split:
|
if not split:
|
||||||
if args.deviceinfo["cgpt_kpart"]:
|
if args.deviceinfo["cgpt_kpart"] and args.install_cgpt:
|
||||||
pmb.install.partition_cgpt(
|
pmb.install.partition_cgpt(
|
||||||
args, layout, size_boot, size_reserve)
|
args, layout, size_boot, size_reserve)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -79,6 +79,8 @@ def arguments_install(subparser):
|
||||||
" installation - will be handled in PLAIN TEXT during"
|
" installation - will be handled in PLAIN TEXT during"
|
||||||
" install and may be logged to the logfile, do not use an"
|
" install and may be logged to the logfile, do not use an"
|
||||||
" important password!")
|
" important password!")
|
||||||
|
ret.add_argument("--no-cgpt", help="do not use cgpt partition table",
|
||||||
|
dest="install_cgpt", action="store_false", default=True)
|
||||||
|
|
||||||
# Image type
|
# Image type
|
||||||
group_desc = ret.add_argument_group(
|
group_desc = ret.add_argument_group(
|
||||||
|
|
Loading…
Reference in New Issue