1
0
forked from pool/virtualbox

Accepting request 1186452 from home:larryr:branches:Virtualization

VirtualBox 7.0.18 with Oracle's 15.6 patches and all obsolete patches removed

OBS-URL: https://build.opensuse.org/request/show/1186452
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=742
This commit is contained in:
Larry Rainey 2024-07-13 13:17:31 +00:00 committed by Git OBS Bridge
commit a065251386
71 changed files with 13843 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

39
README.autostart Normal file
View File

@ -0,0 +1,39 @@
Prerequisites
=============
Users, that want to use the VirtualBox autostart feature, have to be
members of the vboxusers group.
E.g.:
sudo usermod -aG vboxusers USERNAME
Preparation
===========
For each autostart user, add a section in /etc/vbox/autostart.cfg:
USERNAME = {
allow = true
}
Users work
==========
The *first* time a user configures autostart, the command:
VBoxManage setproperty autostartdbpath /etc/vbox/autostart.d
needs to be run.
Note: The autostart options are stored in the /etc/vbox file, and in the
VM itself. If moving a VM, these options may need to be set again.
Prepare a VM to start automatically:
VBoxManage modifyvm <uuid|vmname> --autostart-enabled on
Choose a shut down mode:
VBoxManage modifyvm <uuid|vmname> --autostop-type <disabled|savestate|poweroff|acpishutdown>
Restart the vboxdrv service to start the VMs in question
sudo service vboxdrv restart
To turn off autostart for a VM
VBoxManage modifyvm <uuid|vmname> --autostart-enabled off

128
README.build Normal file
View File

@ -0,0 +1,128 @@
Instructions for building the VirtualBox project
Although it is possible to modify a project at the openSUSE Build System (OBS),
I have found it to be more convenient to use the various osc commands to create a
local copy, edit it on my own computer to fix any problems, and then push the result
to OBS.
You will need a login account at OBS. This account is also used to login at openSUSE's
bugzilla, etc. Those credentials are also used by osc whose package must also be
installed.
A. Create a new sub-project:
1. Branch the package:
The sources for Tumbleweed and the Leap releases have been merges, thus
development work can be concentrates on TW. To branch VB for Tumbleweed,
osc branch Virtualization virtualbox
2. Checkout the package using the "osc co" command listed
B. For the first time, test Build the project:
1. Use "osc build" to build. This step is rather compute intensive and
takes about an hour on my Toshiba laptop with a dual-core Intel Core i7 CPU
with hyper-threading, 12 GB RAM, and an SSD. This build will create all the
VirtualBox packages except the kernel modules. To build them use "osc build -M kmp",
which takes a lot less time. The split was made to reduce the load on OBS.
Now, a kernel change only requires rebuild of the modules, not the entire package.
2. The build results are stored in the /var/tmp/build-root tree. These files
can occupy a lot of disc space, particularly when one builds several flavors.
To keep from running out of space on the / partition, I mount /var/tmp on
a separate partition. In general, about 25 GB is required for each flavor,
thus the disk usabe can approach 100 GB. If you have plenty of headroom in /,
you can skip this separate partition.
3. Special flavors:
When a new kernel is released, there may be several API changes that affect
builds of the kernel modules used by VirtualBox. In Factory, the project that
contains the latest kernels is "Kernel-HEAD-standard". To run a test build with
this kernel, use the command " osc build --alternative-project Kernel:HEAD standard".
Note: The syntax of this step has changed throughout the years. If it fails, ask
how to do it on the openSUSE Factory mailing list at opensuse-factory@opensuse.org.
When switching between kernel projects, use of the "--clean" switch is advised,
otherwise strange "missing library" messages will result.
4. On occasion, there may be breakage in the build when there is an update of
python or Qt. Use the "--alternative-project=<xxx>" switch to force usage of
the revised component. You will need to ask at factory@lists.opensuse.org to
get the proper profect name.
C. Steps to take with a new release:
1. When Oracle releases a new version, you will need to download the new tarball
from https://download.virtualbox.org/virtualbox/. While downloading the file, I
also get the new UserManual.pdf. I use the wget utility, but the browser could
be used.
2. openSUSE makes some changes to the tarballi, which are done with the command
bash ./virtualbox-patch-source.sh <name of tarball just downloaded>
This script unpacks the tar file, removes Windows and Mac host code from the file,
and recreates the tar file with "patched" in its name. Any further modifications
are made by patches that are applied during the build process. Do NOT make any
further changes to the tar file.
3. Edit the "Version" line near the start of virtualbox.spec to select the new version.
4. Use "osc rm <old_tarball-name>" and "osc add <new_tarball_name>" to get the
new file into osc. The local build will work without these changes, but the remote
operations with OBS will fail.
5. VirtualBox at openSUSE is a multi-build package consisting of virtualbox-kmp and
the rest of virtualbox. The former builds in about 20% of the time needed for the
latter, thus it is best to start with the kmp part.
6. The usual problems are as follows:
a. Fixing for kernel API changes are incorporated in a new release, thus our patch
is obsolete.
b. Oracle has revised their code such that one of the patches needed by openSUSE
fails to apply.
c. There are kernel API changes that break the building of the kmp part of VB.
5. When fixing kernel API changes, keep in mind that Oracle will be 2-3 months behind
your needs; however, they will eventually include the necessary changes in their
distribution. If you find something that you do not know how to fix, you could file
a bug tracker at https://www.virtualbox.org/wiki/Bugtracker. Note that previous
reports have gotten the response "We do not support kernel X.Y" - a really helpful
response. To be able to back out your changes, create a new patch file for the
updates. An OBS or osc build will unpack the "patched" tarball and apply the patches.
To help in the creation of such patches, it is my practice to untar the tarball and
use quilt to create the necessary patch, refresh it, and then copy it back into the
main directory. At that point it can be added into the spec file. The utility
wiggle is useful in fixing patches that will not apply.
6. Once the kmp modules, and the main part of VirtualBox are building correctly with
osc, use 'osc status' to indicate the file changes. Anything with a "?" as its status
is a new file that needs to be resolved. If these files are not added to the project,
they will not be uploaded to OBS. You should also remove any files made obsolete
because Oracle caught up with kernel API changes. At this point, the new release
should be tested by adding the directory
/var/tmp/build-root/.../home/abuild/rpmbuild/RPMS/x86_64
to the list of repositories, and updating virtualbox from that new repository. These
packages will not be signed, thus you will get a warning that can be ignored. Be sure
to install virtualbox-host-source, as well as kernel-default-devel and kernel-devel
for the kernel you are running. After loading the updated packages, then run
'sudo /lib/sbin/vboxconfig' to build and install the kernel modules.
7. The new code can now be tested. Usually, the tests will not show any problems;
however, there was a version where Windows 7 failed to boot because of a virtual
BIOS change. With kernel 5.18, there was a major bug where the FPU was not being
saved. The symptoms ranged from application crashes in a Linux VM to a full virtual
machine crash in a Windows 10 VM. The patch for this problem was provided by Oracle,
only a few days before kernel 5.18.1 was released and added to Tumbleweed. Obviously,
both Windows and Linux systems should be tested to ensure that screen resizing,
bidirectional clipboard, and shared folders work with no crashes.
8. Once the new release is tested and 'osc status' is clean, it is time to update the
changes file using the 'osc vc' command. I copy and paste the changes listed in
the Oracle release notes to the new entry and add references to any bugzilla entries.
In this section, it is essential that you list files that are deleted or added. It is
not necessary to mention the tarball change - it is implied.
9. Now it is time to send the new material to OBS using the 'osc ci' command. The
material in the new section usually appears as the commit message. If not, copy it
from the .changes file. Committing new material will trigger builds at OBS. The
status of them can be seen with the 'osc r' command. Once the builds are successful,
they should be submitted using the 'osc sr' for Tumbleweed. One peculiarity of the
factory releases is that they require a review, even for your own changes. A few
minutes after an osc sr command, you will need to log into OBS and check your
tasks for “Outgoing Requests”. From there, you will be able to submit a review.
10. After VirtualBox is completed for Tumbleweed, and building OK on the various Leap
versions at OBS, you can branch the various Leap versions with the command
osc branch openSUSE:Leap:15.X:Update virtualbox
It is not necessary to check out the code as creating the directory that will
be used. If it already exists on your system, delete all files in that directory.
Then copy all the files from the Tumbleweed source into the Leap directory. To
syncronize your system wuth OBS, do an "osc update". At this point, you will
need to repeat the "osc rm" and "osc add" steps to update the version of the
tarball. After that, make sure that "osc status" is clean. At that point, update
the package at OBS with "osc ci". When "osc r" shows that the build has completed,
use "osc mr" to submit it to the project. For the update projects, no review by
the maintainer is requied.
11. When a new Leap release is in a pre-release state, updated VB releases can be
sent to that project from OBS.

3
UserManual.pdf Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:23271ffe5f6141af3be22359c65ec73ce784286a60795f445c5353c8a43a0c69
size 4600053

View File

@ -0,0 +1,23 @@
Index: VirtualBox-7.0.14/src/VBox/Additions/x11/Installer/98vboxadd-xclient
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/x11/Installer/98vboxadd-xclient
+++ VirtualBox-7.0.14/src/VBox/Additions/x11/Installer/98vboxadd-xclient
@@ -31,15 +31,9 @@ for i in $HOME/.vboxclient-*.pid; do
test -w $i || rm -f $i
done
-if ! test -c /dev/vboxguest 2>/dev/null; then
- # Do not start if the kernel module is not present.
- # Execute notify-send in the back-ground to avoid racing with sddm,
- # as notify-send may wait for sddm to start while it waits for us to exit.
- notify-send "VBoxClient: the VirtualBox kernel service is not running. Exiting." &
-elif test -z "${SSH_CONNECTION}"; then
- # This script can also be triggered by a connection over SSH, which is not
- # what we had in mind, so we do not start VBoxClient in that case. We do
- # not use "exit" here as this script is "source"d, not executed.
+# Do not start if the kernel module is not present; or if this script is
+# triggered by a connection over SSH.
+if [ -c /dev/vboxguest -a -z "${SSH_CONNECTION}" ]; then
/usr/bin/VBoxClient --clipboard
/usr/bin/VBoxClient --checkhostversion
/usr/bin/VBoxClient --seamless

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ee3266e4fda1638efaaafd1b6b58c4327c940ff1f3a9605f5292b8393e311742
size 156466139

21
VirtualBox.appdata.xml Normal file
View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>virtualbox.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0-or-later</project_license>
<name>VirtualBox</name>
<summary>Virtual Machine client</summary>
<description>
<p>
VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use.
</p>
</description>
<url type="homepage">https://www.virtualbox.org/</url>
<url type="bugtracker">https://www.virtualbox.org/wiki/Bugtracker</url>
<url type="help">https://www.virtualbox.org/manual</url>
<screenshots>
<screenshot type="default">
<image>https://www.virtualbox.org/attachment/wiki/Screenshots/OpenSuse13.2_on_Windows_7.png</image>
</screenshot>
</screenshots>
</component>

11
_constraints Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0"?>
<constraints>
<hardware>
<physicalmemory>
<size unit="M">8000</size>
</physicalmemory>
<disk>
<size unit="G">9</size>
</disk>
</hardware>
</constraints>

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<flavor>kmp</flavor>
</multibuild>

5
_service Normal file
View File

@ -0,0 +1,5 @@
<services>
<service name="refresh_patches" mode="disabled">
<param name="changesgenerate">enable</param>
</service>
</services>

View File

@ -0,0 +1,24 @@
Index: VirtualBox-7.0.14/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.cpp
+++ VirtualBox-7.0.14/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.cpp
@@ -28,6 +28,7 @@
/* Qt includes: */
#include <QApplication>
#include <QLabel>
+#include <QPainterPath>
#include <QPaintEvent>
#include <QStyle>
#include <QVBoxLayout>
Index: VirtualBox-7.0.14/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.h
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.h
+++ VirtualBox-7.0.14/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.h
@@ -47,7 +47,6 @@ class QIcon;
class QLabel;
class QMouseEvent;
class QObject;
-class QPainterPath;
class QPaintEvent;
class QResizeEvent;
class QString;

View File

