On Wed, Feb 11, 2015 at 05:34:50PM +0100, Robert Schwebel wrote:
> Since we have our debug root components in .debug directories, it became
> complicated to find out about the size of the root directory. Add an
> option for it.

'du' can do that for you easily:

$ du -sh --exclude=.debug platform-<something>/root

No need for an extra command.

Michael

> Signed-off-by: Robert Schwebel <r.schwe...@pengutronix.de>
> ---
>  bin/ptxdist | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/bin/ptxdist b/bin/ptxdist
> index 854648a..34605c2 100755
> --- a/bin/ptxdist
> +++ b/bin/ptxdist
> @@ -994,6 +994,7 @@ Misc:
>    newpackage <type>          create a new package Makefile in a rules dir
>                               use 'newpackage help' for a longer description
>    nfsroot                    run a userspace NFS server and export the 
> nfsroot
> +  rootstat                      print statistics about root directory
>    print <var>                        print the contents of a variable, in 
> the way
>                               it is known by "make"
>    list-packages                      print a list of all selected packages
> @@ -1959,6 +1960,16 @@ EOF
>                       ptxd_make_log ptxd_make_nfsd
>                       exit
>                       ;;
> +             rootstat)
> +                     if [ "${PTXDIST_VERBOSE}" == "1" ]; then
> +                             echo "verbose"
> +                             exit
> +                     fi
> +                     find ${ROOTDIR} -type f \
> +                             -and \! -path "*/.debug/*" -exec ls 
> --block-size=1 -s {} \; \
> +                             | awk '{sum += $1} END {print sum/(1024*1024) " 
> MB"}'
> +                     exit
> +                     ;;
>               print)
>                       if [ ${#} -eq 0 ]; then
>                               exit 1
> -- 
> 2.1.4
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to