main/postmarketos-update-kernel use partlabel specified in deviceinfo (MR 2786)

This is done as devices that use Heimdall flash to KERNEL instead of boot
like in case of fastboot, plus devices with weird partitions can set the
var in deviceinfo
This commit is contained in:
Mighty 2021-12-24 14:32:48 +05:30 committed by Caleb Connolly
parent be5681e102
commit fad7c7ef8e
No known key found for this signature in database
GPG key ID: 0583312B195F64B6
2 changed files with 10 additions and 6 deletions

View file

@ -1,5 +1,5 @@
pkgname=postmarketos-update-kernel
pkgver=0.0.6
pkgver=0.0.7
pkgrel=0
pkgdesc="kernel updater script for postmarketOS"
url="https://postmarketos.org"
@ -14,5 +14,5 @@ package() {
}
sha512sums="
e321b5bc601e87f9431140bdb89613cae105fe9e86a7ceab5444a378ab3397a717250a035b5389e227afb1f998f7a959af5009b83c9346d65f83a0e4d3cce114 update-kernel.sh
dae5ab226de812f3368d115a7906e3070929b58a90f428bb65bd60bde46a0802cb56189c4bbf7d686f4cbf3a78c667979080c9a5535244090118b7163362f9aa update-kernel.sh
"

View file

@ -18,10 +18,11 @@ ab_get_slot() {
echo "$ab_slot_suffix"
}
# $1: partition to flash from deviceinfo
update_android_fastboot() {
BOOT_PART_SUFFIX=$(ab_get_slot) # Empty for non-A/B devices
BOOT_PARTITION=$(findfs PARTLABEL="boot${BOOT_PART_SUFFIX}")
echo "Flashing boot.img to 'boot${BOOT_PART_SUFFIX}'"
BOOT_PARTITION=$(findfs PARTLABEL="$1${BOOT_PART_SUFFIX}")
echo "Flashing boot.img to '$1${BOOT_PART_SUFFIX}'"
dd if=/boot/boot.img of="$BOOT_PARTITION" bs=1M
}
@ -43,8 +44,11 @@ update_android_split_kernel_initfs() {
METHOD=${deviceinfo_flash_method:?}
case $METHOD in
fastboot|heimdall-bootimg)
update_android_fastboot
fastboot)
update_android_fastboot "${flash_fastboot_partition_kernel:-boot}"
;;
heimdall-bootimg)
update_android_fastboot "${flash_heimdall_partition_kernel:-KERNEL}"
;;
heimdall-isorec)
update_android_split_kernel_initfs