diff options
author | William Pitcock <nenolod@dereferenced.org> | 2017-04-27 05:13:29 +0000 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2017-04-27 05:46:22 +0000 |
commit | e78c37459b6399ac066e30fff9bd49bfe7779d30 (patch) | |
tree | 748fc95a65d99eba13c1e523b27c6bd88333bbf7 /community/virtualbox-guest-modules-hardened/APKBUILD | |
parent | 43a9721d269bdcd4e863248474ae2601f2f53548 (diff) | |
download | aports-e78c37459b6399ac066e30fff9bd49bfe7779d30.tar.bz2 aports-e78c37459b6399ac066e30fff9bd49bfe7779d30.tar.xz |
community/virtualbox-guest-modules-hardened: rename from virtualbox-guest-modules-grsec, provide virtualbox-guest-modules-grsec
Diffstat (limited to 'community/virtualbox-guest-modules-hardened/APKBUILD')
-rw-r--r-- | community/virtualbox-guest-modules-hardened/APKBUILD | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/community/virtualbox-guest-modules-hardened/APKBUILD b/community/virtualbox-guest-modules-hardened/APKBUILD new file mode 100644 index 0000000000..2b01cfc48b --- /dev/null +++ b/community/virtualbox-guest-modules-hardened/APKBUILD @@ -0,0 +1,95 @@ +# Maintainer: Ben Allen <bensallen@me.com> +# Contributor: Ben Allen <bensallen@me.com> + +_flavor=${FLAVOR:-hardened} +_kpkg=linux-$_flavor +_kver=4.9.24 +_kpkgrel=1 + +# when chaning _ver we *must* bump _mypkgrel +_ver=5.1.14 +_mypkgrel=0 +_name=virtualbox-guest-modules + +_kpkgver="$_kver-r$_kpkgrel" +_abi_release=${_kver}-${_kpkgrel}-${_flavor} +_abi_release_virthardened=${_kver}-${_kpkgrel}-virthardened + +pkgname=${_name}-${_flavor} +pkgver=$_kver +pkgrel=$(($_kpkgrel + $_mypkgrel)) +pkgdesc="VirtualBox Additions kernel modules for $_flavor " +arch='x86 x86_64' +url='http://virtualbox.org' +license="GPL custom" +makedepends="linux-hardened-dev=$_kpkgver linux-virthardened-dev=$_kpkgver sed coreutils" +subpackages="$_name-virthardened:_virthardened" +source="http://download.virtualbox.org/virtualbox/$_ver/VirtualBox-$_ver.tar.bz2 + vboxguest-log-use-c99.patch + const-struct-kernel_param.patch + " +provides="${_name}-grsec=${pkgver}-r${pkgrel}" +builddir="$srcdir"/VirtualBox-$_ver + +prepare() { + local i + + ( + # verify the kernel version before entering chroot + _kapkbuild="$startdir"/../../main/linux-${_flavor}/APKBUILD + if [ -f $_kapkbuild ]; then + . $_kapkbuild + pkgname=$_name-$_flavor + if [ "$_kver" != "$pkgver" ]; then + die "please update _kver to $pkgver" + fi + if [ "$_kpkgrel" != "$pkgrel" ]; then + die "please update _kpkgrel to $pkgrel" + fi + fi + ) || return 1 + + cd "$builddir" + default_prepare || return 1 + "$builddir"/src/VBox/Additions/linux/export_modules \ + "$srcdir/vbox-kmod-$_ver.tar.gz" || return 1 + + for i in $_abi_release $_abi_release_virthardened; do + mkdir -p "$srcdir/$i" + tar -C "$srcdir/$i" -zxf "$srcdir"/vbox-kmod-$_ver.tar.gz + done +} + +build() { + local i + for i in $_abi_release $_abi_release_virthardened; do + cd "$srcdir/$i" + # Build Kernel Modules + make KERN_DIR=/lib/modules/${i}/build \ + || return 1 + done +} + +package() { + local i module= + for i in $_abi_release $_abi_release_virthardened; do + cd "$srcdir/$i" + for module in *.ko; do + install -v -D -m644 ${module} \ + "$pkgdir/lib/modules/$i/misc/${module}" + done + done +} + +_virthardened() { + pkgdesc="VirtualBox Additions kernel modules for virthardened" + mkdir -p "$subpkgdir"/lib/modules/ + # vboxvideo.ko won't load with virthardened kernel as it doesn't have DRM + rm "$pkgdir"/lib/modules/$_abi_release_virthardened/misc/vboxvideo.ko + mv "$pkgdir"/lib/modules/$_abi_release_virthardened \ + "$subpkgdir"/lib/modules/ +} + +sha512sums="ab0646c587fa1b573a9332ca0f1959660adc02f2ecf63ac808f4a7e3ceb9b2c58adab8e309aec4630ff7fa447f47d7487e7e8d0a1f718a42d39ce71e96067fae VirtualBox-5.1.14.tar.bz2 +bd934e9ed3d2324ef66e2539d2f3f6fab35a8858d670bba817b9cabfe66e85fe13a8594b35f4a8e639841f72fb0b8d12af38518ba25638da5ef338b259ab600b vboxguest-log-use-c99.patch +d069876f93e431833800c1d26ea77ae1dec40c840bb549cf519ceea93ee1ca89bcb262a13b00001503d19e596965d74a71a7f49be232ea892a82114d3ea4337c const-struct-kernel_param.patch" |