aboutsummaryrefslogtreecommitdiffstats
path: root/community/virtualbox-guest-modules-hardened
diff options
context:
space:
mode:
Diffstat (limited to 'community/virtualbox-guest-modules-hardened')
-rw-r--r--community/virtualbox-guest-modules-hardened/APKBUILD95
-rw-r--r--community/virtualbox-guest-modules-hardened/const-struct-kernel_param.patch76
-rw-r--r--community/virtualbox-guest-modules-hardened/vboxguest-log-use-c99.patch13
3 files changed, 184 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"
diff --git a/community/virtualbox-guest-modules-hardened/const-struct-kernel_param.patch b/community/virtualbox-guest-modules-hardened/const-struct-kernel_param.patch
new file mode 100644
index 0000000000..d73ae16133
--- /dev/null
+++ b/community/virtualbox-guest-modules-hardened/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-hardened/vboxguest-log-use-c99.patch b/community/virtualbox-guest-modules-hardened/vboxguest-log-use-c99.patch
new file mode 100644
index 0000000000..d8af408b8a
--- /dev/null
+++ b/community/virtualbox-guest-modules-hardened/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