From c6f0bfbc4637ee1ef82a8445acd8f5565f8059cc Mon Sep 17 00:00:00 2001 From: Heinz Wiesinger Date: Sun, 3 Feb 2019 21:43:56 +0100 Subject: system/virtualbox-kernel: Fix building against kernel >= 4.4.168. Signed-off-by: Heinz Wiesinger --- system/virtualbox-kernel/virtualbox-kernel.SlackBuild | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/system/virtualbox-kernel/virtualbox-kernel.SlackBuild b/system/virtualbox-kernel/virtualbox-kernel.SlackBuild index 2ded2d2429..d6c0e8a584 100644 --- a/system/virtualbox-kernel/virtualbox-kernel.SlackBuild +++ b/system/virtualbox-kernel/virtualbox-kernel.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for virtualbox-kernel -# Copyright 2008-2017 Heinz Wiesinger, Amsterdam, The Netherlands +# Copyright 2008-2019 Heinz Wiesinger, Amsterdam, The Netherlands # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -26,7 +26,7 @@ PRGNAM=virtualbox-kernel VERSION=${VERSION:-5.0.40} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} KERNEL=${KERNEL:-$(uname -r)} @@ -70,6 +70,14 @@ if ! [ "${HARDENING:-yes}" = "yes" ]; then {vboxdrv,vboxnetadp,vboxnetflt,vboxpci}/Makefile fi +KERNEL_MINOR=$(echo $KERNEL | cut -d "." -f 2) +KERNEL_PATCH=$(echo $KERNEL | cut -d "." -f 3) + +# Work around API break introduced in kernel 4.4.168 +if [ "$KERNEL_MINOR" = 4 -a "$KERNEL_PATCH" -ge 168 ]; then + sed -i "s|KERNEL_VERSION(4, 9, 0)|KERNEL_VERSION(4, 4, 168)|" vboxdrv/r0drv/linux/memobj-r0drv-linux.c +fi + make KERN_DIR=${KERNELPATH} mkdir -p $PKG/lib/modules/$KERNEL/misc -- cgit v1.2.3