lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090508204747.GA18041@uranus.ravnborg.org>
Date:	Fri, 8 May 2009 22:47:47 +0200
From:	Sam Ravnborg <sam@...nborg.org>
To:	"H. Peter Anvin" <hpa@...ux.intel.com>
Cc:	linux-kernel@...r.kernel.org, vgoyal@...hat.com, hbabu@...ibm.com,
	kexec@...ts.infradead.org, ying.huang@...el.com, mingo@...e.hu,
	tglx@...utronix.de, ebiederm@...ssion.com,
	"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH 05/14] kbuild: allow compressors (gzip, bzip2, lzma) to take multiple inputs

On Fri, May 08, 2009 at 01:18:56PM -0700, H. Peter Anvin wrote:
> Sam Ravnborg wrote:
> >>diff --git a/scripts/bin_size b/scripts/bin_size
> >>index 43e1b36..55f2161 100644
> >>--- a/scripts/bin_size
> >>+++ b/scripts/bin_size
> >>@@ -1,10 +1,14 @@
> >> #!/bin/sh
> >> 
> >> if [ $# = 0 ] ; then
> >>-   echo Usage: $0 file
> >>+   echo Usage: $0 file...
> >> fi
> >> 
> >>-size_dec=`stat -c "%s" $1`
> >>+size_dec=0
> >>+for file; do
> >>+  fsize=`stat -c "%s" $file`
> >>+  size_dec=`expr $size_dec + $fsize`
> >>+done
> >> size_hex_echo_string=`printf "%08x" $size_dec |
> >>      sed 's/\(..\)\(..\)\(..\)\(..\)/\\\\x\4\\\\x\3\\\\x\2\\\\x\1/g'`
> >> /bin/echo -ne $size_hex_echo_string
> >
> >But I would rather have had this inside makefile.lib...
> >
> 
> It's messy enough as a shell script... it seems like baking it into 
> Makefile syntax would make it even worse.

I did a quick attempt to integrate it in the Makefile - not pretty.
So I dropped that idea.

It is mainly that we should not fill up scripts/ with small
undocumented scripts.

Could you add something like this in the top of the file:

# Find the sum of the size of all files specified and
# output the size as an escaped hex string.
#
# Sample:
# $ ls -l foo
# $ -rw-rw-r-- 1 xxx xxx 146 May  8 22:28 foo
# $ bin_size foo
# $ \\x92\\x00\\x00\\x00
# 146 equals 92 hex

	Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