File: vm-global.apply

package info (click to toggle)
kernel-patch-2.2.17-vm-global 2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 36 kB
  • ctags: 2
  • sloc: makefile: 42; sh: 36
file content (34 lines) | stat: -rw-r--r-- 974 bytes parent folder | download | duplicates (2)
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
#!/bin/sh -e
# $Id: vm-global.apply,v 1.2 2000/04/12 06:29:32 herbert Exp $

if ! test -d kernel -a -d Documentation; then
	echo "Not in kernel top level directory. Exiting" >&2
	exit 1
fi

ARCHITECTURE=`dpkg --print-installation-architecture`
PATCHNAME=vm-global

PATCHDIR=/usr/src/kernel-patches/$ARCHITECTURE/@version@

# Example on how to get current kernel version number etc
VERSION=$(grep ^VERSION Makefile 2>/dev/null | \
                 sed -e 's/[^0-9]*\([0-9]*\)/\1/')
PATCHLEVEL=$( grep ^PATCHLEVEL Makefile 2>/dev/null | \
                    sed -e 's/[^0-9]*\([0-9]*\)/\1/')
SUBLEVEL=$(grep ^SUBLEVEL Makefile 2>/dev/null | \
                  sed -e 's/[^0-9]*\([0-9]*\)/\1/')

if [ $VERSION.$PATCHLEVEL.$SUBLEVEL != @version@ ]; then
	echo "The kernel is incompatible with the patch." >&2
	exit 1
fi

if test -f APPLIED_$ARCHITECTURE_$PATCHNAME; then
	exit 0
fi

bzcat $PATCHDIR/$PATCHNAME.bz2 | patch -s -p1

touch APPLIED_$ARCHITECTURE_$PATCHNAME
exit 0