df 788 B

1234567891011121314151617181920212223242526272829
  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 $@`"
  7. RETVAL=$?
  8. #hack to remove two conflicting entries mounted on / ...
  9. #if [ "`echo "$RETSTUFF" | grep '^rootfs '`" != "" ];then
  10. # if [ "`echo "$RETSTUFF" | grep '^/dev/root '`" != "" ];then
  11. # RETSTUFF="`echo "$RETSTUFF" | grep -v '^rootfs '`"
  12. # fi
  13. #fi
  14. RETSTUFF="`echo "$RETSTUFF" | grep -v '^rootfs '`"
  15. #replace /dev/root with correct root partition...
  16. #rdev is a busybox applet...
  17. ROOTPARTITION="`rdev | grep ' /$' | cut -f 1 -d ' ' | grep -E '/dev/sd|/dev/hd|/dev/mmc'`"
  18. nPATTERN="s%^/dev/root %${ROOTPARTITION} %"
  19. [ "$ROOTPARTITION" ] && RETSTUFF="`echo "$RETSTUFF" | sed -e "$nPATTERN"`"
  20. echo "$RETSTUFF"
  21. exit $RETVAL
  22. ###END###