summaryrefslogtreecommitdiff
blob: 9ad2c242b989d6c4ec546a4ae9bf9d5801c0868c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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