install: install_system_image: no step defaults (MR 1991)
With the default argument values removed, the step logic is more centralized in the install method which makes the code a bit less brittle and easier to follow.
This commit is contained in:
parent
5dea31058d
commit
126a299c43
|
@ -462,15 +462,15 @@ def sanity_check_ondev_version(args):
|
||||||
f" / in the binary packages has version {ver_pkg}.")
|
f" / in the binary packages has version {ver_pkg}.")
|
||||||
|
|
||||||
|
|
||||||
def install_system_image(args, size_reserve, suffix, root_label="pmOS_root",
|
def install_system_image(args, size_reserve, suffix, step, steps,
|
||||||
step=3, steps=5, split=False, sdcard=None):
|
root_label="pmOS_root", split=False, sdcard=None):
|
||||||
"""
|
"""
|
||||||
:param size_reserve: empty partition between root and boot in MiB (pma#463)
|
:param size_reserve: empty partition between root and boot in MiB (pma#463)
|
||||||
:param suffix: the chroot suffix, where the rootfs that will be installed
|
:param suffix: the chroot suffix, where the rootfs that will be installed
|
||||||
on the device has been created (e.g. "rootfs_qemu-amd64")
|
on the device has been created (e.g. "rootfs_qemu-amd64")
|
||||||
:param root_label: label of the root partition (e.g. "pmOS_root")
|
|
||||||
:param step: next installation step
|
:param step: next installation step
|
||||||
:param steps: total installation steps
|
:param steps: total installation steps
|
||||||
|
:param root_label: label of the root partition (e.g. "pmOS_root")
|
||||||
:param split: create separate images for boot and root partitions
|
:param split: create separate images for boot and root partitions
|
||||||
:param sdcard: path to sdcard device (e.g. /dev/mmcblk0) or None
|
:param sdcard: path to sdcard device (e.g. /dev/mmcblk0) or None
|
||||||
"""
|
"""
|
||||||
|
@ -639,8 +639,8 @@ def install_on_device_installer(args, step, steps):
|
||||||
|
|
||||||
# Generate installer image
|
# Generate installer image
|
||||||
size_reserve = round(os.path.getsize(img_path_dest) / 1024 / 1024) + 200
|
size_reserve = round(os.path.getsize(img_path_dest) / 1024 / 1024) + 200
|
||||||
install_system_image(args, size_reserve, suffix_installer, "pmOS_install",
|
install_system_image(args, size_reserve, suffix_installer, step, steps,
|
||||||
step, steps, args.split, args.sdcard)
|
"pmOS_install", args.split, args.sdcard)
|
||||||
|
|
||||||
|
|
||||||
def install(args):
|
def install(args):
|
||||||
|
@ -727,6 +727,6 @@ def install(args):
|
||||||
# Runs install_system_image twice
|
# Runs install_system_image twice
|
||||||
install_on_device_installer(args, 3, steps)
|
install_on_device_installer(args, 3, steps)
|
||||||
else:
|
else:
|
||||||
install_system_image(args, 0, f"rootfs_{args.device}",
|
install_system_image(args, 0, f"rootfs_{args.device}", 3, steps,
|
||||||
split=args.split, sdcard=args.sdcard)
|
split=args.split, sdcard=args.sdcard)
|
||||||
print_flash_info(args, steps, steps)
|
print_flash_info(args, steps, steps)
|
||||||
|
|
Loading…
Reference in New Issue