summaryrefslogtreecommitdiffstats
path: root/kernel/patch_kernel
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu </C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu>2008-07-19 20:48:19 +0000
committer/C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu </C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu>2008-07-19 20:48:19 +0000
commit6a0ae483145159b0c903690c0313dbc03745c412 (patch)
treec76f14af1d80295c94eeba826bdec75cda73ad55 /kernel/patch_kernel
parent87c406c4962ea52f467b9807daf66e3652bd0e9b (diff)
Compatibility cleanup release: kernels >= 2.6.16 and 2.4.36.x are supported.
Diffstat (limited to 'kernel/patch_kernel')
-rwxr-xr-xkernel/patch_kernel41
1 files changed, 35 insertions, 6 deletions
diff --git a/kernel/patch_kernel b/kernel/patch_kernel
index f5b800b..a3f96f0 100755
--- a/kernel/patch_kernel
+++ b/kernel/patch_kernel
@@ -13,6 +13,17 @@ kconfig() {
echo "endmenu" >> $file
}
+config() {
+ file=$1/net/ipv4/netfilter/Config.in
+ if [ "`grep 'CONFIG_IP_NF_SET' $file`" ]; then
+ return
+ fi
+ mv $file $file.orig
+ grep -v endmenu $file.orig > $file
+ cat Config.in.ipset >> $file
+ echo "endmenu" >> $file
+}
+
makefile() {
file=$1/net/ipv4/netfilter/Makefile
if [ "`grep CONFIG_IP_NF_SET $file`" ]; then
@@ -22,6 +33,20 @@ makefile() {
cat Makefile.ipset >> $file
}
+oldmakefile() {
+ file=$1/net/ipv4/netfilter/Makefile
+ if [ "`grep CONFIG_IP_NF_SET $file`" ]; then
+ return
+ fi
+ lineno=`grep -n Rules.make $file | cut -f1 -d:`
+ lineno=$((lineno-1))
+ head -n $lineno $file > $file.head
+ lineno=$((lineno+1))
+ tail +$lineno $file > $file.tail
+ cp $file $file.orig
+ cat $file.head Makefile.ipset Makefile.export.ipset $file.tail > $file
+}
+
tree() {
cp include/linux/netfilter_ipv4/* $1/include/linux/netfilter_ipv4/
cp *.c $1/net/ipv4/netfilter/
@@ -31,11 +56,15 @@ 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."
+if [ -f $1/net/ipv4/netfilter/Kconfig ]; then
+ tree $1
+ kconfig $1
+ makefile $1
+elif [ -f $1/net/ipv4/netfilter/Config.in ]; then
+ tree $1
+ config $1
+ oldmakefile $1
+else
+ echo "Error: The directory $1 doesn't look like a Linux 2.4/2.6 kernel source tree."
exit 1
fi
-
-tree $1
-kconfig $1
-makefile $1