main/postmarketos-update-kernel: heimdall-isorec: use dtb (MR 1648)

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.
This commit is contained in:
Oliver Smith 2020-10-26 12:55:43 +01:00
parent 731bdc44e7
commit 855564d4fa
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 14 additions and 4 deletions

View file

@ -1,5 +1,5 @@
pkgname=postmarketos-update-kernel
pkgver=0.0.3
pkgver=0.0.4
pkgrel=0
pkgdesc="kernel updater script for postmarketOS"
url="https://postmarketos.org"
@ -12,4 +12,4 @@ package() {
install -Dm755 "$srcdir/update-kernel.sh" \
"$pkgdir/sbin/pmos-update-kernel"
}
sha512sums="6ff38c0d0a3b37b052c2cc1be61294079dd5c17e3b1b348f7b9865e83cf6b635fb192128d8a10a86c97ea708e73288ec3c5b3335348ff279ff4b8cace67c4c31 update-kernel.sh"
sha512sums="17de682e88fec2632cb51c6b034e7b9c27e77736d5943906a57e276fb4c594af7af93e411e8cdb1ea2aeefb8d7f231408195102b02af3e8e55d594d1c812ff16 update-kernel.sh"

View file

@ -9,6 +9,9 @@ case $1 in
;;
esac
# Declare used deviceinfo variables to pass shellcheck
deviceinfo_append_dtb=""
# shellcheck disable=SC1091
. /etc/deviceinfo
@ -23,8 +26,15 @@ case $METHOD in
heimdall-isorec)
KERNEL_PARTITION=$(findfs PARTLABEL="${deviceinfo_flash_heimdall_partition_kernel:?}")
INITFS_PARTITION=$(findfs PARTLABEL="${deviceinfo_flash_heimdall_partition_initfs:?}")
echo "Flashing kernel..."
dd if=/boot/vmlinuz-"$FLAVOR" of="$KERNEL_PARTITION" bs=1M
KERNEL="vmlinuz-$FLAVOR"
if [ "${deviceinfo_append_dtb}" = "true" ]; then
KERNEL="$KERNEL-dtb"
fi
echo "Flashing kernel ($KERNEL)..."
dd if=/boot/"$KERNEL" of="$KERNEL_PARTITION" bs=1M
echo "Flashing initramfs..."
gunzip -c /boot/initramfs-"$FLAVOR" | lzop | dd of="$INITFS_PARTITION" bs=1M
;;