"...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:
parent
b0c05436a9
commit
6bb8444fef
|
@ -108,10 +108,10 @@ $ pmbootstrap qemu --image-size=1G
|
||||||
Flash to the device:
|
Flash to the device:
|
||||||
```
|
```
|
||||||
$ pmbootstrap flasher flash_kernel
|
$ 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
|
$ pmbootstrap export
|
||||||
```
|
```
|
||||||
|
|
|
@ -36,7 +36,8 @@ _pmbootstrap_targets()
|
||||||
| sed 's/linux-//g'
|
| sed 's/linux-//g'
|
||||||
;;
|
;;
|
||||||
flasher)
|
flasher)
|
||||||
echo flash_kernel flash_system
|
echo boot flash_kernel flash_rootfs sideload list_flavors \
|
||||||
|
list_devices
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -318,7 +318,7 @@ flashers = {
|
||||||
{
|
{
|
||||||
"list_devices": [["fastboot", "-i", "$VENDOR_ID",
|
"list_devices": [["fastboot", "-i", "$VENDOR_ID",
|
||||||
"devices", "-l"]],
|
"devices", "-l"]],
|
||||||
"flash_system": [["fastboot", "-i", "$VENDOR_ID",
|
"flash_rootfs": [["fastboot", "-i", "$VENDOR_ID",
|
||||||
"flash", "$PARTITION_SYSTEM", "$IMAGE"]],
|
"flash", "$PARTITION_SYSTEM", "$IMAGE"]],
|
||||||
"flash_kernel": [["fastboot", "-i", "$VENDOR_ID",
|
"flash_kernel": [["fastboot", "-i", "$VENDOR_ID",
|
||||||
"flash", "boot", "$BOOT/boot.img-$FLAVOR"]],
|
"flash", "boot", "$BOOT/boot.img-$FLAVOR"]],
|
||||||
|
@ -337,7 +337,7 @@ flashers = {
|
||||||
"actions":
|
"actions":
|
||||||
{
|
{
|
||||||
"list_devices": [["heimdall", "detect"]],
|
"list_devices": [["heimdall", "detect"]],
|
||||||
"flash_system": [
|
"flash_rootfs": [
|
||||||
["heimdall_wait_for_device.sh"],
|
["heimdall_wait_for_device.sh"],
|
||||||
["heimdall", "flash", "--$PARTITION_SYSTEM", "$IMAGE"]],
|
["heimdall", "flash", "--$PARTITION_SYSTEM", "$IMAGE"]],
|
||||||
"flash_kernel": [["heimdall_flash_kernel.sh",
|
"flash_kernel": [["heimdall_flash_kernel.sh",
|
||||||
|
@ -352,7 +352,7 @@ flashers = {
|
||||||
"actions":
|
"actions":
|
||||||
{
|
{
|
||||||
"list_devices": [["heimdall", "detect"]],
|
"list_devices": [["heimdall", "detect"]],
|
||||||
"flash_system": [
|
"flash_rootfs": [
|
||||||
["heimdall_wait_for_device.sh"],
|
["heimdall_wait_for_device.sh"],
|
||||||
["heimdall", "flash", "--$PARTITION_SYSTEM", "$IMAGE"]],
|
["heimdall", "flash", "--$PARTITION_SYSTEM", "$IMAGE"]],
|
||||||
"flash_kernel": [
|
"flash_kernel": [
|
||||||
|
|
|
@ -41,7 +41,7 @@ def symlinks(args, flavor, folder):
|
||||||
"uInitrd-" + flavor: "Initramfs, legacy u-boot image format",
|
"uInitrd-" + flavor: "Initramfs, legacy u-boot image format",
|
||||||
"uImage-" + flavor: "Kernel, legacy u-boot image format",
|
"uImage-" + flavor: "Kernel, legacy u-boot image format",
|
||||||
"vmlinuz-" + flavor: "Linux kernel",
|
"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",
|
"pmos-" + args.device + ".zip": "Android recovery flashable zip",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@ import pmb.install
|
||||||
import pmb.chroot.apk
|
import pmb.chroot.apk
|
||||||
import pmb.chroot.initfs
|
import pmb.chroot.initfs
|
||||||
import pmb.chroot.other
|
import pmb.chroot.other
|
||||||
import pmb.export.frontend
|
|
||||||
import pmb.helpers.frontend
|
import pmb.helpers.frontend
|
||||||
import pmb.parse.kconfig
|
import pmb.parse.kconfig
|
||||||
|
|
||||||
|
@ -60,7 +59,7 @@ def list_flavors(args):
|
||||||
logging.info("* " + flavor)
|
logging.info("* " + flavor)
|
||||||
|
|
||||||
|
|
||||||
def system(args):
|
def rootfs(args):
|
||||||
# Generate system image, install flasher
|
# Generate system image, install flasher
|
||||||
img_path = "/home/pmos/rootfs/" + args.device + ".img"
|
img_path = "/home/pmos/rootfs/" + args.device + ".img"
|
||||||
if not os.path.exists(args.work + "/chroot_native" + img_path):
|
if not os.path.exists(args.work + "/chroot_native" + img_path):
|
||||||
|
@ -77,8 +76,8 @@ def system(args):
|
||||||
" to flash.")
|
" to flash.")
|
||||||
|
|
||||||
# Run the flasher
|
# Run the flasher
|
||||||
logging.info("(native) flash system image")
|
logging.info("(native) flash rootfs image")
|
||||||
pmb.flasher.run(args, "flash_system")
|
pmb.flasher.run(args, "flash_rootfs")
|
||||||
|
|
||||||
|
|
||||||
def list_devices(args):
|
def list_devices(args):
|
||||||
|
@ -114,22 +113,21 @@ def frontend(args):
|
||||||
action = args.action_flasher
|
action = args.action_flasher
|
||||||
method = args.flash_method or args.deviceinfo["flash_method"]
|
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.")
|
logging.info("This device doesn't support any flash method.")
|
||||||
return
|
return
|
||||||
|
|
||||||
if action in ["boot", "flash_kernel"]:
|
if action in ["boot", "flash_kernel"]:
|
||||||
kernel(args)
|
kernel(args)
|
||||||
if action == "flash_system":
|
if action == "flash_rootfs":
|
||||||
system(args)
|
rootfs(args)
|
||||||
if action == "list_flavors":
|
if action == "list_flavors":
|
||||||
list_flavors(args)
|
list_flavors(args)
|
||||||
if action == "list_devices":
|
if action == "list_devices":
|
||||||
list_devices(args)
|
list_devices(args)
|
||||||
if action == "sideload":
|
if action == "sideload":
|
||||||
sideload(args)
|
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)
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ import pmb.config
|
||||||
import pmb.chroot
|
import pmb.chroot
|
||||||
import pmb.chroot.initfs
|
import pmb.chroot.initfs
|
||||||
import pmb.chroot.other
|
import pmb.chroot.other
|
||||||
|
import pmb.export
|
||||||
import pmb.flasher
|
import pmb.flasher
|
||||||
import pmb.helpers.logging
|
import pmb.helpers.logging
|
||||||
import pmb.helpers.other
|
import pmb.helpers.other
|
||||||
|
|
|
@ -306,13 +306,13 @@ def install_system_image(args):
|
||||||
|
|
||||||
# System flash information
|
# System flash information
|
||||||
if not args.sdcard:
|
if not args.sdcard:
|
||||||
logging.info("* pmbootstrap flasher flash_system")
|
logging.info("* pmbootstrap flasher flash_rootfs")
|
||||||
logging.info(" Flashes the system image, that has been"
|
logging.info(" Flashes the generated rootfs image to your device:")
|
||||||
" generated to your device:")
|
|
||||||
logging.info(" " + args.work + "/chroot_native/home/pmos/rootfs/" +
|
logging.info(" " + args.work + "/chroot_native/home/pmos/rootfs/" +
|
||||||
args.device + ".img")
|
args.device + ".img")
|
||||||
logging.info(" (NOTE: This file has a partition table,"
|
logging.info(" (NOTE: This file has a partition table, which contains"
|
||||||
" which contains a boot- and root subpartition.)")
|
" /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("* pmbootstrap flasher flash_kernel")
|
||||||
logging.info(" Flashes the kernel + initramfs to your device:")
|
logging.info(" Flashes the kernel + initramfs to your device:")
|
||||||
|
|
|
@ -50,11 +50,15 @@ def arguments_flasher(subparser):
|
||||||
for action in [boot, flash_kernel]:
|
for action in [boot, flash_kernel]:
|
||||||
action.add_argument("--flavor", default=None)
|
action.add_argument("--flavor", default=None)
|
||||||
|
|
||||||
# Flash system
|
# Flash rootfs
|
||||||
flash_system = sub.add_parser(
|
flash_rootfs = sub.add_parser("flash_rootfs", aliases=["flash_system"],
|
||||||
"flash_system", help="flash the system partition")
|
help="flash the rootfs to a partition on the"
|
||||||
flash_system.add_argument("--partition", default=None, help="partition to flash"
|
" device (partition layout does not get"
|
||||||
" the system image")
|
" 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
|
# Actions without extra arguments
|
||||||
sub.add_parser("sideload", help="sideload recovery zip")
|
sub.add_parser("sideload", help="sideload recovery zip")
|
||||||
|
@ -62,8 +66,6 @@ def arguments_flasher(subparser):
|
||||||
" inside the device rootfs chroot on this computer")
|
" inside the device rootfs chroot on this computer")
|
||||||
sub.add_parser("list_devices", help="show connected devices")
|
sub.add_parser("list_devices", help="show connected devices")
|
||||||
|
|
||||||
# Deprecated "pmbootstrap flasher export"
|
|
||||||
arguments_export(sub)
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue