1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

emulators/virtualbox-ose: Put vbox/networks.conf in the right place

Since virtualbox-ose 6.1.26 a new networks.conf file has been
introduced and the software looks for it in /etc/vbox.

This commit introduces a patch to make virtualbox look for it in
PREFIX/etc/vbox.

To help users with configurations already using this file in /etc/vbox
notes to UPDATING, pkg-message and to the main virtualbox executable
script have been added.

Also adding some comments to the Makefile to note that QA warning
due to reinplace being run but not having changed any file are
expected due to the design of this port Makefile.

PR:		261522
This commit is contained in:
Michael Gmelin 2022-03-11 22:44:02 +01:00 committed by Guido Falsi
parent f70a105964
commit 66635b2061
5 changed files with 50 additions and 3 deletions

View File

@ -5,6 +5,14 @@ they are unavoidable.
You should get into the habit of checking this file for changes each time
you update your ports collection, before attempting any port upgrades.
20220311:
AFFECTS: users of emulators/virtualbox-ose
AUTHOR: grembo@FreeBSD.org
In order to comply to hier(7), VirtualBox's configuration of non-default
IP ranges to be used in host-only mode moved from /etc/vbox/networks.conf
to ${LOCALBASE}/etc/vbox/networks.conf.
20220311:
AFFECTS: users of net/nats-server
AUTHOR: olgeni@FreeBSD.org

View File

@ -2,6 +2,7 @@
PORTNAME= virtualbox-ose
PORTVERSION= 6.1.32
PORTREVISION= 1
CATEGORIES= emulators
MASTER_SITES= https://download.virtualbox.org/virtualbox/${PORTVERSION}/
DISTFILES= VirtualBox-${PORTVERSION}${EXTRACT_SUFX} ${GUESTADDITIONS}
@ -52,6 +53,8 @@ VBOX_PROGS= VBoxAutostart VBoxBalloonCtrl VBoxBugReport VBoxHeadless \
VBOX_UTILS= VBoxExtPackHelperApp VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT \
VBoxSVC VBoxXPCOMIPCD
SUB_FILES= pkg-message
OPTIONS_DEFINE= AIO ALSA DBUS DEBUG GUESTADDITIONS MANUAL NLS OPUS PULSEAUDIO \
PYTHON QT5 R0LOGGING UDPTUNNEL VDE VNC WEBSERVICE VPX X11
OPTIONS_DEFAULT= AIO DBUS QT5 UDPTUNNEL VNC WEBSERVICE X11
@ -307,10 +310,12 @@ post-patch:
${LOCALBASE}/share/kBuild/tools/GXX3.kmk > \
${WRKSRC}/tools/kBuildTools/VBoxGccFreeBSD.kmk
.endif
# Causes a "reinplace" QA warning with default LOCALBASE
@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
${WRKSRC}/Config.kmk ${WRKSRC}/configure \
${WRKSRC}/kBuild/header.kmk ${WRKSRC}/kBuild/units/qt4.kmk \
${WRKSRC}/kBuild/units/qt5.kmk ${WRKSRC}/kBuild/sdks/LIBSDL.kmk \
${WRKSRC}/src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp \
${WRKSRC}/src/libs/xpcom18a4/python/gen_python_deps.py
@${REINPLACE_CMD} \
-e 's|\$$KBUILDDIR_BIN/kmk_sed|${LOCALBASE}/bin/kmk_sed|g' \
@ -321,6 +326,7 @@ post-patch:
${WRKSRC}/src/VBox/Runtime/Makefile.kmk
@${ECHO_CMD} 'VBOX_ICONV_DEFS = LIBICONV_PLUG' >> ${WRKSRC}/LocalConfig.kmk
.endif
# Causes a "reinplace" QA warning with default PREFIX/VBOX_DIR
@${REINPLACE_CMD} -e 's|/usr/local/lib/virtualbox|${VBOX_DIR}|' \
-e 's|/usr/local|${PREFIX}|' \
${WRKSRC}/src/VBox/Installer/freebsd/VBox.sh

View File

@ -1,6 +1,6 @@
--- src/VBox/Installer/freebsd/VBox.sh.orig 2016-08-27 05:10:34 UTC
+++ src/VBox/Installer/freebsd/VBox.sh
@@ -0,0 +1,67 @@
@@ -0,0 +1,74 @@
+#!/bin/sh
+#
+# Oracle VM VirtualBox startup script, FreeBSD hosts.
@ -26,10 +26,17 @@
+ test -f /usr/local/lib/virtualbox/VBoxRT.so; then
+ INSTALL_DIR=/usr/local/lib/virtualbox
+ else
+ echo "Could not find VirtualBox installation. Please reinstall."
+ >&2 echo "Could not find VirtualBox installation. Please reinstall."
+ exit 1
+ fi
+
+if [ -d /etc/vbox ]; then
+ >&2 cat <<-EOH
+ WARNING: Directory /etc/vbox found, but ignored. VirtualBox
+ configuration files are stored in /usr/local/etc/vbox/.
+ EOH
+fi
+
+# workaround for the KDE dialog problem
+KDE_FORK_SLAVES=1; export KDE_FORK_SLAVES
+
@ -63,7 +70,7 @@
+ exec "$INSTALL_DIR/vboxwebsrv" "$@"
+ ;;
+ *)
+ echo "Unknown application - $APP"
+ >&2 echo "Unknown application - $APP"
+ exit 1
+ ;;
+esac

View File

@ -0,0 +1,11 @@
--- src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp.orig 2022-01-13 18:57:40 UTC
+++ src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp
@@ -737,7 +737,7 @@ int Adapter::doIOCtl(unsigned long iCmd, VBOXNETADPREQ
* Global config file implementation *
*********************************************************************************************************************************/
-#define VBOX_GLOBAL_NETWORK_CONFIG_PATH "/etc/vbox/networks.conf"
+#define VBOX_GLOBAL_NETWORK_CONFIG_PATH "/usr/local/etc/vbox/networks.conf"
#define VBOXNET_DEFAULT_IPV4MASK "255.255.255.0"
class NetworkAddress

View File

@ -60,6 +60,10 @@ vfs.aio.max_aio_per_proc=8192
vfs.aio.max_aio_queue=65536
To check if AIO is used use: kldstat -v | grep aio
When assigning IP addresses in host-only mode from ranges outside
of VirtualBox's defaults, the respective ranges need to be listed
in %%LOCALBASE%%/etc/vbox/networks.conf (PR#259399).
Check wiki page for known issues and troubleshooting:
http://wiki.freebsd.org/VirtualBox
@ -78,4 +82,15 @@ machines using the Pulseaudio host audio driver to use another
supported one.
EOM
}
{ type: upgrade
minimum_version: 6.1.26
maximum_version: 6.1.32_1
message: <<EOM
To comply to hier(7) requirements, networks.conf's location changed
to %%LOCALBASE%%/etc/vbox/networks.conf.
In case /etc/vbox/networks.conf exists, it needs to be moved to
%%LOCALBASE%%/etc/vbox and /etc/vbox should be deleted.
EOM
}
]