diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-05-30 03:58:04 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-05-30 03:58:04 +0000 |
commit | 66bcdc88972ebb369e24361435f4e8816de95a2f (patch) | |
tree | 198c1391e55e65e3cccf171f60c22e4453cf87f7 | |
parent | 7b2a5b89cc17df06773048af0fe92cfcf27dafeb (diff) |
Allow the HASH command in ramdisk list files to specify additional files
to be checksummed. ok deraadt@
-rw-r--r-- | distrib/miniroot/list2sh.awk | 7 | ||||
-rw-r--r-- | distrib/miniroot/makehash.sh | 21 |
2 files changed, 19 insertions, 9 deletions
diff --git a/distrib/miniroot/list2sh.awk b/distrib/miniroot/list2sh.awk index 5d897d7c61a..eebdd44faf1 100644 --- a/distrib/miniroot/list2sh.awk +++ b/distrib/miniroot/list2sh.awk @@ -1,4 +1,4 @@ -# $OpenBSD: list2sh.awk,v 1.14 2009/05/05 05:46:31 deraadt Exp $ +# $OpenBSD: list2sh.awk,v 1.15 2009/05/30 03:58:03 miod Exp $ # $NetBSD: list2sh.awk,v 1.2 1996/05/04 15:45:31 pk Exp $ BEGIN { @@ -61,7 +61,10 @@ $1 == "CRUNCHSPECIAL" { } $1 == "HASH" { printf("echo '%s' from RELEASEDIR=$RELEASEDIR for REV=$REV\n", $0); - printf("(cd ${TARGDIR}; sh $UTILS/makehash.sh var/hash $REV $RELEASEDIR)\n"); + printf("(cd ${TARGDIR}; sh $UTILS/makehash.sh %s $REV $RELEASEDIR", $2); + for (i = 3; i <= NF; i++) + printf(" %s", $i); + printf(")\n"); next; } $1 == "TZ" { diff --git a/distrib/miniroot/makehash.sh b/distrib/miniroot/makehash.sh index 9e6ff79fbb9..87fd4e89d08 100644 --- a/distrib/miniroot/makehash.sh +++ b/distrib/miniroot/makehash.sh @@ -12,14 +12,21 @@ rel=$3 #echo makehash args $dir $rev $rel -cat $rel/bsd | sum -a sha256 > $dir/bsd -#ls -alF $rel/bsd -#echo bsd `cat $dir/bsd` +for i in bsd bsd.mp; do + if [ -f $rel/$i ]; then + cat $rel/$i | sum -a sha256 > $dir/$i + #ls -alF $rel/$i + #echo $i `cat $dir/$i` + fi +done -if [ -f $rel/bsd.mp ]; then - cat $rel/bsd.mp | sum -a sha256 > $dir/bsd.mp - #ls -alF $rel/bsd.mp - #echo bsd.mp `cat $dir/bsd.mp` +if [ $# -gt 3 ]; then + shift; shift; shift; + for i in $*; do + cat $rel/$i | sum -a sha256 > $dir/$i + #ls -alF $rel/$i + #echo $i `cat $dir/$i` + done fi for i in base comp etc misc man game ; do |