The factory uboot of the Turris Omnia boots with "root=b301", and we
instruct new users to sysupgrade from there (e.g. method 1, step 7).
Currently, this will fail with "Unable to determine upgrade device".
Add a new case to export_bootdevice, which parses the hex argument.
Fixes commit
2e5a0b81 ("mvebu: sysupgrade: sdcard: keep user added ...")
Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
}
export_bootdevice() {
- local cmdline bootdisk rootpart uuid blockdev uevent line
+ local cmdline bootdisk rootpart uuid blockdev uevent line class
local MAJOR MINOR DEVNAME DEVTYPE
if read cmdline < /proc/cmdline; then
/dev/*)
uevent="/sys/class/block/${rootpart##*/}/../uevent"
;;
+ 0x[a-f0-9][a-f0-9][a-f0-9] | 0x[a-f0-9][a-f0-9][a-f0-9][a-f0-9] | \
+ [a-f0-9][a-f0-9][a-f0-9] | [a-f0-9][a-f0-9][a-f0-9][a-f0-9])
+ rootpart=0x${rootpart#0x}
+ for class in /sys/class/block/*; do
+ while read line; do
+ export -n "$line"
+ done < "$class/uevent"
+ if [ $((rootpart/256)) = $MAJOR -a $((rootpart%256)) = $MINOR ]; then
+ uevent="$class/../uevent"
+ fi
+ done
+ ;;
esac
if [ -e "$uevent" ]; then