* [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
* Re: [ptxdist] [PATCH] [RfC] ptxdist: add rootstat command
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
1 sibling, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2015-02-11 16:42 UTC (permalink / raw)
To: ptxdist; +Cc: Robert Schwebel
Hello,
On Wed, Feb 11, 2015 at 05:34:50PM +0100, Robert Schwebel wrote:
> --- 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
the other lines use tabs between the command and its description.
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ptxdist] [PATCH] [RfC] ptxdist: add rootstat command
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
1 sibling, 1 reply; 4+ messages in thread
From: Michael Olbrich @ 2015-02-16 10:49 UTC (permalink / raw)
To: ptxdist
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ptxdist] [PATCH] [RfC] ptxdist: add rootstat command
2015-02-16 10:49 ` Michael Olbrich
@ 2015-02-16 11:41 ` Robert Schwebel
0 siblings, 0 replies; 4+ messages in thread
From: Robert Schwebel @ 2015-02-16 11:41 UTC (permalink / raw)
To: ptxdist
On Mon, Feb 16, 2015 at 11:49:53AM +0100, Michael Olbrich wrote:
> 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.
Hmm, I suppose I can't remember that for the next time I need it, and
after I went through several methods to include and exclude that, I
think it's also not intuitive that exactly *this* variant does the right
thing (instead of for example excluding things which have .debug in
different parts of the filenames).
I'll change the command to use that and play around with it for a while,
let's see if we find it useful then or not.
rsc
--
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
^ 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