Busybox 1.13.2 and df -h problems

Denys Vlasenko vda.linux at googlemail.com
Thu Mar 19 03:56:45 UTC 2009


On Wednesday 18 March 2009 19:12, Lloyd Sargent wrote:
> On Wednesday 18 March 2009 12:22:24 walter harms wrote:
> > Lloyd Sargent schrieb:
> > > I built a system using Buildroot for the AT91SAM9261 processor and it
> > > works great -- except that when I type "df -h" I don't get human readable
> > > output.
> > >
> > > Here is an example:
> > >
> > > # df
> > > Filesystem           1K-blocks      Used Available Use% Mounted on
> > > /dev/root                 5304      2620      2684  49% /
> > > tmpfs                    30936         0     30936   0% /tmp
> > > # df -h
> > > Filesystem           1K-blocks      Used Available Use% Mounted on
> > > /dev/root                 5304      2620      2684  49% /
> > > tmpfs                    30936         0     30936   0% /tmp
> > >
> > > This used to work in older versions of Busybox (1.2.1) -- is this a known
> > > issue?
> >
> > it works for me with bb 1.13.0
> > can you compile a newer version for your arm ?
> 
> New compile, same problem...
> 
> # df
> Filesystem           1K-blocks      Used Available Use% Mounted on
> /dev/root                 7668      4972      2696  65% /
> tmpfs                    30780         0     30780   0% /tmp
> # df -h
> Filesystem           1K-blocks      Used Available Use% Mounted on
> /dev/root                 7668      4972      2696  65% /
> tmpfs                    30780         0     30780   0% /tmp
> # busybox
> BusyBox v1.13.3 (2009-03-17 23:22:52 CDT) multi-call binary
> Copyright (C) 1998-2008 Erik Andersen, Rob Landley, Denys Vlasenko...

Do you have these in your .config?

# grep -e DF -e HUMAN .config
CONFIG_FEATURE_PIDFILE=y
CONFIG_DF=y
CONFIG_FEATURE_DF_FANCY=y         <======
CONFIG_FEATURE_HUMAN_READABLE=y   <======
CONFIG_LOADFONT=y
CONFIG_FDFLUSH=y
CONFIG_FDFORMAT=y
CONFIG_FINDFS=y
CONFIG_FEATURE_VOLUMEID_UDF=y
# CONFIG_FEATURE_HTTPD_USE_SENDFILE is not set

Hmm... I see. It's a bug in option bit definition. It should be:

                OPT_ALL   = (1 << 2) * ENABLE_FEATURE_DF_FANCY,
                OPT_INODE = (1 << 3) * ENABLE_FEATURE_DF_FANCY,
                OPT_BSIZE = (1 << 4) * ENABLE_FEATURE_DF_FANCY,
                OPT_HUMAN = (1 << (2 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE,
                OPT_MEGA  = (1 << (3 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE,

Because currently it does not do this trick,
when FEATURE_DF_FANCY is off, FEATURE_HUMAN_READABLE
does not work.

For now, just enable FEATURE_DF_FANCY, and 1.14.x will have the fix.
--
vda


More information about the busybox mailing list