a3001a0cb0
This allows to flash correct partition when having 2 installations of pmOS. This will also avoid flashing kernel image when using U-Boot.
21 lines
453 B
Bash
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."
|