aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2018-02-01 21:07:51 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2018-02-01 21:08:25 +0000
commitf8b42961e1a42381af3fd765689c26eb2341d026 (patch)
tree79474ef77b85741e419b521f4d8c998d62ade054
parenta89bb38a6765a19ffc5d6ae4397d2af2cbe6f221 (diff)
downloadaports-f8b42961e1a42381af3fd765689c26eb2341d026.tar.bz2
aports-f8b42961e1a42381af3fd765689c26eb2341d026.tar.xz
community/virtualbox-guest-modules-vanilla: new aport (replacing virtualbox-guest-modules-hardened)
-rw-r--r--community/virtualbox-guest-modules-vanilla/APKBUILD92
-rw-r--r--community/virtualbox-guest-modules-vanilla/const-struct-kernel_param.patch76
-rw-r--r--community/virtualbox-guest-modules-vanilla/vboxguest-log-use-c99.patch13
3 files changed, 181 insertions, 0 deletions
diff --git a/community/virtualbox-guest-modules-vanilla/APKBUILD b/community/virtualbox-guest-modules-vanilla/APKBUILD
new file mode 100644
index 0000000000..f9c0d5bcc6
--- /dev/null
+++ b/community/virtualbox-guest-modules-vanilla/APKBUILD
@@ -0,0 +1,92 @@
+# Maintainer: Ben Allen <bensallen@me.com>
+# Contributor: Ben Allen <bensallen@me.com>
+
+_flavor=${FLAVOR:-vanilla}
+_kpkg=linux-$_flavor
+_kver=4.14.16
+_kpkgrel=0
+
+# when chaning _ver we *must* bump _mypkgrel
+_ver=5.2.2
+_mypkgrel=0
+_name=virtualbox-guest-modules
+
+_kpkgver="$_kver-r$_kpkgrel"
+_abi_release=${_kver}-${_kpkgrel}-${_flavor}
+_abi_release_virt=${_kver}-${_kpkgrel}-virt
+
+pkgname=${_name}-${_flavor}
+pkgver=$_kver
+pkgrel=$(($_kpkgrel + $_mypkgrel))
+pkgdesc="VirtualBox Additions guest kernel modules for $_flavor"
+arch='x86 x86_64'
+url='http://virtualbox.org'
+license="GPL custom"
+makedepends="linux-vanilla-dev=$_kpkgver linux-virt-dev=$_kpkgver sed coreutils"
+subpackages="$_name-virt:virt"
+source="http://download.virtualbox.org/virtualbox/$_ver/VirtualBox-$_ver.tar.bz2
+ vboxguest-log-use-c99.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
+ )
+
+ cd "$builddir"
+ default_prepare
+ "$builddir"/src/VBox/Additions/linux/export_modules.sh \
+ "$srcdir/vbox-kmod-$_ver.tar.gz"
+
+ for i in $_abi_release $_abi_release_virt; 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_virt; do
+ cd "$srcdir/$i"
+ # Build Kernel Modules
+ make KERN_DIR=/lib/modules/${i}/build
+ done
+}
+
+package() {
+ local i module=
+ for i in $_abi_release $_abi_release_virt; do
+ cd "$srcdir/$i"
+ for module in *.ko; do
+ install -v -D -m644 ${module} \
+ "$pkgdir/lib/modules/$i/misc/${module}"
+ done
+ done
+}
+
+virt() {
+ pkgdesc="VirtualBox Additions kernel modules for virt"
+ mkdir -p "$subpkgdir"/lib/modules/
+ # vboxvideo.ko won't load with virt kernel as it doesn't have DRM
+ rm "$pkgdir"/lib/modules/$_abi_release_virt/misc/vboxvideo.ko
+ mv "$pkgdir"/lib/modules/$_abi_release_virt \
+ "$subpkgdir"/lib/modules/
+}
+
+sha512sums="415956cfe987a20eb0a372288c29f0e388bd706a3b94ff69b92ef5bbf2e9aecd75761a56f5421ef97d165f756cd7fd46b9eaf16b74b7d2460b831d7f03aae7dc VirtualBox-5.2.2.tar.bz2
+bd934e9ed3d2324ef66e2539d2f3f6fab35a8858d670bba817b9cabfe66e85fe13a8594b35f4a8e639841f72fb0b8d12af38518ba25638da5ef338b259ab600b vboxguest-log-use-c99.patch"
diff --git a/community/virtualbox-guest-modules-vanilla/const-struct-kernel_param.patch b/community/virtualbox-guest-modules-vanilla/const-struct-kernel_param.patch
new file mode 100644
index 0000000000..d73ae16133
--- /dev/null
+++ b/community/virtualbox-guest-modules-vanilla/const-struct-kernel_param.patch
@@ -0,0 +1,76 @@
+diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
+index bd81000..aa9d6b0 100644
+--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
++++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
+@@ -958,7 +958,7 @@ EXPORT_SYMBOL(VBoxGuestIDCCall);
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+
+ /** log and dbg_log parameter setter. */
+-static int vgdrvLinuxParamLogGrpSet(const char *pszValue, struct kernel_param *pParam)
++static int vgdrvLinuxParamLogGrpSet(const char *pszValue, const struct kernel_param *pParam)
+ {
+ if (g_fLoggerCreated)
+ {
+@@ -973,7 +973,7 @@ static int vgdrvLinuxParamLogGrpSet(const char *pszValue, struct kernel_param *p
+ }
+
+ /** log and dbg_log parameter getter. */
+-static int vgdrvLinuxParamLogGrpGet(char *pszBuf, struct kernel_param *pParam)
++static int vgdrvLinuxParamLogGrpGet(char *pszBuf, const struct kernel_param *pParam)
+ {
+ PRTLOGGER pLogger = pParam->name[0] == 'd' ? RTLogDefaultInstance() : RTLogRelGetDefaultInstance();
+ *pszBuf = '\0';
+@@ -984,7 +984,7 @@ static int vgdrvLinuxParamLogGrpGet(char *pszBuf, struct kernel_param *pParam)
+
+
+ /** log and dbg_log_flags parameter setter. */
+-static int vgdrvLinuxParamLogFlagsSet(const char *pszValue, struct kernel_param *pParam)
++static int vgdrvLinuxParamLogFlagsSet(const char *pszValue, const struct kernel_param *pParam)
+ {
+ if (g_fLoggerCreated)
+ {
+@@ -998,7 +998,7 @@ static int vgdrvLinuxParamLogFlagsSet(const char *pszValue, struct kernel_param
+ }
+
+ /** log and dbg_log_flags parameter getter. */
+-static int vgdrvLinuxParamLogFlagsGet(char *pszBuf, struct kernel_param *pParam)
++static int vgdrvLinuxParamLogFlagsGet(char *pszBuf, const struct kernel_param *pParam)
+ {
+ PRTLOGGER pLogger = pParam->name[0] == 'd' ? RTLogDefaultInstance() : RTLogRelGetDefaultInstance();
+ *pszBuf = '\0';
+@@ -1009,7 +1009,7 @@ static int vgdrvLinuxParamLogFlagsGet(char *pszBuf, struct kernel_param *pParam)
+
+
+ /** log and dbg_log_dest parameter setter. */
+-static int vgdrvLinuxParamLogDstSet(const char *pszValue, struct kernel_param *pParam)
++static int vgdrvLinuxParamLogDstSet(const char *pszValue, const struct kernel_param *pParam)
+ {
+ if (g_fLoggerCreated)
+ {
+@@ -1023,7 +1023,7 @@ static int vgdrvLinuxParamLogDstSet(const char *pszValue, struct kernel_param *p
+ }
+
+ /** log and dbg_log_dest parameter getter. */
+-static int vgdrvLinuxParamLogDstGet(char *pszBuf, struct kernel_param *pParam)
++static int vgdrvLinuxParamLogDstGet(char *pszBuf, const struct kernel_param *pParam)
+ {
+ PRTLOGGER pLogger = pParam->name[0] == 'd' ? RTLogDefaultInstance() : RTLogRelGetDefaultInstance();
+ *pszBuf = '\0';
+@@ -1034,7 +1034,7 @@ static int vgdrvLinuxParamLogDstGet(char *pszBuf, struct kernel_param *pParam)
+
+
+ /** r3_log_to_host parameter setter. */
+-static int vgdrvLinuxParamR3LogToHostSet(const char *pszValue, struct kernel_param *pParam)
++static int vgdrvLinuxParamR3LogToHostSet(const char *pszValue, const struct kernel_param *pParam)
+ {
+ if ( pszValue == NULL
+ || *pszValue == '\0'
+@@ -1052,7 +1052,7 @@ static int vgdrvLinuxParamR3LogToHostSet(const char *pszValue, struct kernel_par
+ }
+
+ /** r3_log_to_host parameter getter. */
+-static int vgdrvLinuxParamR3LogToHostGet(char *pszBuf, struct kernel_param *pParam)
++static int vgdrvLinuxParamR3LogToHostGet(char *pszBuf, const struct kernel_param *pParam)
+ {
+ strcpy(pszBuf, g_DevExt.fLoggingEnabled ? "enabled" : "disabled");
+ return strlen(pszBuf);
diff --git a/community/virtualbox-guest-modules-vanilla/vboxguest-log-use-c99.patch b/community/virtualbox-guest-modules-vanilla/vboxguest-log-use-c99.patch
new file mode 100644
index 0000000000..d8af408b8a
--- /dev/null
+++ b/community/virtualbox-guest-modules-vanilla/vboxguest-log-use-c99.patch
@@ -0,0 +1,13 @@
+diff --git a/src/VBox/Additions/common/VBoxGuest/linux/Makefile b/src/VBox/Additions/common/VBoxGuest/linux/Makefile
+index b403647..cd58fcb 100644
+--- a/src/VBox/Additions/common/VBoxGuest/linux/Makefile
++++ b/src/VBox/Additions/common/VBoxGuest/linux/Makefile
+@@ -108,7 +108,7 @@ endif
+
+ MOD_DEFS = -DVBOX -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_GUEST \
+ -DIN_GUEST_R0 -DIN_MODULE -DRT_WITH_VBOX -DVBGL_VBOXGUEST \
+- -DVBOX_WITH_HGCM
++ -DVBOX_WITH_HGCM -DLOG_USE_C99
+ ifeq ($(BUILD_TARGET_ARCH),amd64)
+ MOD_DEFS += -DRT_ARCH_AMD64
+ else