From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: Robert Schwebel Date: Wed, 11 Feb 2015 17:34:50 +0100 Message-Id: <1423672490-5598-1-git-send-email-r.schwebel@pengutronix.de> Subject: [ptxdist] [PATCH] [RfC] ptxdist: add rootstat command Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Cc: Robert Schwebel 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. Signed-off-by: Robert Schwebel --- 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 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 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