mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] [RfC] ptxdist: add rootstat command
@ 2015-02-11 16:34 Robert Schwebel
  2015-02-11 16:42 ` Uwe Kleine-König
  2015-02-16 10:49 ` Michael Olbrich
  0 siblings, 2 replies; 4+ messages in thread
From: Robert Schwebel @ 2015-02-11 16:34 UTC (permalink / raw)
  To: ptxdist; +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 <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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-16 11:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-11 16:34 [ptxdist] [PATCH] [RfC] ptxdist: add rootstat command Robert Schwebel
2015-02-11 16:42 ` Uwe Kleine-König
2015-02-16 10:49 ` Michael Olbrich
2015-02-16 11:41   ` Robert Schwebel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox