From 34dbc700c65c2f1a840a9023e88bc1d07392df92 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Tue, 29 Mar 2016 10:37:29 +0300 Subject: [PATCH] CC luci-mod-admin-full: Enable reset in Luci also for ubi Enable reset in LuCI also for ubi based firmwares. Discussion at #672 Backport of 5b79e62c0a99bab8dfb8dce8124d9fecc11da54b Signed-off-by: Hannu Nyman --- .../luci-mod-admin-full/luasrc/controller/admin/system.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua b/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua index ee8d1d318..4feab2841 100644 --- a/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua +++ b/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua @@ -171,7 +171,7 @@ function action_flashops() local fs = require "nixio.fs" local upgrade_avail = fs.access("/lib/upgrade/platform.sh") - local reset_avail = os.execute([[grep '"rootfs_data"' /proc/mtd >/dev/null 2>&1]]) == 0 + local reset_avail = os.execute([[grep -E '"rootfs_data"|"ubi"' /proc/mtd >/dev/null 2>&1]]) == 0 local restore_cmd = "tar -xzC/ >/dev/null 2>&1" local backup_cmd = "sysupgrade --create-backup - 2>/dev/null" @@ -287,7 +287,7 @@ function action_flashops() msg = luci.i18n.translate("The system is erasing the configuration partition now and will reboot itself when finished."), addr = "192.168.1.1" }) - fork_exec("killall dropbear uhttpd; sleep 1; mtd -r erase rootfs_data") + fork_exec("sleep 1; killall dropbear uhttpd; sleep 1; jffs2reset -y && reboot") else -- -- Overview -- 2.25.1