main/postmarketos-update-depthcharge-kernel: use kern_guid instead of label (MR 4066)

This allows to flash correct partition when having 2 installations of pmOS.

This will also avoid flashing kernel image when using U-Boot.
This commit is contained in:
Anton Bambura 2023-05-09 16:56:02 +03:00 committed by Newbyte
parent 13904bb777
commit a3001a0cb0
No known key found for this signature in database
GPG key ID: 990600ED1DB95E02
2 changed files with 10 additions and 6 deletions

View file

@ -1,6 +1,6 @@
# Maintainer: Jenneron <jenneron@protonmail.com>
pkgname=postmarketos-update-depthcharge-kernel
pkgver=1
pkgver=2
pkgrel=0
pkgdesc="depthcharge kernel updater script for postmarketOS"
url="https://postmarketos.org"
@ -15,5 +15,5 @@ package() {
}
sha512sums="
e0348c99d9b13e41718ec2804866cca1b4585ead259450dc09f595092a0497903cb78fa23b8a33a8ac0ba0d1425e4c8b22af7b3bfc1a7292ac3a8a8dbf2a8717 update-depthcharge-kernel.sh
a30bcbafd16e365ffd4f43718575076e06bf641ed505982a2ce6f03d2a398a9695144b5cd4d69762bdbad79c7e9b1e1c71ccb8dc1ee224d731d30d0c7b366863 update-depthcharge-kernel.sh
"

View file

@ -9,9 +9,13 @@ deviceinfo_cgpt_kpart=""
# shellcheck disable=SC1091
. /etc/deviceinfo
partition=$(findfs PARTLABEL=pmOS_kernel)
echo "Flashing $deviceinfo_cgpt_kpart to $partition"
dd if="$deviceinfo_cgpt_kpart" of="$partition"
# shellcheck disable=SC2013
for x in $(cat /proc/cmdline); do
[ "$x" = "${x#kern_guid=}" ] && continue
GUID="${x#kern_guid=}"
partition=$(findfs PARTUUID="$GUID")
echo "Flashing $deviceinfo_cgpt_kpart to $partition"
dd if="$deviceinfo_cgpt_kpart" of="$partition"
done
echo "Done."