mvebu: base-files: autodetect upgrade device

Since some boards could be also booted from other mediums than SD card,
lets make the upgrade block device autodetected.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
This commit is contained in:
Tomasz Maciej Nowak
2019-03-28 18:07:08 +01:00
committed by Hauke Mehrtens
parent 727c3df5bb
commit 4e8345ff68
2 changed files with 18 additions and 10 deletions

View File

@@ -1,12 +1,13 @@
#!/bin/sh
# Copyright (C) 2015 OpenWrt.org
BOOTPART=/dev/mmcblk0p1
. /lib/functions.sh
. /lib/upgrade/common.sh
move_config() {
if [ -b $BOOTPART ]; then
local partdev
if export_bootdevice && export_partdevice partdev 1; then
case $(board_name) in
turris-omnia)
insmod nls_cp437
@@ -16,7 +17,7 @@ move_config() {
;;
esac
mkdir -p /boot
mount -o rw,noatime $BOOTPART /boot
mount -o rw,noatime "/dev/$partdev" /boot
[ -f /boot/sysupgrade.tgz ] && mv -f /boot/sysupgrade.tgz /
umount /boot
fi