From 4d3c14f6c1ca5309949587ce7b954aa131344594 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Mon, 26 Oct 2020 12:42:10 +0100 Subject: [PATCH] flasher: heimdall-isorec: use kernel+dtb (MR 1986) Use the dtb-appended kernel file, e.g. postmarketos-exynos4-dtb instead of postmarketos-exynos4, if it is available. This is needed to flash a mainline kernel with appended dtb to isorec devices. --- pmb/config/__init__.py | 5 ++++- pmb/flasher/variables.py | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pmb/config/__init__.py b/pmb/config/__init__.py index 99c7e006..be0cff33 100644 --- a/pmb/config/__init__.py +++ b/pmb/config/__init__.py @@ -325,6 +325,7 @@ deviceinfo_attributes = [ "screen_height", "dev_touchscreen", "dev_touchscreen_calibration", + "append_dtb", # bootloader "flash_method", @@ -418,6 +419,7 @@ flash_mount_bind = [ Flasher abstraction. Allowed variables: $BOOT: Path to the /boot partition +$DTB: Set to "-dtb" if deviceinfo_append_dtb is set, otherwise "" $FLAVOR: Kernel flavor $IMAGE: Path to the combined boot/rootfs image $IMAGE_SPLIT_BOOT: Path to the (split) boot image @@ -481,7 +483,8 @@ flashers = { ["heimdall", "flash", "--$PARTITION_SYSTEM", "$IMAGE"]], "flash_kernel": [["heimdall_flash_kernel.sh", "$BOOT/initramfs-$FLAVOR", "$PARTITION_INITFS", - "$BOOT/vmlinuz-$FLAVOR", "$PARTITION_KERNEL"]] + "$BOOT/vmlinuz-$FLAVOR$DTB", + "$PARTITION_KERNEL"]] }, }, # Some Samsung devices need a 'boot.img' file, just like the one generated diff --git a/pmb/flasher/variables.py b/pmb/flasher/variables.py index eb36f91a..54a430dd 100644 --- a/pmb/flasher/variables.py +++ b/pmb/flasher/variables.py @@ -24,8 +24,13 @@ def variables(args, flavor, method): _partition_system = args.partition _partition_vbmeta = args.partition + _dtb = "" + if args.deviceinfo["append_dtb"] == "true": + _dtb = "-dtb" + vars = { "$BOOT": "/mnt/rootfs_" + args.device + "/boot", + "$DTB": _dtb, "$FLAVOR": flavor if flavor is not None else "", "$IMAGE_SPLIT_BOOT": "/home/pmos/rootfs/" + args.device + "-boot.img", "$IMAGE_SPLIT_ROOT": "/home/pmos/rootfs/" + args.device + "-root.img",