Renamed linux to kernel
[namenlos-ports.git] / kernel / Pkgfile
blobdadba65a3f2e3a1c8c1f2c550b82caaca759e926
1 # Maintainer: Richard Pöttler, richard dot poettler at gmail dot com
2 # Description: the linux kernel
3 # URL: http://www.kernel.org/
4 # Depends on: 
6 if [ -r /usr/src/kernel.release ]; then
7         . /usr/src/kernel.release
8 fi
10 name=kernel
11 version=${version:-2.6.23.9}
12 release=${release:-1}
13 source=()
15 build () {
16         # get the sources
17         ketchup -d kernel $version
18         cd kernel
20         # configure the kernel
21         if [ -r /usr/src/kernel.config ]; then
22                 cp /usr/src/kernel.config .config
23         else
24                 make defconfig
25         fi
27         # apply patches
28         if [ -d /usr/src/kernel.patches/$version ]; then
29                 for patch in `ls /usr/src/kernel.patches/$version`; do
30                         patch -p1 < /usr/src/kernel.patches/$version/$patch
31                 done
32         fi
34         # remove the lilo calls
35         sed -i -e '/if \[ -x \/sbin\/lilo \]; then \/sbin\/lilo;/d' \
36                 `grep -lr 'if \[ -x /sbin/lilo \]; then /sbin/lilo;' ./`
38         # build everything
39         make all
41         # install the modules
42         make INSTALL_MOD_PATH=$PKG modules_install
44         # install the kernel image and the System.map
45         mkdir $PKG/boot
46         make INSTALL_PATH=$PKG/boot install
48         # correct the /lib/modules/$version/{build,source} links to
49         # /usr/src/linux
50         rm $PKG/lib/modules/$version/{build,source}
51         ln -s /usr/src/linux $PKG/lib/modules/$version/build
52         ln -s /usr/src/linux $PKG/lib/modules/$version/source
54         # copy the configuration for later use
55         install .config $PKG/boot/kernel.config