aboutsummaryrefslogtreecommitdiffstats
path: root/core/linux-grsec/APKBUILD
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-06-29 12:08:24 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-06-29 12:08:24 +0000
commite4b8888455398cebd852317d8d71cdf11e57be81 (patch)
tree01eb3b489d85ac1b06f7b6bf9d6354818e8b2d4b /core/linux-grsec/APKBUILD
parent793bd9b332af1beae2d2e43e6c27abaed4c61720 (diff)
downloadaports-e4b8888455398cebd852317d8d71cdf11e57be81.tar.gz
aports-e4b8888455398cebd852317d8d71cdf11e57be81.tar.bz2
aports-e4b8888455398cebd852317d8d71cdf11e57be81.tar.xz
core/linux-grsec: upgrade to 2.6.29.5
We also move a way from the concept of linux-sources packages.
Diffstat (limited to 'core/linux-grsec/APKBUILD')
-rw-r--r--core/linux-grsec/APKBUILD95
1 files changed, 71 insertions, 24 deletions
diff --git a/core/linux-grsec/APKBUILD b/core/linux-grsec/APKBUILD
index fc66f061fe..63505b9b6a 100644
--- a/core/linux-grsec/APKBUILD
+++ b/core/linux-grsec/APKBUILD
@@ -1,38 +1,85 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+
_flavor=grsec
-pkgname=linux-$_flavor
-pkgver=2.6.28.9
-pkgrel=4
+pkgname=linux-${_flavor}
+pkgver=2.6.29.5
+_kernver=2.6.29
+pkgrel=0
pkgdesc="Linux kernel with grsecurity"
url=http://grsecurity.net
-arch=i486
-makedepends="$pkgname-sources perl"
-source="kernelconfig"
-subpackages="$pkgname-mod $pkgname-dev"
-license=GPL-2
+makedepends="$pkgname-sources perl installkernel"
+_config=${config:-kernelconfig}
+source="ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_kernver.tar.bz2
+ ftp://ftp.kernel.org/pub/linux/kernel/v2.6/patch-$pkgver.bz2
+ grsecurity-2.1.14-2.6.29.5-200906152045.patch
+ 0001-linux-2.6.28.5-ipgre-strict-binding.patch
+ 0002-linux-2.6.28.5-ipgre-optimize-hash-lookup.patch
+ net-next-2.6.git-5ef12d98a19254ee5dc851bd83e214b43ec1f725.patch
+ $_config
+ "
+subpackages="$pkgname-dev"
+license="GPL-2"
-build() {
- mkdir -p "$srcdir/$pkgname"
- cd "$srcdir/$pkgname"
- cp ../kernelconfig .config
- make -C /usr/src/linux-$pkgver-grsec "O=$PWD" HOSTCC="$CC" \
+_ksrcdir=/usr/src/linux-${pkgver}-${_flavor}
+_abi_release=${pkgver}-${_flavor}
+
+_prepare() {
+ cd "$srcdir"/linux-$_kernver
+ if [ "$_kernver" != "$pkgver" ]; then
+ bunzip2 -c < ../patch-$pkgver.bz2 | patch -p1 || return 1
+ fi
+
+ for i in ../*.patch; do
+ msg "Applying $i..."
+ patch -p1 -N < $i || return 1
+ done
+
+ mkdir -p "$srcdir"/build
+ cp "$srcdir"/$_config "$srcdir"/build/.config
+ make -C "$_ksrcdir" O="$srcdir"/build HOSTCC="$CC" \
silentoldconfig
+}
+
+# this is so we can do: 'abuild menuconfig' to reconfigure kernel
+menuconfig() {
+ _prepare
+ cd "$srcdir"/build
+ make menuconfig
+ cp .config "$startdir"/$_config
+}
+
+build() {
+ _prepare || return 1
+ cd "$srcdir"/build
make CC="$CC" || return 1
- mkdir -p $pkgdir/boot $pkgdir/lib/modules
+ mkdir -p "$pkgdir"/boot "$pkgdir"/lib/modules
make modules_install install \
- INSTALL_MOD_PATH=$pkgdir \
- INSTALL_PATH=$pkgdir/boot
- cd "$pkgdir"/boot
- mv vmlinuz $_flavor
+ INSTALL_MOD_PATH="$pkgdir" \
+ INSTALL_PATH="$pkgdir"/boot
+
+ # point the build symlink to headers dir
+ rm -f "$pkgdir"/lib/modules/${_abi_release}/build
+ ln -sf /usr/src/linux-headers-${_abi_release} \
+ "$pkgdir"/lib/modules/${_abi_release}/build
}
dev() {
- install -Dm644 "$srcdir"/$pkgname/Module.symvers \
- "$subpkgdir"/boot/Module.symvers-$_flavor
- install -Dm644 "$srcdir/kernelconfig" \
- "$subpkgdir"/boot/config-$_flavor
- mv "$pkgdir"/boot/System.map "$subpkgdir"/boot/System.map-$_flavor
+ # create flavored headers ubuntu style
+ local dir="$subpkgdir"/usr/src/linux-headers-${_abi_release}
+ mkdir -p "$dir"
+ cp "$srcdir"/kernelconfig "$dir"/.config
+ make -j1 -C /usr/src/linux-$pkgver-grsec O="$dir" HOSTCC="$CC" \
+ silentoldconfig prepare scripts
+
+ install -Dm644 "$srcdir"/build/Module.symvers \
+ "$dir"/Module.symvers
}
-md5sums="2b13beaff480758b99eba6cb2191952b kernelconfig"
+md5sums="64921b5ff5cdadbccfcd3820f03be7d8 linux-2.6.29.tar.bz2
+bd23086872a85c9fd00163e9ab78038a patch-2.6.29.5.bz2
+e2e49a250303720b31c4371905c105e3 grsecurity-2.1.14-2.6.29.5-200906152045.patch
+7673b4521283ad41434a18ca18b16ad8 0001-linux-2.6.28.5-ipgre-strict-binding.patch
+8f405c738b150c532c46eaad5390cca2 0002-linux-2.6.28.5-ipgre-optimize-hash-lookup.patch
+ca05fd252783b82e01610e775cf56498 net-next-2.6.git-5ef12d98a19254ee5dc851bd83e214b43ec1f725.patch
+d5df3f51ca178a17492beca1419e427e kernelconfig"