@ -0,0 +1,28 @@
Index: VirtualBox-7.0.14/src/VBox/HostDrivers/Support/SUPDrvGip.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/HostDrivers/Support/SUPDrvGip.cpp
+++ VirtualBox-7.0.14/src/VBox/HostDrivers/Support/SUPDrvGip.cpp
@@ -4537,9 +4537,11 @@ static int supdrvTscDeltaThreadWait(PSUP
*/
static void supdrvTscDeltaThreadStartMeasurement(PSUPDRVDEVEXT pDevExt, bool fForceAll)
{
+ if (!pDevExt || ! pDevExt->hTscDeltaSpinlock)
+ return;
+ RTSpinlockAcquire(pDevExt->hTscDeltaSpinlock);
if (pDevExt->hTscDeltaThread != NIL_RTTHREAD)
{
- RTSpinlockAcquire(pDevExt->hTscDeltaSpinlock);
if ( pDevExt->enmTscDeltaThreadState == kTscDeltaThreadState_Listening
|| pDevExt->enmTscDeltaThreadState == kTscDeltaThreadState_Measuring)
{
@@ -4550,9 +4552,9 @@ static void supdrvTscDeltaThreadStartMea
else if ( pDevExt->enmTscDeltaThreadState == kTscDeltaThreadState_WaitAndMeasure
&& fForceAll)
pDevExt->fTscThreadRecomputeAllDeltas = true;
- RTSpinlockRelease(pDevExt->hTscDeltaSpinlock);
RTThreadUserSignal(pDevExt->hTscDeltaThread);
}
+ RTSpinlockRelease(pDevExt->hTscDeltaSpinlock);
}

View File

@ -0,0 +1,13 @@
Index: VirtualBox-7.0.14/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.c
+++ VirtualBox-7.0.14/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.c
@@ -140,7 +140,7 @@ static struct vboxguest_module_info g_VB
RTMemAllocExTag,
RTMemContAlloc,
RTMemContFree,
- RTMemFreeEx,
+ RTMemFreeExG,
RTMpIsCpuPossible,
RTMpNotificationDeregister,
RTMpNotificationRegister,

16
fix_for_leap15.5.patch Normal file
View File

@ -0,0 +1,16 @@
Index: VirtualBox-7.0.14/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
+++ VirtualBox-7.0.14/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
+# if defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 15 && CONFIG_SUSE_PATCHLEVEL == 5
+# define OPENSUSE_155
@@ -710,7 +710,7 @@ static const char *keyModToStr(unsigned
RT_CASE_RET_STR(KMOD_NUM);
RT_CASE_RET_STR(KMOD_CAPS);
RT_CASE_RET_STR(KMOD_MODE);
- RT_CASE_RET_STR(KMOD_SCROLL);
+ RT_CASE_RET_STR(KMOD_RESERVED);
default:
break;
}
+# endif

92
fix_sdl_build.patch Normal file
View File

@ -0,0 +1,92 @@
Index: VirtualBox-7.0.18/configure
===================================================================
--- VirtualBox-7.0.18.orig/configure
+++ VirtualBox-7.0.18/configure
@@ -1186,21 +1186,19 @@ check_sdl()
fail
fi
else
- if which_wrapper sdl-config > /dev/null; then
- FLGSDL=`sdl-config --cflags`
+ FLGSDL="-I/usr/include/SDL2 -D_GNU_SOURCE=1 -D_REENTRANT"
INCSDL=`strip_I "$FLGSDL"`
- LIBSDL=`sdl-config --libs`
+ LIBSDL="-L/usr/lib64 -LSDL2"
LIBSDLMAIN="-lSDLmain"
FLDSDL=
foundsdl=1
- fi
fi
[ "$OS" = "linux" -o "$OS" = "darwin" -o "$OS" = "solaris" ] && LIBSDLMAIN=""
if [ -n "$foundsdl" ]; then
cat > $ODIR.tmp_src.cc << EOF
#include <cstdio>
#include <SDL.h>
-#include <SDL_main.h>
+//#include <SDL_main.h>
#undef main
extern "C" int main(int argc, char** argv)
{
@@ -1216,7 +1214,7 @@ extern "C" int main(int argc, char** arg
}
EOF
[ -n "$INCSDL" ] && I_INCSDL=`prefix_I "$INCSDL"`
- if test_compile "$LIBSDL $LIBSDLMAIN $I_INCSDL $FLDSDL" SDL SDL; then
+ if test_compile "$LIBSDL $LIBSDLMAIN $I_INCSDL $FLDSDL" SDL2 SDL2; then
if test_execute; then
cnf_append "LIB_SDK_LIBSDL_SDL" "`strip_l "$LIBSDL"`"
cnf_append "SDK_LIBSDL_LIBPATH" "`strip_L "$LIBSDL"`"
@@ -3010,11 +3008,8 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then
[ $WITH_LIBLZMA -eq 1 ] && check_liblzma
[ "$OS" != "darwin" ] && check_png
[ $OSE -eq 0 -a "$OS" = "linux" ] && check_pam
- if [ $WITH_SDL -eq 1 ]; then
- check_sdl
- else
- cnf_append "VBOX_WITH_VBOXSDL" ""
- fi
+ check_sdl
+ cnf_append "VBOX_WITH_VBOXSDL" "1"
[ $WITH_SDL_TTF -eq 1 -a $OSE -eq 0 ] && check_sdl_ttf
[ $WITH_X11 -eq 1 ] && check_x
# TODO check for xcomposite-dev (X11/extensions/Xcomposite.h, additions only)
Index: VirtualBox-7.0.18/src/VBox/Frontends/VBoxSDL/Makefile.kmk
===================================================================
--- VirtualBox-7.0.18.orig/src/VBox/Frontends/VBoxSDL/Makefile.kmk
+++ VirtualBox-7.0.18/src/VBox/Frontends/VBoxSDL/Makefile.kmk
@@ -51,7 +51,7 @@ if !defined(VBOX_WITH_HARDENING) || "$(K
PROGRAMS += VBoxSDL
endif
VBoxSDL_TEMPLATE := $(if $(VBOX_WITH_HARDENING),VBoxMainClientDll,VBoxMainClientExe)
- VBoxSDL_SDKS = LIBSDL2
+ VBoxSDL_SDKS = LIBSDL
VBoxSDL_SOURCES = \
VBoxSDL.cpp \
Framebuffer.cpp \
@@ -81,7 +81,7 @@ if !defined(VBOX_WITH_HARDENING) || "$(K
endif
ifn1of ($(KBUILD_TARGET), solaris) # Probably wrong with SDL2
VBoxSDL_LIBS = \
- $(LIB_SDK_LIBSDL2_SDLMAIN)
+ $(LIB_SDK_LIBSDL_SDLMAIN)
endif
if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris) # X11
VBoxSDL_LIBS += \
@@ -121,7 +121,7 @@ if !defined(VBOX_WITH_HARDENING) || "$(K
if 0
PROGRAMS += tstSDL
tstSDL_TEMPLATE = VBoxR3TstExe
- tstSDL_SDKS = LIBSDL2
+ tstSDL_SDKS = LIBSDL
tstSDL_INST = $(INST_TESTCASE)
tstSDL_SOURCES = \
VBoxSDLTest.cpp
@@ -138,7 +138,7 @@ if !defined(VBOX_WITH_HARDENING) || "$(K
$(LIB_RUNTIME)
ifn1of ($(KBUILD_TARGET), solaris)
tstSDL_LIBS += \
- $(LIB_SDK_LIBSDL2_SDLMAIN)
+ $(LIB_SDK_LIBSDL_SDLMAIN)
endif
ifdef VBOX_OPENGL

7
fix_usb_rules.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
# script to disable USB passthru in /etc/udev/rules.d/60-vboxdrv.rules
# if already disabled, clear the comment character
sed -i 's/#SUBSYSTEM==\"usb/SUBSYSTEM==\"usb/' /usr/lib/udev/rules.d/60-vboxdrv.rules
# now comment the usb lines
sed -i 's/SUBSYSTEM==\"usb/#SUBSYSTEM==\"usb/' /usr/lib/udev/rules.d/60-vboxdrv.rules

26
fixes_for_gcc13.patch Normal file
View File

@ -0,0 +1,26 @@
Index: VirtualBox-7.0.18/src/libs/dxvk-native-1.9.2a/src/util/util_bit.h
===================================================================
--- VirtualBox-7.0.18.orig/src/libs/dxvk-native-1.9.2a/src/util/util_bit.h
+++ VirtualBox-7.0.18/src/libs/dxvk-native-1.9.2a/src/util/util_bit.h
@@ -13,6 +13,7 @@
#include <intrin.h>
#endif
+#include <cstdint>
#include "util_likely.h"
#include "util_math.h"
Index: VirtualBox-7.0.18/src/VBox/Additions/x11/x11include/XFree86-4.3/Xserver/misc.h
===================================================================
--- VirtualBox-7.0.18.orig/src/VBox/Additions/x11/x11include/XFree86-4.3/Xserver/misc.h
+++ VirtualBox-7.0.18/src/VBox/Additions/x11/x11include/XFree86-4.3/Xserver/misc.h
@@ -66,6 +66,9 @@ TORTIOUS ACTION, ARISING OUT OF OR IN CO
OF THIS SOFTWARE.
******************************************************************/
+
+#define __STDC_HOSTED__ 1
+
/* $Xorg: misc.h,v 1.5 2001/02/09 02:05:15 xorgcvs Exp $ */
#ifndef MISC_H
#define MISC_H 1

516
fixes_for_leap.patch Normal file
View File

@ -0,0 +1,516 @@
Index: VirtualBox-7.0.14/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
+++ VirtualBox-7.0.14/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
@@ -89,6 +89,17 @@
#define VBOXNETFLT_OS_SPECFIC 1
#include "../VBoxNetFltInternal.h"
+# if defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 15 && CONFIG_SUSE_PATCHLEVEL == 6
+# define OPENSUSE_156
+# endif
+# if defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 15 && CONFIG_SUSE_PATCHLEVEL == 5
+# define OPENSUSE_155
+# endif
+
+#if RTLNX_SUSE_MAJ_PREREQ(15, 6)
+#include <net/gso.h>
+#endif
+
typedef struct VBOXNETFLTNOTIFIER {
struct notifier_block Notifier;
PVBOXNETFLTINS pThis;
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_drv.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/drm/vbox_drv.c
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_drv.c
@@ -39,6 +39,7 @@
#include "vbox_drv.h"
#include <drm/drm_crtc_helper.h>
+
#if RTLNX_VER_MIN(5,1,0) || RTLNX_RHEL_MAJ_PREREQ(8,1)
# include <drm/drm_probe_helper.h>
#endif
@@ -342,12 +343,15 @@ static void vbox_master_drop(struct drm_
}
static struct drm_driver driver = {
-#if RTLNX_VER_MAX(5,4,0) && !RTLNX_RHEL_MAJ_PREREQ(8,3) && !RTLNX_SUSE_MAJ_PREREQ(15,3)
- .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ |
+#if RTLNX_VER_MAX(5,4,0)
+ .driver_features =
+#if defined(OPENSUSE_152)
+ DRIVER_PRIME |
+#endif
# if RTLNX_VER_MAX(5,1,0) && !RTLNX_RHEL_MAJ_PREREQ(8,1)
DRIVER_IRQ_SHARED |
# endif
- DRIVER_PRIME,
+ DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ,
#else /* >= 5.4.0 && RHEL >= 8.3 && SLES >= 15-SP3 */
.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ,
#endif /* < 5.4.0 */
@@ -395,7 +399,7 @@ static struct drm_driver driver = {
#endif
.gem_prime_import = drm_gem_prime_import,
.gem_prime_import_sg_table = vbox_gem_prime_import_sg_table,
-#if RTLNX_VER_MAX(6,6,0) && !RTLNX_RHEL_RANGE(9,4, 9,99)
+#if RTLNX_VER_MAX(6,4,0) && !RTLNX_RHEL_RANGE(9,4, 9,99)
.gem_prime_mmap = vbox_gem_prime_mmap,
#endif
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_main.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/drm/vbox_main.c
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_main.c
@@ -663,8 +663,12 @@ static inline u64 vbox_bo_mmap_offset(st
#elif RTLNX_VER_MAX(3,12,0) && !RTLNX_RHEL_MAJ_PREREQ(7,0)
return bo->bo.addr_space_offset;
#else
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
+ return drm_vma_node_offset_addr(&bo->bo.base.vma_node);
+#else
return drm_vma_node_offset_addr(&bo->bo.vma_node);
#endif /* >= 5.4.0 */
+#endif
}
int
Index: VirtualBox-7.0.14/include/iprt/cdefs.h
===================================================================
--- VirtualBox-7.0.14.orig/include/iprt/cdefs.h
+++ VirtualBox-7.0.14/include/iprt/cdefs.h
@@ -1399,14 +1399,15 @@
#if RT_CLANG_PREREQ(4, 0) && RT_CPLUSPLUS_PREREQ(201100)
# define RT_FALL_THROUGH() [[clang::fallthrough]]
#elif RT_CLANG_PREREQ(12, 0) || RT_GNUC_PREREQ(7, 0)
-# define RT_FALL_THROUGH() __attribute__((__fallthrough__))
+# define FALL_THROUGH __attribute__((__fallthrough__))
#else
-# define RT_FALL_THROUGH() (void)0
+# define FALL_THROUGH (void)0
#endif
/** @def RT_FALL_THRU
* Tell the compiler that we're falling thru to the next case in a switch.
* @sa RT_FALL_THROUGH */
-#define RT_FALL_THRU() RT_FALL_THROUGH()
+#define RT_FALL_THRU() FALL_THROUGH
+#define RT_FALL_THROUGH() FALL_THROUGH
/** @def RT_IPRT_FORMAT_ATTR
Index: VirtualBox-7.0.14/kBuild/header.kmk
===================================================================
--- VirtualBox-7.0.14.orig/kBuild/header.kmk
+++ VirtualBox-7.0.14/kBuild/header.kmk
@@ -764,7 +764,7 @@ RMDIR_EXT := $(KBUILD_BIN_PATH)/kmk_rm
RMDIR_INT := kmk_builtin_rmdir
RMDIR := $(RMDIR_INT)
-SED_EXT := $(KBUILD_BIN_PATH)/kmk_sed$(HOSTSUFF_EXE)
+SED_EXT := /usr/bin/kmk_sed$(HOSTSUFF_EXE)
SED_INT := $(SED_EXT)
SED := $(SED_EXT)
Index: VirtualBox-7.0.14/configure
===================================================================
--- VirtualBox-7.0.14.orig/configure
+++ VirtualBox-7.0.14/configure
@@ -2039,7 +2039,7 @@ check_kbuild()
fi
echo "export KBUILD_PATH KBUILD_DEVTOOLS PATH" >> $ENV
echo "unset path_kbuild_bin path_tools_bin" >> $ENV
- KBUILD_SED="$KBUILDDIR_BIN/kmk_sed"
+ KBUILD_SED="/usr/bin/kmk_sed"
echo '' >> $ENV
echo "# Legacy - do not use:" >> $ENV
@@ -2049,7 +2049,7 @@ check_kbuild()
echo '' >> $ENV
elif check_avail "kmk" KBUILDDIR really; then
# check for installed kBuild
- KBUILD_SED="`which_wrapper kmk_sed`"
+ KBUILD_SED="/usr/bin/kmk_sed"
else
fail
fi
Index: VirtualBox-7.0.14/tools/bin/backport-commit.sh
===================================================================
--- VirtualBox-7.0.14.orig/tools/bin/backport-commit.sh
+++ VirtualBox-7.0.14/tools/bin/backport-commit.sh
@@ -29,7 +29,7 @@
#
# Determin script dir so we can source the common bits.
#
-MY_SED=kmk_sed
+MY_SED=/usr/bin/kmk_sed
MY_SCRIPT_DIR=`echo "$0" | "${MY_SED}" -e 's|\\\|/|g' -e 's|^\(.*\)/[^/][^/]*$|\1|'` # \ -> / is for windows.
if test "${MY_SCRIPT_DIR}" = "$0"; then
MY_SCRIPT_DIR=`pwd -L`
Index: VirtualBox-7.0.14/tools/bin/backport-common.sh
===================================================================
--- VirtualBox-7.0.14.orig/tools/bin/backport-common.sh
+++ VirtualBox-7.0.14/tools/bin/backport-common.sh
@@ -1,4 +1,4 @@
-# $Id: backport-common.sh $
+ $Id: backport-common.sh $
## @file
# Common backport script bits.
#
@@ -33,7 +33,7 @@
MY_PRINTF=kmk_printf
MY_RM=kmk_rm
MY_SVN=svn
- MY_SED=kmk_sed
+ MY_SED=/usr/bin/kmk_sed
#
# Functions.
Index: VirtualBox-7.0.14/tools/bin/backport-merge-and-commit.sh
===================================================================
--- VirtualBox-7.0.14.orig/tools/bin/backport-merge-and-commit.sh
+++ VirtualBox-7.0.14/tools/bin/backport-merge-and-commit.sh
@@ -29,7 +29,7 @@
#
# Determin script dir so we can invoke the two worker scripts.
#
-MY_SED=kmk_sed
+MY_SED=/usr/bin/kmk_sed
MY_SCRIPT_DIR=`echo "$0" | "${MY_SED}" -e 's|\\\|/|g' -e 's|^\(.*\)/[^/][^/]*$|\1|'` # \ -> / is for windows.
if test "${MY_SCRIPT_DIR}" = "$0"; then
MY_SCRIPT_DIR=`pwd -L`
Index: VirtualBox-7.0.14/tools/bin/backport-merge.sh
===================================================================
--- VirtualBox-7.0.14.orig/tools/bin/backport-merge.sh
+++ VirtualBox-7.0.14/tools/bin/backport-merge.sh
@@ -29,7 +29,7 @@
#
# Determin script dir so we can source the common bits.
#
-MY_SED=kmk_sed
+MY_SED=/usr/bin/kmk_sed
MY_SCRIPT_DIR=`echo "$0" | "${MY_SED}" -e 's|\\\|/|g' -e 's|^\(.*\)/[^/][^/]*$|\1|'` # \ -> / is for windows.
if test "${MY_SCRIPT_DIR}" = "$0"; then
MY_SCRIPT_DIR=`pwd -L`
Index: VirtualBox-7.0.14/src/VBox/Main/Makefile.kmk
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Main/Makefile.kmk
+++ VirtualBox-7.0.14/src/VBox/Main/Makefile.kmk
@@ -264,7 +264,7 @@ $(VBOX_XIDL_FILE).ts +| $(VBOX_XIDL_FILE
| $$(dir $$@)
$(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
$(QUIET)$(VBOX_XSLTPROC) -o $(VBOX_XIDL_FILE).ts-tmp $(VBOX_PATH_MAIN_SRC)/idl/docstrip.xsl $(VBOX_XIDL_FILE_SRC)
- $(QUIET)$(SED) -e 's/ *$(DOLLAR)//g' -e '/^$(DOLLAR)/d' --output $(VBOX_XIDL_FILE).ts $(VBOX_XIDL_FILE).ts-tmp
+ /usr/bin/kmk_sed -e 's/ *$(DOLLAR)//g' -e '/^$(DOLLAR)/d' --output $(VBOX_XIDL_FILE).ts $(VBOX_XIDL_FILE).ts-tmp
$(QUIET)$(RM) -- $(VBOX_XIDL_FILE).ts-tmp
$(QUIET)$(CP) --changed -fv -- $(VBOX_XIDL_FILE).ts $(VBOX_XIDL_FILE)
Index: VirtualBox-7.0.14/src/VBox/Runtime/Makefile.kmk
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Runtime/Makefile.kmk
+++ VirtualBox-7.0.14/src/VBox/Runtime/Makefile.kmk
@@ -4421,6 +4421,7 @@ $(foreach lib,RuntimeR3 RuntimeBldProg V
#
# Generate the status code data.
#
+SED = "/usr/bin/kmk_sed"
$(IPRT_OUT_DIR)/errmsgdata.h: \
$(VBOX_PATH_RUNTIME_SRC)/common/err/errmsg.sed \
$(PATH_ROOT)/include/iprt/err.h \
Index: VirtualBox-7.0.14/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
+++ VirtualBox-7.0.14/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
@@ -147,9 +147,9 @@
#include <linux/interrupt.h>
#include <linux/completion.h>
#include <linux/compiler.h>
-#if RTLNX_VER_MIN(5,9,0) || RTLNX_SUSE_MAJ_PREREQ(15,3) /* linux/fs.h defined HAVE_UNLOCKED_IOCTL from 2.6.11 up to 5.9 (also 5.3.18-56 in SLES15-SP3), when it became an implicit assumption. */
+//#if RTLNX_VER_MIN(5,9,0) || RTLNX_SUSE_MAJ_PREREQ(15,3) /* linux/fs.h defined HAVE_UNLOCKED_IOCTL from 2.6.11 up to 5.9 (also 5.3.18-56 in SLES15-SP3), when it became an implicit assumption. */
# define HAVE_UNLOCKED_IOCTL 1 /* We use this in a couple of places, so for now just define it for 5.9+ too. */
-#endif
+//#endif
#if !defined(HAVE_UNLOCKED_IOCTL) && RTLNX_VER_MAX(2,6,38)
# include <linux/smp_lock.h>
#endif
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/python/src/PyXPCOM.h
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/python/src/PyXPCOM.h
+++ VirtualBox-7.0.14/src/libs/xpcom18a4/python/src/PyXPCOM.h
@@ -191,7 +191,7 @@ extern "C" PyAPI_FUNC(const char *) PyUn
# endif
/* PyUnicode_AsUTF8 is just PyUnicode_AsUTF8AndSize without returning a size. */
-# define PyUnicode_AsUTF8(o) PyUnicode_AsUTF8AndSize(o, NULL)
+// # define PyUnicode_AsUTF8(o) (const char *)PyUnicode_AsUTF8AndSize(o, NULL)
DECLINLINE(int) PyRun_SimpleString(const char *pszCode)
{
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/python/src/ErrorUtils.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/python/src/ErrorUtils.cpp
+++ VirtualBox-7.0.14/src/libs/xpcom18a4/python/src/ErrorUtils.cpp
@@ -121,7 +121,7 @@ void DoLogMessage(const char *methodName
#if PY_MAJOR_VERSION <= 2
c += PyString_AsString(repr);
#else
- c += PyUnicode_AsUTF8(repr);
+ c += PyUnicode_AsUTF8AndSize(repr, NULL);
#endif
Py_DECREF(repr);
}
@@ -203,7 +203,7 @@ PRBool PyXPCOM_FormatGivenException(nsCS
#if PY_MAJOR_VERSION <= 2
streamout += PyString_AsString(temp);
#else
- streamout += PyUnicode_AsUTF8(temp);
+ streamout += PyUnicode_AsUTF8AndSize(temp, NULL);
#endif
Py_DECREF(temp);
} else
@@ -215,7 +215,7 @@ PRBool PyXPCOM_FormatGivenException(nsCS
#if PY_MAJOR_VERSION <= 2
streamout += PyString_AsString(temp);
#else
- streamout += PyUnicode_AsUTF8(temp);
+ streamout += PyUnicode_AsUTF8AndSize(temp, NULL);
#endif
Py_DECREF(temp);
} else
@@ -440,10 +440,10 @@ char *PyTraceback_AsString(PyObject *exc
#if PY_MAJOR_VERSION <= 2
char *tempResult = (char *)PyString_AsString(obResult);
#elif PY_MINOR_VERSION <= 6
- char *tempResult = (char *)PyUnicode_AsUTF8(obResult);
+ char *tempResult = (char *)PyUnicode_AsUTF8AndSize(obResult, NULL);
#else
/* PyUnicode_AsUTF8() is const char * as of Python 3.7, char * earlier. */
- const char *tempResult = (const char *)PyUnicode_AsUTF8(obResult);
+ const char *tempResult = (const char *)PyUnicode_AsUTF8AndSize(obResult, NULL);
#endif
result = (char *)PyMem_Malloc(strlen(tempResult)+1);
if (result==NULL)
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/python/src/PyGBase.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/python/src/PyGBase.cpp
+++ VirtualBox-7.0.14/src/libs/xpcom18a4/python/src/PyGBase.cpp
@@ -117,7 +117,7 @@ PyG_Base::PyG_Base(PyObject *instance, c
#if PY_MAJOR_VERSION <= 2
szRepr = PyString_AsString(r);
#else
- szRepr = PyUnicode_AsUTF8(r);
+ szRepr = PyUnicode_AsUTF8AndSize(r, NULL);
#endif
if (szRepr==NULL) szRepr = "";
int reprOffset = *szRepr=='<' ? 1 : 0;
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/python/src/PyIID.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/python/src/PyIID.cpp
+++ VirtualBox-7.0.14/src/libs/xpcom18a4/python/src/PyIID.cpp
@@ -137,7 +137,7 @@ Py_nsIID::IIDFromPyObject(PyObject *ob,
ok = iid.Parse(PyString_AsString(ob));
#else
if (PyUnicode_Check(ob)) {
- ok = iid.Parse(PyUnicode_AsUTF8(ob));
+ ok = iid.Parse(PyUnicode_AsUTF8AndSize(ob, NULL));
#endif
if (!ok) {
PyXPCOM_BuildPyException(NS_ERROR_ILLEGAL_VALUE);
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/python/src/VariantUtils.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/python/src/VariantUtils.cpp
+++ VirtualBox-7.0.14/src/libs/xpcom18a4/python/src/VariantUtils.cpp
@@ -141,7 +141,7 @@ PyObject *PyObject_FromNSString( const n
#if PY_MAJOR_VERSION <= 2
char* dest = (char *)PyString_AS_STRING(ret);
#else
- char* dest = (char *)PyUnicode_AsUTF8(ret);
+ char* dest = (char *)PyUnicode_AsUTF8AndSize(ret, NULL);
#endif
copy_string(s.BeginReading(fromBegin), s.EndReading(fromEnd), dest);
}
@@ -393,7 +393,7 @@ PRBool FillSingleArray(void *array_ptr,
#if PY_MAJOR_VERSION <= 2
sequence_ob = PyObject_Str(sequence_ob);
#else
- sequence_ob = PyUnicode_AsUTF8String(sequence_ob);
+ sequence_ob = (PyObject *)PyUnicode_AsUTF8AndSize(sequence_ob, NULL);
#endif
} else
release_seq = PR_FALSE;
@@ -402,7 +402,7 @@ PRBool FillSingleArray(void *array_ptr,
#if PY_MAJOR_VERSION <= 2
memcpy(pthis, PyString_AS_STRING(sequence_ob), sequence_size);
#else
- memcpy(pthis, PyUnicode_AsUTF8(sequence_ob), sequence_size);
+ memcpy(pthis, PyUnicode_AsUTF8AndSize(sequence_ob, NULL), sequence_size);
#endif
if (release_seq)
{
@@ -477,7 +477,7 @@ PRBool FillSingleArray(void *array_ptr,
PyErr_SetString(PyExc_TypeError, "This parameter must be a unicode object");
BREAK_FALSE;
}
- FILL_SIMPLE_POINTER( char, *PyUnicode_AsUTF8(val) );
+ FILL_SIMPLE_POINTER( char, *PyUnicode_AsUTF8AndSize(val, NULL) );
#endif
break;
@@ -549,7 +549,7 @@ PRBool FillSingleArray(void *array_ptr,
PyErr_SetString(PyExc_TypeError, "This parameter must be a unicode object");
BREAK_FALSE;
}
- if ((val_use = PyUnicode_AsUTF8String(val))==NULL)
+ if ((val_use = (PyObject *)PyUnicode_AsUTF8AndSize(val, NULL))==NULL)
BREAK_FALSE;
const char *sz = PyBytes_AS_STRING(val_use);
Index: VirtualBox-7.0.14/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
+++ VirtualBox-7.0.14/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
@@ -710,7 +710,7 @@ static const char *keyModToStr(unsigned
RT_CASE_RET_STR(KMOD_NUM);
RT_CASE_RET_STR(KMOD_CAPS);
RT_CASE_RET_STR(KMOD_MODE);
- RT_CASE_RET_STR(KMOD_SCROLL);
+ RT_CASE_RET_STR(KMOD_RESERVED);
default:
break;
}
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_drv.h
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/drm/vbox_drv.h
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_drv.h
@@ -39,6 +39,7 @@
# pragma once
#endif
+
#include <linux/version.h>
/* iprt/linux/version.h copy - start */
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_ttm.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/drm/vbox_ttm.c
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_ttm.c
@@ -38,6 +38,10 @@
# include <drm/ttm/ttm_tt.h>
#endif
+# if defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 15 && CONFIG_SUSE_PATCHLEVEL == 5
+# define OPENSUSE_155
+# endif
+
#if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_MAJ_PREREQ(8,5)
# include <drm/drm_gem.h>
# include <drm/drm_gem_ttm_helper.h>
@@ -330,11 +334,9 @@ static struct ttm_tt *vbox_ttm_tt_create
#else
if (ttm_tt_init(tt, bdev, size, page_flags, dummy_read_page)) {
#endif
-
kfree(tt);
return NULL;
}
-
return tt;
}
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_fb.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/drm/vbox_fb.c
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_fb.c
@@ -47,6 +47,7 @@
#include <drm/drm_crtc.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_crtc_helper.h>
+#include <drm/drm_framebuffer.h>
#include <VBoxVideo.h>
@@ -196,7 +197,7 @@ static struct fb_ops vboxfb_ops = {
.owner = THIS_MODULE,
.fb_check_var = drm_fb_helper_check_var,
.fb_set_par = drm_fb_helper_set_par,
-#if RTLNX_VER_MIN(6,5,0) || RTLNX_RHEL_RANGE(9,4, 9,99)
+#if RTLNX_VER_MIN(6, 4, 0) || RTLNX_RHEL_RANGE(9,4, 9,99)
.fb_read = fb_sys_read,
.fb_write = fb_sys_write,
.fb_fillrect = sys_fillrect,
@@ -351,7 +352,7 @@ static int vboxfb_create(struct drm_fb_h
* The last flag forces a mode set on VT switches even if the kernel
* does not think it is needed.
*/
-#if RTLNX_VER_MIN(6,6,0)
+#if RTLNX_VER_MIN(6,4,0)
info->flags = FBINFO_MISC_ALWAYS_SETPAR;
#else
info->flags = FBINFO_DEFAULT | FBINFO_MISC_ALWAYS_SETPAR;
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_mode.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/drm/vbox_mode.c
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_mode.c
@@ -53,6 +53,7 @@
#if RTLNX_VER_MIN(6,0,0) || RTLNX_RHEL_RANGE(8,8, 8,99) || RTLNX_RHEL_MAJ_PREREQ(9,2) || RTLNX_SUSE_MAJ_PREREQ(15,5)
# include <drm/drm_edid.h>
#endif
+#include <drm/drm_edid.h>
#include "VBoxVideo.h"
Index: VirtualBox-7.0.14/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
+++ VirtualBox-7.0.14/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
@@ -77,7 +77,7 @@
#define VBOXNETADP_FROM_IFACE(iface) ((PVBOXNETADP) ifnet_softc(iface))
/** Set netdev MAC address. */
-#if RTLNX_VER_MIN(5,17,0)
+#if RTLNX_VER_MIN(5,17,0) || RTLNX_SUSE_MAJ_PREREQ(15,5)
# define VBOX_DEV_ADDR_SET(dev, addr, len) dev_addr_mod(dev, 0, addr, len)
#else /* < 5.17.0 */
# define VBOX_DEV_ADDR_SET(dev, addr, len) memcpy(dev->dev_addr, addr, len)
Index: VirtualBox-7.0.14/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
+++ VirtualBox-7.0.14/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
@@ -1342,7 +1342,7 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
fWrite, /* force write access. */
# endif
&pMemLnx->apPages[0] /* Page array. */
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0)
+# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0) && !RTLNX_SUSE_MAJ_PREREQ(15, 6)
, papVMAs /* vmas */
# endif
);
@@ -1389,7 +1389,7 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
fWrite, /* force write access. */
# endif
&pMemLnx->apPages[0] /* Page array. */
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0)
+# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0) && && !defined(OPENSUSE_156)
, papVMAs /* vmas */
# endif
);
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/sharedfolders/regops.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/sharedfolders/regops.c
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/sharedfolders/regops.c
@@ -270,8 +270,12 @@ static ssize_t vbsf_iov_iter_get_pages(s
size_t cPagesLocked;
down_read(&pTask->mm->mmap_sem);
- cPagesLocked = get_user_pages(pTask, pTask->mm, uPtrFrom, cPages, iter->v_write, 1 /*force*/, papPages, NULL);
- up_read(&pTask->mm->mmap_sem);
+#if defined(OPENSUSE_156)
+ cPagesLocked = get_user_pages(pTask, pTask->mm, uPtrFrom, cPages);
+#else
+ cPagesLocked = get_user_pages(pTask, pTask->mm, uPtrFrom, cPages, iter->v_write, 1 /*force*/, papPages, NULL);
+#endif
+ up_read(&pTask->mm->mmap_sem);
if (cPagesLocked == cPages) {
size_t cbRet = (cPages << PAGE_SHIFT) - offPg0;
if (cPages == cPagesLeft) {

110
fixes_for_leap15.6.patch Normal file
View File

@ -0,0 +1,110 @@
Index: VirtualBox-7.0.14/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
+++ VirtualBox-7.0.14/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
@@ -1292,9 +1292,6 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
IPRT_LINUX_SAVE_EFL_AC();
const int cPages = cb >> PAGE_SHIFT;
struct task_struct *pTask = rtR0ProcessToLinuxTask(R0Process);
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0)
- struct vm_area_struct **papVMAs;
-# endif
PRTR0MEMOBJLNX pMemLnx;
int rc = VERR_NO_MEMORY;
int const fWrite = fAccess & RTMEM_PROT_WRITE ? 1 : 0;
@@ -1318,11 +1315,6 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
return VERR_NO_MEMORY;
}
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0)
- papVMAs = (struct vm_area_struct **)RTMemAlloc(sizeof(*papVMAs) * cPages);
- if (papVMAs)
- {
-# endif
LNX_MM_DOWN_READ(pTask->mm);
/*
@@ -1342,9 +1334,6 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
fWrite, /* force write access. */
# endif
&pMemLnx->apPages[0] /* Page array. */
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0) && !RTLNX_SUSE_MAJ_PREREQ(15, 6)
- , papVMAs /* vmas */
-# endif
);
/*
* Actually this should not happen at the moment as call this function
@@ -1367,12 +1356,7 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
fWrite, /* force write access. */
# endif
&pMemLnx->apPages[0] /* Page array. */
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0)
- , papVMAs /* vmas */
-# endif
-# if GET_USER_PAGES_API >= KERNEL_VERSION(4, 10, 0)
- , NULL /* locked */
-# endif
+ , NULL, NULL
);
#else /* GET_USER_PAGES_API < KERNEL_VERSION(4, 6, 0) */
rc = get_user_pages(pTask, /* Task for fault accounting. */
@@ -1389,9 +1373,6 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
fWrite, /* force write access. */
# endif
&pMemLnx->apPages[0] /* Page array. */
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0) && && !defined(OPENSUSE_156)
- , papVMAs /* vmas */
-# endif
);
#endif /* GET_USER_PAGES_API < KERNEL_VERSION(4, 6, 0) */
if (rc == cPages)
@@ -1415,21 +1396,10 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
while (rc-- > 0)
{
flush_dcache_page(pMemLnx->apPages[rc]);
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0)
-# if RTLNX_VER_MIN(6,3,0)
- vm_flags_set(papVMAs[rc], VM_DONTCOPY | VM_LOCKED);
-# else
- papVMAs[rc]->vm_flags |= VM_DONTCOPY | VM_LOCKED;
-# endif
-# endif
}
LNX_MM_UP_READ(pTask->mm);
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0)
- RTMemFree(papVMAs);
-# endif
-
pMemLnx->Core.u.Lock.R0Process = R0Process;
pMemLnx->cPages = cPages;
Assert(!pMemLnx->fMappedToRing0);
@@ -1457,11 +1427,6 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser
rc = VERR_LOCK_FAILED;
-# if GET_USER_PAGES_API < KERNEL_VERSION(6, 5, 0)
- RTMemFree(papVMAs);
- }
-# endif
-
rtR0MemObjDelete(&pMemLnx->Core);
IPRT_LINUX_RESTORE_EFL_AC();
return rc;
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/sharedfolders/regops.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/sharedfolders/regops.c
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/sharedfolders/regops.c
@@ -270,11 +270,7 @@ static ssize_t vbsf_iov_iter_get_pages(s
size_t cPagesLocked;
down_read(&pTask->mm->mmap_sem);
-#if defined(OPENSUSE_156)
cPagesLocked = get_user_pages(pTask, pTask->mm, uPtrFrom, cPages);
-#else
- cPagesLocked = get_user_pages(pTask, pTask->mm, uPtrFrom, cPages, iter->v_write, 1 /*force*/, papPages, NULL);
-#endif
up_read(&pTask->mm->mmap_sem);
if (cPagesLocked == cPages) {
size_t cbRet = (cPages << PAGE_SHIFT) - offPg0;

826
fixes_for_makefile.patch Normal file
View File

@ -0,0 +1,826 @@
Index: VirtualBox-7.0.14/src/VBox/HostDrivers/linux/Makefile
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/HostDrivers/linux/Makefile
+++ VirtualBox-7.0.14/src/VBox/HostDrivers/linux/Makefile
@@ -43,11 +43,8 @@ obj-m = vboxdrv/
obj-m += vboxnetflt/
endif
ifneq ($(wildcard $(CURDIR)/vboxnetadp/Makefile),)
-obj-m += vboxnetadp/
- endif
- ifneq ($(wildcard $(CURDIR)/vboxpci/Makefile),)
-obj-m += vboxpci/
- endif
+ obj-m += vboxnetadp/
+endif
else # ! KERNELRELEASE
@@ -62,12 +59,14 @@ SUDO :=
endif
KBUILD_VERBOSE ?=
+PWD ?= $(shell pwd)
+
.PHONY: all install clean check unload load \
- vboxdrv vboxnetflt vboxnetadp vboxpci \
- install-vboxdrv install-vboxnetflt install-vboxnetadp install-vboxpci \
- clean-vboxdrv clean-vboxnetflt clean-vboxnetadp clean-vboxpci
+ vboxdrv vboxnetflt vboxnetadp \
+ install-vboxdrv install-vboxnetflt install-vboxnetadp \
+ clean-vboxdrv clean-vboxnetflt clean-vboxnetadp
-all: vboxdrv vboxnetflt vboxnetadp vboxpci
+all: vboxdrv vboxnetflt vboxnetadp
# We want to build on Linux 2.6.18 and later kernels.
KERN_VER ?= $(shell uname -r)
@@ -81,56 +80,38 @@ vboxdrv:
vboxnetflt: vboxdrv
+@if [ -d vboxnetflt ]; then \
- if [ -f vboxdrv/Module.symvers ]; then \
- cp vboxdrv/Module.symvers vboxnetflt; \
- fi; \
+ export KBUILD_EXTRA_SYMBOLS=${PWD}/vboxdrv/Module.symvers; \
echo "=== Building 'vboxnetflt' module ==="; \
- $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) KBUILD_EXTRA_SYMBOLS=$(abspath vboxnetflt/Module.symvers) -C vboxnetflt || exit 1; \
+ $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) KBUILD_EXTRA_SYMBOLS=$(abspath vboxdrv/Module.symvers) -C vboxnetflt || exit 1; \
cp vboxnetflt/vboxnetflt.ko .; \
echo; \
fi
vboxnetadp: vboxdrv
+@if [ -d vboxnetadp ]; then \
- if [ -f vboxdrv/Module.symvers ]; then \
- cp vboxdrv/Module.symvers vboxnetadp; \
- fi; \
+ export KBUILD_EXTRA_SYMBOLS=${PWD}/vboxdrv/Module.symvers; \
echo "=== Building 'vboxnetadp' module ==="; \
- $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) KBUILD_EXTRA_SYMBOLS=$(abspath vboxnetadp/Module.symvers) -C vboxnetadp || exit 1; \
+ $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) KBUILD_EXTRA_SYMBOLS=$(abspath vboxdrv/Module.symvers) -C vboxnetadp || exit 1; \
cp vboxnetadp/vboxnetadp.ko .; \
echo; \
fi
-vboxpci: vboxdrv
- +@if [ -d vboxpci ]; then \
- if [ -f vboxdrv/Module.symvers ]; then \
- cp vboxdrv/Module.symvers vboxpci; \
- fi; \
- echo "=== Building 'vboxpci' module ==="; \
- $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) KBUILD_EXTRA_SYMBOLS=$(abspath vboxpci/Module.symvers) -C vboxpci || exit 1; \
- cp vboxpci/vboxpci.ko .; \
- echo; \
- fi
-
install-vboxdrv:
+@$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxdrv install
install-vboxnetflt:
+@if [ -d vboxnetflt ]; then \
+ export KBUILD_EXTRA_SYMBOLS=${PWD}/vboxdrv/Module.symvers; \
$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetflt install; \
fi
install-vboxnetadp:
+@if [ -d vboxnetadp ]; then \
+ export KBUILD_EXTRA_SYMBOLS=${PWD}/vboxdrv/Module.symvers; \
$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetadp install; \
fi
-install-vboxpci:
- +@if [ -d vboxpci ]; then \
- $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxpci install; \
- fi
-
-install: install-vboxdrv install-vboxnetflt install-vboxnetadp install-vboxpci
+install: install-vboxdrv install-vboxnetflt install-vboxnetadp
# Look for wrapper modules, sorting them so vmmr0 is first.
VBOX_WRAPPER_DIRS := $(notdir $(wildcard $(CURDIR)/vbox_*))
@@ -140,6 +121,9 @@ VBOX_WRAPPER_DIRS := $(filter vbox_vmmr0
define wrapper_template
$(wrapper): $(subst $(wrapper),,vbox_vmmr0)
+$$(MAKE) KBUILD_VERBOSE=$$(KBUILD_VERBOSE) -C $(wrapper)/
+vboxnetflt:
+vboxnetadp:
+install:
load-$(wrapper): $(subst load-$(wrapper),,load-vbox_vmmr0)
@if ! grep -q "^$(wrapper) " /proc/modules; then \
@@ -217,19 +201,13 @@ clean-vboxnetadp:
fi
rm -rf vboxnetadp.ko
-clean-vboxpci:
- +@if [ -d vboxpci ]; then \
- $(MAKE) -C vboxpci clean; \
- fi
- rm -f vboxpci.ko
-
-clean: clean-vboxdrv clean-vboxnetflt clean-vboxnetadp clean-vboxpci
+clean: clean-vboxdrv clean-vboxnetflt clean-vboxnetadp
check:
+@$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxdrv check
unload:
- @for module in vboxpci vboxnetadp vboxnetflt vboxdrv; do \
+ @for module in vboxnetadp vboxnetflt vboxdrv; do \
if grep "^$$module " /proc/modules >/dev/null; then \
echo "Removing previously installed $$module module"; \
$(SUDO) /sbin/rmmod $$module; \
@@ -237,7 +215,7 @@ unload:
done
load: unload
- @for module in vboxdrv vboxnetflt vboxnetadp vboxpci; do \
+ @for module in vboxdrv vboxnetflt vboxnetadp; do \
if test -f $$module.ko; then \
echo "Installing $$module module"; \
$(SUDO) /sbin/insmod $$module.ko; \
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/Makefile
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/Makefile
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/Makefile
@@ -34,6 +34,7 @@ obj-m = vboxguest/ vboxsf/ vboxvideo/
else # ! KERNELRELEASE
KBUILD_VERBOSE =
+PWD ?= $(shell pwd)
ifeq ($(KBUILD_VERBOSE),)
VBOX_QUIET := @
VBOX_QUIET_SH := @
@@ -59,6 +60,7 @@ vboxsf: vboxguest
if [ -f vboxguest/Module.symvers ]; then \
cp vboxguest/Module.symvers vboxsf; \
fi; \
+ export KBUILD_EXTRA_SYMBOLS=${PWD}/vboxvideo/Module.symvers; \
echo "=== Building 'vboxsf' module ==="; \
$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) KBUILD_EXTRA_SYMBOLS=$(abspath vboxsf/Module.symvers) -C vboxsf || exit 1; \
if [ -f vboxsf/vboxsf.ko ]; then \
@@ -71,6 +73,9 @@ vboxsf: vboxguest
vboxvideo:
+ $(VBOX_QUIET_SH)if [ -d vboxvideo ]; then \
+ if [ -f vboxguest/Module.symvers ]; then \
+ cp vboxguest/Module.symvers vboxvideo; \
+ fi; \
echo "=== Building 'vboxvideo' module ==="; \
$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxvideo || exit 1; \
if [ -f vboxvideo/vboxvideo.ko ]; then \
@@ -86,11 +91,13 @@ install-vboxguest:
install-vboxsf:
+ $(VBOX_QUIET_SH)if [ -d vboxsf ]; then \
+ export KBUILD_EXTRA_SYMBOLS=${PWD}/vboxsf/Module.symvers; \
$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxsf install; \
fi
install-vboxvideo:
+ $(VBOX_QUIET_SH)if [ -d vboxvideo ]; then \
+ export KBUILD_EXTRA_SYMBOLS=${PWD}/vboxvideo/Module.symvers; \
$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxvideo install; \
fi
Index: VirtualBox-7.0.14/include/iprt/x86.h
===================================================================
--- VirtualBox-7.0.14.orig/include/iprt/x86.h
+++ VirtualBox-7.0.14/include/iprt/x86.h
@@ -937,37 +937,59 @@ typedef const X86CPUIDFEATEDX *PCX86CPUI
* reserved flags.
* @{ */
/** Bit 0 - PE - Protection Enabled */
+#ifndef X86_CR0_PE
#define X86_CR0_PE RT_BIT_32(0)
+#endif
#define X86_CR0_PROTECTION_ENABLE RT_BIT_32(0)
/** Bit 1 - MP - Monitor Coprocessor */
+#ifndef X86_CR0_MP
#define X86_CR0_MP RT_BIT_32(1)
+#endif
#define X86_CR0_MONITOR_COPROCESSOR RT_BIT_32(1)
/** Bit 2 - EM - Emulation. */
+#ifndef X86_CR0_EM
#define X86_CR0_EM RT_BIT_32(2)
+#endif
#define X86_CR0_EMULATE_FPU RT_BIT_32(2)
/** Bit 3 - TS - Task Switch. */
+#ifndef X86_CR0_TS
#define X86_CR0_TS RT_BIT_32(3)
+#endif
#define X86_CR0_TASK_SWITCH RT_BIT_32(3)
/** Bit 4 - ET - Extension flag. (386, 'hardcoded' to 1 on 486+) */
+#ifndef X86_CR0_ET
#define X86_CR0_ET RT_BIT_32(4)
+#endif
#define X86_CR0_EXTENSION_TYPE RT_BIT_32(4)
/** Bit 5 - NE - Numeric error (486+). */
+#ifndef X86_CR0_NE
#define X86_CR0_NE RT_BIT_32(5)
+#endif
#define X86_CR0_NUMERIC_ERROR RT_BIT_32(5)
/** Bit 16 - WP - Write Protect (486+). */
+#ifndef X86_CR0_WP
#define X86_CR0_WP RT_BIT_32(16)
+#endif
#define X86_CR0_WRITE_PROTECT RT_BIT_32(16)
/** Bit 18 - AM - Alignment Mask (486+). */
+#ifndef X86_CR0_AM
#define X86_CR0_AM RT_BIT_32(18)
+#endif
#define X86_CR0_ALIGMENT_MASK RT_BIT_32(18)
/** Bit 29 - NW - Not Write-though (486+). */
+#ifndef X86_CR0_NW
#define X86_CR0_NW RT_BIT_32(29)
+#endif
#define X86_CR0_NOT_WRITE_THROUGH RT_BIT_32(29)
/** Bit 30 - WP - Cache Disable (486+). */
+#ifndef X86_CR0_CD
#define X86_CR0_CD RT_BIT_32(30)
+#endif
#define X86_CR0_CACHE_DISABLE RT_BIT_32(30)
/** Bit 31 - PG - Paging. */
+#ifndef X86_CR0_PG
#define X86_CR0_PG RT_BIT_32(31)
+#endif
#define X86_CR0_PAGING RT_BIT_32(31)
#define X86_CR0_BIT_PG 31 /**< Bit number of X86_CR0_PG */
/** @} */
@@ -976,9 +998,13 @@ typedef const X86CPUIDFEATEDX *PCX86CPUI
/** @name CR3
* @{ */
/** Bit 3 - PWT - Page-level Writes Transparent. */
+#ifndef X86_CR3_PWT
#define X86_CR3_PWT RT_BIT_32(3)
+#endif
/** Bit 4 - PCD - Page-level Cache Disable. */
+#ifndef X86_CR3_PCD
#define X86_CR3_PCD RT_BIT_32(4)
+#endif
/** Bits 12-31 - - Page directory page number. */
#define X86_CR3_PAGE_MASK (0xfffff000)
/** Bits 5-31 - - PAE Page directory page number. */
@@ -997,46 +1023,84 @@ typedef const X86CPUIDFEATEDX *PCX86CPUI
/** @name CR4
* @{ */
/** Bit 0 - VME - Virtual-8086 Mode Extensions. */
+#ifndef X86_CR4_VME
#define X86_CR4_VME RT_BIT_32(0)
+#endif
/** Bit 1 - PVI - Protected-Mode Virtual Interrupts. */
+#ifndef X86_CR4_PVI
#define X86_CR4_PVI RT_BIT_32(1)
+#endif
/** Bit 2 - TSD - Time Stamp Disable. */
+#ifndef X86_CR4_TSD
#define X86_CR4_TSD RT_BIT_32(2)
+#endif
/** Bit 3 - DE - Debugging Extensions. */
+#ifndef X86_CR4_DE
#define X86_CR4_DE RT_BIT_32(3)
+#endif
/** Bit 4 - PSE - Page Size Extension. */
+#ifndef X86_CR4_PSE
#define X86_CR4_PSE RT_BIT_32(4)
+#endif
/** Bit 5 - PAE - Physical Address Extension. */
+#ifndef X86_CR4_PAE
#define X86_CR4_PAE RT_BIT_32(5)
+#endif
/** Bit 6 - MCE - Machine-Check Enable. */
+#ifndef X86_CR4_MCE
#define X86_CR4_MCE RT_BIT_32(6)
+#endif
/** Bit 7 - PGE - Page Global Enable. */
+#ifndef X86_CR4_PGE
#define X86_CR4_PGE RT_BIT_32(7)
+#endif
/** Bit 8 - PCE - Performance-Monitoring Counter Enable. */
+#ifndef X86_CR4_PCE
#define X86_CR4_PCE RT_BIT_32(8)
+#endif
/** Bit 9 - OSFXSR - Operating System Support for FXSAVE and FXRSTORE instructions. */
+#ifndef X86_CR4_OSFXSR
#define X86_CR4_OSFXSR RT_BIT_32(9)
+#endif
/** Bit 10 - OSXMMEEXCPT - Operating System Support for Unmasked SIMD Floating-Point Exceptions. */
#define X86_CR4_OSXMMEEXCPT RT_BIT_32(10)
/** Bit 11 - UMIP - User-Mode Instruction Prevention. */
+#ifndef X86_CR4_UMIP
#define X86_CR4_UMIP RT_BIT_32(11)
+#endif
/** Bit 13 - VMXE - VMX mode is enabled. */
+#ifndef X86_CR4_VMXE
#define X86_CR4_VMXE RT_BIT_32(13)
+#endif
/** Bit 14 - SMXE - Safer Mode Extensions Enabled. */
+#ifndef X86_CR4_SMXE
#define X86_CR4_SMXE RT_BIT_32(14)
+#endif
/** Bit 16 - FSGSBASE - Read/write FSGSBASE instructions Enable. */
+#ifndef X86_CR4_FSGSBASE
#define X86_CR4_FSGSBASE RT_BIT_32(16)
+#endif
/** Bit 17 - PCIDE - Process-Context Identifiers Enabled. */
+#ifndef X86_CR4_PCIDE
#define X86_CR4_PCIDE RT_BIT_32(17)
+#endif
/** Bit 18 - OSXSAVE - Operating System Support for XSAVE and processor
* extended states. */
+#ifndef X86_CR4_OSXSAVE
#define X86_CR4_OSXSAVE RT_BIT_32(18)
+#endif
/** Bit 20 - SMEP - Supervisor-mode Execution Prevention enabled. */
+#ifndef X86_CR4_SMEP
#define X86_CR4_SMEP RT_BIT_32(20)
+#endif
/** Bit 21 - SMAP - Supervisor-mode Access Prevention enabled. */
+#ifndef X86_CR4_SMAP
#define X86_CR4_SMAP RT_BIT_32(21)
+#endif
/** Bit 22 - PKE - Protection Key Enable. */
+#ifndef X86_CR4_PKE
#define X86_CR4_PKE RT_BIT_32(22)
+#endif
/** Bit 23 - CET - Control-flow Enhancement Technology enabled. */
#define X86_CR4_CET RT_BIT_32(23)
/** @} */
@@ -1267,12 +1331,16 @@ AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C
/** Machine check type register (P5). */
#define MSR_P5_MC_TYPE UINT32_C(0x00000001)
/** Time Stamp Counter. */
+#ifndef MSR_IA32_TSC
#define MSR_IA32_TSC 0x10
+#endif
#define MSR_IA32_CESR UINT32_C(0x00000011)
#define MSR_IA32_CTR0 UINT32_C(0x00000012)
#define MSR_IA32_CTR1 UINT32_C(0x00000013)
+#ifndef MSR_IA32_PLATFORM_ID
#define MSR_IA32_PLATFORM_ID 0x17
+#endif
#ifndef MSR_IA32_APICBASE /* qemu cpu.h kludge */
# define MSR_IA32_APICBASE 0x1b
@@ -1298,7 +1366,9 @@ AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C
#define MSR_CORE_THREAD_COUNT 0x35
/** CPU Feature control. */
+#ifndef MSR_IA32_FEATURE_CONTROL
#define MSR_IA32_FEATURE_CONTROL 0x3A
+#endif
/** Feature control - Lock MSR from writes (R/W0). */
#define MSR_IA32_FEATURE_CONTROL_LOCK RT_BIT_64(0)
/** Feature control - Enable VMX inside SMX operation (R/WL). */
@@ -1323,11 +1393,15 @@ AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C
#define MSR_IA32_FEATURE_CONTROL_LMCE RT_BIT_64(20)
/** Per-processor TSC adjust MSR. */
+#ifndef MSR_IA32_TSC_ADJUST
#define MSR_IA32_TSC_ADJUST 0x3B
+#endif
/** Spectre control register.
* Logical processor scope. Reset value 0, unaffected by SIPI & INIT. */
+#ifndef MSR_IA32_SPEC_CTRL
#define MSR_IA32_SPEC_CTRL 0x48
+#endif
/** IBRS - Indirect branch restricted speculation. */
#define MSR_IA32_SPEC_CTRL_F_IBRS RT_BIT_32(0)
/** STIBP - Single thread indirect branch predictors. */
@@ -1337,7 +1411,9 @@ AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C
/** Prediction command register.
* Write only, logical processor scope, no state since write only. */
+#ifndef MSR_IA32_PRED_CMD
#define MSR_IA32_PRED_CMD 0x49
+#endif
/** IBPB - Indirect branch prediction barrie when written as 1. */
#define MSR_IA32_PRED_CMD_F_IBPB RT_BIT_32(0)
@@ -1348,7 +1424,9 @@ AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C
#define MSR_IA32_BIOS_SIGN_ID 0x8B
/** SMM monitor control. */
+#ifndef MSR_IA32_SMM_MONITOR_CTL
#define MSR_IA32_SMM_MONITOR_CTL 0x9B
+#endif
/** SMM control - Valid. */
#define MSR_IA32_SMM_MONITOR_VALID RT_BIT_64(0)
/** SMM control - VMXOFF unblocks SMI. */
@@ -1357,10 +1435,14 @@ AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C
#define MSR_IA32_SMM_MONITOR_MSGEG_PHYSADDR(a) (((a) >> 12) & UINT64_C(0xfffff))
/** SMBASE - Base address of SMRANGE image (Read-only, SMM only). */
+#ifndef MSR_IA32_SMBASE
#define MSR_IA32_SMBASE 0x9E
+#endif
/** General performance counter no. 0. */
+#ifndef MSR_IA32_PMC0
#define MSR_IA32_PMC0 0xC1
+#endif
/** General performance counter no. 1. */
#define MSR_IA32_PMC1 0xC2
/** General performance counter no. 2. */
@@ -1383,18 +1465,26 @@ AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C
#define MSR_IA32_FSB_CLOCK_STS 0xCD
/** C-State configuration control. Intel specific: Nehalem, Sandy Bridge. */
+#ifndef MSR_PKG_CST_CONFIG_CONTROL
#define MSR_PKG_CST_CONFIG_CONTROL UINT32_C(0x000000e2)
+#endif
/** C0 Maximum Frequency Clock Count */
+#ifndef MSR_IA32_MPERF
#define MSR_IA32_MPERF 0xE7
+#endif
/** C0 Actual Frequency Clock Count */
+#ifndef MSR_IA32_APERF
#define MSR_IA32_APERF 0xE8
+#endif
/** MTRR Capabilities. */
#define MSR_IA32_MTRR_CAP 0xFE
/** Architecture capabilities (bugfixes). */
+#ifndef MSR_IA32_ARCH_CAPABILITIES
#define MSR_IA32_ARCH_CAPABILITIES UINT32_C(0x10a)
+#endif
/** CPU is no subject to meltdown problems. */
#define MSR_IA32_ARCH_CAP_F_RDCL_NO RT_BIT_32(0)
/** CPU has better IBRS and you can leave it on all the time. */
@@ -1408,7 +1498,9 @@ AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C
#define MSR_IA32_ARCH_CAP_F_MDS_NO RT_BIT_32(4)
/** Flush command register. */
+#ifndef MSR_IA32_FLUSH_CMD
#define MSR_IA32_FLUSH_CMD UINT32_C(0x10b)
+#endif
/** Flush the level 1 data cache when this bit is written. */
#define MSR_IA32_FLUSH_CMD_F_L1D RT_BIT_32(0)
@@ -1429,14 +1521,20 @@ AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C
#endif
/** Machine Check Global Capabilities Register. */
+#ifndef MSR_IA32_MCG_CAP
#define MSR_IA32_MCG_CAP 0x179
+#endif
/** Machine Check Global Status Register. */
+#ifndef MSR_IA32_MCG_STATUS
#define MSR_IA32_MCG_STATUS 0x17A
+#endif
/** Machine Check Global Control Register. */
#define MSR_IA32_MCG_CTRL 0x17B
/** Page Attribute Table. */
+#ifndef MSR_IA32_CR_PAT
#define MSR_IA32_CR_PAT 0x277
+#endif
/** Default PAT MSR value on processor powerup / reset (see Intel spec. 11.12.4
* "Programming the PAT", AMD spec. 7.8.2 "PAT Indexing") */
#define MSR_IA32_CR_PAT_INIT_VAL UINT64_C(0x0007040600070406)
@@ -1455,36 +1553,58 @@ AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C
#define MSR_FLEX_RATIO 0x194
/** Performance state value and starting with Intel core more.
* Apple uses the >=core features to determine TSC granularity on older CPUs. */
+#ifndef MSR_IA32_PERF_STATUS
#define MSR_IA32_PERF_STATUS 0x198
+#endif
+#ifndef MSR_IA32_PERF_CTL
#define MSR_IA32_PERF_CTL 0x199
+#endif
+#ifndef MSR_IA32_THERM_STATUS
#define MSR_IA32_THERM_STATUS 0x19c
+#endif
/** Offcore response event select registers. */
+#ifndef MSR_OFFCORE_RSP_0
#define MSR_OFFCORE_RSP_0 0x1a6
+#endif
+#ifndef MSR_OFFCORE_RSP_1
#define MSR_OFFCORE_RSP_1 0x1a7
+#endif
/** Enable misc. processor features (R/W). */
+#ifndef MSR_IA32_MISC_ENABLE
#define MSR_IA32_MISC_ENABLE 0x1A0
+#endif
/** Enable fast-strings feature (for REP MOVS and REP STORS). */
#define MSR_IA32_MISC_ENABLE_FAST_STRINGS RT_BIT_64(0)
/** Automatic Thermal Control Circuit Enable (R/W). */
+#ifndef MSR_IA32_MISC_ENABLE_TCC
#define MSR_IA32_MISC_ENABLE_TCC RT_BIT_64(3)
+#endif
/** Performance Monitoring Available (R). */
#define MSR_IA32_MISC_ENABLE_PERF_MON RT_BIT_64(7)
/** Branch Trace Storage Unavailable (R/O). */
+#ifndef MSR_IA32_MISC_ENABLE_BTS_UNAVAIL
#define MSR_IA32_MISC_ENABLE_BTS_UNAVAIL RT_BIT_64(11)
+#endif
/** Precise Event Based Sampling (PEBS) Unavailable (R/O). */
+#ifndef MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL
#define MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL RT_BIT_64(12)
+#endif
/** Enhanced Intel SpeedStep Technology Enable (R/W). */
#define MSR_IA32_MISC_ENABLE_SST_ENABLE RT_BIT_64(16)
/** If MONITOR/MWAIT is supported (R/W). */
#define MSR_IA32_MISC_ENABLE_MONITOR RT_BIT_64(18)
/** Limit CPUID Maxval to 3 leafs (R/W). */
+#ifndef MSR_IA32_MISC_ENABLE_LIMIT_CPUID
#define MSR_IA32_MISC_ENABLE_LIMIT_CPUID RT_BIT_64(22)
+#endif
/** When set to 1, xTPR messages are disabled (R/W). */
#define MSR_IA32_MISC_ENABLE_XTPR_MSG_DISABLE RT_BIT_64(23)
/** When set to 1, the Execute Disable Bit feature (XD Bit) is disabled (R/W). */
+#ifndef MSR_IA32_MISC_ENABLE_XD_DISABLE
#define MSR_IA32_MISC_ENABLE_XD_DISABLE RT_BIT_64(34)
+#endif
/** Trace/Profile Resource Control (R/W) */
#define MSR_IA32_DEBUGCTL UINT32_C(0x000001d9)
@@ -1665,7 +1785,9 @@ AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C
/** @} */
/** Intel TSX (Transactional Synchronization Extensions) control MSR. */
+#ifndef MSR_IA32_TSX_CTRL
#define MSR_IA32_TSX_CTRL 0x122
+#endif
/** Variable range MTRRs.
* @{ */
@@ -1715,93 +1837,171 @@ AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C
#define MSR_IA32_PERF_GLOBAL_OVF_CTRL 0x390
/** Precise Event Based sampling (Intel only). */
+#ifndef MSR_IA32_PEBS_ENABLE
#define MSR_IA32_PEBS_ENABLE 0x3F1
+#endif
+#ifndef MSR_DRAM_POWER_LIMIT
#define MSR_IA32_MC0_CTL 0x400
+#endif
+#ifndef MSR_IA32_MC0_STATUS
#define MSR_IA32_MC0_STATUS 0x401
+#endif
/** Basic VMX information. */
+#ifndef MSR_IA32_VMX_BASIC
#define MSR_IA32_VMX_BASIC 0x480
+#endif
/** Allowed settings for pin-based VM execution controls. */
+#ifndef MSR_IA32_VMX_PINBASED_CTLS
#define MSR_IA32_VMX_PINBASED_CTLS 0x481
+#endif
/** Allowed settings for proc-based VM execution controls. */
+#ifndef MSR_IA32_VMX_PROCBASED_CTLS
#define MSR_IA32_VMX_PROCBASED_CTLS 0x482
+#endif
/** Allowed settings for the VM-exit controls. */
+#ifndef MSR_IA32_VMX_EXIT_CTLS
#define MSR_IA32_VMX_EXIT_CTLS 0x483
+#endif
/** Allowed settings for the VM-entry controls. */
+#ifndef MSR_IA32_VMX_ENTRY_CTLS
#define MSR_IA32_VMX_ENTRY_CTLS 0x484
+#endif
/** Misc VMX info. */
+#ifndef MSR_IA32_VMX_MISC
#define MSR_IA32_VMX_MISC 0x485
+#endif
/** Fixed cleared bits in CR0. */
+#ifndef MSR_IA32_VMX_CR0_FIXED0
#define MSR_IA32_VMX_CR0_FIXED0 0x486
+#endif
/** Fixed set bits in CR0. */
+#ifndef MSR_IA32_VMX_CR0_FIXED1
#define MSR_IA32_VMX_CR0_FIXED1 0x487
+#endif
/** Fixed cleared bits in CR4. */
+#ifndef MSR_IA32_VMX_CR4_FIXED0
#define MSR_IA32_VMX_CR4_FIXED0 0x488
+#endif
/** Fixed set bits in CR4. */
+#ifndef MSR_IA32_VMX_CR4_FIXED1
#define MSR_IA32_VMX_CR4_FIXED1 0x489
+#endif
/** Information for enumerating fields in the VMCS. */
+#ifndef MSR_IA32_VMX_VMCS_ENUM
#define MSR_IA32_VMX_VMCS_ENUM 0x48A
+#endif
/** Allowed settings for secondary processor-based VM-execution controls. */
+#ifndef MSR_IA32_VMX_PROCBASED_CTLS2
#define MSR_IA32_VMX_PROCBASED_CTLS2 0x48B
+#endif
/** EPT capabilities. */
+#ifndef MSR_IA32_VMX_EPT_VPID_CAP
#define MSR_IA32_VMX_EPT_VPID_CAP 0x48C
+#endif
/** Allowed settings of all pin-based VM execution controls. */
+#ifndef MSR_IA32_VMX_TRUE_PINBASED_CTLS
#define MSR_IA32_VMX_TRUE_PINBASED_CTLS 0x48D
+#endif
/** Allowed settings of all proc-based VM execution controls. */
+#ifndef MSR_IA32_VMX_TRUE_PROCBASED_CTLS
#define MSR_IA32_VMX_TRUE_PROCBASED_CTLS 0x48E
+#endif
/** Allowed settings of all VMX exit controls. */
+#ifndef MSR_IA32_VMX_TRUE_EXIT_CTLS
#define MSR_IA32_VMX_TRUE_EXIT_CTLS 0x48F
+#endif
/** Allowed settings of all VMX entry controls. */
+#ifndef MSR_IA32_VMX_TRUE_ENTRY_CTLS
#define MSR_IA32_VMX_TRUE_ENTRY_CTLS 0x490
+#endif
/** Allowed settings for the VM-function controls. */
+#ifndef MSR_IA32_VMX_VMFUNC
#define MSR_IA32_VMX_VMFUNC 0x491
/** Tertiary processor-based VM execution controls. */
#define MSR_IA32_VMX_PROCBASED_CTLS3 0x492
/** Secondary VM-exit controls. */
#define MSR_IA32_VMX_EXIT_CTLS2 0x493
+#endif
/** Intel PT - Enable and control for trace packet generation. */
+#ifndef MSR_IA32_RTIT_CTL
#define MSR_IA32_RTIT_CTL 0x570
+#endif
/** DS Save Area (R/W). */
+#ifndef MSR_IA32_DS_AREA
#define MSR_IA32_DS_AREA 0x600
+#endif
/** Running Average Power Limit (RAPL) power units. */
+#ifndef MSR_RAPL_POWER_UNIT
#define MSR_RAPL_POWER_UNIT 0x606
+#endif
/** Package C3 Interrupt Response Limit. */
+#ifndef MSR_PKGC3_IRTL
#define MSR_PKGC3_IRTL 0x60a
+#endif
/** Package C6/C7S Interrupt Response Limit 1. */
#define MSR_PKGC_IRTL1 0x60b
/** Package C6/C7S Interrupt Response Limit 2. */
#define MSR_PKGC_IRTL2 0x60c
/** Package C2 Residency Counter. */
+#ifndef MSR_PKG_C2_RESIDENCY
#define MSR_PKG_C2_RESIDENCY 0x60d
+#endif
/** PKG RAPL Power Limit Control. */
+#ifndef MSR_PKG_POWER_LIMIT
#define MSR_PKG_POWER_LIMIT 0x610
+#endif
/** PKG Energy Status. */
+#ifndef MSR_PKG_ENERGY_STATUS
#define MSR_PKG_ENERGY_STATUS 0x611
+#endif
/** PKG Perf Status. */
+#ifndef MSR_PKG_PERF_STATUS
#define MSR_PKG_PERF_STATUS 0x613
+#endif
/** PKG RAPL Parameters. */
+#ifndef MSR_PKG_POWER_INFO
#define MSR_PKG_POWER_INFO 0x614
+#endif
/** DRAM RAPL Power Limit Control. */
+#ifndef MSR_DRAM_POWER_LIMIT
#define MSR_DRAM_POWER_LIMIT 0x618
+#endif
/** DRAM Energy Status. */
+#ifndef MSR_DRAM_ENERGY_STATUS
#define MSR_DRAM_ENERGY_STATUS 0x619
+#endif
/** DRAM Performance Throttling Status. */
+#ifndef MSR_DRAM_PERF_STATUS
#define MSR_DRAM_PERF_STATUS 0x61b
+#endif
/** DRAM RAPL Parameters. */
+#ifndef MSR_DRAM_POWER_INFO
#define MSR_DRAM_POWER_INFO 0x61c
+#endif
/** Package C10 Residency Counter. */
+#ifndef MSR_PKG_C10_RESIDENCY
#define MSR_PKG_C10_RESIDENCY 0x632
+#endif
/** PP0 Energy Status. */
+#ifndef MSR_PP0_ENERGY_STATUS
#define MSR_PP0_ENERGY_STATUS 0x639
+#endif
/** PP1 Energy Status. */
+#ifndef MSR_PP1_ENERGY_STATUS
#define MSR_PP1_ENERGY_STATUS 0x641
+#endif
/** Turbo Activation Ratio. */
+#ifndef MSR_TURBO_ACTIVATION_RATIO
#define MSR_TURBO_ACTIVATION_RATIO 0x64c
+#endif
/** Core Performance Limit Reasons. */
+#ifndef MSR_CORE_PERF_LIMIT_REASONS
#define MSR_CORE_PERF_LIMIT_REASONS 0x64f
+#endif
/** X2APIC MSR range start. */
#define MSR_IA32_X2APIC_START 0x800
@@ -1936,23 +2136,47 @@ AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C
/** The mask which give the SYSCALL EIP. */
#define MSR_K6_STAR_SYSCALL_EIP_MASK UINT32_C(0xffffffff)
/** K6 WHCR - Write Handling Control Register. */
+#ifndef MSR_K6_WHCR
#define MSR_K6_WHCR UINT32_C(0xc0000082)
+#endif
/** K6 UWCCR - UC/WC Cacheability Control Register. */
+#ifndef MSR_K6_UWCCR
#define MSR_K6_UWCCR UINT32_C(0xc0000085)
+#endif
/** K6 PSOR - Processor State Observability Register. */
+#ifndef MSR_K6_PSOR
#define MSR_K6_PSOR UINT32_C(0xc0000087)
+#endif
/** K6 PFIR - Page Flush/Invalidate Register. */
+#ifndef MSR_K6_PFIR
#define MSR_K6_PFIR UINT32_C(0xc0000088)
+#endif
/** Performance counter MSRs. (AMD only) */
+#ifndef MSR_K7_EVNTSEL0
#define MSR_K7_EVNTSEL0 UINT32_C(0xc0010000)
+#endif
+#ifndef MSR_K7_EVNTSEL1
#define MSR_K7_EVNTSEL1 UINT32_C(0xc0010001)
+#endif
+#ifndef MSR_K7_EVNTSEL2
#define MSR_K7_EVNTSEL2 UINT32_C(0xc0010002)
+#endif
+#ifndef MSR_K7_EVNTSEL3
#define MSR_K7_EVNTSEL3 UINT32_C(0xc0010003)
+#endif
+#ifndef MSR_K7_PERFCTR0
#define MSR_K7_PERFCTR0 UINT32_C(0xc0010004)
+#endif
+#ifndef MSR_K7_PERFCTR1
#define MSR_K7_PERFCTR1 UINT32_C(0xc0010005)
+#endif
+#ifndef MSR_K7_PERFCTR2
#define MSR_K7_PERFCTR2 UINT32_C(0xc0010006)
+#endif
+#ifndef MSR_K7_PERFCTR3
#define MSR_K7_PERFCTR3 UINT32_C(0xc0010007)
+#endif
/** K8 LSTAR - Long mode SYSCALL target (RIP). */
#define MSR_K8_LSTAR UINT32_C(0xc0000082)
@@ -1968,14 +2192,20 @@ AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C
#define MSR_K8_KERNEL_GS_BASE UINT32_C(0xc0000102)
/** K8 TSC_AUX - Used with RDTSCP. */
#define MSR_K8_TSC_AUX UINT32_C(0xc0000103)
+#ifndef MSR_K8_SYSCFG
#define MSR_K8_SYSCFG UINT32_C(0xc0010010)
+#endif
#define MSR_K8_HWCR UINT32_C(0xc0010015)
#define MSR_K8_IORRBASE0 UINT32_C(0xc0010016)
#define MSR_K8_IORRMASK0 UINT32_C(0xc0010017)
#define MSR_K8_IORRBASE1 UINT32_C(0xc0010018)
#define MSR_K8_IORRMASK1 UINT32_C(0xc0010019)
+#ifndef MSR_K8_TOP_MEM1
#define MSR_K8_TOP_MEM1 UINT32_C(0xc001001a)
+#endif
+#ifndef MSR_K8_TOP_MEM2
#define MSR_K8_TOP_MEM2 UINT32_C(0xc001001d)
+#endif
/** SMM MSRs. */
#define MSR_K7_SMBASE UINT32_C(0xc0010111)
Index: VirtualBox-7.0.14/include/VBox/vmm/hm_vmx.h
===================================================================
--- VirtualBox-7.0.14.orig/include/VBox/vmm/hm_vmx.h
+++ VirtualBox-7.0.14/include/VBox/vmm/hm_vmx.h
@@ -1633,7 +1633,9 @@ AssertCompileSize(VMXABORT, 4);
/** VMCS (and related regions) memory type - Uncacheable. */
#define VMX_BASIC_MEM_TYPE_UC 0
/** VMCS (and related regions) memory type - Write back. */
+#ifndef VMX_BASIC_MEM_TYPE_WB
#define VMX_BASIC_MEM_TYPE_WB 6
+#endif
/** Width of physical addresses used for VMCS and associated memory regions
* (1=32-bit, 0=processor's physical address width). */
#define VMX_BASIC_PHYSADDR_WIDTH_32BIT RT_BIT_64(48)
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_drv.h
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/drm/vbox_drv.h
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_drv.h
@@ -87,6 +87,12 @@
#else
# define RTLNX_RHEL_MAX(a_iMajor, a_iMinor) (0)
#endif
+
+#if defined(CONFIG_SUSE_VERSION)
+# if CONFIG_SUSE_VERSION == 15 && CONFIG_SUSE_PATCHLEVEL == 1
+# define OPENSUSE_151
+# endif
+#endif
#if defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 12 && CONFIG_SUSE_PATCHLEVEL >= 4
# define SUSE_SLE12
#endif

49
fixes_for_qt5.13.patch Normal file
View File

@ -0,0 +1,49 @@
Index: VirtualBox-7.0.14/include/VBox/VBoxGL2D.h
===================================================================
--- VirtualBox-7.0.14.orig/include/VBox/VBoxGL2D.h
+++ VirtualBox-7.0.14/include/VBox/VBoxGL2D.h
@@ -123,7 +123,7 @@ typedef GLvoid (APIENTRY *PFNVBOXVHWA_UN
/* GL_ARB_pixel_buffer_object*/
#ifndef Q_WS_MAC
/* apears to be defined on mac */
-typedef ptrdiff_t GLsizeiptr;
+typedef long int GLsizeiptr;
#endif
#ifndef GL_READ_ONLY
Index: VirtualBox-7.0.14/src/VBox/Additions/3D/mesa/mesa-21.3.8/include/GL/glext.h
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/3D/mesa/mesa-21.3.8/include/GL/glext.h
+++ VirtualBox-7.0.14/src/VBox/Additions/3D/mesa/mesa-21.3.8/include/GL/glext.h
@@ -466,7 +466,12 @@ GLAPI void APIENTRY glBlendEquation (GLe
#ifndef GL_VERSION_1_5
#define GL_VERSION_1_5 1
+#include <QtCore/qglobal.h>
+#if __BITS_PER_LONG != 64
typedef khronos_ssize_t GLsizeiptr;
+#else
+typedef long int GLsizeiptr;
+#endif
typedef khronos_intptr_t GLintptr;
#define GL_BUFFER_SIZE 0x8764
#define GL_BUFFER_USAGE 0x8765
Index: VirtualBox-7.0.14/src/VBox/Devices/Graphics/vmsvga_glext/glext.h
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Devices/Graphics/vmsvga_glext/glext.h
+++ VirtualBox-7.0.14/src/VBox/Devices/Graphics/vmsvga_glext/glext.h
@@ -4680,6 +4680,14 @@ GLAPI void APIENTRY glWeightuivARB (GLin
GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer);
GLAPI void APIENTRY glVertexBlendARB (GLint count);
#endif
+#ifndef GL_VERSION_1_5
+/* GL types for handling large vertex buffer objects */
+typedef ptrdiff_t GLintptr;
+#if __BITS_PER_LONG != 64
+typedef ptrdiff_t GLsizeiptr;
+#else
+typedef long int GLsizeiptr;
+#endif
#endif /* GL_ARB_vertex_blend */
#ifndef GL_ARB_vertex_buffer_object

163
fixes_for_sle12.patch Normal file
View File

@ -0,0 +1,163 @@
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_drv.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/drm/vbox_drv.c
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_drv.c
@@ -362,7 +362,9 @@ static struct drm_driver driver = {
.master_drop = vbox_master_drop,
#if RTLNX_VER_MIN(3,18,0) || RTLNX_RHEL_MAJ_PREREQ(7,2)
# if RTLNX_VER_MAX(4,14,0) && !RTLNX_RHEL_MAJ_PREREQ(7,5) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5)
+#if !(defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 12 && CONFIG_SUSE_PATCHLEVEL >= 4)
.set_busid = drm_pci_set_busid,
+#endif
# endif
#endif
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_main.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/drm/vbox_main.c
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_main.c
@@ -626,11 +626,13 @@ int vbox_dumb_destroy(struct drm_file *f
#endif
#if RTLNX_VER_MAX(4,19,0) && !RTLNX_RHEL_MAJ_PREREQ(7,7) && !RTLNX_RHEL_MAJ_PREREQ(8,1) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5)
+#if !(defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 12 && CONFIG_SUSE_PATCHLEVEL >= 4)
static void ttm_bo_put(struct ttm_buffer_object *bo)
{
ttm_bo_unref(&bo);
}
#endif
+#endif
void vbox_gem_free_object(struct drm_gem_object *obj)
{
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_ttm.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/drm/vbox_ttm.c
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_ttm.c
@@ -302,7 +302,7 @@ static struct ttm_backend_func vbox_tt_b
};
#endif
-#if RTLNX_VER_MAX(4,17,0) && !RTLNX_RHEL_MAJ_PREREQ(7,6) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5)
+#if RTLNX_VER_MAX(4,17,0) && !RTLNX_RHEL_MAJ_PREREQ(7,6) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5) && !defined(SUSE_SLE12)
static struct ttm_tt *vbox_ttm_tt_create(struct ttm_bo_device *bdev,
unsigned long size,
u32 page_flags,
@@ -339,7 +339,7 @@ static struct ttm_tt *vbox_ttm_tt_create
}
#if RTLNX_VER_MAX(4,17,0)
-# if RTLNX_VER_MAX(4,16,0) && !RTLNX_RHEL_MAJ_PREREQ(7,6) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5)
+# if RTLNX_VER_MAX(4,16,0) && !RTLNX_RHEL_MAJ_PREREQ(7,6) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5) && !defined(SUSE_SLE12)
static int vbox_ttm_tt_populate(struct ttm_tt *ttm)
{
return ttm_pool_populate(ttm);
@@ -406,7 +406,7 @@ static struct ttm_bo_driver vbox_bo_driv
.io_mem_reserve = &vbox_ttm_io_mem_reserve,
.io_mem_free = &vbox_ttm_io_mem_free,
#if RTLNX_VER_MIN(4,12,0) || RTLNX_RHEL_MAJ_PREREQ(7,5)
-# if RTLNX_VER_MAX(4,16,0) && !RTLNX_RHEL_MAJ_PREREQ(7,6) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5)
+# if RTLNX_VER_MAX(4,16,0) && !RTLNX_RHEL_MAJ_PREREQ(7,6) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5) && !defined(SUSE_SLE12)
.io_mem_pfn = ttm_bo_default_io_mem_pfn,
# endif
#endif
@@ -651,7 +651,7 @@ int vbox_bo_create(struct drm_device *de
ret = ttm_bo_init(&vbox->ttm.bdev, &vboxbo->bo, size,
#endif /* < 6.1.0 */
ttm_bo_type_device, &vboxbo->placement,
-#if RTLNX_VER_MAX(4,17,0) && !RTLNX_RHEL_MAJ_PREREQ(7,6) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5)
+#if RTLNX_VER_MAX(4,17,0) && !RTLNX_RHEL_MAJ_PREREQ(7,6) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5) && !defined(SUSE_SLE12)
align >> PAGE_SHIFT, false, NULL, acc_size,
#elif RTLNX_VER_MAX(5,13,0) && !RTLNX_RHEL_RANGE(8,6, 8,99) /* < 5.13.0, < RHEL(8.6, 8.99) */
align >> PAGE_SHIFT, false, acc_size,
@@ -693,7 +693,7 @@ static inline u64 vbox_bo_gpu_offset(str
int vbox_bo_pin(struct vbox_bo *bo, u32 mem_type, u64 *gpu_addr)
{
-#if RTLNX_VER_MIN(4,16,0) || RTLNX_RHEL_MAJ_PREREQ(7,6) || RTLNX_SUSE_MAJ_PREREQ(15,1) || RTLNX_SUSE_MAJ_PREREQ(12,5)
+#if RTLNX_VER_MIN(4,16,0) || RTLNX_RHEL_MAJ_PREREQ(7,6) || RTLNX_SUSE_MAJ_PREREQ(15,1) || RTLNX_SUSE_MAJ_PREREQ(12,5) || defined(SUSE_SLE12)
struct ttm_operation_ctx ctx = { false, false };
#endif
int ret;
@@ -716,7 +716,7 @@ int vbox_bo_pin(struct vbox_bo *bo, u32
PLACEMENT_FLAGS(bo->placements[i]) |= TTM_PL_FLAG_NO_EVICT;
#endif
-#if RTLNX_VER_MAX(4,16,0) && !RTLNX_RHEL_MAJ_PREREQ(7,6) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5)
+#if RTLNX_VER_MAX(4,16,0) && !RTLNX_RHEL_MAJ_PREREQ(7,6) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5) && !defined(SUSE_SLE12)
ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
#else
ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx);
@@ -738,7 +738,7 @@ int vbox_bo_pin(struct vbox_bo *bo, u32
int vbox_bo_unpin(struct vbox_bo *bo)
{
-#if RTLNX_VER_MIN(4,16,0) || RTLNX_RHEL_MAJ_PREREQ(7,6) || RTLNX_SUSE_MAJ_PREREQ(15,1) || RTLNX_SUSE_MAJ_PREREQ(12,5)
+#if RTLNX_VER_MIN(4,16,0) || RTLNX_RHEL_MAJ_PREREQ(7,6) || RTLNX_SUSE_MAJ_PREREQ(15,1) || RTLNX_SUSE_MAJ_PREREQ(12,5) || defined(SUSE_SLE12)
# if RTLNX_VER_MAX(5,11,0) && !RTLNX_RHEL_MAJ_PREREQ(8,5)
struct ttm_operation_ctx ctx = { false, false };
# endif
@@ -761,7 +761,7 @@ int vbox_bo_unpin(struct vbox_bo *bo)
PLACEMENT_FLAGS(bo->placements[i]) &= ~TTM_PL_FLAG_NO_EVICT;
#endif
-#if RTLNX_VER_MAX(4,16,0) && !RTLNX_RHEL_MAJ_PREREQ(7,6) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5)
+#if RTLNX_VER_MAX(4,16,0) && !RTLNX_RHEL_MAJ_PREREQ(7,6) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5) && !defined(SUSE_SLE12)
ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
#elif RTLNX_VER_MAX(5,11,0) && !RTLNX_RHEL_MAJ_PREREQ(8,5)
ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx);
@@ -784,7 +784,7 @@ int vbox_bo_unpin(struct vbox_bo *bo)
*/
int vbox_bo_push_sysram(struct vbox_bo *bo)
{
-# if RTLNX_VER_MIN(4,16,0) || RTLNX_RHEL_MAJ_PREREQ(7,6) || RTLNX_SUSE_MAJ_PREREQ(15,1) || RTLNX_SUSE_MAJ_PREREQ(12,5)
+# if RTLNX_VER_MIN(4,16,0) || RTLNX_RHEL_MAJ_PREREQ(7,6) || RTLNX_SUSE_MAJ_PREREQ(15,1) || RTLNX_SUSE_MAJ_PREREQ(12,5) || defined(SUSE_SLE12)
struct ttm_operation_ctx ctx = { false, false };
# endif
int i, ret;
@@ -805,7 +805,7 @@ int vbox_bo_push_sysram(struct vbox_bo *
for (i = 0; i < bo->placement.num_placement; i++)
PLACEMENT_FLAGS(bo->placements[i]) |= TTM_PL_FLAG_NO_EVICT;
-# if RTLNX_VER_MAX(4,16,0) && !RTLNX_RHEL_MAJ_PREREQ(7,6) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5)
+# if RTLNX_VER_MAX(4,16,0) && !RTLNX_RHEL_MAJ_PREREQ(7,6) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5) && !defined(SUSE_SLE12)
ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
# else
ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx);
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_drv.h
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/drm/vbox_drv.h
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_drv.h
@@ -87,6 +87,9 @@
#else
# define RTLNX_RHEL_MAX(a_iMajor, a_iMinor) (0)
#endif
+#if defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 12 && CONFIG_SUSE_PATCHLEVEL >= 4
+# define SUSE_SLE12
+#endif
/** @def RTLNX_RHEL_RANGE
* Check that it's a RedHat kernel in the given version range.
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_mode.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/drm/vbox_mode.c
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/drm/vbox_mode.c
@@ -557,7 +557,8 @@ static void vbox_set_edid(struct drm_con
for (i = 0; i < EDID_SIZE - 1; ++i)
sum += edid[i];
edid[EDID_SIZE - 1] = (0x100 - (sum & 0xFF)) & 0xFF;
-#if RTLNX_VER_MIN(4,19,0) || RTLNX_RHEL_MAJ_PREREQ(7,7) || RTLNX_RHEL_MAJ_PREREQ(8,1) || RTLNX_SUSE_MAJ_PREREQ(15,1) || RTLNX_SUSE_MAJ_PREREQ(12,5)
+#if RTLNX_VER_MIN(4,19,0) || RTLNX_RHEL_MAJ_PREREQ(7,7) || \
+ defined(SUSE_SLE12) || RTLNX_RHEL_MAJ_PREREQ(8,1) || RTLNX_SUSE_MAJ_PREREQ(15,1) || RTLNX_SUSE_MAJ_PREREQ(12,5)
drm_connector_update_edid_property(connector, (struct edid *)edid);
#else
drm_mode_connector_update_edid_property(connector, (struct edid *)edid);
@@ -732,7 +733,7 @@ static int vbox_connector_init(struct dr
drm_connector_register(connector);
#endif
-#if RTLNX_VER_MIN(4,19,0) || RTLNX_RHEL_MAJ_PREREQ(7,7) || RTLNX_RHEL_MAJ_PREREQ(8,1) || RTLNX_SUSE_MAJ_PREREQ(15,1) || RTLNX_SUSE_MAJ_PREREQ(12,5)
+#if RTLNX_VER_MIN(4,19,0) || RTLNX_RHEL_MAJ_PREREQ(7,7) || defined(SUSE_SLE12) || RTLNX_RHEL_MAJ_PREREQ(8,1) || RTLNX_SUSE_MAJ_PREREQ(15,1) || RTLNX_SUSE_MAJ_PREREQ(12,5)
drm_connector_attach_encoder(connector, encoder);
#else
drm_mode_connector_attach_encoder(connector, encoder);

107
fixes_for_vboxconfig.patch Normal file
View File

@ -0,0 +1,107 @@
Index: VirtualBox-7.0.14/src/VBox/Frontends/VirtualBox/nls/VirtualBox_lt.ts
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Frontends/VirtualBox/nls/VirtualBox_lt.ts
+++ VirtualBox-7.0.14/src/VBox/Frontends/VirtualBox/nls/VirtualBox_lt.ts
@@ -92,19 +92,19 @@
<translation type="vanished">VirtualBox Linux branduolio modulis (vboxdrv) arba nėra įkeltas, arba nepakanka leidimų dirbti su /dev/vboxdrv. Iš naujo įdiekite branduolio modulį root teisėmis įvykdydami &lt;br/&gt;&lt;br/&gt;&lt;font color=blue&gt;&apos;/sbin/rcvboxdrv setup&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;. Jei įmanoma pirma turite įsidiegti DKMS paketą. Šis paketas seka Linux branduolio pakeitimus ir, jei reikia, perkompiliuoja vboxdrv branduolio modulį.</translation>
</message>
<message>
- <source>The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;as root.</source>
- <translation type="vanished">VirtualBox Linux branduolio tvarkyklė (vboxdrv) neįkelta arba /dev/vboxdrv turi bėdų su leidimais. Iš naujo įdiekite branduolio modulį įvykdydami &lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;/sbin/vboxconfig&lt;/font&gt;&lt;br/&gt;&lt;br/&gt; administratoriaus (root) teisėmis.</translation>
+ <source>The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/usr/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;as root.</source>
+ <translation type="vanished">VirtualBox Linux branduolio tvarkyklė (vboxdrv) neįkelta arba /dev/vboxdrv turi bėdų su leidimais. Iš naujo įdiekite branduolio modulį įvykdydami &lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;/usr/sbin/vboxconfig&lt;/font&gt;&lt;br/&gt;&lt;br/&gt; administratoriaus (root) teisėmis.</translation>
</message>
<message>
- <source>The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Executing&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;may correct this. Make sure that you do not mix the OSE version and the PUEL version of VirtualBox.</source>
- <translation type="vanished">VirtualBox branduolio modulis neatitinka VirtualBox versijos. Panašu, kad VirtualBox diegimas nebuvo sėkmingas. Pataisyti gali pavykti įvykdžius&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;/sbin/vboxconfig&lt;/font&gt;&lt;br/&gt;&lt;br/&gt; Įsitikinkite, ar nemaišote VirtualBox OSE ir PUEL versijų.</translation>
+ <source>The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Executing&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/usr/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;may correct this. Make sure that you do not mix the OSE version and the PUEL version of VirtualBox.</source>
+ <translation type="vanished">VirtualBox branduolio modulis neatitinka VirtualBox versijos. Panašu, kad VirtualBox diegimas nebuvo sėkmingas. Pataisyti gali pavykti įvykdžius&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;/usr/sbin/vboxconfig&lt;/font&gt;&lt;br/&gt;&lt;br/&gt; Įsitikinkite, ar nemaišote VirtualBox OSE ir PUEL versijų.</translation>
</message>
<message>
- <source>The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please try setting it up again by executing&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;as root.&lt;br/&gt;&lt;br/&gt;If your system has EFI Secure Boot enabled you may also need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system&apos;s documentation for more information.</source>
+ <source>The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please try setting it up again by executing&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/usr/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;as root.&lt;br/&gt;&lt;br/&gt;If your system has EFI Secure Boot enabled you may also need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system&apos;s documentation for more information.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Executing&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;may correct this. Make sure that you are not mixing builds of VirtualBox from different sources.</source>
+ <source>The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Executing&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/usr/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;may correct this. Make sure that you are not mixing builds of VirtualBox from different sources.</source>
<translation type="unfinished"></translation>
</message>
</context>
Index: VirtualBox-7.0.14/src/VBox/Frontends/VirtualBox/nls/VirtualBox_tr.ts
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Frontends/VirtualBox/nls/VirtualBox_tr.ts
+++ VirtualBox-7.0.14/src/VBox/Frontends/VirtualBox/nls/VirtualBox_tr.ts
@@ -148,20 +148,20 @@
<translation type="obsolete">Kare Boyutu: %1x%2, Kare Oranı: %3fps, Bit Oranı: %4kbps</translation>
</message>
<message>
- <source>The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;as root.</source>
- <translation type="vanished">VirtualBox Linux çekirdek sürücüsü (vboxdrv) ya yüklenmedi ya da /dev/vboxdrv ile ilgili izin sorunu var. Lütfen root kullanıcısı olarak &lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt; dosyasını çalıştırarak çekirdek modülünü yeniden yükleyin.</translation>
+ <source>The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/usr/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;as root.</source>
+ <translation type="vanished">VirtualBox Linux çekirdek sürücüsü (vboxdrv) ya yüklenmedi ya da /dev/vboxdrv ile ilgili izin sorunu var. Lütfen root kullanıcısı olarak &lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/usr/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt; dosyasını çalıştırarak çekirdek modülünü yeniden yükleyin.</translation>
</message>
<message>
- <source>The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Executing&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;may correct this. Make sure that you do not mix the OSE version and the PUEL version of VirtualBox.</source>
- <translation type="vanished">VirtualBox çekirdek modülleri VirtualBox&apos;ın bu sürümüyle uyuşmuyor. VirtualBox&apos;ın kurulumu görünüşe göre başarılı olmadı. &lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt; dosyasını çalıştırmak bunu düzeltebilir. VirtualBox&apos;ın OSE ve PUEL sürümlerini karıştırmadığınızdan emin olun.</translation>
+ <source>The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Executing&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/usr/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;may correct this. Make sure that you do not mix the OSE version and the PUEL version of VirtualBox.</source>
+ <translation type="vanished">VirtualBox çekirdek modülleri VirtualBox&apos;ın bu sürümüyle uyuşmuyor. VirtualBox&apos;ın kurulumu görünüşe göre başarılı olmadı. &lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/usr/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt; dosyasını çalıştırmak bunu düzeltebilir. VirtualBox&apos;ın OSE ve PUEL sürümlerini karıştırmadığınızdan emin olun.</translation>
</message>
<message>
- <source>The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please try setting it up again by executing&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;as root.&lt;br/&gt;&lt;br/&gt;If your system has EFI Secure Boot enabled you may also need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system&apos;s documentation for more information.</source>
- <translation>VirtualBox Linux çekirdek sürücüsü ya yüklenmedi ya da doğru olarak ayarlanmadı. Lütfen root kullanıcısı olarak &lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt; dosyasını çalıştırarak bunu tekrar ayarlamayı deneyin. Eğer sisteminizde EFI Secure Boot etkinleştirildiyse, çekirdek modüllerini (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) yüklemeden önce ayrıca bunları imzalamanız gerekebilir. Lütfen daha fazla bilgi için Linux sisteminin belgelerine bakın.</translation>
+ <source>The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please try setting it up again by executing&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/usr/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;as root.&lt;br/&gt;&lt;br/&gt;If your system has EFI Secure Boot enabled you may also need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system&apos;s documentation for more information.</source>
+ <translation>VirtualBox Linux çekirdek sürücüsü ya yüklenmedi ya da doğru olarak ayarlanmadı. Lütfen root kullanıcısı olarak &lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/usr/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt; dosyasını çalıştırarak bunu tekrar ayarlamayı deneyin. Eğer sisteminizde EFI Secure Boot etkinleştirildiyse, çekirdek modüllerini (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) yüklemeden önce ayrıca bunları imzalamanız gerekebilir. Lütfen daha fazla bilgi için Linux sisteminin belgelerine bakın.</translation>
</message>
<message>
- <source>The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Executing&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;may correct this. Make sure that you are not mixing builds of VirtualBox from different sources.</source>
- <translation>VirtualBox çekirdek modülleri VirtualBox&apos;ın bu sürümüyle uyuşmuyor. VirtualBox&apos;ın kurulumu görünüşe göre başarılı olmadı. &lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt; dosyasını çalıştırmak bunu düzeltebilir. Farklı kaynaklardan gelen VirtualBox&apos;ın yapımlarını karıştırmadığınızdan emin olun.</translation>
+ <source>The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Executing&lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/usr/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;may correct this. Make sure that you are not mixing builds of VirtualBox from different sources.</source>
+ <translation>VirtualBox çekirdek modülleri VirtualBox&apos;ın bu sürümüyle uyuşmuyor. VirtualBox&apos;ın kurulumu görünüşe göre başarılı olmadı. &lt;br/&gt;&lt;br/&gt; &lt;font color=blue&gt;&apos;/usr/sbin/vboxconfig&apos;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt; dosyasını çalıştırmak bunu düzeltebilir. Farklı kaynaklardan gelen VirtualBox&apos;ın yapımlarını karıştırmadığınızdan emin olun.</translation>
</message>
</context>
<context>
Index: VirtualBox-7.0.14/src/VBox/Frontends/VirtualBox/src/main.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Frontends/VirtualBox/src/main.cpp
+++ VirtualBox-7.0.14/src/VBox/Frontends/VirtualBox/src/main.cpp
@@ -99,7 +99,7 @@ QString g_QStrHintLinuxNoMemory = QAppli
QString g_QStrHintLinuxNoDriver = QApplication::tr(
"The VirtualBox Linux kernel driver is either not loaded or not set "
"up correctly. Please try setting it up again by executing<br/><br/>"
- " <font color=blue>'/sbin/vboxconfig'</font><br/><br/>"
+ " <font color=blue>'/usr/sbin/vboxconfig'</font><br/><br/>"
"as root.<br/><br/>"
"If your system has EFI Secure Boot enabled you may also need to sign "
"the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before "
@@ -118,7 +118,7 @@ QString g_QStrHintLinuxWrongDriverVersio
"The VirtualBox kernel modules do not match this version of "
"VirtualBox. The installation of VirtualBox was apparently not "
"successful. Executing<br/><br/>"
- " <font color=blue>'/sbin/vboxconfig'</font><br/><br/>"
+ " <font color=blue>'/usr/sbin/vboxconfig'</font><br/><br/>"
"may correct this. Make sure that you are not mixing builds "
"of VirtualBox from different sources."
);
Index: VirtualBox-7.0.14/src/VBox/Installer/linux/VBox.sh
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Installer/linux/VBox.sh
+++ VirtualBox-7.0.14/src/VBox/Installer/linux/VBox.sh
@@ -72,7 +72,7 @@ WARNING: The vboxdrv kernel module is no
available for the current kernel (`uname -r`) or it failed to
load. Please recompile the kernel module and install it by
- sudo /sbin/vboxconfig
+ sudo /usr/sbin/vboxconfig
You will not be able to start VMs until this problem is fixed.
EOF
@@ -80,7 +80,7 @@ elif [ ! -c /dev/vboxdrv ]; then
cat << EOF
WARNING: The character device /dev/vboxdrv does not exist. Try
- sudo /sbin/vboxconfig
+ sudo /usr/sbin/vboxconfig
and if that is not successful, try to re-install the package.

20
gcc5-real-support.patch Normal file
View File

@ -0,0 +1,20 @@
Index: VirtualBox-7.0.14/configure
===================================================================
--- VirtualBox-7.0.14.orig/configure
+++ VirtualBox-7.0.14/configure
@@ -475,8 +475,13 @@ check_gcc()
log_failure "cannot execute '$CXX -dumpversion'"
fail really
fi
- cc_maj=`echo $cc_ver|cut -d. -f1`
- cc_min=`echo $cc_ver|cut -d. -f2`
+ if echo $cc_ver | grep -q '\.'; then
+ cc_maj=`echo $cc_ver|cut -d. -f1`
+ cc_min=`echo $cc_ver|cut -d. -f2`
+ else
+ cc_maj=$cc_ver
+ cc_min=0
+ fi
if [ "x$cc_ver" != "x$cxx_ver" ]; then
log_failure "gcc version $cc_ver does not match g++ version $cxx_ver"
fail really

22
libxml21206.patch Normal file
View File

@ -0,0 +1,22 @@
Index: VirtualBox-7.0.18/src/libs/libxml2-2.12.6/include/vboxconfig.h
===================================================================
--- VirtualBox-7.0.18.orig/src/libs/libxml2-2.12.6/include/vboxconfig.h
+++ VirtualBox-7.0.18/src/libs/libxml2-2.12.6/include/vboxconfig.h
@@ -387,7 +387,7 @@
#define PACKAGE_TARNAME ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "2.6.30"
+#define PACKAGE_VERSION "2.12.6"
/* Define to 1 if the C compiler supports function prototypes. */
#define PROTOTYPES 1
@@ -399,7 +399,7 @@
#undef SUPPORT_IP6
/* Version number of package */
-#define VERSION "2.6.30"
+#define VERSION "2.12.6"
/* Determine what socket length (socklen_t) data type is */
#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)

View File

@ -0,0 +1,30 @@
Index: VirtualBox-7.0.14/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
+++ VirtualBox-7.0.14/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
@@ -45,7 +45,7 @@
#include <iprt/assert.h>
#include <iprt/errcore.h>
#include "r0drv/alloc-r0drv.h"
-
+#include <linux/kmemleak.h>
#include "internal/initterm.h"
@@ -78,11 +78,12 @@ DECLHIDDEN(int) rtR0MemAllocEx(size_t cb
&& !(fFlags & RTMEMHDR_FLAG_ANY_CTX) ))
{
fFlags &= ~RTMEMHDR_FLAG_KMALLOC;
- pHdr = vmalloc(cb + sizeof(*pHdr));
- }
+ pHdr = vmalloc(cb + sizeof(*pHdr));
+ }
+ kmemleak_not_leak(pHdr);
}
- else
- pHdr = vmalloc(cb + sizeof(*pHdr));
+ else
+ pHdr = vmalloc(cb + sizeof(*pHdr));
if (RT_LIKELY(pHdr))
{
/*

26
python311.patch Normal file
View File

@ -0,0 +1,26 @@
Index: VirtualBox-7.0.14/configure
===================================================================
--- VirtualBox-7.0.14.orig/configure
+++ VirtualBox-7.0.14/configure
@@ -2178,7 +2178,7 @@ extern "C" int main(void)
}
EOF
found=
- SUPPYTHONLIBS="python2.7 python2.6 python3.1 python3.2 python3.3 python3.4 python3.4m python3.5 python3.5m python3.6 python3.6m python3.7 python3.7m python3.8 python3.9 python3.10 python3.11 python3.12"
+ SUPPYTHONLIBS="python2.7 python2.6 python3.1 python3.2 python3.3 python3.4 python3.4m python3.5 python3.5m python3.6 python3.6m python3.7 python3.7m python3.8 python3.9 python3.10 python3.11 python3.12 python3.11 python3.11m"
for p in $PYTHONDIR; do
for d in $SUPPYTHONLIBS; do
for b in lib/x86_64-linux-gnu lib/i386-linux-gnu lib64 lib/64 lib; do
Index: VirtualBox-7.0.14/src/VBox/Installer/linux/routines.sh
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Installer/linux/routines.sh
+++ VirtualBox-7.0.14/src/VBox/Installer/linux/routines.sh
@@ -444,7 +444,7 @@ maybe_run_python_bindings_installer() {
# the VirtualBox API bindings. Needs to prevent double installs which waste
# quite a bit of time.
PYTHONS=""
- for p in python2.6 python2.7 python2 python3.3 python3.4 python3.5 python3.6 python3.7 python3.8 python3.9 python3.10 python3 python; do
+ for p in python2.6 python2.7 python2 python3.3 python3.4 python3.5 python3.6 python3.7 python3.8 python3.9 python3.10 python3.11 python3 python; do
if [ "`$p -c 'import sys
if sys.version_info >= (2, 6) and (sys.version_info < (3, 0) or sys.version_info >= (3, 3)):
print(\"test\")' 2> /dev/null`" != "test" ]; then

View File

@ -0,0 +1,39 @@
Index: VirtualBox-7.0.18/Makefile.kmk
===================================================================
--- VirtualBox-7.0.18.orig/Makefile.kmk
+++ VirtualBox-7.0.18/Makefile.kmk
@@ -824,7 +824,6 @@ VBOX_CORE_DOXYFILE_INPUT_DIRS = \
src/VBox/Additions/x11/vboxmouse \
src/VBox/Additions/x11/vboxmouse/xorg70 \
src/VBox/Additions/x11/vboxmouse/xorg71 \
- src/VBox/Additions/x11/vboxvideo \
src/VBox/NetworkServices \
src/VBox/NetworkServices/Dhcpd \
src/VBox/NetworkServices/NAT \
Index: VirtualBox-7.0.18/src/VBox/Additions/x11/vboxvideo/Makefile.kmk
===================================================================
--- VirtualBox-7.0.18.orig/src/VBox/Additions/x11/vboxvideo/Makefile.kmk
+++ VirtualBox-7.0.18/src/VBox/Additions/x11/vboxvideo/Makefile.kmk
@@ -404,7 +404,8 @@ vboxvideo_drv_118_INCS += $(PATH_ROOT)/s
vboxvideo_drv_118_SOURCES := $(vboxvideo_drv_17_SOURCES)
vboxvideo_drv_118_LIBS += $(vboxvideo_drv_70_LIBS)
-ifdef VBOX_USE_SYSTEM_XORG_HEADERS
+# Fix to never build
+ifdef XX_VBOX_USE_SYSTEM_XORG_HEADERS
# Build using local X.Org headers. We assume X.Org Server 1.7 or later.
DLLS := $(filter-out vboxvideo_drv_%,$(DLLS)) vboxvideo_drv_system
SYSMODS := $(filter-out vboxvideo_drv%,$(SYSMODS))
Index: VirtualBox-7.0.18/src/VBox/Additions/x11/Makefile.kmk
===================================================================
--- VirtualBox-7.0.18.orig/src/VBox/Additions/x11/Makefile.kmk
+++ VirtualBox-7.0.18/src/VBox/Additions/x11/Makefile.kmk
@@ -32,7 +32,7 @@ include $(KBUILD_PATH)/subheader.kmk
if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris)
include $(PATH_SUB_CURRENT)/VBoxClient/Makefile.kmk
ifndef VBOX_NO_LEGACY_XORG_X11
- include $(PATH_SUB_CURRENT)/vboxvideo/Makefile.kmk
+# include $(PATH_SUB_CURRENT)/vboxvideo/Makefile.kmk
ifn1of ($(KBUILD_TARGET), netbsd solaris)
include $(PATH_SUB_CURRENT)/vboxmouse/Makefile.kmk
endif

40
security_fixes.patch Normal file
View File

@ -0,0 +1,40 @@
# This patch file is to warn future maintainers of VirtualBox on openSUSE
# platforms that the distributed versions of vboxadd.sh and vboxdrv.sh
# contain security holes. If you need to use these scripts in the future,
# please consult the Security Group at openSUSE.
#
# January 31, 2019 - Larry Finger
#
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/installer/vboxadd.sh
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/installer/vboxadd.sh
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/installer/vboxadd.sh
@@ -1228,9 +1228,11 @@ dmnstatus()
fi
}
-for i; do
- case "$i" in quiet) QUIET=yes;; esac
-done
+echo "This script has insecurities. It must never be used in openSUSE without consultine Security."
+exit 1
+
+case "$2" in quiet)
+ QUIET=yes;;
case "$1" in
# Does setup without clean-up first and marks all kernels currently found on the
# system so that we can see later if any were added.
Index: VirtualBox-7.0.14/src/VBox/Installer/linux/vboxdrv.sh
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Installer/linux/vboxdrv.sh
+++ VirtualBox-7.0.14/src/VBox/Installer/linux/vboxdrv.sh
@@ -48,6 +48,9 @@ DEVICE=/dev/vboxdrv
MODPROBE=/sbin/modprobe
SCRIPTNAME=vboxdrv.sh
+echo "This script has insecurities. It must never be used in openSUSE without consultine Security."
+exit 1
+
# The below is GNU-specific. See VBox.sh for the longer Solaris/OS X version.
TARGET=`readlink -e -- "${0}"` || exit 1
SCRIPT_DIR="${TARGET%/[!/]*}"

17
smap.diff Normal file
View File

@ -0,0 +1,17 @@
Index: VirtualBox-7.0.14/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
+++ VirtualBox-7.0.14/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
@@ -61,6 +61,12 @@
# include <iprt/power.h>
# define VBOX_WITH_SUSPEND_NOTIFICATION
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
+# include <asm/smap.h>
+#else
+static inline void clac(void) { }
+static inline void stac(void) { }
+#endif
#include <linux/sched.h>
#include <linux/miscdevice.h>

18
turn_off_cloud_net.patch Normal file
View File

@ -0,0 +1,18 @@
Index: VirtualBox-7.0.18/Config.kmk
===================================================================
--- VirtualBox-7.0.18.orig/Config.kmk
+++ VirtualBox-7.0.18/Config.kmk
@@ -981,11 +981,9 @@ if1of ($(KBUILD_TARGET), freebsd linux)
endif
# Use new VBoxNetDhcpd instead of old VBoxNetDHCP
VBOX_WITH_DHCPD = 1
-# Experimental suport for cloud network integration (depends on libssh)
-ifdef VBOX_WITH_LIBSSH
- VBOX_WITH_CLOUD_NET = 1
-endif
# Use Mac OS X VMNET API instead of network kernel extensions
+# Experimental suport for cloud network integration
+#VBOX_WITH_CLOUD_NET = 1
VBOX_WITH_VMNET = 1
## @}

64
update-extpack.sh Normal file
View File

@ -0,0 +1,64 @@
#!/bin/bash
# Script to update extpack
# The idea for this method and the original code came from Larry Len Rainey.
#
# This implementation by Larry Finger
# Define some symbols and determine the current version of VB
VBOXMANAGE=/usr/bin/VBoxManage
AWK=/usr/bin/awk
GREP=/usr/bin/grep
WGET=/usr/bin/wget
VBOX_VERSION=`$VBOXMANAGE --version | $AWK -F_ {'print $1'}`
# Define a symbol for the name of the extpack matching the VB version
VBOX_EXT=`echo Oracle_VM_VirtualBox_Extension_Pack-${VBOX_VERSION}.vbox-extpack`
# Full path to extpack license file
LICENSE_PATH="/usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/ExtPack-license.rtf"
# Determine the installed version of extpack, if any.
EXTPACK_CURRENT=`$VBOXMANAGE list extpacks | $GREP -A1 "Oracle VM VirtualBox Extension Pack" | $GREP Version | $AWK -F\ {'print $2'}`
# The extpacks are licensed under a Personal Use and Evaluation License
# At some point, the user must agree to the conditions of that license.
# If no extpack is installed on this system, then there is no agreement,
# thus this script cannot install the extpack.
#
# This situation applies to new installations that could conform to the license,
# but more importantly, it handles commercial setups that have not purchased
# the necessary license.
# Check if extpack is currently installed. If not exit
if [ -z $EXTPACK_CURRENT ]; then
exit 0
fi
#
# An extpack has been installed on this system. Now we need to check if
# it was issued under the current version of the license.
#Note to maintainers: The "version 11" in the next command must be changed
# manually when Oracle revises the license.
LICENSE_CHECK=`$GREP "version 11" $LICENSE_PATH | $AWK -F\ {'print $2'}`
if [ -z $LICENSE_CHECK ]; then
# New license version does not match the current installation.
# The user will need to agree to the new version, thus we do nothing here.
exit 0
fi
if [ $VBOX_VERSION == $EXTPACK_CURRENT ]; then
# The extpack currently installed matches - we are done
exit 0
fi
# A new version of extpack is needed - switch to directory that can be written, and download it
pushd ~ > /dev/null 2>&1
$WGET https://download.virtualbox.org/virtualbox/$VBOX_VERSION/$VBOX_EXT > /dev/null 2>&1
# Now install it
echo Y | $VBOXMANAGE extpack install --replace $VBOX_EXT > /dev/null 2>&1
# Clean up by deleting downloaded file and restoring the original working directory
rm -f $VBOX_EXT
popd ~ > /dev/null 2>&1

25
vbox-default-os-type.diff Normal file
View File

@ -0,0 +1,25 @@
Index: VirtualBox-7.0.14/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp
+++ VirtualBox-7.0.14/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp
@@ -397,15 +397,15 @@ void UINameAndSystemEditor::sltFamilyCha
if (iIndexWin10 != -1)
m_pComboType->setCurrentIndex(iIndexWin10);
}
- /* Or select Oracle Linux item for Linux family as default: */
+ /* Or select openSUSE item for Linux family as default: */
else if (m_strFamilyId == "Linux")
{
- QString strDefaultID = "Oracle";
+ QString strDefaultID = "openSUSE";
if (ARCH_BITS == 64)
strDefaultID += "_64";
- const int iIndexUbuntu = m_pComboType->findData(strDefaultID, TypeID);
- if (iIndexUbuntu != -1)
- m_pComboType->setCurrentIndex(iIndexUbuntu);
+ const int iIndexOpenSUSE = m_pComboType->findData(strDefaultID, TypeID);
+ if (iIndexOpenSUSE != -1)
+ m_pComboType->setCurrentIndex(iIndexOpenSUSE);
}
/* Else simply select the first one present: */
else

View File

@ -0,0 +1,13 @@
Index: VirtualBox-7.0.14/src/VBox/Main/webservice/Makefile.kmk
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Main/webservice/Makefile.kmk
+++ VirtualBox-7.0.14/src/VBox/Main/webservice/Makefile.kmk
@@ -848,7 +848,7 @@ ifdef VBOX_GSOAP_INSTALLED
$(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
$(call MSG_GENERATE,,lots of files,$(GSOAPH_RELEVANT))
$(RM) -f $@
- $(REDIRECT) -C $(VBOXWEB_OUT_DIR) -- $(VBOX_SOAPCPP2) $(VBOXWEB_SOAPCPP2_SKIP_FILES) -L -2 -w -I$(VBOX_PATH_GSOAP_IMPORT) $(GSOAPH_RELEVANT)
+ $(REDIRECT) -C $(VBOXWEB_OUT_DIR) -- $(VBOX_SOAPCPP2) $(VBOXWEB_SOAPCPP2_SKIP_FILES) -z1 -L -2 -w -I$(VBOX_PATH_GSOAP_IMPORT) $(GSOAPH_RELEVANT)
ifeq ($(KBUILD_TARGET),win) # MSC -Wall workaround.
$(CP) -f "$(VBOXWEB_SOAP_CLIENT_H)" "$(VBOXWEB_SOAP_CLIENT_H).tmp"
$(SED) -f $(VBOX_PATH_WEBSERVICE)/stdsoap2.sed --output "$(VBOXWEB_SOAP_CLIENT_H)" "$(VBOXWEB_SOAP_CLIENT_H).tmp"

31
vbox-disable-updates.diff Normal file
View File

@ -0,0 +1,31 @@
Index: VirtualBox-7.0.14/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
+++ VirtualBox-7.0.14/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
@@ -99,8 +99,6 @@ void UISettingsDialogGlobal::retranslate
m_pSelector->setItemText(GlobalSettingsPageType_Input, tr("Input"));
#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
- /* Update page: */
- m_pSelector->setItemText(GlobalSettingsPageType_Update, tr("Update"));
#endif
/* Language page: */
@@ -225,17 +223,6 @@ void UISettingsDialogGlobal::prepare()
addPageHelpKeyword(iPageIndex, "preferences");
break;
}
-#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
- /* Update page: */
- case GlobalSettingsPageType_Update:
- {
- pSettingsPage = new UIGlobalSettingsUpdate;
- addItem(":/refresh_32px.png", ":/refresh_24px.png", ":/refresh_16px.png",
- iPageIndex, "#update", pSettingsPage);
- addPageHelpKeyword(iPageIndex, "preferences");
- break;
- }
-#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
/* Language page: */
case GlobalSettingsPageType_Language:
{

25
vbox-fpie.diff Normal file
View File

@ -0,0 +1,25 @@
Index: VirtualBox-7.0.14/Config.kmk
===================================================================
--- VirtualBox-7.0.14.orig/Config.kmk
+++ VirtualBox-7.0.14/Config.kmk
@@ -6777,6 +6777,9 @@ TEMPLATE_VBoxR3HardenedExe_LDFLAGS.darwi
ifeq ($(KBUILD_TARGET),linux)
# not necessary except USE_LIB_PCAP is defined in SUPR3HardenedMain.cpp
# TEMPLATE_VBoxR3HardenedExe_LIBS += cap
+ TEMPLATE_VBOXR3HARDENEDEXE_CXXFLAGS.linux = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.linux) -fPIE
+ TEMPLATE_VBOXR3HARDENEDEXE_CFLAGS.linux = $(TEMPLATE_VBOXR3EXE_CFLAGS.linux) -fPIE
+ TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.linux = $(TEMPLATE_VBOXR3EXE_LDFLAGS.linux) -pie
endif
ifeq ($(KBUILD_TARGET),win) # No CRT!
TEMPLATE_VBoxR3HardenedExe_SDKS = VBoxNtDll $(TEMPLATE_VBoxR3Exe_SDKS)
@@ -6809,8 +6812,8 @@ ifeq ($(KBUILD_TARGET),win) # No CRT!
TEMPLATE_VBoxR3HardenedExe_VBOX_IMPORT_CHECKER.win = noimports
else ifn1of ($(KBUILD_TARGET), os2)
ifneq ($(KBUILD_TYPE),asan) # Keep RPATH in asan builds so we can find libasan.so.X and libubsan.so.Y.
- TEMPLATE_VBoxR3HardenedExe_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBoxR3Exe_LDFLAGS))
- TEMPLATE_VBoxR3HardenedExe_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3Exe_LDFLAGS.linux))
+ TEMPLATE_VBoxR3HardenedExe_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBoxR3Exe_LDFLAGS)) -pie
+ TEMPLATE_VBoxR3HardenedExe_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3Exe_LDFLAGS.linux)) -pie
endif
endif

40
vbox-gsoapssl-deps.diff Normal file
View File

@ -0,0 +1,40 @@
Index: VirtualBox-7.0.14/src/VBox/Main/webservice/Makefile.kmk
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Main/webservice/Makefile.kmk
+++ VirtualBox-7.0.14/src/VBox/Main/webservice/Makefile.kmk
@@ -412,11 +412,12 @@ ifdef VBOX_GSOAP_INSTALLED
endif
endif
vboxwebsrv_LIBS += \
- $(PATH_STAGE_LIB)/vboxsoap$(VBOX_SUFF_LIB) \
- $(VBOX_GSOAP_CXX_LIBS) \
- $(LIB_RUNTIME)
- vboxwebsrv_LIBS.solaris += socket nsl
- ifdef VBOX_WITH_WEBSERVICES_SSL
+ $(PATH_STAGE_LIB)/vboxsoap$(VBOX_SUFF_LIB) \
+ $(VBOX_GSOAP_CXX_LIBS) \
+ ssl crypto z \
+ $(LIB_RUNTIME)
+ vboxwebsrv_LIBS.solaris += socket nsl
+ ifdef VBOX_WITH_WEBSERVICES_SSL
vboxwebsrv_DEFS += WITH_OPENSSL
vboxwebsrv_SDKS += VBoxOpenSsl
endif
@@ -588,11 +589,12 @@ ifdef VBOX_GSOAP_INSTALLED
$(VBOXWEB_OUT_DIR) \
.
webtest_LIBS += \
- $(PATH_STAGE_LIB)/vboxsoap$(VBOX_SUFF_LIB) \
- $(VBOX_GSOAP_CXX_LIBS) \
- $(LIB_RUNTIME)
- webtest_LIBS.solaris += nsl
- ifdef VBOX_WITH_WEBSERVICES_SSL
+ $(PATH_STAGE_LIB)/vboxsoap$(VBOX_SUFF_LIB) \
+ $(VBOX_GSOAP_CXX_LIBS) \
+ ssl crypto z \
+ $(LIB_RUNTIME)
+ webtest_LIBS.solaris += nsl
+ ifdef VBOX_WITH_WEBSERVICES_SSL
webtest_DEFS += WITH_OPENSSL
webtest_SDKS += VBoxOpenSsl
endif

406
vbox-no-build-dates.diff Normal file
View File

@ -0,0 +1,406 @@
Index: VirtualBox-7.0.14/src/VBox/Frontends/VBoxFB/VBoxFB.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Frontends/VBoxFB/VBoxFB.cpp
+++ VirtualBox-7.0.14/src/VBox/Frontends/VBoxFB/VBoxFB.cpp
@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
printf("VirtualBox DirectFB GUI built %s %s\n"
"Copyright (C) 2004-" VBOX_C_YEAR " " VBOX_VENDOR "\n"
- "Copyright (C) 2004-2005 secunet Security Networks AG\n", __DATE__, __TIME__);
+ "Copyright (C) 2004-2005 secunet Security Networks AG\n");
fputs("\nWARNING! Unmaintained code.\nWARNING! Needs fixing & debugging!\n\n", stdout);
Index: VirtualBox-7.0.14/src/VBox/Runtime/common/string/uniread.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Runtime/common/string/uniread.cpp
+++ VirtualBox-7.0.14/src/VBox/Runtime/common/string/uniread.cpp
@@ -1049,7 +1049,7 @@ int PrintHeader(const char *argv0, const
" * IPRT - Unicode Tables.\n"
" *\n"
" * Automatically Generated from %s\n"
- " * by %s (" __DATE__ " " __TIME__ ")\n"
+ " * by %s\n"
" */\n"
"\n"
"/*\n"
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/nsprpub/lib/libc/src/plvrsion.c
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/nsprpub/lib/libc/src/plvrsion.c
+++ VirtualBox-7.0.14/src/libs/xpcom18a4/nsprpub/lib/libc/src/plvrsion.c
@@ -42,16 +42,13 @@
/**************************IDENTITY AND VERSIONING***********************/
/************************************************************************/
#include "_pl_bld.h"
-#if !defined(_BUILD_TIME)
-#ifdef HAVE_LONG_LONG
-#define _BUILD_TIME 0
-#else
+
+#undef _BUILD_TIME
#define _BUILD_TIME {0, 0}
-#endif
-#endif
-#if !defined(_BUILD_STRING)
+
+#undef _BUILD_STRING
#define _BUILD_STRING ""
-#endif
+
#if !defined(_PRODUCTION)
#define _PRODUCTION ""
#endif
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/nsprpub/pr/src/prvrsion.c
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/nsprpub/pr/src/prvrsion.c
+++ VirtualBox-7.0.14/src/libs/xpcom18a4/nsprpub/pr/src/prvrsion.c
@@ -44,16 +44,10 @@
#ifndef XP_MAC
#include "_pr_bld.h"
#endif
-#if !defined(_BUILD_TIME)
-#ifdef HAVE_LONG_LONG
-#define _BUILD_TIME 0
-#else
+#undef _BUILD_TIME
#define _BUILD_TIME {0, 0}
-#endif
-#endif
-#if !defined(_BUILD_STRING)
+#undef _BUILD_STRING
#define _BUILD_STRING ""
-#endif
#if !defined(_PRODUCTION)
#define _PRODUCTION ""
#endif
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/nsprpub/lib/prstreams/plvrsion.c
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/nsprpub/lib/prstreams/plvrsion.c
+++ VirtualBox-7.0.14/src/libs/xpcom18a4/nsprpub/lib/prstreams/plvrsion.c
@@ -42,16 +42,13 @@
/**************************IDENTITY AND VERSIONING***********************/
/************************************************************************/
#include "_pl_bld.h"
-#if !defined(_BUILD_TIME)
-#ifdef HAVE_LONG_LONG
-#define _BUILD_TIME 0
-#else
+
+#undef _BUILD_TIME
#define _BUILD_TIME {0, 0}
-#endif
-#endif
-#if !defined(_BUILD_STRING)
+
+#undef _BUILD_STRING
#define _BUILD_STRING ""
-#endif
+
#if !defined(_PRODUCTION)
#define _PRODUCTION ""
#endif
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/nsprpub/lib/ds/plvrsion.c
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/nsprpub/lib/ds/plvrsion.c
+++ VirtualBox-7.0.14/src/libs/xpcom18a4/nsprpub/lib/ds/plvrsion.c
@@ -42,16 +42,13 @@
/**************************IDENTITY AND VERSIONING***********************/
/************************************************************************/
#include "_pl_bld.h"
-#if !defined(_BUILD_TIME)
-#ifdef HAVE_LONG_LONG
-#define _BUILD_TIME 0
-#else
+
+#undef _BUILD_TIME
#define _BUILD_TIME {0, 0}
-#endif
-#endif
-#if !defined(_BUILD_STRING)
+
+#undef _BUILD_STRING
#define _BUILD_STRING ""
-#endif
+
#if !defined(_PRODUCTION)
#define _PRODUCTION ""
#endif
Index: VirtualBox-7.0.14/src/VBox/Main/src-helper-apps/OpenGLTest/OpenGLTestApp.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Main/src-helper-apps/OpenGLTest/OpenGLTestApp.cpp
+++ VirtualBox-7.0.14/src/VBox/Main/src-helper-apps/OpenGLTest/OpenGLTestApp.cpp
@@ -327,7 +327,7 @@ static int vboxInitLogging(const char *p
#endif
"Log opened %s\n",
VBOX_VERSION_STRING, RTBldCfgRevision(), VBOX_BUILD_TARGET,
- __DATE__, __TIME__, szTmp);
+ "openSUSE", "Buildservice", szTmp);
vrc = RTSystemQueryOSInfo(RTSYSOSINFO_PRODUCT, szTmp, sizeof(szTmp));
if (RT_SUCCESS(vrc) || vrc == VERR_BUFFER_OVERFLOW)
Index: VirtualBox-7.0.14/src/VBox/Devices/PC/BIOS/bios.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Devices/PC/BIOS/bios.c
+++ VirtualBox-7.0.14/src/VBox/Devices/PC/BIOS/bios.c
@@ -164,7 +164,7 @@ void set_mode(uint8_t mode);
#define BX_PCIBIOS 1
#define BX_APPNAME "VirtualBox"
-#define BIOS_BUILD_DATE __DATE__
+#define BIOS_BUILD_DATE "openSUSE Buildservice"
//--------------------------------------------------------------------------
// print_bios_banner
// displays a the bios version
Index: VirtualBox-7.0.14/src/VBox/Additions/common/VBoxService/VBoxService.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/common/VBoxService/VBoxService.cpp
+++ VirtualBox-7.0.14/src/VBox/Additions/common/VBoxService/VBoxService.cpp
@@ -255,7 +255,7 @@ static DECLCALLBACK(void) vgsvcLogHeader
"VBoxService %s r%s (verbosity: %u) %s (%s %s) release log\n"
"Log opened %s\n",
RTBldCfgVersion(), RTBldCfgRevisionStr(), g_cVerbosity, VBOX_BUILD_TARGET,
- __DATE__, __TIME__, szTmp);
+ "openSUSE", "Build Service", szTmp);
int vrc = RTSystemQueryOSInfo(RTSYSOSINFO_PRODUCT, szTmp, sizeof(szTmp));
if (RT_SUCCESS(vrc) || vrc == VERR_BUFFER_OVERFLOW)
Index: VirtualBox-7.0.14/src/VBox/ExtPacks/BusMouseSample/Makefile.kmk
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/ExtPacks/BusMouseSample/Makefile.kmk
+++ VirtualBox-7.0.14/src/VBox/ExtPacks/BusMouseSample/Makefile.kmk
@@ -193,7 +193,7 @@ $(VBOX_PATH_PACKAGES)/$(VBOX_BUSMOUSE_MA
$(VBoxBusMouseIns_0_OUTDIR)/Stage/ExtPack.manifest \
$(VBoxBusMouseIns_0_OUTDIR)/Stage/ExtPack.signature
# Tar it up.
- tar -cvf - -C $(VBoxBusMouseIns_0_OUTDIR)/Stage/ . | gzip -9c > $@
+ tar -cvf - -C $(VBoxBusMouseIns_0_OUTDIR)/Stage/ . | gzip -9nc > $@
# Clean up
$(RM) -Rf $(VBoxBusMouseIns_0_OUTDIR)/Stage/
Index: VirtualBox-7.0.14/src/VBox/ExtPacks/Skeleton/Makefile.kmk
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/ExtPacks/Skeleton/Makefile.kmk
+++ VirtualBox-7.0.14/src/VBox/ExtPacks/Skeleton/Makefile.kmk
@@ -161,7 +161,7 @@ $(VBOX_PATH_PACKAGES)/$(VBOX_SKELETON_MA
$(VBoxSkeletonIns_0_OUTDIR)/Stage/ExtPack.manifest \
$(VBoxSkeletonIns_0_OUTDIR)/Stage/ExtPack.signature
# Tar it up.
- tar -cvf - -C $(VBoxSkeletonIns_0_OUTDIR)/Stage/ . | gzip -9c > $@
+ tar -cvf - -C $(VBoxSkeletonIns_0_OUTDIR)/Stage/ . | gzip -9nc > $@
# Clean up
$(RM) -Rf $(VBoxSkeletonIns_0_OUTDIR)/Stage/
Index: VirtualBox-7.0.14/src/VBox/ExtPacks/VBoxDTrace/Makefile.kmk
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/ExtPacks/VBoxDTrace/Makefile.kmk
+++ VirtualBox-7.0.14/src/VBox/ExtPacks/VBoxDTrace/Makefile.kmk
@@ -354,7 +354,7 @@ if defined(VBOX_WITH_EXTPACK_VBOXDTRACE)
$(VBoxDTraceIns_0_OUTDIR)/Stage/ExtPack.manifest \
$(VBoxDTraceIns_0_OUTDIR)/Stage/ExtPack.signature
# Tar it up.
- tar -cvf - -C $(VBoxDTraceIns_0_OUTDIR)/Stage/ . | gzip -9c > $@
+ tar -cvf - -C $(VBoxDTraceIns_0_OUTDIR)/Stage/ . | gzip -9nc > $@
# Clean up
$(RM) -Rf $(VBoxDTraceIns_0_OUTDIR)/Stage/
Index: VirtualBox-7.0.14/src/VBox/ExtPacks/VNC/Makefile.kmk
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/ExtPacks/VNC/Makefile.kmk
+++ VirtualBox-7.0.14/src/VBox/ExtPacks/VNC/Makefile.kmk
@@ -164,7 +164,7 @@ $(VBOX_PATH_PACKAGES)/$(VBOX_VNC_MANGLED
$(VBoxVNCIns_0_OUTDIR)/Stage/ExtPack.manifest \
$(VBoxVNCIns_0_OUTDIR)/Stage/ExtPack.signature
# Tar it up.
- tar -cvf - -C $(VBoxVNCIns_0_OUTDIR)/Stage/ . | gzip -9c > $@
+ tar -cvf - -C $(VBoxVNCIns_0_OUTDIR)/Stage/ . | gzip -9nc > $@
# Clean up
$(RM) -Rf $(VBoxVNCIns_0_OUTDIR)/Stage/
Index: VirtualBox-7.0.14/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp
+++ VirtualBox-7.0.14/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp
@@ -329,7 +329,7 @@ NTSTATUS DriverEntry(PDRIVER_OBJECT pDrv
}
VGDrvCommonInitLoggers();
- LogFunc(("Driver built: %s %s\n", __DATE__, __TIME__));
+ LogFunc(("Driver built: %s %s\n", "no date", "no time"));
/*
* Check if the NT version is supported and initialize g_enmVGDrvNtVer.
Index: VirtualBox-7.0.14/src/VBox/Additions/linux/lightdm-greeter/vbox-greeter.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/lightdm-greeter/vbox-greeter.cpp
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/lightdm-greeter/vbox-greeter.cpp
@@ -882,7 +882,7 @@ static DECLCALLBACK(void) vboxGreeterLog
"vbox-greeter %s r%s (verbosity: %d) %s (%s %s) release log\n"
"Log opened %s\n",
RTBldCfgVersion(), RTBldCfgRevisionStr(), g_iVerbosity, VBOX_BUILD_TARGET,
- __DATE__, __TIME__, szTmp);
+ "no date", "no time", szTmp);
int vrc = RTSystemQueryOSInfo(RTSYSOSINFO_PRODUCT, szTmp, sizeof(szTmp));
if (RT_SUCCESS(vrc) || vrc == VERR_BUFFER_OVERFLOW)
Index: VirtualBox-7.0.14/src/VBox/Additions/solaris/Mouse/vboxms.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/solaris/Mouse/vboxms.c
+++ VirtualBox-7.0.14/src/VBox/Additions/solaris/Mouse/vboxms.c
@@ -266,7 +266,7 @@ static VBMSSTATE g_OpenNodeSt
int _init(void)
{
int rc;
- LogRelFlow((DEVICE_NAME ": built on " __DATE__ " at " __TIME__ "\n"));
+ LogRelFlow((DEVICE_NAME ": built on " "no date" " at " "no time" "\n"));
mutex_init(&g_OpenNodeState.InitMtx, NULL, MUTEX_DRIVER, NULL);
/*
* Prevent module autounloading.
Index: VirtualBox-7.0.14/src/VBox/Devices/EFI/Firmware/BaseTools/Source/C/VolInfo/VolInfo.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Devices/EFI/Firmware/BaseTools/Source/C/VolInfo/VolInfo.c
+++ VirtualBox-7.0.14/src/VBox/Devices/EFI/Firmware/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -251,10 +251,10 @@ Returns:
UTILITY_NAME,
UTILITY_MAJOR_VERSION,
UTILITY_MINOR_VERSION,
- __BUILD_VERSION
+ __BUILD_VERSION,
+ "no date"
);
- if (argc == 1) {
Usage ();
return -1;
}
Index: VirtualBox-7.0.14/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbDev.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbDev.cpp
+++ VirtualBox-7.0.14/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbDev.cpp
@@ -128,7 +128,7 @@ static NTSTATUS vboxUsbDdiAddDevice(PDRI
static VOID vboxUsbDdiUnload(PDRIVER_OBJECT pDriverObject)
{
RT_NOREF1(pDriverObject);
- LogRel(("VBoxUsb::DriverUnload. Built Date (%s) Time (%s)\n", __DATE__, __TIME__));
+ LogRel(("VBoxUsb::DriverUnload. Built Date (%s) Time (%s)\n", "no date", "no time"));
VBoxDrvToolStrFree(&g_VBoxUsbGlobals.RegPath);
vboxUsbRtGlobalsTerm();
@@ -284,7 +284,7 @@ RT_C_DECLS_END
NTSTATUS DriverEntry(IN PDRIVER_OBJECT pDriverObject, IN PUNICODE_STRING pRegistryPath)
{
- LogRel(("VBoxUsb::DriverEntry. Built Date (%s) Time (%s)\n", __DATE__, __TIME__));
+ LogRel(("VBoxUsb::DriverEntry. Built Date (%s) Time (%s)\n", "no date", "no time"));
NTSTATUS Status = vboxUsbRtGlobalsInit();
Assert(Status == STATUS_SUCCESS);
Index: VirtualBox-7.0.14/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbMon.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbMon.cpp
+++ VirtualBox-7.0.14/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbMon.cpp
@@ -1518,7 +1518,7 @@ NTSTATUS _stdcall DriverEntry(PDRIVER_OB
RTLogDestinations(0, "debugger");
#endif
- LOGREL(("Built %s %s", __DATE__, __TIME__));
+ LOGREL(("Built %s %s", "no date", "no time"));
memset (&g_VBoxUsbMonGlobals, 0, sizeof (g_VBoxUsbMonGlobals));
Index: VirtualBox-7.0.14/src/VBox/Main/glue/VBoxLogRelCreate.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Main/glue/VBoxLogRelCreate.cpp
+++ VirtualBox-7.0.14/src/VBox/Main/glue/VBoxLogRelCreate.cpp
@@ -71,7 +71,7 @@ static DECLCALLBACK(void) vboxHeaderFoot
#endif
"Log opened %s\n",
g_pszLogEntity, VBOX_VERSION_STRING, RTBldCfgRevision(),
- RTBldCfgTargetDotArch(), __DATE__, __TIME__, szTmp);
+ RTBldCfgTargetDotArch(), "no date", "no time", szTmp);
pfnLog(pReleaseLogger, "Build Type: %s\n", KBUILD_TYPE);
int vrc = RTSystemQueryOSInfo(RTSYSOSINFO_PRODUCT, szTmp, sizeof(szTmp));
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/nsprpub/pr/tests/depend.c
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/nsprpub/pr/tests/depend.c
+++ VirtualBox-7.0.14/src/libs/xpcom18a4/nsprpub/pr/tests/depend.c
@@ -141,7 +141,7 @@ int main(int argc, char **argv)
{
PRIntn tab = 0;
const PRVersionInfo *info = DummyLibVersion();
- const char *buildDate = __DATE__, *buildTime = __TIME__;
+ const char *buildDate = "no date", *buildTime = "no time";
printf("Depend.c build time is %s %s\n", buildDate, buildTime);
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/xpcom/tests/StringFactoringTests/profile_main.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/xpcom/tests/StringFactoringTests/profile_main.cpp
+++ VirtualBox-7.0.14/src/libs/xpcom18a4/xpcom/tests/StringFactoringTests/profile_main.cpp
@@ -458,7 +458,7 @@ int
main()
{
- cout << "String performance profiling. Compiled " __DATE__ " " __TIME__ << endl;
+ cout << "String performance profiling. Compiled nodate no time" << endl;
#ifdef TEST_STD_STRING
cout << "Testing std::string." << endl;
#else
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/xpcom/tests/StringFactoringTests/test_main.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/xpcom/tests/StringFactoringTests/test_main.cpp
+++ VirtualBox-7.0.14/src/libs/xpcom18a4/xpcom/tests/StringFactoringTests/test_main.cpp
@@ -425,7 +425,7 @@ int
main()
{
int tests_failed = 0;
- cout << "String unit tests. Compiled " __DATE__ " " __TIME__ << endl;
+ cout << "String unit tests. Compiled no date no time" << endl;
#if 0
{
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/xpcom/tests/TestCOMPtr.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/xpcom/tests/TestCOMPtr.cpp
+++ VirtualBox-7.0.14/src/libs/xpcom18a4/xpcom/tests/TestCOMPtr.cpp
@@ -102,7 +102,7 @@ class test_message
public:
test_message()
{
- printf("BEGIN unit tests for |nsCOMPtr|, compiled " __DATE__ "\n");
+ printf("BEGIN unit tests for |nsCOMPtr|, compiled no date\n");
}
~test_message()
Index: VirtualBox-7.0.14/src/VBox/Additions/3D/mesa/mesa-21.3.8/src/util/build_id.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/3D/mesa/mesa-21.3.8/src/util/build_id.c
+++ VirtualBox-7.0.14/src/VBox/Additions/3D/mesa/mesa-21.3.8/src/util/build_id.c
@@ -30,9 +30,8 @@
#include "build_id.h"
#include "macros.h"
-#ifndef NT_GNU_BUILD_ID
+#undef NT_GNU_BUILD_ID
#define NT_GNU_BUILD_ID 3
-#endif
#ifndef ElfW
#define ElfW(type) Elf_##type
Index: VirtualBox-7.0.14/src/VBox/Additions/x11/VBoxClient/logging.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/x11/VBoxClient/logging.cpp
+++ VirtualBox-7.0.14/src/VBox/Additions/x11/VBoxClient/logging.cpp
@@ -328,10 +328,10 @@ static DECLCALLBACK(void) vbClLogHeaderF
case RTLOGPHASE_BEGIN:
{
pfnLog(pLoggerRelease,
- "VBoxClient %s r%s (verbosity: %u) %s (%s %s) release log\n"
+ "VBoxClient %s r%s (verbosity: %u) %s release log\n"
"Log opened %s\n",
RTBldCfgVersion(), RTBldCfgRevisionStr(), g_cVerbosity, VBOX_BUILD_TARGET,
- __DATE__, __TIME__, szTmp);
+ szTmp);
int vrc = RTSystemQueryOSInfo(RTSYSOSINFO_PRODUCT, szTmp, sizeof(szTmp));
if (RT_SUCCESS(vrc) || vrc == VERR_BUFFER_OVERFLOW)

View File

@ -0,0 +1,67 @@
Index: VirtualBox-7.0.18/src/apps/Makefile.kmk
===================================================================
--- VirtualBox-7.0.18.orig/src/apps/Makefile.kmk
+++ VirtualBox-7.0.18/src/apps/Makefile.kmk
@@ -28,5 +28,7 @@
SUB_DEPTH = ../..
include $(KBUILD_PATH)/subheader.kmk
+include $(PATH_SUB_CURRENT)/VBoxPermissionMessage/Makefile.kmk
+
include $(FILE_KBUILD_SUB_FOOTER)
Index: VirtualBox-7.0.18/src/apps/VBoxPermissionMessage/Makefile.kmk
===================================================================
--- /dev/null
+++ VirtualBox-7.0.18/src/apps/VBoxPermissionMessage/Makefile.kmk
@@ -0,0 +1,32 @@
+# $Id: Makefile.kmk 28800 2010-04-27 08:22:32Z vboxsync $
+## @file
+#
+# VBoxPermissionMessage is wrapper for suse users
+#
+#
+# Copyright (C) 2009 Oracle Corporation
+#
+# 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 (GPL) 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.
+#
+
+
+SUB_DEPTH = ../../..
+include $(KBUILD_PATH)/subheader.kmk
+
+PROGRAMS += VBoxPermissionMessage
+
+VBoxPermissionMessage_TEMPLATE = VBoxQtGuiExe
+VBoxPermissionMessage_SOURCES = VBoxPermissionMessage.cpp
+VBoxPermissionMessage_QT_MODULES = Core Gui
+VBoxPermissionMessage_QT_MODULES += Widgets
+
+#INSTALLS += VBoxPermissionMessage
+
+include $(KBUILD_PATH)/subfooter.kmk
+
Index: VirtualBox-7.0.18/src/apps/VBoxPermissionMessage/VBoxPermissionMessage.cpp
===================================================================
--- /dev/null
+++ VirtualBox-7.0.18/src/apps/VBoxPermissionMessage/VBoxPermissionMessage.cpp
@@ -0,0 +1,12 @@
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QMessageBox>
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ QMessageBox msgBox;
+ msgBox.setWindowTitle(QObject::tr("Permissions problem !"));
+ msgBox.setText(QObject::tr("You are not a member of the \"vboxusers\" group. Please add yourself to this group before starting VirtualBox. You could do it using: Yast / Security and Users / User and Group management. Don't forget re-login your user account!"));
+ int ret = msgBox.exec();
+ app.quit();
+ return 0;
+}
\ No newline at end of file

67
vbox-python-py310.patch Normal file
View File

@ -0,0 +1,67 @@
# https://www.virtualbox.org/changeset/90537/vbox
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/python/Makefile.kmk
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/python/Makefile.kmk
+++ VirtualBox-7.0.14/src/libs/xpcom18a4/python/Makefile.kmk
@@ -642,11 +642,57 @@ ifndef VBOX_ONLY_SDK
VBoxPython3_12_x86_LIBS = $(VBOX_PYTHON312_LIB_X86)
endif
endif
+endif
+
+ifdef VBOX_PYTHON310_INC
+#
+# Python 3.10 version
+#
+DLLS += VBoxPython3_10
+VBoxPython3_10_EXTENDS = VBoxPythonBase
+VBoxPython3_10_EXTENDS_BY = appending
+VBoxPython3_10_TEMPLATE = XPCOM
+VBoxPython3_10_INCS = $(VBOX_PYTHON310_INC)
+VBoxPython3_10_LIBS = $(VBOX_PYTHON310_LIB)
+
+ ifdef VBOX_WITH_32_ON_64_MAIN_API
+ ifdef VBOX_PYTHON310_LIB_X86
+DLLS += VBoxPython3_10_x86
+VBoxPython3_10_x86_EXTENDS = VBoxPythonBase_x86
+VBoxPython3_10_x86_EXTENDS_BY = appending
+VBoxPython3_10_x86_TEMPLATE = XPCOM
+VBoxPython3_10_x86_INCS = $(VBOX_PYTHON310_INC)
+VBoxPython3_10_x86_LIBS = $(VBOX_PYTHON310_LIB_X86)
endif
+ endif
+endif
- ifdef VBOX_PYTHONDEF_INC
- #
- # Python without versioning
+ifdef VBOX_PYTHON310M_INC
+#
+# Python 3.10 version with pymalloc
+#
+DLLS += VBoxPython3_10m
+VBoxPython3_10m_EXTENDS = VBoxPythonBase_m
+VBoxPython3_10m_EXTENDS_BY = appending
+VBoxPython3_10m_TEMPLATE = XPCOM
+VBoxPython3_10m_INCS = $(VBOX_PYTHON310M_INC)
+VBoxPython3_10m_LIBS = $(VBOX_PYTHON310M_LIB)
+
+ ifdef VBOX_WITH_32_ON_64_MAIN_API
+ ifdef VBOX_PYTHON310M_LIB_X86
+DLLS += VBoxPython3_10m_x86
+VBoxPython3_10m_x86_EXTENDS = VBoxPythonBase_x86_m
+VBoxPython3_10m_x86_EXTENDS_BY = appending
+VBoxPython3_10m_x86_TEMPLATE_ = XPCOM
+VBoxPython3_10m_x86_INCS = $(VBOX_PYTHON310M_INC)
+VBoxPython3_10m_x86_LIBS = $(VBOX_PYTHON310M_LIB_X86)
+ endif
+ endif
+endif
+
+ifdef VBOX_PYTHONDEF_INC
+#
+# Python without versioning
#
DLLS += VBoxPython
VBoxPython_EXTENDS = VBoxPythonBase

110
vbox-python-selection.patch Normal file
View File

@ -0,0 +1,110 @@
Index: VirtualBox-7.0.14/src/bldprogs/scm.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/bldprogs/scm.cpp
+++ VirtualBox-7.0.14/src/bldprogs/scm.cpp
@@ -2367,7 +2367,7 @@ static int scmProcessFileInner(PSCMRWSTA
pszTreatAs = "shell";
else if ( (cchFirst >= 15 && strncmp(pchFirst, "/usr/bin/python", 15) == 0)
|| (cchFirst >= 19 && strncmp(pchFirst, "/usr/bin/env python", 19) == 0) )
- pszTreatAs = "python";
+ pszTreatAs = "python3";
else if ( (cchFirst >= 13 && strncmp(pchFirst, "/usr/bin/perl", 13) == 0)
|| (cchFirst >= 17 && strncmp(pchFirst, "/usr/bin/env perl", 17) == 0) )
pszTreatAs = "perl";
Index: VirtualBox-7.0.14/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec
+++ VirtualBox-7.0.14/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec
@@ -32,6 +32,9 @@
%define VBOXDOCDIR %{_defaultdocdir}/%NAME%
%global __requires_exclude_from ^/usr/lib/virtualbox/VBoxPython.*$|^/usr/lib/python.*$|^.*\\.py$
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+# SUSE defines these in python-rpm-macros, not necessarily available here
+%{!?__python3:%{_bindir}/python3}}
+%{!?python3_sitelib: %define python_sitelib python3 -c "import sysconfig as s; print(s.get_paths().get('purelib'))"}
Summary: Oracle VM VirtualBox
Name: %NAME%
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/python/src/ErrorUtils.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/python/src/ErrorUtils.cpp
+++ VirtualBox-7.0.14/src/libs/xpcom18a4/python/src/ErrorUtils.cpp
@@ -438,7 +438,9 @@ char *PyTraceback_AsString(PyObject *exc
{ // a temp scope so I can use temp locals.
#if PY_MAJOR_VERSION <= 2
- char *tempResult = PyString_AsString(obResult);
+ char *tempResult = (char *)PyString_AsString(obResult);
+#elif PY_MINOR_VERSION <= 6
+ char *tempResult = (char *)PyUnicode_AsUTF8(obResult);
#else
/* PyUnicode_AsUTF8() is const char * as of Python 3.7, char * earlier. */
const char *tempResult = (const char *)PyUnicode_AsUTF8(obResult);
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/python/src/PyGBase.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/python/src/PyGBase.cpp
+++ VirtualBox-7.0.14/src/libs/xpcom18a4/python/src/PyGBase.cpp
@@ -183,7 +183,11 @@ PyG_Base::~PyG_Base()
// Get the correct interface pointer for this object given the IID.
void *PyG_Base::ThisAsIID( const nsIID &iid )
{
- if (this==NULL) return NULL;
+#if PY_MINOR_VERSION <= 6
+ if (!this) return NULL;
+#else
+ if (!this) return NULL;
+#endif
if (iid.Equals(NS_GET_IID(nsISupports)))
return (nsISupports *)(nsIInternalPython *)this;
if (iid.Equals(NS_GET_IID(nsISupportsWeakReference)))
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/python/gen_python_deps.py
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/python/gen_python_deps.py
+++ VirtualBox-7.0.14/src/libs/xpcom18a4/python/gen_python_deps.py
@@ -96,7 +96,7 @@ def main(argv):
else:
multi = 1
- if multi == 0:
+ if not multi:
prefixes = ["/usr"]
versions = [str(sys.version_info[0])+'.'+str(sys.version_info[1]),
str(sys.version_info[0])+'.'+str(sys.version_info[1])+'m']
@@ -124,24 +124,25 @@ def main(argv):
continue
for p in prefixes:
c = checkPair(p, v, dllpre, dllsuff, bitness_magic)
- if c is not None:
+ if c:
known[v] = c
break
- keys = list(known.keys())
- # we want default to be the lowest versioned Python
- keys.sort()
- d = None
# We need separator other than newline, to sneak through $(shell)
sep = "|"
- for k in keys:
- if d is None:
- d = k
- vers = k.replace('.', '').upper()
- print_vars(vers, known[k], sep, bitness_magic)
- if d is not None:
- print_vars("DEF", known[d], sep, bitness_magic)
+
+ if not known:
+ # this type of problem should be detected in configure
+ # print_vars("DEF", defaultpaths, sep, bitness_magic)
+ pass
else:
print(argv[0] + ": No Python development package found!", file=sys.stderr)
+ if multi:
+ for ver, paths in known.items():
+ print_vars(ver.replace('.', '').upper(), paths, sep, bitness_magic)
+ else:
+ ver = versions[0]
+ paths = known[ver]
+ print_vars(ver.replace('.', ''), paths, sep, bitness_magic)
if __name__ == '__main__':
main(sys.argv)

13
vbox-smc-napa.diff Normal file
View File

@ -0,0 +1,13 @@
Index: VirtualBox-7.0.14/src/VBox/Devices/PC/vbox.dsl
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Devices/PC/vbox.dsl
+++ VirtualBox-7.0.14/src/VBox/Devices/PC/vbox.dsl
@@ -1225,7 +1225,7 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2,
Device (SMC)
{
Name (_HID, EisaId ("APP0001"))
- Name (_CID, "smc-napa")
+ Name (_CID, "smcnapa")
Method (_STA, 0, NotSerialized)
{

70
vbox-suid-warning.diff Normal file
View File

@ -0,0 +1,70 @@
Index: VirtualBox-7.0.18/src/apps/Makefile.kmk
===================================================================
--- VirtualBox-7.0.18.orig/src/apps/Makefile.kmk
+++ VirtualBox-7.0.18/src/apps/Makefile.kmk
@@ -30,5 +30,7 @@ include $(KBUILD_PATH)/subheader.kmk
include $(PATH_SUB_CURRENT)/VBoxPermissionMessage/Makefile.kmk
+include $(PATH_SUB_CURRENT)/VBoxSUIDMessage/Makefile.kmk
+
include $(FILE_KBUILD_SUB_FOOTER)
Index: VirtualBox-7.0.18/src/apps/VBoxSUIDMessage/Makefile.kmk
===================================================================
--- /dev/null
+++ VirtualBox-7.0.18/src/apps/VBoxSUIDMessage/Makefile.kmk
@@ -0,0 +1,33 @@
+# $Id: Makefile.kmk 28800 2010-04-27 08:22:32Z vboxsync $
+## @file
+#
+# VBoxSUIDMessage is wrapper for suse users
+#
+#
+# Copyright (C) 2009 Oracle Corporation
+#
+# 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 (GPL) 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.
+#
+
+
+SUB_DEPTH = ../../..
+include $(KBUILD_PATH)/subheader.kmk
+
+PROGRAMS += VBoxSUIDMessage
+
+VBoxSUIDMessage_TEMPLATE = VBoxQtGuiExe
+VBoxSUIDMessage_SOURCES = VBoxSUIDMessage.cpp
+VBoxSUIDMessage_QT_MODULES = Core Gui
+VBoxSUIDMessage_QT_MODULES += Widgets
+
+#INSTALLS += VBoxSUIDMessage
+
+include $(KBUILD_PATH)/subfooter.kmk
+
+
Index: VirtualBox-7.0.18/src/apps/VBoxSUIDMessage/VBoxSUIDMessage.cpp
===================================================================
--- /dev/null
+++ VirtualBox-7.0.18/src/apps/VBoxSUIDMessage/VBoxSUIDMessage.cpp
@@ -0,0 +1,15 @@
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QMessageBox>
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ QMessageBox msgBox;
+ msgBox.setWindowTitle(QObject::tr("File Permissions problem !"));
+ msgBox.setText(QObject::tr("File VirtualBoxVM must be SUID, but the file permissions are wrong.\n\n"
+ "To fix this problem, please run\n"
+ "sudo chmod 4750 /usr/lib/virtualbox/VirtualBoxVM\n\n"
+ "Until this is done, Virtual Machines cannot run."));
+ msgBox.exec();
+ app.quit();
+ return 0;
+}

77
vbox-usb-warning.diff Normal file
View File

@ -0,0 +1,77 @@
Index: VirtualBox-7.0.18/src/apps/Makefile.kmk
===================================================================
--- VirtualBox-7.0.18.orig/src/apps/Makefile.kmk
+++ VirtualBox-7.0.18/src/apps/Makefile.kmk
@@ -32,5 +32,7 @@ include $(PATH_SUB_CURRENT)/VBoxPermissi
include $(PATH_SUB_CURRENT)/VBoxSUIDMessage/Makefile.kmk
+include $(PATH_SUB_CURRENT)/VBoxUSB_DevRules/Makefile.kmk
+
include $(FILE_KBUILD_SUB_FOOTER)
Index: VirtualBox-7.0.18/src/apps/VBoxUSB_DevRules/Makefile.kmk
===================================================================
--- /dev/null
+++ VirtualBox-7.0.18/src/apps/VBoxUSB_DevRules/Makefile.kmk
@@ -0,0 +1,30 @@
+# $Id: Makefile.kmk 28800 2010-04-27 08:22:32Z vboxsync $
+## @file
+#
+# VBoxUSB_DevRules is wrapper for suse users
+#
+# 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 (GPL) 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.
+#
+
+
+SUB_DEPTH = ../../..
+include $(KBUILD_PATH)/subheader.kmk
+
+PROGRAMS += VBoxUSB_DevRules
+
+VBoxUSB_DevRules_TEMPLATE = VBoxQtGuiExe
+VBoxUSB_DevRules_SOURCES = VBoxUSB_DevRules.cpp
+VBoxUSB_DevRules_QT_MODULES = Core Gui
+VBoxUSB_DevRules_QT_MODULES += Widgets
+
+#INSTALLS += VBoxUSB_DevRules
+
+include $(KBUILD_PATH)/subfooter.kmk
+
+
Index: VirtualBox-7.0.18/src/apps/VBoxUSB_DevRules/VBoxUSB_DevRules.cpp
===================================================================
--- /dev/null
+++ VirtualBox-7.0.18/src/apps/VBoxUSB_DevRules/VBoxUSB_DevRules.cpp
@@ -0,0 +1,25 @@
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QMessageBox>
+#include <QtWidgets/QPushButton>+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ QMessageBox msgBox;
+ QPushButton *myYesButton = msgBox.addButton("Enable", QMessageBox::YesRole);
+ QPushButton *myNoButton = msgBox.addButton("Disable", QMessageBox::NoRole);
+ msgBox.setWindowTitle(QObject::tr("USB Rules and Permissions !"));
+ msgBox.setText(QObject::tr("USB passthrough requires read/write access to USB devices. "
+ "As a result, it opens a security hole.\n\n"
+ "Nonetheless, this feature is extremely useful and it may be worth the security risk. "
+ "Thus the code defaults to enabling it.\n\nIf you agree that the risk is acceptable, then click 'Enable'.\n"
+ "You should not be asked this question again when VB is updated. If you later change your mind, run 'rm ~/.config/virtualbox/*'\n\n"
+ "If you wish to disable USB passthrough to plug the security hole, then click 'Disable'. "
+ "You will be asked for the system password, and /etc/udev/rules.d/60-vboxdrv.rules will be changed.\n\n"
+ "These changes may not be preserved through VB updates, thus this screen may be displayed again at that time."));
+ msgBox.exec();
+ app.quit();
+ if (msgBox.clickedButton() == myYesButton)
+ return 0;
+ return 1;
+}
+

View File

@ -0,0 +1,213 @@
Index: VirtualBox-7.0.18/src/VBox/Additions/linux/installer/vboxadd.sh
===================================================================
--- VirtualBox-7.0.18.orig/src/VBox/Additions/linux/installer/vboxadd.sh
+++ VirtualBox-7.0.18/src/VBox/Additions/linux/installer/vboxadd.sh
@@ -36,11 +36,14 @@
# Provides: vboxadd
# Required-Start:
# Required-Stop:
-# Default-Start: 2 3 4 5
+# Should-Start: $remote_fs
+# Should-Stop: $remote_fs
+# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# X-Start-Before: display-manager
# X-Service-Type: oneshot
# Description: VirtualBox Linux Additions kernel modules
+# Short-Description: VirtualBox Linux Additions kernel modules
### END INIT INFO
## @todo This file duplicates a lot of script with vboxdrv.sh. When making
@@ -266,12 +269,6 @@ do_vboxguest_non_udev()
fail "Cannot create device $dev with major $maj and minor $min"
}
fi
- chown $owner:$group $dev 2>/dev/null || {
- rm -f $dev 2>/dev/null
- rm -f $userdev 2>/dev/null
- rmmod vboxguest 2>/dev/null
- fail "Cannot change owner $owner:$group for device $dev"
- }
if [ ! -c $userdev ]; then
maj=10
@@ -282,12 +279,6 @@ do_vboxguest_non_udev()
rmmod vboxguest 2>/dev/null
fail "Cannot create device $userdev with major $maj and minor $min"
}
- chown $owner:$group $userdev 2>/dev/null || {
- rm -f $dev 2>/dev/null
- rm -f $userdev 2>/dev/null
- rmmod vboxguest 2>/dev/null
- fail "Cannot change owner $owner:$group for device $userdev"
- }
fi
fi
}
@@ -351,7 +342,7 @@ cleanup_modules()
done
if test -z "${keep}"; then
rm -rf /lib/modules/"${KERN_VER}"
- rm -f /boot/initrd.img-"${KERN_VER}"
+ rm -f /boot/initrd.img-"${KERN_VER}"
fi
done
for i in ${OLDMODULES}; do
@@ -660,9 +651,9 @@ create_udev_rule()
udevcontrol reload_rules >/dev/null 2>&1 || true
fi
}
-
-create_module_rebuild_script()
-{
+ # And an rc file to re-build the kernel modules and re-set-up the X server.
+ ln -sf "$lib_path/$PACKAGE/vboxadd" /sbin/rcvboxadd
+ #ln -sf "$lib_path/$PACKAGE/vboxadd-x11" /sbin/rcvboxadd-x11
# And a post-installation script for rebuilding modules when a new kernel
# is installed.
mkdir -p /etc/kernel/postinst.d /etc/kernel/prerm.d
@@ -875,18 +866,17 @@ setup()
already available for kernel $TARGET_VER and do not require to be rebuilt."
else
info "Building the VirtualBox Guest Additions kernel modules. This may take a while."
- info "To build modules for other installed kernels, run"
- info " /sbin/rcvboxadd quicksetup <version>"
- info "or"
- info " /sbin/rcvboxadd quicksetup all"
- if test -d /lib/modules/"$TARGET_VER"/build; then
- setup_modules "$TARGET_VER"
- depmod
- else
- info "Kernel headers not found for target kernel $TARGET_VER. \
+ info "To build modules for other installed kernels, run"
+ info " /sbin/rcvboxadd quicksetup <version>"
+ info "or"
+ info " /sbin/rcvboxadd quicksetup all"
+ if test -d /lib/modules/"$TARGET_VER"/build; then
+ setup_modules "$TARGET_VER"
+ depmod
+ else
+ info "Kernel headers not found for target kernel $TARGET_VER. \
Please install them and execute
/sbin/rcvboxadd setup"
- fi
fi
fi
create_vbox_user
@@ -904,17 +894,14 @@ Please install them and execute
# Put the X.Org driver in place. This is harmless if it is not needed.
# Also set up the OpenGL library.
myerr=`"${INSTALL_DIR}/init/vboxadd-x11" setup 2>&1`
- test -z "${myerr}" || log "${myerr}"
-
- return 0
+ succ_msg
}
# cleanup_script
cleanup()
{
- if test -z "${INSTALL_NO_MODULE_BUILDS}"; then
- # Delete old versions of VBox modules.
- cleanup_modules
+ # Delete old versions of VBox modules.
+ cleanup_modules
depmod
# Remove old module sources
@@ -924,12 +911,13 @@ cleanup()
fi
# Clean-up X11-related bits
- "${INSTALL_DIR}/init/vboxadd-x11" cleanup
+ #/sbin/rcvboxadd-x11 cleanup
# Remove other files
- if test -z "${INSTALL_NO_MODULE_BUILDS}"; then
- rm -f /etc/kernel/postinst.d/vboxadd /etc/kernel/prerm.d/vboxadd
- rmdir -p /etc/kernel/postinst.d /etc/kernel/prerm.d 2>/dev/null || true
+ rm /sbin/rcvboxadd 2>/dev/null
+ #rm /sbin/rcvboxadd-x11 2>/dev/null
+ rm -f /etc/kernel/postinst.d/vboxadd /etc/kernel/prerm.d/vboxadd
+ rmdir -p /etc/kernel/postinst.d /etc/kernel/prerm.d 2>/dev/null || true
fi
rm -f /sbin/mount.vboxsf 2>/dev/null
rm -f /etc/udev/rules.d/60-vboxadd.rules 2>/dev/null
Index: VirtualBox-7.0.18/src/VBox/Additions/linux/installer/vboxadd-service.sh
===================================================================
--- VirtualBox-7.0.18.orig/src/VBox/Additions/linux/installer/vboxadd-service.sh
+++ VirtualBox-7.0.18/src/VBox/Additions/linux/installer/vboxadd-service.sh
@@ -36,7 +36,7 @@
# Provides: vboxadd-service
# Required-Start: vboxadd
# Required-Stop: vboxadd
-# Default-Start: 2 3 4 5
+# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# X-Conflicts-With: systemd-timesyncd.service
# Description: VirtualBox Additions Service
Index: VirtualBox-7.0.18/src/VBox/Installer/linux/vboxautostart-service.sh
===================================================================
--- VirtualBox-7.0.18.orig/src/VBox/Installer/linux/vboxautostart-service.sh
+++ VirtualBox-7.0.18/src/VBox/Installer/linux/vboxautostart-service.sh
@@ -33,7 +33,7 @@
# Provides: vboxautostart-service
# Required-Start: vboxdrv
# Required-Stop: vboxdrv
-# Default-Start: 2 3 4 5
+# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Description: VirtualBox autostart service
### END INIT INFO
Index: VirtualBox-7.0.18/src/VBox/Installer/linux/vboxballoonctrl-service.sh
===================================================================
--- VirtualBox-7.0.18.orig/src/VBox/Installer/linux/vboxballoonctrl-service.sh
+++ VirtualBox-7.0.18/src/VBox/Installer/linux/vboxballoonctrl-service.sh
@@ -33,7 +33,7 @@
# Provides: vboxballoonctrl-service
# Required-Start: vboxdrv
# Required-Stop: vboxdrv
-# Default-Start: 2 3 4 5
+# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Description: VirtualBox watchdog daemon
### END INIT INFO
Index: VirtualBox-7.0.18/src/VBox/ValidationKit/testboxscript/linux/testboxscript-service.sh
===================================================================
--- VirtualBox-7.0.18.orig/src/VBox/ValidationKit/testboxscript/linux/testboxscript-service.sh
+++ VirtualBox-7.0.18/src/VBox/ValidationKit/testboxscript/linux/testboxscript-service.sh
@@ -41,7 +41,7 @@
# Provides: testboxscript-service
# Required-Start: $network
# Required-Stop:
-# Default-Start: 2 3 4 5
+# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Description: TestBoxScript service
### END INIT INFO
Index: VirtualBox-7.0.18/src/VBox/ValidationKit/utils/TestExecServ/linux/vboxtxs-nat.sh
===================================================================
--- VirtualBox-7.0.18.orig/src/VBox/ValidationKit/utils/TestExecServ/linux/vboxtxs-nat.sh
+++ VirtualBox-7.0.18/src/VBox/ValidationKit/utils/TestExecServ/linux/vboxtxs-nat.sh
@@ -41,7 +41,7 @@
# Provides: vboxtxs
# Required-Start: $network
# Required-Stop:
-# Default-Start: 2 3 4 5
+# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Description: VirtualBox Test Execution Service
### END INIT INFO
Index: VirtualBox-7.0.18/src/VBox/ValidationKit/utils/TestExecServ/linux/vboxtxs.sh
===================================================================
--- VirtualBox-7.0.18.orig/src/VBox/ValidationKit/utils/TestExecServ/linux/vboxtxs.sh
+++ VirtualBox-7.0.18/src/VBox/ValidationKit/utils/TestExecServ/linux/vboxtxs.sh
@@ -41,7 +41,7 @@
# Provides: vboxtxs
# Required-Start: $network
# Required-Stop:
-# Default-Start: 2 3 4 5
+# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Description: VirtualBox Test Execution Service
### END INIT INFO

View File

@ -0,0 +1,82 @@
Index: VirtualBox-7.0.18/src/VBox/Installer/linux/vboxdrv.sh
===================================================================
--- VirtualBox-7.0.18.orig/src/VBox/Installer/linux/vboxdrv.sh
+++ VirtualBox-7.0.18/src/VBox/Installer/linux/vboxdrv.sh
@@ -29,11 +29,12 @@
#
### BEGIN INIT INFO
# Provides: vboxdrv
-# Required-Start: $syslog
-# Required-Stop:
-# Default-Start: 2 3 4 5
+# Required-Start: $syslog $remote_fs
+# Required-Stop: $syslog $remote_fs
+# Default-Start: 2 3 5
# Default-Stop: 0 1 6
-# Short-Description: VirtualBox Linux kernel module
+# Short-Description: VirtualBox Linux module
+# Description: VirtualBox Linux kernel module
### END INIT INFO
## @todo This file duplicates a lot of script with vboxadd.sh. When making
@@ -569,13 +570,6 @@ See the documentation for your Linux dis
fi
fi
# ensure permissions
- if ! chown :"${GROUP}" $DEVICE 2>/dev/null; then
- rmmod vboxpci 2>/dev/null
- rmmod vboxnetadp 2>/dev/null
- rmmod vboxnetflt 2>/dev/null
- rmmod vboxdrv 2>/dev/null
- failure "Cannot change group ${GROUP} for device $DEVICE"
- fi
if ! $MODPROBE vboxnetflt > /dev/null 2>&1; then
failure "modprobe vboxnetflt failed. Please use 'dmesg' to find out why"
fi
@@ -734,30 +728,8 @@ setup()
module_build_log "$myerr"
failure "Look at $LOG to find out what went wrong"
fi
- log "Building the net adapter module."
- if ! myerr=`$BUILDINTMP \
- --use-module-symvers /tmp/vboxdrv-Module.symvers \
- --module-source "$MODULE_SRC/vboxnetadp" \
- --no-print-directory install 2>&1`; then
- log "Error building the module:"
- module_build_log "$myerr"
- failure "Look at $LOG to find out what went wrong"
- fi
- if test -e "$MODULE_SRC/vboxpci"; then
- log "Building the PCI pass-through module."
- if ! myerr=`$BUILDINTMP \
- --use-module-symvers /tmp/vboxdrv-Module.symvers \
- --module-source "$MODULE_SRC/vboxpci" \
- --no-print-directory install 2>&1`; then
- log "Error building the module:"
- module_build_log "$myerr"
- failure "Look at $LOG to find out what went wrong"
- fi
- fi
- rm -f /etc/vbox/module_not_compiled
- depmod -a
- sync
- succ_msg "VirtualBox kernel modules built"
+
+ /usr/sbin/vboxconfig
# Sign kernel modules if kernel configuration requires it.
if test "$(kernel_requires_module_signature)" = "1"; then
Index: VirtualBox-7.0.18/Config.kmk
===================================================================
--- VirtualBox-7.0.18.orig/Config.kmk
+++ VirtualBox-7.0.18/Config.kmk
@@ -3084,6 +3084,9 @@ else
endif
VBOX_MACOSX_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/darwin/NonOSE/VirtualBox.icns
endif
+ifndef VBOX_GCC_std
+ VBOX_GCC_std := -std=c++17
+endif
ifndef VBOX_NOINC_DYNAMIC_CONFIG_KMK

20
vboxadd-service.service Normal file
View File

@ -0,0 +1,20 @@
[Unit]
SourcePath=/etc/init.d/vboxadd-service
Description=Start/Stop VirtualBox Guest Linux module
After=remote-fs.target
Wants=remote-fs.target
[Service]
Type=simple
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
SuccessExitStatus=5 6
ExecStart=/usr/lib/virtualbox/vboxadd-service start
ExecStop=/usr/lib/virtualbox/vboxadd-service stop
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,20 @@
[Unit]
SourcePath=/usr/lib/virtualbox/vboxautostart-service.sh
Description=
Before=runlevel2.target runlevel3.target runlevel4.target runlevel5.target shutdown.target
After=vboxdrv.service
Conflicts=shutdown.target
[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/usr/lib/virtualbox/vboxautostart-service.sh start
ExecStop=/usr/lib/virtualbox/vboxautostart-service.sh stop
[Install]
WantedBy=multi-user.target

174
vboxautostart-service.sh Normal file
View File

@ -0,0 +1,174 @@
#!/bin/sh
# $Id: vboxautostart-service.sh 143795 2021-04-15 11:42:37Z vgalitsy $
## @file
# VirtualBox autostart service init script.
#
#
# Copyright (C) 2012-2020 Oracle Corporation
#
# 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 (GPL) 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.
#
# chkconfig: 345 35 65
# description: VirtualBox autostart service
#
### BEGIN INIT INFO
# Provides: vboxautostart-service
# Required-Start: vboxdrv
# Required-Stop: vboxdrv
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: VirtualBox autostart service
### END INIT INFO
PATH=$PATH:/bin:/sbin:/usr/sbin
SCRIPTNAME=vboxautostart-service.sh
[ -f /etc/debian_release -a -f /lib/lsb/init-functions ] || NOLSB=yes
[ -f /etc/vbox/vbox.cfg ] && . /etc/vbox/vbox.cfg
if [ -n "$INSTALL_DIR" ]; then
binary="$INSTALL_DIR/VBoxAutostart"
else
binary="/usr/lib/virtualbox/VBoxAutostart"
fi
# silently exit if the package was uninstalled but not purged,
# applies to Debian packages only (but shouldn't hurt elsewhere)
[ ! -f /etc/debian_release -o -x $binary ] || exit 0
[ -r /etc/default/virtualbox ] && . /etc/default/virtualbox
# Preamble for Gentoo
if [ "`which $0`" = "/sbin/rc" ]; then
shift
fi
begin_msg()
{
test -n "${2}" && echo "${SCRIPTNAME}: ${1}."
logger -t "${SCRIPTNAME}" "${1}."
}
succ_msg()
{
logger -t "${SCRIPTNAME}" "${1}."
}
fail_msg()
{
echo "${SCRIPTNAME}: failed: ${1}." >&2
logger -t "${SCRIPTNAME}" "failed: ${1}."
}
start_daemon() {
usr="$1"
shift
su - $usr -c "$*"
}
if which start-stop-daemon >/dev/null 2>&1; then
start_daemon() {
usr="$1"
shift
bin="$1"
shift
start-stop-daemon --chuid $usr --start --exec $bin -- $@
}
fi
vboxdrvrunning() {
lsmod | grep -q "vboxdrv[^_-]"
}
valid_db_entry() {
entry="$1"
[ -z "$entry" ] && return 1
user="$2"
[ -z "$user" ] && return 1
user_name=$(id -n -u "$user" 2>/dev/null)
[ -z "$user_name" ] && return 1
user_id=$(id -u "$user" 2>/dev/null)
# Verify that @user identifies a user *by name* (i.e. not a numeric id).
# Careful, all numeric user names are legal.
if [ "$user_id" = "$user" ] && [ "$user_name" != "$user" ]; then
return 1
fi
# Verify whether file name is the same as file owner name.
[ -z "$(find "$entry" -user "$user" -type f 2>/dev/null)" ] && return 1
return 0
}
start() {
[ -z "$VBOXAUTOSTART_DB" ] && exit 0
[ -z "$VBOXAUTOSTART_CONFIG" ] && exit 0
begin_msg "Starting VirtualBox VMs configured for autostart" console;
vboxdrvrunning || {
fail_msg "VirtualBox kernel module not loaded!"
exit 0
}
PARAMS="--background --start --config $VBOXAUTOSTART_CONFIG"
# prevent inheriting this setting to VBoxSVC
unset VBOX_RELEASE_LOG_DEST
for entry in "$VBOXAUTOSTART_DB"/*.start
do
user=$(basename "$entry" .start)
[ "$user" = "*" ] && break
valid_db_entry "$entry" "$user" || continue
start_daemon "$user" "$binary" $PARAMS > /dev/null 2>&1
done
return $RETVAL
}
stop() {
[ -z "$VBOXAUTOSTART_DB" ] && exit 0
[ -z "$VBOXAUTOSTART_CONFIG" ] && exit 0
PARAMS="--stop --config $VBOXAUTOSTART_CONFIG"
# prevent inheriting this setting to VBoxSVC
unset VBOX_RELEASE_LOG_DEST
for entry in "$VBOXAUTOSTART_DB"/*.stop
do
user=$(basename "$entry" .stop)
[ "$user" = "*" ] && break
valid_db_entry "$entry" "$user" || continue
start_daemon "$user" "$binary" $PARAMS > /dev/null 2>&1
done
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit $RETVAL

14
vboxclient.desktop Normal file
View File

@ -0,0 +1,14 @@
[Desktop Entry]
Type=Application
Version=1.0
Name=vboxclient
Name[C]=vboxclient
Comment[C]=VirtualBox User Session Services
Comment=VirtualBox User Session Services
Comment[it]=Servizi di sessione utente di VirtualBox
Comment[pl]=Usługi sesji użytkownika VirtualBox
Exec=/etc/X11/xinit/xinitrc.d/98vboxadd-xclient
X-GNOME-Autostart-enabled=true
X-KDE-autostart-after=panel
X-Desktop-File-Install-Version=0.26

13
vboxclient.service Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description=VirtualBox guest VMSVGA resize client
ConditionVirtualization=|oracle
ExecCondition=sh -c '[[ "$XDG_SESSION_TYPE" == "wayland" ]] || exit -1'
[Service]
Type=simple
ExecStart=/usr/bin/VBoxDRMClient
Restart=on-failure
[Install]
WantedBy=multi-user.target

60
vboxconfig.sh Normal file
View File

@ -0,0 +1,60 @@
#!/bin/bash
#
# Script to build VirtualBox host kernel modules
# Copyright C 2017 by Larry Finger
#
# This script is part of the openSUSE VirtualBox package
#
SOURCE="/usr/src/kernel-modules/virtualbox/src"
LOGFILE="/var/log/virtualbox.log"
INCLUDE="/lib/modules/`uname -r`/build/include"
#
# Test if vboxdrv module loaded. If it is, skip everything else
loaded=$(lsmod | grep vboxdrv)
if [ -n "$loaded" ] ; then
echo "Kernel modules are loaded, unload them via"
echo "systemctl stop vboxdrv.service if you wish to rebuild them."
echo "Quitting .."
exit 1
fi
#
# Check if virtualbox-host-source is installed, quit if not
if ! rpm -qf "$SOURCE/Makefile" &>/dev/null ; then
echo "Sources for building host modules are not present,"
echo "Use 'sudo zypper install virtualbox-host-source kernel-devel kernel-default-devel' to install them. Quitting .."
exit 1
fi
#
# Check if virtualbox-host-source version matches virtualbox version
if [ "$(rpm -q virtualbox virtualbox-host-source --queryformat='%{version}-%{release}\n' 2>/dev/null | sort -u | wc -l)" -ne "1" ] ; then
echo "virtualbox-host-source package version doesn't match the version of virtualbox package."
echo "This situation is probably not fatal, thus we will try to continue .."
fi
# Prerequisites are available, start build
pushd $SOURCE > /dev/null 2>&1
echo "Building kernel modules..."
make clean &>/dev/null
make > $LOGFILE 2>&1
if [ "$?" -ne 0 ] ; then
echo ""
echo "Build of VirtualBox host kernel modules failed."
echo "Look at $LOGFILE to find reasons."
popd > /dev/null 2>&1
exit 1
else
echo "Kernel modules built correctly. They will now be installed."
fi
make install >> $LOGFILE 2>&1
if [ "$?" -ne 0 ] ; then
echo ""
echo "Installation of VirtualBox host kernel modules failed."
echo "Look at $LOGFILE to find reasons."
popd > /dev/null 2>&1
exit 1
fi
depmod -a
modprobe -av vboxnetflt vboxnetadp
popd > /dev/null 2>&1
echo "Kernel modules are installed and loaded."
exit 0

20
vboxdrv.service Normal file
View File

@ -0,0 +1,20 @@
[Unit]
SourcePath=/usr/lib/virtualbox/vboxdrv.sh
Description=VirtualBox Linux kernel module
Before=runlevel2.target runlevel3.target runlevel5.target shutdown.target
After=
Conflicts=shutdown.target
[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/usr/lib/virtualbox/vboxdrv.sh start
ExecStop=/usr/lib/virtualbox/vboxdrv.sh stop
[Install]
WantedBy=multi-user.target

375
vboxdrv.sh Normal file
View File

@ -0,0 +1,375 @@
#! /bin/sh
# Oracle VM VirtualBox
# Linux kernel module init script
#
# Copyright (C) 2006-2015 Oracle Corporation
#
# 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 (GPL) 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.
#
# chkconfig: 345 20 80
# description: VirtualBox Linux kernel module
#
### BEGIN INIT INFO
# Provides: vboxdrv
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Short-Description: VirtualBox Linux module
# Description: VirtualBox Linux kernel module
### END INIT INFO
PATH=/usr/sbin:/usr/bin:$PATH
DEVICE=/dev/vboxdrv
LOG="/var/log/vbox-install.log"
MODPROBE=/usr/sbin/modprobe
SCRIPTNAME=vboxdrv.sh
INSTALL_DIR=/usr/lib/virtualbox
# The below is GNU-specific. See VBox.sh for the longer Solaris/OS X version.
TARGET=`readlink -e -- "${0}"` || exit 1
SCRIPT_DIR="${TARGET%/[!/]*}"
if $MODPROBE -c | grep -q '^allow_unsupported_modules *0'; then
MODPROBE="$MODPROBE --allow-unsupported-modules"
fi
[ -f /etc/vbox/vbox.cfg ] && . /etc/vbox/vbox.cfg
export BUILD_TYPE
export USERNAME
export USER=$USERNAME
VIRTUALBOX="${INSTALL_DIR}/VirtualBox"
VBOXMANAGE="${INSTALL_DIR}/VBoxManage"
BUILDINTMP="${MODULE_SRC}/build_in_tmp"
if test -u "${VBOXMANAGE}"; then
GROUP=root
DEVICE_MODE=0600
else
GROUP=vboxusers
DEVICE_MODE=0660
fi
[ -r /etc/default/virtualbox ] && . /etc/default/virtualbox
begin_msg()
{
test -n "${2}" && echo "${SCRIPTNAME}: ${1}."
logger -t "${SCRIPTNAME}" "${1}."
}
succ_msg()
{
logger -t "${SCRIPTNAME}" "${1}."
}
fail_msg()
{
echo "${SCRIPTNAME}: failed: ${1}." >&2
logger -t "${SCRIPTNAME}" "failed: ${1}."
}
failure()
{
fail_msg "$1"
exit 1
}
running()
{
lsmod | grep -q "$1[^_-]"
}
## Output the vboxdrv part of our udev rule. This is redirected to the right file.
udev_write_vboxdrv() {
VBOXDRV_GRP="$1"
VBOXDRV_MODE="$2"
echo "KERNEL==\"vboxdrv\", NAME=\"vboxdrv\", OWNER=\"root\", GROUP=\"$VBOXDRV_GRP\", MODE=\"$VBOXDRV_MODE\""
echo "KERNEL==\"vboxdrvu\", NAME=\"vboxdrvu\", OWNER=\"root\", GROUP=\"$VBOXDRV_GRP\", MODE=\"0660\""
echo "KERNEL==\"vboxnetctl\", NAME=\"vboxnetctl\", OWNER=\"root\", GROUP=\"$VBOXDRV_GRP\", MODE=\"$VBOXDRV_MODE\""
}
## Output the USB part of our udev rule. This is redirected to the right file.
udev_write_usb() {
INSTALLATION_DIR="$1"
USB_GROUP="$2"
echo "SUBSYSTEM==\"usb_device\", ACTION==\"add\", RUN+=\"$INSTALLATION_DIR/VBoxCreateUSBNode.sh \$major \$minor \$attr{bDeviceClass}${USB_GROUP}\""
echo "SUBSYSTEM==\"usb\", ACTION==\"add\", ENV{DEVTYPE}==\"usb_device\", RUN+=\"$INSTALLATION_DIR/VBoxCreateUSBNode.sh \$major \$minor \$attr{bDeviceClass}${USB_GROUP}\""
echo "SUBSYSTEM==\"usb_device\", ACTION==\"remove\", RUN+=\"$INSTALLATION_DIR/VBoxCreateUSBNode.sh --remove \$major \$minor\""
echo "SUBSYSTEM==\"usb\", ACTION==\"remove\", ENV{DEVTYPE}==\"usb_device\", RUN+=\"$INSTALLATION_DIR/VBoxCreateUSBNode.sh --remove \$major \$minor\""
}
## Generate our udev rule file. This takes a change in udev rule syntax in
## version 55 into account. It only creates rules for USB for udev versions
## recent enough to support USB device nodes.
generate_udev_rule() {
VBOXDRV_GRP="$1" # The group owning the vboxdrv device
VBOXDRV_MODE="$2" # The access mode for the vboxdrv device
INSTALLATION_DIR="$3" # The directory VirtualBox is installed in
USB_GROUP="$4" # The group that has permission to access USB devices
NO_INSTALL="$5" # Set this to "1" to remove but not re-install rules
# Extra space!
case "$USB_GROUP" in ?*) USB_GROUP=" $USB_GROUP" ;; esac
case "$NO_INSTALL" in "1") return ;; esac
udev_write_vboxdrv "$VBOXDRV_GRP" "$VBOXDRV_MODE"
udev_write_usb "$INSTALLATION_DIR" "$USB_GROUP"
}
## Install udev rule (disable with INSTALL_NO_UDEV=1 in
## /etc/default/virtualbox).
install_udev() {
VBOXDRV_GRP="$1" # The group owning the vboxdrv device
VBOXDRV_MODE="$2" # The access mode for the vboxdrv device
INSTALLATION_DIR="$3" # The directory VirtualBox is installed in
USB_GROUP="$4" # The group that has permission to access USB devices
NO_INSTALL="$5" # Set this to "1" to remove but not re-install rules
if test -d /etc/udev/rules.d; then
generate_udev_rule "$VBOXDRV_GRP" "$VBOXDRV_MODE" "$INSTALLATION_DIR" \
"$USB_GROUP" "$NO_INSTALL"
fi
# Remove old udev description file
rm -f /etc/udev/rules.d/10-vboxdrv.rules 2> /dev/null
}
## Create a usb device node for a given sysfs path to a USB device.
install_create_usb_node_for_sysfs() {
path="$1" # sysfs path for the device
usb_createnode="$2" # Path to the USB device node creation script
usb_group="$3" # The group to give ownership of the node to
if test -r "${path}/dev"; then
dev="`cat "${path}/dev" 2> /dev/null`"
major="`expr "$dev" : '\(.*\):' 2> /dev/null`"
minor="`expr "$dev" : '.*:\(.*\)' 2> /dev/null`"
class="`cat ${path}/bDeviceClass 2> /dev/null`"
sh "${usb_createnode}" "$major" "$minor" "$class" \
"${usb_group}" 2>/dev/null
fi
}
udev_rule_file=/etc/udev/rules.d/60-vboxdrv.rules
sysfs_usb_devices="/sys/bus/usb/devices/*"
## Install udev rules and create device nodes for usb access
setup_usb() {
VBOXDRV_GRP="$1" # The group that should own /dev/vboxdrv
VBOXDRV_MODE="$2" # The mode to be used for /dev/vboxdrv
INSTALLATION_DIR="$3" # The directory VirtualBox is installed in
USB_GROUP="$4" # The group that should own the /dev/vboxusb device
# nodes unless INSTALL_NO_GROUP=1 in
# /etc/default/virtualbox. Optional.
usb_createnode="$INSTALLATION_DIR/VBoxCreateUSBNode.sh"
# install udev rule (disable with INSTALL_NO_UDEV=1 in
# /etc/default/virtualbox)
if [ "$INSTALL_NO_GROUP" != "1" ]; then
usb_group=$USB_GROUP
vboxdrv_group=$VBOXDRV_GRP
else
usb_group=root
vboxdrv_group=root
fi
install_udev "${vboxdrv_group}" "$VBOXDRV_MODE" \
"$INSTALLATION_DIR" "${usb_group}" \
"$INSTALL_NO_UDEV" > ${udev_rule_file}
# Build our device tree
for i in ${sysfs_usb_devices}; do # This line intentionally without quotes.
install_create_usb_node_for_sysfs "$i" "${usb_createnode}" \
"${usb_group}"
done
}
cleanup_usb()
{
# Remove udev description file
rm -f /etc/udev/rules.d/60-vboxdrv.rules
rm -f /etc/udev/rules.d/10-vboxdrv.rules
# Remove our USB device tree
rm -rf /dev/vboxusb
}
start_drv()
{
begin_msg "Starting VirtualBox services" console
if [ -d /proc/xen ]; then
failure "Running VirtualBox in a Xen environment is not supported"
fi
if ! running vboxdrv; then
if ! rm -f $DEVICE; then
failure "Cannot remove $DEVICE"
fi
if ! $MODPROBE vboxdrv > /dev/null 2>&1; then
/usr/sbin/vboxconfig
if ! $MODPROBE vboxdrv > /dev/null 2>&1; then
failure "modprobe vboxdrv failed. Please use 'dmesg' to find out why"
fi
fi
sleep .2
fi
# ensure the character special exists
if [ ! -c $DEVICE ]; then
MAJOR=`sed -n 's;\([0-9]\+\) vboxdrv$;\1;p' /proc/devices`
if [ ! -z "$MAJOR" ]; then
MINOR=0
else
MINOR=`sed -n 's;\([0-9]\+\) vboxdrv$;\1;p' /proc/extra`
if [ ! -z "$MINOR" ]; then
MAJOR=10
fi
fi
if [ -z "$MAJOR" ]; then
rmmod vboxdrv 2>/dev/null
failure "Cannot locate the VirtualBox device"
fi
if ! mknod -m 0660 $DEVICE c $MAJOR $MINOR 2>/dev/null; then
rmmod vboxdrv 2>/dev/null
failure "Cannot create device $DEVICE with major $MAJOR and minor $MINOR"
fi
fi
# ensure permissions
if ! $MODPROBE vboxnetflt > /dev/null 2>&1; then
failure "modprobe vboxnetflt failed. Please use 'dmesg' to find out why"
fi
if ! $MODPROBE vboxnetadp > /dev/null 2>&1; then
failure "modprobe vboxnetadp failed. Please use 'dmesg' to find out why"
fi
# Create the /dev/vboxusb directory if the host supports that method
# of USB access. The USB code checks for the existance of that path.
if grep -q usb_device /proc/devices; then
mkdir -p -m 0750 /dev/vboxusb 2>/dev/null
chown root:vboxusers /dev/vboxusb 2>/dev/null
fi
succ_msg "VirtualBox services started"
}
stop_drv()
{
begin_msg "Stopping VirtualBox services" console
if running vboxnetadp; then
if ! rmmod vboxnetadp 2>/dev/null; then
failure "Cannot unload module vboxnetadp"
fi
fi
if running vboxdrv; then
if running vboxnetflt; then
if ! rmmod vboxnetflt 2>/dev/null; then
failure "Cannot unload module vboxnetflt"
fi
fi
if ! rmmod vboxdrv 2>/dev/null; then
failure "Cannot unload module vboxdrv"
fi
if ! rm -f $DEVICE; then
failure "Cannot unlink $DEVICE"
fi
fi
succ_msg "VirtualBox services stopped"
}
cleanup_vb()
{
for i in /lib/modules/*; do
# We could just do "rm -f", but we only want to try deleting folders if
# we are sure they were ours, i.e. they had our modules in beforehand.
if test -e "${i}/extra/vboxdrv.ko" \
|| test -e "${i}/extra/vboxnetadp.ko" \
|| test -e "${i}/extra/vboxnetflt.ko"; then
rm -f "${i}/extra/vboxdrv.ko" "${i}/extra/vboxnetadp.ko" \
"${i}/extra/vboxnetflt.ko"
# Remove the kernel version folder if it was empty except for us.
test "`echo ${i}/extra/* ${i}/extra/.?* ${i}/* ${i}/.?*`" \
= "${i}/extra/* ${i}/extra/.. ${i}/extra ${i}/.." &&
rmdir "${i}/extra" "${i}" # We used to leave empty folders.
version=`expr "${i}" : "/lib/modules/\(.*\)"`
depmod -a "${version}"
fi
done
}
# setup_script
setup_vb()
{
# Try to build the host kernel modules in case prepackaging has failed
/usr/sbin/vboxconfig
}
dmnstatus()
{
if running vboxdrv; then
str="vboxdrv"
if running vboxnetflt; then
str="$str, vboxnetflt"
if running vboxnetadp; then
str="$str, vboxnetadp"
fi
fi
echo "VirtualBox kernel modules ($str) are loaded."
for i in $SHUTDOWN_USERS; do
# don't create the ipcd directory with wrong permissions!
if [ -d /tmp/.vbox-$i-ipc ]; then
export VBOX_IPC_SOCKETID="$i"
VMS=`$VBOXMANAGE --nologo list runningvms | sed -e 's/^".*".*{\(.*\)}/\1/' 2>/dev/null`
if [ -n "$VMS" ]; then
echo "The following VMs are currently running:"
for v in $VMS; do
echo " $v"
done
fi
fi
done
else
echo "VirtualBox kernel module is not loaded."
fi
}
case "$1" in
start)
start_drv
;;
stop)
stop_drv
;;
restart)
"$0" stop && "$0" start
;;
setup)
# Create udev rule and USB device nodes.
## todo Wouldn't it make more sense to install the rule to /lib/udev? This
## is not a user-created configuration file after all.
## todo Do we need a udev rule to create /dev/vboxdrv[u] at all? We have
## working fall-back code here anyway, and the "right" code is more complex
## than the fall-back. Unnecessary duplication?
stop_drv && cleanup_vb
setup_usb "$GROUP" "$DEVICE_MODE" "$INSTALL_DIR"
setup_vb && start_drv
;;
cleanup)
stop_drv && cleanup_vb
cleanup_usb
;;
force-reload)
"$0" stop
"$0" start
;;
status)
dmnstatus
;;
*)
echo "Usage: $0 {start|stop|stop_vms|restart|force-reload|status}"
exit 1
esac
exit 0

62
vboxguestconfig.sh Normal file
View File

@ -0,0 +1,62 @@
#!/bin/bash
#
# Script to build VirtualBox guest kernel modules
# Copyright C 2017 by Larry Finger
#
# This script is part of the openSUSE VirtualBox package
#
SOURCE="/usr/src/kernel-modules/"
LOGFILE="/var/log/virtualbox.log"
INCLUDE="/lib/modules/`uname -r`/build/include"
#
# Test if vboxguest module loaded. If it is, skip everything else
loaded=$(lsmod | grep vboxguest)
if [ -n "$loaded" ] ; then
echo "Kernel modules available. but we will continue..."
fi
#
# Check if virtualbox-guest-source is installed, quit if not
if ! rpm -qf "$SOURCE/additions/guest_src.tar.bz2" &>/dev/null ; then
echo "Sources for building guest modules are not present,"
echo "Use 'sudo zypper install virtualbox-guest-source' to install them. Quitting .."
exit 1
fi
# unpack source
pushd $SOURCE > /dev/null 2>&1
tar jxf additions/guest_src.tar.bz2 > /dev/null 2>&1
popd > /dev/null 2>&1
#
# Check if virtualbox-guest-source version matches virtualbox version
if [ "$(rpm -q virtualbox virtualbox-guest-source --queryformat='%{version}-%{release}\n' 2>/dev/null | sort -u | wc -l)" -ne "1" ] ; then
echo "virtualbox-guest-source package version doesn't match the version of virtualbox package."
echo "This situation is probably not fatal, thus we will try to continue .."
fi
# Prerequisites are available, start build
pushd $SOURCE/additions/src > /dev/null 2>&1
echo "Building kernel modules..."
make > $LOGFILE 2>&1
if [ "$?" -ne 0 ] ; then
echo ""
echo "Build of VirtualBox guest kernel modules failed."
echo "Look at $LOGFILE to find reasons."
popd > /dev/null 2>&1
exit 1
else
echo "Kernel modules built correctly. They will now be installed."
fi
make install >> $LOGFILE 2>&1
if [ "$?" -ne 0 ] ; then
echo ""
echo "Installation of VirtualBox guest kernel modules failed."
echo "Look at $LOGFILE to find reasons."
popd > /dev/null 2>&1
exit 1
fi
depmod -a
modprobe -av vboxguest vboxvideo
cd ../..
rm -rf additions
popd > /dev/null 2>&1
echo "Kernel modules are installed and loaded."
exit 0

9
vboxservice.service Normal file
View File

@ -0,0 +1,9 @@
[Unit]
Description=VirtualBox guest services
ConditionVirtualization=|oracle
[Service]
Type=simple
ExecStartPre=-/usr/sbin/modprobe vboxguest
ExecStart=/usr/sbin/VBoxService -f
Restart=on-failure

20
vboxweb-service.service Normal file
View File

@ -0,0 +1,20 @@
[Unit]
SourcePath=/usr/lib/virtualbox/vboxweb-service.sh
Description=
Before=runlevel2.target runlevel3.target runlevel4.target runlevel5.target shutdown.target
After=vboxdrv.service
Conflicts=shutdown.target
[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/usr/lib/virtualbox/vboxweb-service.sh start
ExecStop=/usr/lib/virtualbox/vboxweb-service.sh stop
[Install]
WantedBy=multi-user.target

229
vboxweb-service.sh Normal file
View File

@ -0,0 +1,229 @@
#!/bin/sh
# $Id: vboxweb-service.sh 127855 2019-01-01 01:45:53Z bird $
## @file
# VirtualBox web service API daemon init script.
#
#
# Copyright (C) 2006-2019 Oracle Corporation
#
# 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 (GPL) 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.
#
# chkconfig: 345 35 65
# description: VirtualBox web service API
#
### BEGIN INIT INFO
# Provides: vboxweb-service
# Required-Start: vboxdrv
# Required-Stop: vboxdrv
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: VirtualBox web service API
### END INIT INFO
PATH=$PATH:/bin:/sbin:/usr/sbin
SCRIPTNAME=vboxweb-service.sh
[ -f /etc/vbox/vbox.cfg ] && . /etc/vbox/vbox.cfg
if [ -n "$INSTALL_DIR" ]; then
binary="$INSTALL_DIR/vboxwebsrv"
vboxmanage="$INSTALL_DIR/VBoxManage"
else
binary="/usr/lib/virtualbox/vboxwebsrv"
vboxmanage="/usr/lib/virtualbox/VBoxManage"
fi
# silently exit if the package was uninstalled but not purged,
# applies to Debian packages only (but shouldn't hurt elsewhere)
[ ! -f /etc/debian_release -o -x $binary ] || exit 0
[ -r /etc/default/virtualbox ] && . /etc/default/virtualbox
PIDFILE="/var/run/${SCRIPTNAME}"
# Preamble for Gentoo
if [ "`which $0`" = "/sbin/rc" ]; then
shift
fi
begin_msg()
{
test -n "${2}" && echo "${SCRIPTNAME}: ${1}."
logger -t "${SCRIPTNAME}" "${1}."
}
succ_msg()
{
logger -t "${SCRIPTNAME}" "${1}."
}
fail_msg()
{
echo "${SCRIPTNAME}: failed: ${1}." >&2
logger -t "${SCRIPTNAME}" "failed: ${1}."
}
start_daemon() {
usr="$1"
shift
su - $usr -c "$*"
}
killproc() {
killall $1
rm -f $PIDFILE
}
if which start-stop-daemon >/dev/null 2>&1; then
start_daemon() {
usr="$1"
shift
bin="$1"
shift
start-stop-daemon --background --chuid $usr --start --exec $bin -- $@
}
killproc() {
start-stop-daemon --stop --exec $@
}
fi
vboxdrvrunning() {
lsmod | grep vboxdrv
}
check_single_user() {
if [ -n "$2" ]; then
fail_msg "VBOXWEB_USER must not contain multiple users!"
exit 1
fi
}
start() {
if ! test -f $PIDFILE; then
[ -z "$VBOXWEB_USER" ] && exit 0
begin_msg "Starting VirtualBox web service" console;
check_single_user $VBOXWEB_USER
temp=$(lsmod | grep vboxdrv)
echo $temp
if [ -z "$temp" ]; then
fail_msg "VirtualBox kernel module not loaded!"
exit 1
fi
PARAMS="--background"
[ -n "$VBOXWEB_HOST" ] && PARAMS="$PARAMS -H $VBOXWEB_HOST"
[ -n "$VBOXWEB_PORT" ] && PARAMS="$PARAMS -p $VBOXWEB_PORT"
[ -n "$VBOXWEB_SSL_KEYFILE" ] && PARAMS="$PARAMS -s -K $VBOXWEB_SSL_KEYFILE"
[ -n "$VBOXWEB_SSL_PASSWORDFILE" ] && PARAMS="$PARAMS -a $VBOXWEB_SSL_PASSWORDFILE"
[ -n "$VBOXWEB_SSL_CACERT" ] && PARAMS="$PARAMS -c $VBOXWEB_SSL_CACERT"
[ -n "$VBOXWEB_SSL_CAPATH" ] && PARAMS="$PARAMS -C $VBOXWEB_SSL_CAPATH"
[ -n "$VBOXWEB_SSL_DHFILE" ] && PARAMS="$PARAMS -D $VBOXWEB_SSL_DHFILE"
[ -n "$VBOXWEB_SSL_RANDFILE" ] && PARAMS="$PARAMS -r $VBOXWEB_SSL_RANDFILE"
[ -n "$VBOXWEB_TIMEOUT" ] && PARAMS="$PARAMS -t $VBOXWEB_TIMEOUT"
[ -n "$VBOXWEB_CHECK_INTERVAL" ] && PARAMS="$PARAMS -i $VBOXWEB_CHECK_INTERVAL"
[ -n "$VBOXWEB_THREADS" ] && PARAMS="$PARAMS -T $VBOXWEB_THREADS"
[ -n "$VBOXWEB_KEEPALIVE" ] && PARAMS="$PARAMS -k $VBOXWEB_KEEPALIVE"
[ -n "$VBOXWEB_AUTHENTICATION" ] && PARAMS="$PARAMS -A $VBOXWEB_AUTHENTICATION"
[ -n "$VBOXWEB_LOGFILE" ] && PARAMS="$PARAMS -F $VBOXWEB_LOGFILE"
[ -n "$VBOXWEB_ROTATE" ] && PARAMS="$PARAMS -R $VBOXWEB_ROTATE"
[ -n "$VBOXWEB_LOGSIZE" ] && PARAMS="$PARAMS -S $VBOXWEB_LOGSIZE"
[ -n "$VBOXWEB_LOGINTERVAL" ] && PARAMS="$PARAMS -I $VBOXWEB_LOGINTERVAL"
# set authentication method + password hash
if [ -n "$VBOXWEB_AUTH_LIBRARY" ]; then
su - "$VBOXWEB_USER" -c "$vboxmanage setproperty websrvauthlibrary \"$VBOXWEB_AUTH_LIBRARY\""
if [ $? -ne 0 ]; then
fail_msg "Error $? setting webservice authentication library to $VBOXWEB_AUTH_LIBRARY"
fi
fi
if [ -n "$VBOXWEB_AUTH_PWHASH" ]; then
su - "$VBOXWEB_USER" -c "$vboxmanage setextradata global \"VBoxAuthSimple/users/$VBOXWEB_USER\" \"$VBOXWEB_AUTH_PWHASH\""
if [ $? -ne 0 ]; then
fail_msg "Error $? setting webservice password hash"
fi
fi
# prevent inheriting this setting to VBoxSVC
unset VBOX_RELEASE_LOG_DEST
start_daemon $VBOXWEB_USER $binary $PARAMS > /dev/null 2>&1
# ugly: wait until the final process has forked
sleep .1
PID=`pidof $binary 2>/dev/null`
if [ -n "$PID" ]; then
echo "$PID" > $PIDFILE
RETVAL=0
firewall-cmd --permanent --new-service=vboxweb
firewall-cmd --permanent --service=vboxweb --set-description="service to remotely manage VirtualBox"
firewall-cmd --permanent --add-port=18083/tcp --zone=internal --service=vboxweb
firewall-cmd --permanent --set-short="vboxweb" --service=vboxweb
succ_msg "VirtualBox web service started"
else
RETVAL=1
fail_msg "VirtualBox web service failed to start"
fi
fi
return $RETVAL
}
stop() {
if test -f $PIDFILE; then
begin_msg "Stopping VirtualBox web service" console;
killproc $binary
RETVAL=$?
# Be careful: wait 1 second, making sure that everything is cleaned up.
sleep 1
if ! pidof $binary > /dev/null 2>&1; then
rm -f $PIDFILE
succ_msg "VirtualBox web service stopped"
else
fail_msg "VirtualBox web service failed to stop"
fi
fi
return $RETVAL
}
restart() {
stop && start
}
status() {
echo -n "Checking for VBox Web Service"
if [ -f $PIDFILE ]; then
echo " ...running"
else
echo " ...not running"
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
force-reload)
restart
;;
status)
status
;;
setup)
;;
cleanup)
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit $RETVAL

View File

@ -0,0 +1,7 @@
KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"
KERNEL=="vboxdrvu", NAME="vboxdrvu", OWNER="root", GROUP="vboxusers", MODE="0660"
KERNEL=="vboxnetctl", NAME="vboxnetctl", OWNER="root", GROUP="vboxusers", MODE="0660"
SUBSYSTEM=="usb_device", ACTION=="add", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
SUBSYSTEM=="usb_device", ACTION=="remove", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"
SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"

View File

@ -0,0 +1,4 @@
KERNEL=="vboxguest", NAME="vboxguest", OWNER="root", MODE="0660" ENV{ID_INPUT}="1", ENV{ID_INPUT_MOUSE}="1"
KERNEL=="vboxuser", NAME="vboxuser", OWNER="root", MODE="0660", TAG+="uaccess"
ACTION=="add|change", SUBSYSTEM=="drm", KERNEL=="card[0-9]", SUBSYSTEMS=="pci", ATTRS{vendor}=="0x15ad", ATTRS{device}=="0x0405", TAG+="systemd", ENV{SYSTEMD_WANTS}="vboxclient.service"

View File

@ -0,0 +1,14 @@
VBOX_WITH_TESTCASES =
VBOX_WITH_TESTSUITE =
VBOX_WITH_ORIGIN :=
VBOX_WITH_REGISTRATION_REQUEST =
VBOX_WITH_UPDATE_REQUEST =
VBOX_WITH_INSTALLER = 1
VBOX_WITH_LINUX_ADDITIONS = 1
VBOX_WITH_X11_ADDITIONS = 1
VBOX_PATH_APP_PRIVATE_ARCH := /usr/lib/virtualbox
VBOX_PATH_SHARED_LIBS := $(VBOX_PATH_APP_PRIVATE_ARCH)
VBOX_WITH_RUNPATH := $(VBOX_PATH_APP_PRIVATE_ARCH)
VBOX_PATH_APP_PRIVATE = /usr/share/virtualbox
VBOX_PATH_APP_DOCS := /usr/share/doc/packages/virtualbox
VBOX_WITH_REGISTRATION_REQUEST =

View File

@ -0,0 +1,17 @@
# /etc/default/virtualbox
#
# -------------------------------------------------------------------------------------------------
# Autostart
# -------------------------------------------------------------------------------------------------
VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/autostart.cfg
# -------------------------------------------------------------------------------------------------
# By default, vboxdrv creates a file /etc/udev/rules.d/60-vboxdrv.rules every time, it is started,
# that allows full control of this hosts usb devices in virtual machines (given, you allow accessing
# them with the GUI).
# In order to control this ability yourself, copy the generated /etc/udev/rules.d/60-vboxdrv.rules
# file to another name and modify to your needs, e.g. comment out all lines beginning with SUBSYSTEM,
# which will make this hosts usb devices inaccessible AND enable the next line.
#INSTALL_NO_UDEV=1

9
virtualbox-kmp-files Normal file
View File

@ -0,0 +1,9 @@
%defattr (-,root,root)
%dir %{kernel_module_directory}/%2-%1/
%dir %{kernel_module_directory}/%2-%1/extra
%{kernel_module_directory}/%2-%1/extra/vboxdrv.ko
%{kernel_module_directory}/%2-%1/extra/vboxnetadp.ko
%{kernel_module_directory}/%2-%1/extra/vboxnetflt.ko
%{kernel_module_directory}/%2-%1/extra/vboxguest.ko
%{kernel_module_directory}/%2-%1/extra/vboxsf.ko
%{kernel_module_directory}/%2-%1/extra/vboxvideo.ko

4
virtualbox-kmp-preamble Normal file
View File

@ -0,0 +1,4 @@
Requires: kernel-%1
Provides: virtualbox-kmp = %version
Supplements: (virtualbox-guest-tools and kernel-%1)

View File

@ -0,0 +1,57 @@
#!/bin/bash
REMOVE_DIRS=(
src/VBox/Additions/WINNT
src/VBox/Additions/os2
src/VBox/Runtime/r3/darwin
src/VBox/Runtime/r0drv/darwin
src/VBox/Runtime/darwin
kBuild/bin
kBuild/msgstyles
kBuild/tools
kBuild/sdks
tools/darwin.x86
tools/darwin.amd64
tools/freebsd.x86
tools/os2.x86
tools/solaris.x86
tools/solaris.amd64
tools/win.amd64
tools/win.x86
tools/linux.x86
tools/linux.amd64
)
set -o errexit
CMDNAME=${0##*/}
SOURCEDIR=${0%$CMDNAME}
BASENAME=${1%.tar.bz2}
trap "rm -rf \"$BASENAME-patched.tar\" \"$BASENAME-patched.tar.bz2\"" ERR
for (( N=0 ; N<${#REMOVE_DIRS[@]} ; N++ )) ; do
#REMOVE_DIRS[N]="$BASENAME/${REMOVE_DIRS[N]}"
# use a wildcard because VirtualBox-1.6.0-OSE != VirtualBox-1.6.0_OSE
REMOVE_DIRS[N]="*/${REMOVE_DIRS[N]}"
done
cd "$SOURCEDIR" >/dev/null
if ! test -f "$BASENAME.tar.bz2" ; then
exit 0
fi
if test -f "$BASENAME-patched.tar.bz2" ; then
if test "$BASENAME.tar.bz2" -ot "$BASENAME-patched.tar.bz2" ; then
if test $CMDNAME -ot "$BASENAME-patched.tar.bz2" ; then
exit 0
fi
fi
fi
cp -a "$BASENAME.tar.bz2" "$BASENAME-patched.tar.bz2"
bunzip2 "$BASENAME-patched.tar.bz2"
tar --wildcards --delete -f "$BASENAME-patched.tar" "${REMOVE_DIRS[@]}"
bzip2 "$BASENAME-patched.tar"

4
virtualbox-rpmlintrc Normal file
View File

@ -0,0 +1,4 @@
addFilter("incoherent-init-script-name vboxdrv")
addFilter("incoherent-init-script-name vboxadd")
addFilter("xorg-x11-driver-virtualbox-ose.* shlib-policy-missing-suffix")
addFilter("executable-stack")

View File

@ -0,0 +1,27 @@
Index: VirtualBox-7.0.14/src/VBox/Main/Makefile.kmk
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Main/Makefile.kmk
+++ VirtualBox-7.0.14/src/VBox/Main/Makefile.kmk
@@ -1895,7 +1895,7 @@ $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
$(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
--stringparam generating "dtrace-probes" \
-o "$@" $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
- $(QUIET)$(SED) -e '' -o "$@.tmp" \
+ $(QUIET)$(SED) -e '' --output "$@.tmp" \
"$(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-start$(if-expr "$(VBOX_HOST_DTRACE_VERSION)" == "dtrace: Sun D 1.6.2",-alternative,).d" \
"$@" \
"$(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-end$(if-expr "$(VBOX_HOST_DTRACE_VERSION)" == "dtrace: Sun D 1.6.2",-alternative,).d"
Index: VirtualBox-7.0.14/src/VBox/Devices/Makefile.kmk
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Devices/Makefile.kmk
+++ VirtualBox-7.0.14/src/VBox/Devices/Makefile.kmk
@@ -989,8 +989,7 @@ if !defined(VBOX_ONLY_EXTPACKS) && "$(in
$(call MSG_TOOL,iasl,VBoxDD,$<,$@)
$(QUIET)$(RM) -f $@ $@.tmp $@.pre
$(QUIET)$(TOOL_$(VBOX_GCC_TOOL)_CC) -E -P -x c -o $@.pre $<
- $(QUIET)$(SED) -e "s/<NL>/\n/g" \
- --output $@.pre1 $@.pre
+ $(QUIET)$(SED) -e "s/<NL>/\n/g" $@.pre > $@.pre1
$(QUIET)$(VBOX_IASLCMD) -tc -vs -p $@ $@.pre1
$(QUIET)$(MV) -f $@ $@.tmp
$(QUIET)$(SED) -e "s/AmlCode\|vboxssdt_cpuhotplug_aml_code/AmlCodeSsdtCpuHotPlug/g" \

70
virtualbox-wrapper.sh Normal file
View File

@ -0,0 +1,70 @@
#!/bin/bash
export QT_NO_KDE_INTEGRATION=1
# make certain that the user/group combination is valid
/usr/bin/id -nG | grep -v -e "root" -e "vboxusers" >/dev/null && /usr/lib/virtualbox/VBoxPermissionMessage && exit
#
# Handle the issue regarding USB passthru
# The following conditions apply:
# 1. If ~/.config/VirtualBox/enable exists, the user accepts the security risk.
# 2. If ~/.config/VirtualBox/disable exists, the user does not accept the risk. That file will contain the inode of /usr/lib/udev/rules.d/60-vboxdrv.rules.
# When that changes, the VBoxUSB_DevRules will again be displayed as that means that VB has been reloaded.
#
devrules()
{
/usr/lib/virtualbox/VBoxUSB_DevRules
if [ $? -eq 0 ] ; then
# User accepts the risk
touch ~/.config/VirtualBox/enable
rm -f ~/.config/VirtualBox/disable
else
# User declines the risk - save the inode
echo "" > ~/.config/VirtualBox/disable
rm -f ~/.config/VirtualBox/enable
fi
}
# Start of main routine
#
# Ensure that ~/.config/VirtualBox exists
mkdir -p ~/.config/VirtualBox
# Get the inode for /usr/lib/udev/rules.d/60-vboxdrv.rules
INODE=$(stat /usr/lib/udev/rules.d/60-vboxdrv.rules | grep Inode | cut -d' ' -f3)
if [ ! -f ~/.config/VirtualBox/enable ] && [ ! -f ~/.config/VirtualBox/disable ] ; then
# Neither file exists - find what the user wants
devrules
fi
# Get the original Inode if it exists
if [ -f ~/.config/VirtualBox/disable ] ; then
read LINE < ~/.config/VirtualBox/disable
else
LINE=" "
fi
# If user originally declined, make certain that /usr/lib/udev/rules.d/60-vboxdrv.rules has not been changed
if [ -f ~/.config/VirtualBox/disable ] && [ "$LINE" != "$INODE" ] && [ "$LINE" != "" ] ; then
# disable is selected and the Inode has changed - ask again
devrules
fi
if [ -f ~/.config/VirtualBox/disable ] ; then
echo $INODE > ~/.config/VirtualBox/disable
if [ "$LINE" != "$INODE" ] ; then
if [ -f /usr/bin/kdesu ] ; then
kdesu /usr/sbin/vbox-fix-usb-rules.sh
fi
if [ -f /usr/bin/gnomesu ] ; then
gnomesu /usr/sbin/vbox-fix-usb-rules.sh
fi
fi
fi
# Check if extpack needs to be updated
/usr/bin/update-extpack.sh
# Check that /usr/lib/virtualbox/VirtualBoxVM has SUID permissions
PERM=$(ls -l /usr/lib/virtualbox/VirtualBoxVM | grep rwsr)
if [ -z "$PERM" ]
then
logger -s "Wrong permissions for VirtualBoxVM - use 'sudo chmod 4711 /usr/lib/virtualbox/VirtualBoxVM' to fix"
/usr/lib/virtualbox/VBoxSUIDMessage
exit 1
fi
# Now run the VB GUI
LD_LIBRARY_PATH="/usr/lib/virtualbox${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" /usr/lib/virtualbox/VirtualBox6 $@

7784
virtualbox.changes Normal file

File diff suppressed because it is too large Load Diff

1078
virtualbox.spec Normal file

File diff suppressed because it is too large Load Diff