aboutsummaryrefslogtreecommitdiff
path: root/utils/uvol/files/uvol.defaults
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2023-02-15 04:04:12 +0000
committerDaniel Golle <daniel@makrotopia.org>2023-02-15 04:06:36 +0000
commit3d86716b4f83aa827e0b28ba6d27a9c71855eb96 (patch)
treee7c0b60dfb96ca85c28072eebc9c6f61d9aa54d4 /utils/uvol/files/uvol.defaults
parent7aa180412c8b422f7ecb9fde1e46f3cdb0e9f48b (diff)
uvol: switch to /sys/class/ubi
Instead of /sys/devices/virtual/ubi which will no longer be available in future kernels, switch to /sys/class/ubi. While at it fix unrelated arithmetic syntax error by guarding the affected expression to not run on an empty string. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'utils/uvol/files/uvol.defaults')
-rw-r--r--utils/uvol/files/uvol.defaults4
1 files changed, 3 insertions, 1 deletions
diff --git a/utils/uvol/files/uvol.defaults b/utils/uvol/files/uvol.defaults
index 43c971154..927f8c115 100644
--- a/utils/uvol/files/uvol.defaults
+++ b/utils/uvol/files/uvol.defaults
@@ -4,7 +4,9 @@ uvol_init() {
local metasz freesz totalsz
uvol detect
metasz="$(uvol size .meta 2>/dev/null)"
- [ "$((metasz))" -gt 0 ] && return
+ if [ "$metasz" ]; then
+ [ "$((metasz))" -gt 0 ] && return
+ fi
totalsz="$(uvol total)"
freesz="$(uvol free)"
metasz="$((totalsz / 10240))"