Skip to content

Commit

Permalink
emulators/virtualbox-ose[-legacy]: VM VirtualBox Manager: Help menu: …
Browse files Browse the repository at this point in the history
…unable to open external browser

While here sort out LOCALBASE, PREFIX, VBOX_DIR, VBOX_ETC

PR:			266778
Approved by:		arrowd (mentor)
Differential Revision:	https://reviews.freebsd.org/D40119
  • Loading branch information
Vladimir Druzenko authored and Vladimir Druzenko committed May 18, 2023
1 parent 9ff7e7b commit 8b9f425
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 21 deletions.
6 changes: 4 additions & 2 deletions emulators/virtualbox-ose-legacy/Makefile
Expand Up @@ -52,6 +52,7 @@ USERS= ${VBOXUSER}
GROUPS= ${VBOXGROUP}
VBOX_DIR= ${PREFIX}/${VBOX_DIR_REL}
VBOX_DIR_REL= lib/virtualbox
VBOX_ETC= ${PREFIX}/etc/vbox
VBOX_LINKS= VBoxVRDP
VBOX_PROGS= VBoxAutostart VBoxBalloonCtrl VBoxBugReport VBoxHeadless \
VBoxManage
Expand Down Expand Up @@ -323,8 +324,9 @@ post-patch:
${WRKSRC}/src/VBox/Runtime/Makefile.kmk
@${ECHO_CMD} 'VBOX_ICONV_DEFS = LIBICONV_PLUG' >> ${WRKSRC}/LocalConfig.kmk
.endif
@${REINPLACE_CMD} -e 's|/usr/local/lib/virtualbox|${VBOX_DIR}|' \
-e 's|/usr/local|${PREFIX}|' \
@${REINPLACE_CMD} -e 's|%%VBOX_DIR%%|${VBOX_DIR}|g' \
-e 's|%%VBOX_ETC%%|${VBOX_ETC}|g' \
-e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
${WRKSRC}/src/VBox/Installer/freebsd/VBox.sh
@${REINPLACE_CMD} \
-e 's|^versions =.*|versions = ["${PYTHON_VER}${PYTHON_ABIVER}"]|' \
Expand Down
Expand Up @@ -16,15 +16,15 @@
+# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+
+PATH="/usr/bin:/bin:/usr/sbin:/sbin"
+CONFIG="/usr/local/etc/vbox/vbox.cfg"
+PATH="/sbin:/bin:/usr/sbin:/usr/bin:%%LOCALBASE%%/sbin:%%LOCALBASE%%/bin"
+CONFIG="%%VBOX_ETC%%/vbox.cfg"
+
+test -r "${CONFIG}" &&
+ . "${CONFIG}"
+test -z "${INSTALL_DIR}" &&
+ if test -d /usr/local/lib/virtualbox &&
+ test -f /usr/local/lib/virtualbox/VBoxRT.so; then
+ INSTALL_DIR=/usr/local/lib/virtualbox
+ if test -d %%VBOX_DIR%% &&
+ test -f %%VBOX_DIR%%/VBoxRT.so; then
+ INSTALL_DIR=%%VBOX_DIR%%
+ else
+ echo "Could not find VirtualBox installation. Please reinstall."
+ exit 1
Expand Down
10 changes: 6 additions & 4 deletions emulators/virtualbox-ose/Makefile
Expand Up @@ -45,6 +45,7 @@ USERS= ${VBOXUSER}
GROUPS= ${VBOXGROUP}
VBOX_DIR= ${PREFIX}/${VBOX_DIR_REL}
VBOX_DIR_REL= lib/virtualbox
VBOX_ETC= ${PREFIX}/etc/vbox
VBOX_LINKS= VBoxVRDP
VBOX_PROGS= VBoxAutostart VBoxBalloonCtrl VBoxBugReport VBoxHeadless \
VBoxManage
Expand Down Expand Up @@ -314,7 +315,6 @@ post-patch:
${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' \
Expand All @@ -325,10 +325,12 @@ 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}|' \
@${REINPLACE_CMD} -e 's|%%VBOX_DIR%%|${VBOX_DIR}|g' \
-e 's|%%VBOX_ETC%%|${VBOX_ETC}|g' \
-e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
${WRKSRC}/src/VBox/Installer/freebsd/VBox.sh
@${REINPLACE_CMD} -e 's|%%VBOX_ETC%%|${VBOX_ETC}|g' \
${WRKSRC}/src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp
@${REINPLACE_CMD} \
-e 's|^versions =.*|versions = ["${PYTHON_VER}${PYTHON_ABIVER}"]|' \
${WRKSRC}/src/libs/xpcom18a4/python/gen_python_deps.py
Expand Down
Expand Up @@ -16,15 +16,15 @@
+# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+
+PATH="/usr/bin:/bin:/usr/sbin:/sbin"
+CONFIG="/usr/local/etc/vbox/vbox.cfg"
+PATH="/sbin:/bin:/usr/sbin:/usr/bin:%%LOCALBASE%%/sbin:%%LOCALBASE%%/bin"
+CONFIG="%%VBOX_ETC%%/vbox.cfg"
+
+test -r "${CONFIG}" &&
+ . "${CONFIG}"
+test -z "${INSTALL_DIR}" &&
+ if test -d /usr/local/lib/virtualbox &&
+ test -f /usr/local/lib/virtualbox/VBoxRT.so; then
+ INSTALL_DIR=/usr/local/lib/virtualbox
+ if test -d %%VBOX_DIR%% &&
+ test -f %%VBOX_DIR%%/VBoxRT.so; then
+ INSTALL_DIR=%%VBOX_DIR%%
+ else
+ >&2 echo "Could not find VirtualBox installation. Please reinstall."
+ exit 1
Expand All @@ -33,7 +33,7 @@
+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/.
+ configuration files are stored in %%VBOX_ETC%%/.
+ EOH
+fi
+
Expand Down
Expand Up @@ -5,7 +5,7 @@
*********************************************************************************************************************************/

-#define VBOX_GLOBAL_NETWORK_CONFIG_PATH "/etc/vbox/networks.conf"
+#define VBOX_GLOBAL_NETWORK_CONFIG_PATH "/usr/local/etc/vbox/networks.conf"
+#define VBOX_GLOBAL_NETWORK_CONFIG_PATH "%%VBOX_ETC%%/networks.conf"
#define VBOXNET_DEFAULT_IPV4MASK "255.255.255.0"

class NetworkAddress
6 changes: 3 additions & 3 deletions emulators/virtualbox-ose/files/pkg-message.in
Expand Up @@ -62,7 +62,7 @@ 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).
in %%VBOX_ETC%%/networks.conf (PR#259399).

Check wiki page for known issues and troubleshooting:
http://wiki.freebsd.org/VirtualBox
Expand All @@ -87,10 +87,10 @@ EOM
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.
to %%VBOX_ETC%%/networks.conf.

In case /etc/vbox/networks.conf exists, it needs to be moved to
%%LOCALBASE%%/etc/vbox and /etc/vbox should be deleted.
%%VBOX_ETC%% and /etc/vbox should be deleted.
EOM
}
]

0 comments on commit 8b9f425

Please sign in to comment.