df 564 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. #(c) Barry Kauler 2009, licence GPL2
  3. #w482 fix for /dev/root.
  4. DF="busybox df"
  5. [ "`which df-FULL`" != "" ] && DF="df-FULL"
  6. RETSTUFF="`$DF "$@"`" #quotes added
  7. RETVAL=$?
  8. RETSTUFF="`echo "$RETSTUFF" | grep -v '^rootfs '`"
  9. #replace /dev/root with correct root partition...
  10. #rdev is a busybox applet...
  11. ROOTPARTITION="`rdev | grep ' /$' | cut -f 1 -d ' ' | grep -E '/dev/sd|/dev/hd|/dev/mmc'`"
  12. nPATTERN="s%^/dev/root %${ROOTPARTITION} %"
  13. [ "$ROOTPARTITION" ] && RETSTUFF="`echo "$RETSTUFF" | sed -e "$nPATTERN"`"
  14. echo "$RETSTUFF"
  15. exit $RETVAL
  16. ###END###