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/ap.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/ap.patch.sh')
-rwxr-xr-xscripts/ap.patch.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/ap.patch.sh b/scripts/ap.patch.sh
new file mode 100755
index 0000000..9ad2c24
--- /dev/null
+++ b/scripts/ap.patch.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+SCRIPT="${0}"
+KMAJOR="${1}"
+PATCHSET="/root/hardened-patchset/${KMAJOR}"
+
+if [[ -z "${KMAJOR}" ]] ; then
+ echo "Usage: ${SCRIPT} <kernel_major>"
+ exit
+fi
+
+if [[ ! -d ${PATCHSET} ]] ; then
+ echo "Patchset ${KMAJOR} doesn't exist"
+ exit
+fi
+
+for p in $(ls ${PATCHSET}) ; do
+ if [[ ${p#0000} == $p ]] ; then
+ echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+ echo
+ echo $p
+ echo
+ patch -p 1 --dry-run < ${PATCHSET}/$p
+ echo "Cont?"
+ read n
+ echo
+ patch -p 1 < ${PATCHSET}/$p
+ echo
+ echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+ fi
+done
+