"...flasher flash_rootfs" instead of "..._system" (#1373)

* Change `pmbootstrap flasher flash_system` command to
  `pmbootstrap flasher flash_rootfs`
* The old command still works, but all references have been changed to
  the new command
* Remove obsolete `pmbootstrap flasher export` (that was changed to
  `pmbootstrap export` a few months ago)
* Update `README.md` and ZSH auto completion
* Change the description of the generated rootfs image (not talking
  about a system image anymore, mention that it has subpartitions)
* Better description of `pmbootstrap flasher flash_rootfs --partition`
This commit is contained in:
Oliver Smith 2018-03-30 01:11:20 +00:00 committed by GitHub
parent b0c05436a9
commit 6bb8444fef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 33 additions and 31 deletions

View File

@ -108,10 +108,10 @@ $ pmbootstrap qemu --image-size=1G
Flash to the device:
```
$ pmbootstrap flasher flash_kernel
$ pmbootstrap flasher flash_system --partition=userdata
$ pmbootstrap flasher flash_rootfs --partition=userdata
```
Export the system image, kernel, initramfs, `boot.img` etc.:
Export the rootfs, kernel, initramfs, `boot.img` etc.:
```
$ pmbootstrap export
```

View File

@ -36,7 +36,8 @@ _pmbootstrap_targets()
| sed 's/linux-//g'
;;
flasher)
echo flash_kernel flash_system
echo boot flash_kernel flash_rootfs sideload list_flavors \
list_devices
;;
esac
}

View File

@ -318,7 +318,7 @@ flashers = {
{
"list_devices": [["fastboot", "-i", "$VENDOR_ID",
"devices", "-l"]],
"flash_system": [["fastboot", "-i", "$VENDOR_ID",
"flash_rootfs": [["fastboot", "-i", "$VENDOR_ID",
"flash", "$PARTITION_SYSTEM", "$IMAGE"]],
"flash_kernel": [["fastboot", "-i", "$VENDOR_ID",
"flash", "boot", "$BOOT/boot.img-$FLAVOR"]],
@ -337,7 +337,7 @@ flashers = {
"actions":
{
"list_devices": [["heimdall", "detect"]],
"flash_system": [
"flash_rootfs": [
["heimdall_wait_for_device.sh"],
["heimdall", "flash", "--$PARTITION_SYSTEM", "$IMAGE"]],
"flash_kernel": [["heimdall_flash_kernel.sh",
@ -352,7 +352,7 @@ flashers = {
"actions":
{
"list_devices": [["heimdall", "detect"]],
"flash_system": [
"flash_rootfs": [
["heimdall_wait_for_device.sh"],
["heimdall", "flash", "--$PARTITION_SYSTEM", "$IMAGE"]],
"flash_kernel": [

View File

@ -41,7 +41,7 @@ def symlinks(args, flavor, folder):
"uInitrd-" + flavor: "Initramfs, legacy u-boot image format",
"uImage-" + flavor: "Kernel, legacy u-boot image format",
"vmlinuz-" + flavor: "Linux kernel",
args.device + ".img": "System partition",
args.device + ".img": "Rootfs with partitions for /boot and /",
"pmos-" + args.device + ".zip": "Android recovery flashable zip",
}

View File

@ -25,7 +25,6 @@ import pmb.install
import pmb.chroot.apk
import pmb.chroot.initfs
import pmb.chroot.other
import pmb.export.frontend
import pmb.helpers.frontend
import pmb.parse.kconfig
@ -60,7 +59,7 @@ def list_flavors(args):
logging.info("* " + flavor)
def system(args):
def rootfs(args):
# Generate system image, install flasher
img_path = "/home/pmos/rootfs/" + args.device + ".img"
if not os.path.exists(args.work + "/chroot_native" + img_path):
@ -77,8 +76,8 @@ def system(args):
" to flash.")
# Run the flasher
logging.info("(native) flash system image")
pmb.flasher.run(args, "flash_system")
logging.info("(native) flash rootfs image")
pmb.flasher.run(args, "flash_rootfs")
def list_devices(args):
@ -114,22 +113,21 @@ def frontend(args):
action = args.action_flasher
method = args.flash_method or args.deviceinfo["flash_method"]
if method == "none" and action in ["boot", "flash_kernel", "flash_system"]:
# Legacy alias
if action == "flash_system":
action = "flash_rootfs"
if method == "none" and action in ["boot", "flash_kernel", "flash_rootfs"]:
logging.info("This device doesn't support any flash method.")
return
if action in ["boot", "flash_kernel"]:
kernel(args)
if action == "flash_system":
system(args)
if action == "flash_rootfs":
rootfs(args)
if action == "list_flavors":
list_flavors(args)
if action == "list_devices":
list_devices(args)
if action == "sideload":
sideload(args)
if action == "export":
logging.info("WARNING: 'pmbootstrap flasher export' is deprecated and"
" will be removed soon. The new syntax is 'pmbootstrap"
" export'.")
pmb.export.frontend(args)

View File

@ -32,6 +32,7 @@ import pmb.config
import pmb.chroot
import pmb.chroot.initfs
import pmb.chroot.other
import pmb.export
import pmb.flasher
import pmb.helpers.logging
import pmb.helpers.other

View File

@ -306,13 +306,13 @@ def install_system_image(args):
# System flash information
if not args.sdcard:
logging.info("* pmbootstrap flasher flash_system")
logging.info(" Flashes the system image, that has been"
" generated to your device:")
logging.info("* pmbootstrap flasher flash_rootfs")
logging.info(" Flashes the generated rootfs image to your device:")
logging.info(" " + args.work + "/chroot_native/home/pmos/rootfs/" +
args.device + ".img")
logging.info(" (NOTE: This file has a partition table,"
" which contains a boot- and root subpartition.)")
logging.info(" (NOTE: This file has a partition table, which contains"
" /boot and / subpartitions. That way we don't need to"
" change the partition layout on your device.)")
logging.info("* pmbootstrap flasher flash_kernel")
logging.info(" Flashes the kernel + initramfs to your device:")

View File

@ -50,11 +50,15 @@ def arguments_flasher(subparser):
for action in [boot, flash_kernel]:
action.add_argument("--flavor", default=None)
# Flash system
flash_system = sub.add_parser(
"flash_system", help="flash the system partition")
flash_system.add_argument("--partition", default=None, help="partition to flash"
" the system image")
# Flash rootfs
flash_rootfs = sub.add_parser("flash_rootfs", aliases=["flash_system"],
help="flash the rootfs to a partition on the"
" device (partition layout does not get"
" changed)")
flash_rootfs.add_argument("--partition", default=None,
help="partition to flash to (Android: default"
" is 'system', but 'userdata' may have more"
" space)")
# Actions without extra arguments
sub.add_parser("sideload", help="sideload recovery zip")
@ -62,8 +66,6 @@ def arguments_flasher(subparser):
" inside the device rootfs chroot on this computer")
sub.add_parser("list_devices", help="show connected devices")
# Deprecated "pmbootstrap flasher export"
arguments_export(sub)
return ret