1
0
mirror of https://github.com/gryf/gryf-overlay.git synced 2026-04-18 23:43:33 +02:00

Make virtualbox-guest-additions to compile

Currently official build for guest additions will fail due to some
unset/wrong set variables. This is an workaround for it - added KERN_VER
variable which is set to current kernel version, so this ebuild cannot
be run against new kernel version while executed on older/other kernel
version.
This commit is contained in:
2018-11-25 09:10:20 +01:00
parent 18fcf3ca69
commit 5cdd66dd7c
9 changed files with 372 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
[Desktop Entry]
Type=Application
Name=VirtualBox Client Service
Exec=VBoxClient-all
Terminal=false
X-KDE-StartupNotify=false
StartupNotify=false

View File

@@ -0,0 +1,13 @@
# https://bugs.gentoo.org/298988
--- a/vboxguest/Makefile
+++ b/vboxguest/Makefile
@@ -104,7 +104,7 @@
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

View File

@@ -0,0 +1,30 @@
# -*- Makefile -*-
#
# Overwrite some default kBuild settings
#
#
# Copyright (C) 2006-2008 Sun Microsystems, Inc.
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation,
# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
# distribution. VirtualBox OSE is distributed in the hope that it will
# be useful, but WITHOUT ANY WARRANTY of any kind.
#
# don't build testcases to save time, they are not needed for the package
VBOX_WITH_TESTCASES :=
VBOX_WITH_VALIDATIONKIT :=
KBUILD_MSG_STYLE := brief
## paths, origin, hardening
VBOX_WITH_HARDENING := 2
VBOX_WITH_ORIGIN :=
VBOX_ONLY_ADDITIONS := 1
## don't build with -Werror
VBOX_WITH_WARNINGS_AS_ERRORS :=

View File

@@ -0,0 +1,29 @@
Author: Larry Finger
Origin: https://www.mail-archive.com/vbox-dev@virtualbox.org/msg09363.html
--- a/src/VBox/Additions/linux/sharedfolders/utils.c
+++ b/src/VBox/Additions/linux/sharedfolders/utils.c
@@ -50,7 +50,11 @@ static void sf_timespec_from_ftime(RTTIMESPEC *ts, time_t *time)
RTTimeSpecSetNano(ts, t);
}
#else /* >= 2.6.0 */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
+static void sf_ftime_from_timespec(struct timespec64 *tv, RTTIMESPEC *ts)
+#else
static void sf_ftime_from_timespec(struct timespec *tv, RTTIMESPEC *ts)
+#endif
{
int64_t t = RTTimeSpecGetNano(ts);
int64_t nsec;
@@ -60,7 +64,11 @@ static void sf_ftime_from_timespec(struct timespec *tv, RTTIMESPEC *ts)
tv->tv_nsec = nsec;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
+static void sf_timespec_from_ftime(RTTIMESPEC *ts, struct timespec64 *tv)
+#else
static void sf_timespec_from_ftime(RTTIMESPEC *ts, struct timespec *tv)
+#endif
{
int64_t t = (int64_t)tv->tv_nsec + (int64_t)tv->tv_sec * 1000000000;
RTTimeSpecSetNano(ts, t);

View File

@@ -0,0 +1,25 @@
#!/sbin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
pidfile="/var/run/vboxguest-service.pid"
command="/usr/sbin/vboxguest-service"
command_args="--foreground"
command_background="true"
depend() {
need dbus localmount
before xdm
}
start_pre() {
einfo "Loading kernel modules"
/sbin/modprobe vboxguest 2>&1
/sbin/modprobe vboxsf 2>&1
}
stop_post() {
einfo "Removing kernel modules"
/sbin/modprobe -r vboxsf 2>&1
/sbin/modprobe -r vboxguest 2>&1
}

View File

@@ -0,0 +1,16 @@
[Unit]
Description=VirtualBox Guest Additions
ConditionVirtualization=oracle
Before=display-manager.service
[Service]
Type=simple
ExecStartPre=/sbin/modprobe vboxguest
ExecStartPre=/sbin/modprobe vboxsf
ExecStart=/usr/sbin/vboxguest-service --foreground
ExecStopPost=/sbin/modprobe -r vboxsf
ExecStopPost=/sbin/modprobe -r vboxguest
PIDFile=/var/run/vboxguest-service.pid
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,13 @@
Section "Device"
Identifier "Device-vboxvideo"
Driver "vboxvideo"
EndSection
Section "Screen"
Identifier "Screen-vboxvideo"
Device "Device-vboxvideo"
EndSection
Section "ServerLayout"
Identifier "Default Layout"
Screen "Screen-vboxvideo"
EndSection