diff --git a/main/postmarketos-update-kernel/APKBUILD b/main/postmarketos-update-kernel/APKBUILD index 8b6f60f68..6fd916ca9 100644 --- a/main/postmarketos-update-kernel/APKBUILD +++ b/main/postmarketos-update-kernel/APKBUILD @@ -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" diff --git a/main/postmarketos-update-kernel/update-kernel.sh b/main/postmarketos-update-kernel/update-kernel.sh index bddde4d59..fdf7c6975 100644 --- a/main/postmarketos-update-kernel/update-kernel.sh +++ b/main/postmarketos-update-kernel/update-kernel.sh @@ -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 ;;