summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-04-17 03:50:54 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-04-17 03:50:54 +0000
commit2227c4575268540c346b6d370ec40ac3e0208d07 (patch)
treeda0007401c3e11ffba4e57d434d7ce28ed3b2d1e /distrib
parent989923a2c8d9cab91554f65b9e88863e1c837ec0 (diff)
A new directive HASH, which fills a a hash directory (on the media)
with the SHA256 hashes of the various install sets
Diffstat (limited to 'distrib')
-rw-r--r--distrib/miniroot/list2sh.awk7
-rw-r--r--distrib/miniroot/makehash.sh35
2 files changed, 41 insertions, 1 deletions
diff --git a/distrib/miniroot/list2sh.awk b/distrib/miniroot/list2sh.awk
index 858bbe035ba..17d7de5cb84 100644
--- a/distrib/miniroot/list2sh.awk
+++ b/distrib/miniroot/list2sh.awk
@@ -1,4 +1,4 @@
-# $OpenBSD: list2sh.awk,v 1.12 2002/11/28 03:06:30 deraadt Exp $
+# $OpenBSD: list2sh.awk,v 1.13 2009/04/17 03:50:53 deraadt Exp $
# $NetBSD: list2sh.awk,v 1.2 1996/05/04 15:45:31 pk Exp $
BEGIN {
@@ -59,6 +59,11 @@ $1 == "CRUNCHSPECIAL" {
# crunchgen directive; ignored here
next;
}
+$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");
+ next;
+}
$1 == "COPYDIR" {
printf("echo '%s'\n", $0);
printf("(cd ${TARGDIR}/%s && find . ! -name . | xargs /bin/rm -rf)\n",
diff --git a/distrib/miniroot/makehash.sh b/distrib/miniroot/makehash.sh
new file mode 100644
index 00000000000..f5de00263cb
--- /dev/null
+++ b/distrib/miniroot/makehash.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+dir=$1
+rev=$2
+
+if [ $# -lt 3 ]; then
+ echo makehash.sh: No RELEASEDIR -- skipping hash storage
+ exit 0
+fi
+
+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`
+
+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`
+fi
+
+if [ -f $rel/bsd.rd ]; then
+ cat $rel/bsd.rd | sum -a sha256 > $dir/bsd.rd
+ #ls -alF $rel/bsd.rd
+ #echo bsd.rd `cat $dir/bsd.rd`
+fi
+
+for i in base comp etc misc man game ; do
+ cat $rel/$i$rev.tgz | sum -a sha256 > $dir/$i$rev.tgz
+ #ls -alF $rel/$i$rev.tgz
+ #echo $i$rev.tgz `cat $dir/$i$rev.tgz`
+done