summaryrefslogtreecommitdiff
path: root/packaging/utils/kernelpatch
blob: d2b8e86f154fccd7c974d8547d65cd323c818cd7 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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