summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2011-05-01 12:24:52 -0400
committerAnthony G. Basile <blueness@gentoo.org>2011-05-01 12:24:52 -0400
commit6b060c7792c98bbde56eccbf3077580b35d80218 (patch)
tree9d760ba4e4f22231902820aefc8e9bb288c6676e /scripts/mk.patch.sh
parentUpdate Grsec/PaX (diff)
downloadhardened-patchset-6b060c7792c98bbde56eccbf3077580b35d80218.tar.gz
hardened-patchset-6b060c7792c98bbde56eccbf3077580b35d80218.tar.bz2
hardened-patchset-6b060c7792c98bbde56eccbf3077580b35d80218.zip
Added script to automatically retrieve patches
Diffstat (limited to 'scripts/mk.patch.sh')
-rwxr-xr-xscripts/mk.patch.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/mk.patch.sh b/scripts/mk.patch.sh
new file mode 100755
index 0000000..0086237
--- /dev/null
+++ b/scripts/mk.patch.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+SCRIPT_NAME="${0}"
+KERNEL_VER="${1%/}"
+HGPV_PATCH="${2}"
+TAR="/bin/tar"
+GPG="/usr/bin/gpg"
+SIGNAS="basile"
+
+################################################################################
+
+die() {
+ echo "$1"
+ exit
+}
+
+sanity() {
+ [[ -d "${KERNEL_VER}" ]] || die "Can't find ${KERNEL_VER} directory"
+ [[ -e "${TAR}" ]] || die "Can't find tar"
+ [[ -n "${HGPV_PATCH}" ]] || die "No HGPV patchlevel given"
+}
+
+################################################################################
+
+sanity
+
+HGPV="${KERNEL_VER}-${HGPV_PATCH}"
+HGPV_TARBALL="hardened-patches-${HGPV}.extras.tar.bz2"
+
+$TAR jcvf ${HGPV_TARBALL} ${KERNEL_VER}
+
+$GPG -a -s -b --default-key $SIGNAS ${HGPV_TARBALL}