#!/bin/sh
#(c) Barry Kauler 2009, licence GPL2
#w482 fix for /dev/root.

DF="busybox df"
[ "`which df-FULL`" != "" ] && DF="df-FULL"

RETSTUFF="`$DF "$@"`" #quotes added
RETVAL=$?

RETSTUFF="`echo "$RETSTUFF" | grep -v '^rootfs '`"

#replace /dev/root with correct root partition...
#rdev is a busybox applet...
ROOTPARTITION="`rdev | grep ' /$' | cut -f 1 -d ' ' | grep -E '/dev/sd|/dev/hd|/dev/mmc'`"
nPATTERN="s%^/dev/root %${ROOTPARTITION} %"
[ "$ROOTPARTITION" ] && RETSTUFF="`echo "$RETSTUFF" | sed -e "$nPATTERN"`"

echo "$RETSTUFF"
exit $RETVAL

###END###
