diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-10-16 21:31:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-16 21:31:26 +0200 |
commit | 3d11af11a72740aefee26c299de379a2780d2f79 (patch) | |
tree | 9d8a148ff4842ef235db030c02ed7bfa16853b46 /modules | |
parent | 7a010b11781222622673c948a06acf0929b98d0a (diff) | |
parent | 29aad47121e8c69552ffbc1455443c69ee4c7497 (diff) |
Merge pull request #3145 from ptpt52/refine-flash-reset
luci-mod-system: refine flash reset
Diffstat (limited to 'modules')
-rw-r--r-- | modules/luci-base/root/usr/share/rpcd/acl.d/luci-base.json | 2 | ||||
-rw-r--r-- | modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js | 11 |
2 files changed, 5 insertions, 8 deletions
diff --git a/modules/luci-base/root/usr/share/rpcd/acl.d/luci-base.json b/modules/luci-base/root/usr/share/rpcd/acl.d/luci-base.json index f811fb99e..b3c401378 100644 --- a/modules/luci-base/root/usr/share/rpcd/acl.d/luci-base.json +++ b/modules/luci-base/root/usr/share/rpcd/acl.d/luci-base.json @@ -36,7 +36,7 @@ "/proc/mtd": [ "read" ], "/proc/partitions": [ "read" ], "/proc/sys/kernel/hostname": [ "read" ], - "/sys/devices/virtual/ubi/*/name": [ "read" ] + "/proc/mounts": [ "read" ] }, "ubus": { "file": [ "list", "read", "stat" ], diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js index 61e021c28..d18246b6b 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js @@ -143,18 +143,14 @@ var mapdata = { actions: {}, config: {} }; return L.view.extend({ load: function() { - var max_ubi = 2, max_ubi_vol = 4; var tasks = [ L.resolveDefault(fs.stat('/lib/upgrade/platform.sh'), {}), fs.trimmed('/proc/sys/kernel/hostname'), fs.trimmed('/proc/mtd'), - fs.trimmed('/proc/partitions') + fs.trimmed('/proc/partitions'), + fs.trimmed('/proc/mounts') ]; - for (var i = 0; i < max_ubi; i++) - for (var j = 0; j < max_ubi_vol; j++) - tasks.push(fs.trimmed('/sys/devices/virtual/ubi/ubi%d/ubi%d_%d/name'.format(i, i, j))); - return Promise.all(tasks); }, @@ -428,7 +424,8 @@ return L.view.extend({ hostname = rpc_replies[1], procmtd = rpc_replies[2], procpart = rpc_replies[3], - has_rootfs_data = (procmtd.match(/"rootfs_data"/) != null) || rpc_replies.slice(4).filter(function(n) { return n == 'rootfs_data' })[0], + procmounts = rpc_replies[4], + has_rootfs_data = (procmtd.match(/"rootfs_data"/) != null) || (procmounts.match("overlayfs:\/overlay \/ ") != null), storage_size = findStorageSize(procmtd, procpart), m, s, o, ss; |