diff options
11 files changed, 320 insertions, 0 deletions
diff --git a/user/virtualbox-guest-additions/60-vbox-guest.rules b/user/virtualbox-guest-additions/60-vbox-guest.rules new file mode 100644 index 000000000..9edd66dd0 --- /dev/null +++ b/user/virtualbox-guest-additions/60-vbox-guest.rules @@ -0,0 +1,2 @@ +KERNEL=="vboxguest", ACTION=="add", OWNER="root", MODE="0600" +KERNEL=="vboxuser", ACTION=="add", OWNER="root", MODE="0666" diff --git a/user/virtualbox-guest-additions/APKBUILD b/user/virtualbox-guest-additions/APKBUILD new file mode 100644 index 000000000..a258654ff --- /dev/null +++ b/user/virtualbox-guest-additions/APKBUILD @@ -0,0 +1,91 @@ +# Contributor: Ben Allen <bensallen@me.com> +# Contributor: Peter Shkenev <santurysim@gmail.com> +# Maintainer: Zach van Rijn <me@zv.io> +pkgname=virtualbox-guest-additions +pkgver=7.0.12 +pkgrel=0 +pkgdesc="Host integration components for VirtualBox virtual machines" +arch="pmmx x86_64" +options="!check" # no test suite +url="https://www.virtualbox.org/" +license="GPL-2.0-only OR (GPL-2.0-only AND CDDL-1.0)" +install="$pkgname.pre-install" +depends="" +makedepends="kbuild lvm2-dev yasm nasm zlib-dev openssl-dev curl-dev + libxslt libxrandr-dev libxt-dev libxmu-dev linux-pam-dev utmps-dev cmd:which" +subpackages="$pkgname-x11 $pkgname-openrc $pkgname-eudev" +source="https://download.virtualbox.org/virtualbox/$pkgver/VirtualBox-$pkgver.tar.bz2 + musl-fix-stat-nsec.patch + musl-no-glibc.patch + musl-off_t.patch + glibc-symvers.patch + VBoxClient.patch + + $pkgname-localconfig + $pkgname.initd + virtualbox-drm-client.initd + 60-vbox-guest.rules + " + +builddir="$srcdir"/VirtualBox-$pkgver + +prepare() { + default_prepare + rm -rf "$builddir"/kBuild/bin + cp "$srcdir"/$pkgname-localconfig LocalConfig.kmk +} + +build() { + ./configure \ + --nofatal \ + --disable-alsa \ + --build-headless \ + ; + kBuild/env.sh kmk VBOX_ONLY_ADDITIONS=1 KBUILD_VERBOSE=2 +} + +package() { + install -v -Dm755 "$builddir"/out/linux.*/release/bin/additions/VBoxService "$pkgdir/usr/sbin/VBoxService" + install -v -Dm755 "$builddir"/out/linux.*/release/bin/additions/VBoxControl "$pkgdir/usr/bin/VBoxControl" + # mount.vboxsf needs to be in /sbin for "mount -t vboxsf..." to work. + install -v -Dm755 "$builddir"/out/linux.*/release/bin/additions/mount.vboxsf "$pkgdir/sbin/mount.vboxsf" + install -v -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname +} + +x11() { + install_if="$pkgname=$pkgver-r$pkgrel libx11" + + install -v -Dm755 "$builddir"/out/linux.*/release/bin/additions/VBoxClient "$subpkgdir/usr/sbin/VBoxClient" + install -v -Dm755 "$builddir"/out/linux.*/release/bin/additions/VBoxDRMClient "$subpkgdir/usr/sbin/VBoxDRMClient" + install -v -Dm755 "$srcdir"/virtualbox-drm-client.initd "$subpkgdir"/etc/init.d/virtualbox-drm-client +} + +eudev() { + pkgdesc="VirtualBox guest rules" + install_if="$pkgname-x11=$pkgver-r$pkgrel eudev" + install -D -m0644 60-vbox-guest.rules "$subpkgdir"/usr/lib/udev/rules.d/60-vbox-guest.rules +} + +sha512sums=" +9fe4511442eba788d02f932f5e98cfcc5aa4ebed41c00bd7333cf7e3f5de787e458f1f56930978283f041f403652c803143335fe9120ab63a2c113ca7b3f588f VirtualBox-7.0.12.tar.bz2 +fe5003d340ef40490eec6746dbc79f1df89cccf55358ce8eef3cef7fcb8fac36c1223850109f1f3b8d3f8ea6f4183367579256ca0604cd98c893b98afa154a32 futimens.patch +7a97497605afe486d31b21b6fecd8e0763415983ea0259093ca9c4589046a9b7e87567bc16c3f5ff80407586aec709091f2f2b4493a8a6cee79311c67412a161 musl-no-glibc.patch +d5ea53cc11fd4a9f1a17f5c68ca3939004e178b11e105c61c8a49df456311633a9fe020d2773d37ee50e90c0a16f2c0c5f0944b2294ccaaafa099b86fe10fee0 musl-fix-stat-nsec.patch +b08e050c4738af121dfdb22ab2bdfe1dec3f27ac32d299ea9ca1130e15b4cd4a3619a9402012086f997fb56e3f9b5be3cddaf8f515ccf1e3014dc54d98bd2d6a musl-off_t.patch +4879003fbd7c4a93fe12019e507fca94290ebd5227af911838f346bdb9cb6ef1e36aa27d32b1e69fb1d95fd05ed1929c4e43ae43b1f11693c20b72ac08f7fa3d glibc-symvers.patch +922bb37d9b85daf1db469a6fc906539fbf8b99feee49e15a5df34ed5f5a223ee256786d5aca217a23adfd7e2e078b2f4f7a1843ecc405363659b7dd75b647a3e VBoxClient.patch +4b4709cb9c8ce9f29d3e62d64d5a9aef406799ff21e94bb6ec07eeb2b05e9481ac66a32cbcf42bd0738b7d1831e3ef2df84e8f77ad95fe5979f3984f5e61c4e1 virtualbox-guest-additions-localconfig +ad6ff256def558f5c6b772c62a3e7a6ccd067ae208491e02ce6738a501d02bcac214056825b804c19fd21b33f3752c62bd8572eb8764f6c5eb10534fa668bd38 virtualbox-guest-additions.initd +44c900a4e96cde88521afaa3604a7e1fa28666196de2f86de02ef7e96d2a64c00f852f9ffb2d77be3a14e11d857d5baf37dec38dfce33ddef8e5518efd7532ed virtualbox-drm-client.initd +0e4fb3bca40ef6b049306c0859e95c02736b411c23028e1917dad01be4c234fd9fcf81e2a184c31e602df3a2a87dd06862e9083a2207731a4253ac8096a47715 60-vbox-guest.rules +" +sha512sums="9fe4511442eba788d02f932f5e98cfcc5aa4ebed41c00bd7333cf7e3f5de787e458f1f56930978283f041f403652c803143335fe9120ab63a2c113ca7b3f588f VirtualBox-7.0.12.tar.bz2 +84de1c35574de12b0a8b9aed798a5f22063f8a754ccd21817ddc953ca1490e68a29e755095ab7622ddb23ac78af04f13bfd1408a7c3c49ab576d1fa5b3c97605 musl-fix-stat-nsec.patch +5d10c12ea3774fb412f4c3717729a5de5b961cf4326cf6d39905d69f8a62b9a6ce9a7e5bdec6b0c801ed56718eb14c109bcd2c8e1e6df835e637b55d5f06fd2d musl-no-glibc.patch +b08e050c4738af121dfdb22ab2bdfe1dec3f27ac32d299ea9ca1130e15b4cd4a3619a9402012086f997fb56e3f9b5be3cddaf8f515ccf1e3014dc54d98bd2d6a musl-off_t.patch +4879003fbd7c4a93fe12019e507fca94290ebd5227af911838f346bdb9cb6ef1e36aa27d32b1e69fb1d95fd05ed1929c4e43ae43b1f11693c20b72ac08f7fa3d glibc-symvers.patch +922bb37d9b85daf1db469a6fc906539fbf8b99feee49e15a5df34ed5f5a223ee256786d5aca217a23adfd7e2e078b2f4f7a1843ecc405363659b7dd75b647a3e VBoxClient.patch +587922642b1ff3132d5c47a359c60232b43e331ffcd48a3c97bd2aaea44e305c58cd11073e43c93a0b10bc91ff6070e481703455a5893b4a72c9840928d5dd4b virtualbox-guest-additions-localconfig +ad6ff256def558f5c6b772c62a3e7a6ccd067ae208491e02ce6738a501d02bcac214056825b804c19fd21b33f3752c62bd8572eb8764f6c5eb10534fa668bd38 virtualbox-guest-additions.initd +b4cbc84e358cd55ac380a95952acd1bec79330c77242760aabaac08dbea52d9e9824e256381e8f1fd72187c78a5e2a379caa624ebd2d7658b3eb7d0c2d6cb77d virtualbox-drm-client.initd +0e4fb3bca40ef6b049306c0859e95c02736b411c23028e1917dad01be4c234fd9fcf81e2a184c31e602df3a2a87dd06862e9083a2207731a4253ac8096a47715 60-vbox-guest.rules" diff --git a/user/virtualbox-guest-additions/VBoxClient.patch b/user/virtualbox-guest-additions/VBoxClient.patch new file mode 100644 index 000000000..29d7f550e --- /dev/null +++ b/user/virtualbox-guest-additions/VBoxClient.patch @@ -0,0 +1,41 @@ +diff --git a/src/VBox/Additions/x11/VBoxClient/Makefile.kmk b/src/VBox/Additions/x11/VBoxClient/Makefile.kmk +index 1687b59..f37b791 100644 +--- a/src/VBox/Additions/x11/VBoxClient/Makefile.kmk ++++ b/src/VBox/Additions/x11/VBoxClient/Makefile.kmk +@@ -108,14 +108,6 @@ ifdef VBOX_WITH_DRAG_AND_DROP + endif + endif + +-# This forces the memcpy references in the static libraries to go to +-# __wrap_memcpy, which we can wrap around memcpy@GLIBC_2.2.5. I do not know +-# how else to do that without recompiling or implementing our own memcpy. +-ifeq ($(KBUILD_TARGET),linux) +- VBoxClient_LDFLAGS.amd64 += \ +- -Wl,--wrap=memcpy +-endif +- + ifdef VBOX_WITH_GUEST_PROPS + VBoxClient_DEFS += VBOX_WITH_GUEST_PROPS + VBoxClient_SOURCES += \ +diff --git a/src/VBox/Additions/x11/VBoxClient/chk_stubs.c b/src/VBox/Additions/x11/VBoxClient/chk_stubs.c +index 9b5093e..cb14ada 100644 +--- a/src/VBox/Additions/x11/VBoxClient/chk_stubs.c ++++ b/src/VBox/Additions/x11/VBoxClient/chk_stubs.c +@@ -53,17 +53,3 @@ void __stack_chk_fail(void) + fprintf(stderr, "Stack check failed!\n"); + _exit(1); + } +- +-#ifdef __x86_64 +-/* Furthermore, wrap references to memcpy to force them to go to the right +- * version. We are forced to do it this way because the shared libraries +- * supc++ and gcc_eh contain references which we cannot change. */ +- +-extern void *__wrap_memcpy(void *dest, const void *src, size_t n); +- +-asm (".symver memcpy, memcpy@GLIBC_2.2.5"); +-void *__wrap_memcpy(void *dest, const void *src, size_t n) +-{ +- return memcpy(dest, src, n); +-} +-#endif diff --git a/user/virtualbox-guest-additions/glibc-symvers.patch b/user/virtualbox-guest-additions/glibc-symvers.patch new file mode 100644 index 000000000..29632f8f8 --- /dev/null +++ b/user/virtualbox-guest-additions/glibc-symvers.patch @@ -0,0 +1,30 @@ +--- VirtualBox-7.0.0.orig/include/iprt/linux/symvers.h ++++ VirtualBox-7.0.0/include/iprt/linux/symvers.h +@@ -49,12 +49,14 @@ + /* Use versions of glibc symbols which are available in 32-bit EL3 or + * 64-bit EL4. Currently only those symbols needed by the Additions, + * though this could probably be extended to work for host builds too. */ ++#if defined(__GLIBC__) + #if defined(RT_ARCH_AMD64) + __asm__(".symver memcpy,memcpy@GLIBC_2.2.5"); + __asm__(".symver posix_spawn,posix_spawn@GLIBC_2.2.5"); + #else /* RT_ARCH_X86 */ + __asm__(".symver posix_spawn,posix_spawn@GLIBC_2.2"); + #endif ++#endif + + /* Do not use *_chk functions */ + #undef _FORTIFY_SOURCE +@@ -77,10 +79,12 @@ + #ifdef fnctl + # undef fcntl + #endif ++#if defined(__GLIBC__) + #if defined(RT_ARCH_AMD64) + __asm__(".symver fcntl64,fcntl@GLIBC_2.2.5"); + #else + __asm__(".symver fcntl64,fcntl@GLIBC_2.0"); ++#endif + #endif + + /* Do not use ISO C99 scanf which has a glibc 2.7 dependency. */ diff --git a/user/virtualbox-guest-additions/musl-fix-stat-nsec.patch b/user/virtualbox-guest-additions/musl-fix-stat-nsec.patch new file mode 100644 index 000000000..4e6027023 --- /dev/null +++ b/user/virtualbox-guest-additions/musl-fix-stat-nsec.patch @@ -0,0 +1,11 @@ +--- VirtualBox-7.0.0.orig/src/VBox/Runtime/include/internal/fs.h ++++ VirtualBox-7.0.0/src/VBox/Runtime/include/internal/fs.h +@@ -72,8 +72,4 @@ + #ifdef RT_OS_LINUX +-# ifdef __USE_MISC + # define HAVE_STAT_TIMESPEC_BRIEF +-# else +-# define HAVE_STAT_NSEC +-# endif + #endif + diff --git a/user/virtualbox-guest-additions/musl-no-glibc.patch b/user/virtualbox-guest-additions/musl-no-glibc.patch new file mode 100644 index 000000000..9536e899c --- /dev/null +++ b/user/virtualbox-guest-additions/musl-no-glibc.patch @@ -0,0 +1,32 @@ +--- VirtualBox-7.0.0.orig/src/VBox/Runtime/r3/linux/semevent-linux.cpp ++++ VirtualBox-7.0.0/src/VBox/Runtime/r3/linux/semevent-linux.cpp +@@ -35,7 +35,7 @@ + */ + + #include <features.h> +-#if __GLIBC_PREREQ(2,6) && !defined(IPRT_WITH_FUTEX_BASED_SEMS) ++#if defined(__GLIBC__) && !defined(IPRT_WITH_FUTEX_BASED_SEMS) + + /* + * glibc 2.6 fixed a serious bug in the mutex implementation. We wrote this +--- VirtualBox-7.0.0.orig/src/VBox/Runtime/r3/linux/semeventmulti-linux.cpp ++++ VirtualBox-7.0.0/src/VBox/Runtime/r3/linux/semeventmulti-linux.cpp +@@ -36,7 +36,7 @@ + + + #include <features.h> +-#if __GLIBC_PREREQ(2,6) && !defined(IPRT_WITH_FUTEX_BASED_SEMS) ++#if defined(__GLIBC__) && !defined(IPRT_WITH_FUTEX_BASED_SEMS) + + /* + * glibc 2.6 fixed a serious bug in the mutex implementation. We wrote this +--- VirtualBox-7.0.0.orig/src/VBox/Runtime/r3/linux/thread-affinity-linux.cpp ++++ VirtualBox-7.0.0/src/VBox/Runtime/r3/linux/thread-affinity-linux.cpp +@@ -42,6 +42,6 @@ + # define _GNU_SOURCE + #endif + #include <features.h> +-#if __GLIBC_PREREQ(2,4) ++#if defined(__GLIBC__) + + #include <sched.h> diff --git a/user/virtualbox-guest-additions/musl-off_t.patch b/user/virtualbox-guest-additions/musl-off_t.patch new file mode 100644 index 000000000..a334364e0 --- /dev/null +++ b/user/virtualbox-guest-additions/musl-off_t.patch @@ -0,0 +1,24 @@ +--- VirtualBox-7.0.0.orig/src/VBox/Runtime/r3/linux/RTFileCopyPartEx-linux.cpp ++++ VirtualBox-7.0.0/src/VBox/Runtime/r3/linux/RTFileCopyPartEx-linux.cpp +@@ -73,8 +73,8 @@ + static int32_t volatile g_fCopyFileRangeSupported = -1; + + +-DECLINLINE(loff_t) +-MyCopyFileRangeSysCall(int fdIn, loff_t *poffIn, int fdOut, loff_t *poffOut, size_t cbChunk, unsigned int fFlags) ++DECLINLINE(off_t) ++MyCopyFileRangeSysCall(int fdIn, off_t *poffIn, int fdOut, off_t *poffOut, size_t cbChunk, unsigned int fFlags) + { + return syscall(__NR_copy_file_range, fdIn, poffIn, fdOut, poffOut, cbChunk, fFlags); + } +@@ -154,8 +154,8 @@ + do + { + size_t cbThisCopy = (size_t)RT_MIN(cbToCopy - cbCopied, _1G); +- loff_t offThisDst = offSrc + cbCopied; +- loff_t offThisSrc = offDst + cbCopied; ++ off_t offThisDst = offSrc + cbCopied; ++ off_t offThisSrc = offDst + cbCopied; + ssize_t cbActual = MyCopyFileRangeSysCall((int)RTFileToNative(hFileSrc), &offThisSrc, + (int)RTFileToNative(hFileDst), &offThisDst, + cbThisCopy, 0); diff --git a/user/virtualbox-guest-additions/virtualbox-drm-client.initd b/user/virtualbox-guest-additions/virtualbox-drm-client.initd new file mode 100755 index 000000000..894f272b3 --- /dev/null +++ b/user/virtualbox-guest-additions/virtualbox-drm-client.initd @@ -0,0 +1,11 @@ +#!/sbin/openrc-run +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +description="VirtualBox graphical integration service" + +command="/usr/sbin/VBoxDRMClient" +output_log="/var/log/VBoxDRMClient.log" +error_log="/var/log/VBoxDRMClient.log" +pidfile="/var/run/virtualbox-drm-client.pid" +command_background="yes" diff --git a/user/virtualbox-guest-additions/virtualbox-guest-additions-localconfig b/user/virtualbox-guest-additions/virtualbox-guest-additions-localconfig new file mode 100644 index 000000000..38b39f02e --- /dev/null +++ b/user/virtualbox-guest-additions/virtualbox-guest-additions-localconfig @@ -0,0 +1,38 @@ +# -*- 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 := + +## don't build with -Werror +VBOX_WITH_WARNINGS_AS_ERRORS := + +# use system xorg and gl headers +VBOX_USE_SYSTEM_XORG_HEADERS = 1 +VBOX_USE_SYSTEM_GL_HEADERS = 1 + +# no legacy X.org - use KMS +VBOX_NO_LEGACY_XORG_X11 = 1 + +TOOL_YASM_AS := yasm diff --git a/user/virtualbox-guest-additions/virtualbox-guest-additions.initd b/user/virtualbox-guest-additions/virtualbox-guest-additions.initd new file mode 100755 index 000000000..e43092f72 --- /dev/null +++ b/user/virtualbox-guest-additions/virtualbox-guest-additions.initd @@ -0,0 +1,35 @@ +#!/sbin/openrc-run +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +description="VirtualBox control service" + +pidfile="/var/run/vboxguest-service.pid" +command="/usr/sbin/VBoxService" +command_args="--foreground" +start_stop_daemon_args="--make-pidfile --pidfile ${pidfile} --background" + +depend() { + need localmount +} + +start_pre() { + einfo "Loading kernel modules" + /sbin/modprobe vboxguest 2>&1 && \ + /sbin/modprobe vboxsf 2>&1 + eend $? +} + +stop_pre() { + einfo "Unmounting shared folders" + /bin/grep vboxsf /proc/mounts | /usr/bin/cut -f2 -d' ' | /usr/bin/xargs -n1 -r /bin/umount + eend $? +} + +stop_post() { + einfo "Removing kernel modules" + /sbin/modprobe -r vboxsf 2>&1 && \ + /sbin/modprobe -r vboxguest 2>&1 + eend $? +} diff --git a/user/virtualbox-guest-additions/virtualbox-guest-additions.pre-install b/user/virtualbox-guest-additions/virtualbox-guest-additions.pre-install new file mode 100644 index 000000000..272a4d28a --- /dev/null +++ b/user/virtualbox-guest-additions/virtualbox-guest-additions.pre-install @@ -0,0 +1,5 @@ +#!/bin/sh + +groupadd -r -g 201 vboxsf 2>/dev/null + +exit 0 |