diff options
Diffstat (limited to 'kernel/patch_kernel')
-rwxr-xr-x | kernel/patch_kernel | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/kernel/patch_kernel b/kernel/patch_kernel new file mode 100755 index 0000000..f5b800b --- /dev/null +++ b/kernel/patch_kernel @@ -0,0 +1,41 @@ +#!/bin/bash + +# set -e + +kconfig() { + file=$1/net/ipv4/netfilter/Kconfig + if [ "`grep 'config IP_NF_SET' $file`" ]; then + return + fi + mv $file $file.orig + grep -v endmenu $file.orig > $file + cat Kconfig.ipset >> $file + echo "endmenu" >> $file +} + +makefile() { + file=$1/net/ipv4/netfilter/Makefile + if [ "`grep CONFIG_IP_NF_SET $file`" ]; then + return + fi + cp $file $file.orig + cat Makefile.ipset >> $file +} + +tree() { + cp include/linux/netfilter_ipv4/* $1/include/linux/netfilter_ipv4/ + cp *.c $1/net/ipv4/netfilter/ +} + +if [ -z "$1" ]; then + echo "Error: missing kernel directory parameter." + exit 1 +fi +if [ ! -f $1/net/ipv4/netfilter/Kconfig ]; then + echo "Error: the directory $1 doesn't look like a Linux 2.6.x kernel source tree." + exit 1 +fi + +tree $1 +kconfig $1 +makefile $1 |