mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-02-22 13:15:44 -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']
|
||||
ABOOT = FLASH_PARTS['ABOOT']
|
||||
|
||||
BOOT_TYPES = [LK2ND, JUMPDRIVE, ABOOT]
|
||||
BOOT_TYPES = [ABOOT, LK2ND, JUMPDRIVE]
|
||||
|
||||
|
||||
@click.command(name='boot')
|
||||
|
|
|
@ -79,7 +79,16 @@ def cmd_flash(
|
|||
sector_size: Optional[int] = None,
|
||||
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()
|
||||
device = get_profile_device(profile)
|
||||
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())}')
|
||||
|
||||
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"
|
||||
"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:
|
||||
path = ''
|
||||
|
|
Loading…
Add table
Reference in a new issue