forked from Mirror/pmbootstrap
Add "flash_fastboot_vendor_id" deviceinfo variable for fastboot flash method (#857)
This commit is contained in:
parent
e735be93e4
commit
6fb5b28e2f
3 changed files with 13 additions and 7 deletions
|
@ -213,6 +213,7 @@ deviceinfo_attributes = [
|
||||||
"flash_heimdall_partition_kernel",
|
"flash_heimdall_partition_kernel",
|
||||||
"flash_heimdall_partition_initfs",
|
"flash_heimdall_partition_initfs",
|
||||||
"flash_heimdall_partition_system",
|
"flash_heimdall_partition_system",
|
||||||
|
"flash_fastboot_vendor_id",
|
||||||
"flash_offset_base",
|
"flash_offset_base",
|
||||||
"flash_offset_kernel",
|
"flash_offset_kernel",
|
||||||
"flash_offset_ramdisk",
|
"flash_offset_ramdisk",
|
||||||
|
@ -275,7 +276,7 @@ $FLAVOR: Kernel flavor
|
||||||
$IMAGE: Path to the system partition image
|
$IMAGE: Path to the system partition image
|
||||||
$PARTITION_SYSTEM: Partition to flash the system image
|
$PARTITION_SYSTEM: Partition to flash the system image
|
||||||
|
|
||||||
Fastboot specific: $KERNEL_CMDLINE
|
Fastboot specific: $KERNEL_CMDLINE, $VENDOR_ID
|
||||||
Heimdall specific: $PARTITION_KERNEL, $PARTITION_INITFS
|
Heimdall specific: $PARTITION_KERNEL, $PARTITION_INITFS
|
||||||
"""
|
"""
|
||||||
flashers = {
|
flashers = {
|
||||||
|
@ -283,11 +284,15 @@ flashers = {
|
||||||
"depends": ["android-tools"],
|
"depends": ["android-tools"],
|
||||||
"actions":
|
"actions":
|
||||||
{
|
{
|
||||||
"list_devices": [["fastboot", "devices", "-l"]],
|
"list_devices": [["fastboot", "-i", "$VENDOR_ID",
|
||||||
"flash_system": [["fastboot", "flash", "$PARTITION_SYSTEM", "$IMAGE"]],
|
"devices", "-l"]],
|
||||||
"flash_kernel": [["fastboot", "flash", "boot", "$BOOT/boot.img-$FLAVOR"]],
|
"flash_system": [["fastboot", "-i", "$VENDOR_ID",
|
||||||
"boot": [["fastboot", "-c", "$KERNEL_CMDLINE", "boot", "$BOOT/boot.img-$FLAVOR"]],
|
"flash", "$PARTITION_SYSTEM", "$IMAGE"]],
|
||||||
|
"flash_kernel": [["fastboot", "-i", "$VENDOR_ID",
|
||||||
|
"flash", "boot", "$BOOT/boot.img-$FLAVOR"]],
|
||||||
|
"boot": [["fastboot", "-i", "$VENDOR_ID",
|
||||||
|
"-c", "$KERNEL_CMDLINE", "boot",
|
||||||
|
"$BOOT/boot.img-$FLAVOR"]],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
# Some Samsung devices need the initramfs to be baked into the kernel (e.g.
|
# Some Samsung devices need the initramfs to be baked into the kernel (e.g.
|
||||||
|
|
|
@ -39,7 +39,7 @@ def run(args, action, flavor=None):
|
||||||
for key, value in vars.items():
|
for key, value in vars.items():
|
||||||
for i in range(len(command)):
|
for i in range(len(command)):
|
||||||
if key in command[i]:
|
if key in command[i]:
|
||||||
if not value and key != "$KERNEL_CMDLINE":
|
if not value and key not in ["$KERNEL_CMDLINE", "$VENDOR_ID"]:
|
||||||
raise RuntimeError("Variable " + key + " found in"
|
raise RuntimeError("Variable " + key + " found in"
|
||||||
" action " + action + " for method " + method + ","
|
" action " + action + " for method " + method + ","
|
||||||
" but the value for this variable is None! Is that"
|
" but the value for this variable is None! Is that"
|
||||||
|
|
|
@ -34,6 +34,7 @@ def variables(args, flavor, method):
|
||||||
"$BOOT": "/mnt/rootfs_" + args.device + "/boot",
|
"$BOOT": "/mnt/rootfs_" + args.device + "/boot",
|
||||||
"$FLAVOR": flavor if flavor is not None else "",
|
"$FLAVOR": flavor if flavor is not None else "",
|
||||||
"$IMAGE": "/home/pmos/rootfs/" + args.device + ".img",
|
"$IMAGE": "/home/pmos/rootfs/" + args.device + ".img",
|
||||||
|
"$VENDOR_ID": args.deviceinfo["flash_fastboot_vendor_id"],
|
||||||
"$KERNEL_CMDLINE": _cmdline,
|
"$KERNEL_CMDLINE": _cmdline,
|
||||||
"$PARTITION_KERNEL": args.deviceinfo["flash_heimdall_partition_kernel"] or "KERNEL",
|
"$PARTITION_KERNEL": args.deviceinfo["flash_heimdall_partition_kernel"] or "KERNEL",
|
||||||
"$PARTITION_INITFS": args.deviceinfo["flash_heimdall_partition_initfs"] or "RECOVERY",
|
"$PARTITION_INITFS": args.deviceinfo["flash_heimdall_partition_initfs"] or "RECOVERY",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue