[OpenWrt-Devel] [PATCH v5 2/2] Allow sysupgrade restore on ER

Jonathan Thibault jonathan at navigue.com
Thu Dec 6 10:25:36 EST 2018


---
 target/linux/octeon/base-files/lib/preinit/79_move_config | 15 ++++++++++++---
 target/linux/octeon/base-files/lib/upgrade/platform.sh    | 15 ++++++++++++---
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/target/linux/octeon/base-files/lib/preinit/79_move_config b/target/linux/octeon/base-files/lib/preinit/79_move_config
index ec63d9f5ff..8c379a3276 100644
--- a/target/linux/octeon/base-files/lib/preinit/79_move_config
+++ b/target/linux/octeon/base-files/lib/preinit/79_move_config
@@ -1,14 +1,23 @@
 #!/bin/sh
 # Copyright (C) 2014 OpenWrt.org
 
+er_move_config() {
+	local dev="$1"
+
+	mount -t vfat "$dev" /mnt
+	[ -f /mnt/sysupgrade.tgz ] && mv -f /mnt/sysupgrade.tgz /
+	umount /mnt
+}
+
 move_config() {
 	. /lib/functions.sh
 
 	case "$(board_name)" in
+		er)
+			er_move_config /dev/mmcblk0p1
+			;;
 		erlite)
-			mount -t vfat /dev/sda1 /mnt
-			[ -f /mnt/sysupgrade.tgz ] && mv -f /mnt/sysupgrade.tgz /
-			umount /mnt
+			er_move_config /dev/sda1
 			;;
 	esac
 }
diff --git a/target/linux/octeon/base-files/lib/upgrade/platform.sh b/target/linux/octeon/base-files/lib/upgrade/platform.sh
index 6d258dbb0f..a38a2a362a 100755
--- a/target/linux/octeon/base-files/lib/upgrade/platform.sh
+++ b/target/linux/octeon/base-files/lib/upgrade/platform.sh
@@ -21,12 +21,21 @@ platform_get_rootfs() {
 	fi
 }
 
+er_platform_copy_config() {
+	local dev="$1"
+
+	mount -t vfat "$dev" /mnt
+	cp -af "$CONF_TAR" /mnt/
+	umount /mnt
+}
+
 platform_copy_config() {
 	case "$(board_name)" in
+	er)
+		er_platform_copy_config /dev/mmcblk0p1
+		;;
 	erlite)
-		mount -t vfat /dev/sda1 /mnt
-		cp -af "$CONF_TAR" /mnt/
-		umount /mnt
+		er_platform_copy_config /dev/sda1
 		;;
 	esac
 }
-- 
2.12.2


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list