mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] [RfC] ptxdist: add rootstat command
Date: Mon, 16 Feb 2015 11:49:53 +0100	[thread overview]
Message-ID: <20150216104953.GB30223@pengutronix.de> (raw)
In-Reply-To: <1423672490-5598-1-git-send-email-r.schwebel@pengutronix.de>

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.schwebel@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

  parent reply	other threads:[~2015-02-16 10:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-11 16:34 Robert Schwebel
2015-02-11 16:42 ` Uwe Kleine-König
2015-02-16 10:49 ` Michael Olbrich [this message]
2015-02-16 11:41   ` Robert Schwebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150216104953.GB30223@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox