summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-admin-full/luasrc
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2017-11-29 16:51:08 +0100
committerYousong Zhou <yszhou4tech@gmail.com>2018-05-07 20:36:40 +0800
commitda4fab0462bef28f8a9b929efea2910023c92ec3 (patch)
treed2b9f1930387b911bfd6658ebd7efe5e47101a47 /modules/luci-mod-admin-full/luasrc
parent428eb63f0a77fe1334986d45f19bd6723733618a (diff)
luci-mod-admin-full: change supports_reset() test for factory reset
The check "supports_reset" only covers /proc/mtd partitions. If we have this the commands checks for names like ubi or rootfs_data. If this is found the system is possible for a factory reset. But on x86 the situation is different. We have no /proc/mtd partitions because this system do not use a bare metall flash. To solve this issue check if we have an overlay and if so we could do a factory reset. This could be applied for system which uses bare metal flash and system which uses FTL or harddisks. Jffs2reset is the current command used for factory reset. It will try to find volume "rootfs_data" and if it's mounted will delete all files under directory /overlay luci-mod-admin-mini also has check for reset available, but we leave it alone for now as it uses "mtd -r erase rootfs_data" Signed-off-by: Florian Eckert <fe@dev.tdt.de> Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Diffstat (limited to 'modules/luci-mod-admin-full/luasrc')
-rw-r--r--modules/luci-mod-admin-full/luasrc/controller/admin/system.lua2
1 files changed, 1 insertions, 1 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 5478afa3e..51f9d9d7b 100644
--- a/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua
+++ b/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua
@@ -195,7 +195,7 @@ local function supports_sysupgrade()
end
local function supports_reset()
- return (os.execute([[grep -sqE '"rootfs_data"|"ubi"' /proc/mtd]]) == 0)
+ return (os.execute([[grep -sq "^overlayfs:/overlay / overlay " /proc/mounts]]) == 0)
end
local function storage_size()