pmaports/main/postmarketos-update-depthcharge-kernel/update-depthcharge-kernel.sh
Anton Bambura a3001a0cb0
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.
2023-05-14 19:22:51 +02:00

21 lines
453 B
Bash

#!/bin/sh
# GPL-3.0-or-later
set -e
# Declare used deviceinfo variables to pass shellcheck
deviceinfo_cgpt_kpart=""
# shellcheck disable=SC1091
. /etc/deviceinfo
# 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."