summaryrefslogtreecommitdiff
path: root/packaging/utils/kernelpatch
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/utils/kernelpatch')
-rwxr-xr-xpackaging/utils/kernelpatch55
1 files changed, 55 insertions, 0 deletions
diff --git a/packaging/utils/kernelpatch b/packaging/utils/kernelpatch
new file mode 100755
index 000000000..d2b8e86f1
--- /dev/null
+++ b/packaging/utils/kernelpatch
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+# wander through a FreeSWAN linux directory, creating a patch file (to stdout)
+# that will apply the code to a kernel source directory.
+#
+# $Id: kernelpatch,v 1.1 2004/03/15 20:35:27 as Exp $
+#
+
+KERN=$1
+shift
+
+case $KERN in
+ 2.0) patchname=fs2_0;;
+ 2.2) patchname=fs2_2;;
+ 2.4) patchname=fs2_4;;
+ 2.5) patchname=fs2_5;;
+ *) echo "Invalid kernel patch target: $KERN"; exit 1;;
+esac
+
+# make sure that sort gets the right locale.
+LANG=C export LANG
+LC_ALL=C export LC_ALL
+
+
+find linux -type f -print | grep -v CVS | egrep -v 'linux/Makefile' | sort | while read file
+do
+ base=`basename $file`
+ case $base in
+ TAGS) ;;
+ tags) ;;
+ .cvsignore) ;;
+ .*.o.flags) ;;
+ .\#*);;
+ *.o) ;;
+ *~) ;;
+ tagsfile.mak) ;;
+ *.$patchname.patch) cat $file;;
+ *.patch) ;;
+ *) diff -u /dev/null $file;;
+ esac
+done
+
+#
+# finally, we have to produce a diff for linux/net/linux/Makefile.ver,
+# a file which is generated at runtime, so there is nothing in CVS.
+#
+echo '--- /dev/null Fri May 10 13:59:54 2002'
+echo '+++ linux/net/ipsec/Makefile.ver Sun Jul 28 22:10:40 2002'
+echo '@@ -0,0 +1 @@'
+echo -n '+'
+grep IPSECVERSION Makefile.ver
+
+exit 0
+
+