You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
418 B

  1. #!/bin/sh
  2. uvol_init() {
  3. local metasz freesz totalsz
  4. uvol detect
  5. metasz="$(uvol size .meta 2>/dev/null)"
  6. [ "$((metasz))" -gt 0 ] && return
  7. totalsz="$(uvol total)"
  8. freesz="$(uvol free)"
  9. metasz="$((totalsz / 10240))"
  10. [ "$metasz" -lt 4194304 ] && metasz=4194304
  11. [ "$metasz" -gt "$freesz" ] && return
  12. uvol create .meta "$metasz" rw
  13. uvol up .meta
  14. }
  15. uci -q get fstab.@uvol[0].initialized >/dev/null || uvol_init