mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-02-23 13:45:45 -05:00
image/cli: cmd_flash: improve log messages and order of partitions in CLI help
This commit is contained in:
parent
379e951526
commit
407d8893a3
2 changed files with 14 additions and 4 deletions
|
@ -18,7 +18,7 @@ from .image import get_device_name, losetup_rootfs_image, get_image_path, dump_a
|
||||||
LK2ND = FLASH_PARTS['LK2ND']
|
LK2ND = FLASH_PARTS['LK2ND']
|
||||||
ABOOT = FLASH_PARTS['ABOOT']
|
ABOOT = FLASH_PARTS['ABOOT']
|
||||||
|
|
||||||
BOOT_TYPES = [LK2ND, JUMPDRIVE, ABOOT]
|
BOOT_TYPES = [ABOOT, LK2ND, JUMPDRIVE]
|
||||||
|
|
||||||
|
|
||||||
@click.command(name='boot')
|
@click.command(name='boot')
|
||||||
|
|
|
@ -79,7 +79,16 @@ def cmd_flash(
|
||||||
sector_size: Optional[int] = None,
|
sector_size: Optional[int] = None,
|
||||||
confirm: bool = False,
|
confirm: bool = False,
|
||||||
):
|
):
|
||||||
"""Flash a partition onto a device. `location` takes either a path to a block device or one of emmc, sdcard"""
|
"""
|
||||||
|
Flash a partition onto a device.
|
||||||
|
|
||||||
|
The syntax of LOCATION depends on the flashing method and is usually only required for flashing "rootfs":
|
||||||
|
|
||||||
|
\b
|
||||||
|
- fastboot: the regular fastboot partition identifier. Usually "userdata"
|
||||||
|
- dd: a path to a block device
|
||||||
|
- jumpdrive: one of "emmc", "sdcard" or a path to a block device
|
||||||
|
"""
|
||||||
enforce_wrap()
|
enforce_wrap()
|
||||||
device = get_profile_device(profile)
|
device = get_profile_device(profile)
|
||||||
flavour = get_profile_flavour(profile).name
|
flavour = get_profile_flavour(profile).name
|
||||||
|
@ -93,10 +102,11 @@ def cmd_flash(
|
||||||
raise Exception(f'Unknown what "{what}", must be one of {", ".join(FLASH_PARTS.values())}')
|
raise Exception(f'Unknown what "{what}", must be one of {", ".join(FLASH_PARTS.values())}')
|
||||||
|
|
||||||
if location and location.startswith('aboot'):
|
if location and location.startswith('aboot'):
|
||||||
raise Exception("You're trying to flash something to your aboot partition, "
|
raise Exception("You're trying to flash something "
|
||||||
|
f"to your aboot partition ({location!r}), "
|
||||||
"which contains the android bootloader itself.\n"
|
"which contains the android bootloader itself.\n"
|
||||||
"This will brick your phone and is not what you want.\n"
|
"This will brick your phone and is not what you want.\n"
|
||||||
'Aborting.\nDid you mean "boot"?')
|
'Aborting.\nDid you mean to flash to "boot"?')
|
||||||
|
|
||||||
if what == ROOTFS:
|
if what == ROOTFS:
|
||||||
path = ''
|
path = ''
|
||||||
|
|
Loading…
Add table
Reference in a new issue