diff --git a/pmb/config/__init__.py b/pmb/config/__init__.py index fe216b8f..08902695 100644 --- a/pmb/config/__init__.py +++ b/pmb/config/__init__.py @@ -213,6 +213,7 @@ deviceinfo_attributes = [ "flash_heimdall_partition_kernel", "flash_heimdall_partition_initfs", "flash_heimdall_partition_system", + "flash_fastboot_vendor_id", "flash_offset_base", "flash_offset_kernel", "flash_offset_ramdisk", @@ -275,7 +276,7 @@ $FLAVOR: Kernel flavor $IMAGE: Path to the system partition 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 """ flashers = { @@ -283,11 +284,15 @@ flashers = { "depends": ["android-tools"], "actions": { - "list_devices": [["fastboot", "devices", "-l"]], - "flash_system": [["fastboot", "flash", "$PARTITION_SYSTEM", "$IMAGE"]], - "flash_kernel": [["fastboot", "flash", "boot", "$BOOT/boot.img-$FLAVOR"]], - "boot": [["fastboot", "-c", "$KERNEL_CMDLINE", "boot", "$BOOT/boot.img-$FLAVOR"]], - + "list_devices": [["fastboot", "-i", "$VENDOR_ID", + "devices", "-l"]], + "flash_system": [["fastboot", "-i", "$VENDOR_ID", + "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. diff --git a/pmb/flasher/run.py b/pmb/flasher/run.py index 201abc20..24d3b6e1 100644 --- a/pmb/flasher/run.py +++ b/pmb/flasher/run.py @@ -39,7 +39,7 @@ def run(args, action, flavor=None): for key, value in vars.items(): for i in range(len(command)): 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" " action " + action + " for method " + method + "," " but the value for this variable is None! Is that" diff --git a/pmb/flasher/variables.py b/pmb/flasher/variables.py index e3505389..3cd14d3d 100644 --- a/pmb/flasher/variables.py +++ b/pmb/flasher/variables.py @@ -34,6 +34,7 @@ def variables(args, flavor, method): "$BOOT": "/mnt/rootfs_" + args.device + "/boot", "$FLAVOR": flavor if flavor is not None else "", "$IMAGE": "/home/pmos/rootfs/" + args.device + ".img", + "$VENDOR_ID": args.deviceinfo["flash_fastboot_vendor_id"], "$KERNEL_CMDLINE": _cmdline, "$PARTITION_KERNEL": args.deviceinfo["flash_heimdall_partition_kernel"] or "KERNEL", "$PARTITION_INITFS": args.deviceinfo["flash_heimdall_partition_initfs"] or "RECOVERY",