summaryrefslogtreecommitdiff
path: root/emulators/virtualbox-ose-kmod-legacy
diff options
context:
space:
mode:
authorGuido Falsi <madpilot@FreeBSD.org>2021-03-09 18:27:36 +0000
committerGuido Falsi <madpilot@FreeBSD.org>2021-03-09 18:27:36 +0000
commit42d8425b62bb66d04dd01c96d516c11451fd86dd (patch)
treee2c43c73c1351cea5743d20d5dc2626d9bcb2c04 /emulators/virtualbox-ose-kmod-legacy
parent82a7880d546383cb6825198f005cf50498300c87 (diff)
downloadfreebsd-ports-42d8425b62bb66d04dd01c96d516c11451fd86dd.zip
- Update VirtualBox OSE to 6.1.18
- Old VirtualBox OSE 5.2.44 preserved as "-legacy" versions of the ports (repocopied) - Add back extra patch removed in r528258, actually required to build DEBUG kmod - Correctly define WITH_DEBUG when enabling the DEBUG option, so binaries are not stripped Please note that this new version supports only amd64 CPUs. If you need to use older hardware please install the legacy ports. Note that moving VM snapshots across major updates is unsupported, it's strongly suggested to properly shutdown VMs before upgrading, please check UPDATING for further details. This update is the result of work from many people, and thanks to all who gave feedback and tested things. Patch based on work from: Mario Lobo <lobo@bsd.com.br> and jkim. PR: 234878 Submitted by: kunda <chitty_cloud@me.com> Approved by: vbox (implicit) Reviewed by: decke Tested by: jwb, martin ilavsky <ilavsky.martin@gmail.com>, Mario Lobo <lobo@bsd.com.br> Relnotes: https://www.virtualbox.org/wiki/Changelog-6.1 Differential Revision: https://reviews.freebsd.org/D28871
Diffstat (limited to 'emulators/virtualbox-ose-kmod-legacy')
-rw-r--r--emulators/virtualbox-ose-kmod-legacy/Makefile108
-rw-r--r--emulators/virtualbox-ose-kmod-legacy/distinfo3
-rw-r--r--emulators/virtualbox-ose-kmod-legacy/files/vboxnet.in70
-rw-r--r--emulators/virtualbox-ose-kmod-legacy/pkg-descr7
-rw-r--r--emulators/virtualbox-ose-kmod-legacy/pkg-plist6
5 files changed, 194 insertions, 0 deletions
diff --git a/emulators/virtualbox-ose-kmod-legacy/Makefile b/emulators/virtualbox-ose-kmod-legacy/Makefile
new file mode 100644
index 000000000000..6b115d5c93f3
--- /dev/null
+++ b/emulators/virtualbox-ose-kmod-legacy/Makefile
@@ -0,0 +1,108 @@
+# Created by: Bernhard Froehlich <decke@bluelife.at>
+# $FreeBSD$
+
+PORTNAME= virtualbox-ose
+PORTVERSION= 5.2.44
+PORTREVISION= 4
+CATEGORIES= emulators
+MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/
+PKGNAMESUFFIX= -kmod-legacy
+DISTNAME= VirtualBox-${PORTVERSION}
+
+MAINTAINER= vbox@FreeBSD.org
+COMMENT= VirtualBox kernel module for FreeBSD
+
+LICENSE= GPLv2
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+BUILD_DEPENDS= kmk:devel/kBuild
+
+CPE_VENDOR= oracle
+CPE_PRODUCT= vm_virtualbox
+
+USES= cpe kmod tar:bzip2
+PATCHDIR= ${.CURDIR}/../${PORTNAME}-legacy/files
+WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION}
+USE_RC_SUBR= vboxnet
+ONLY_FOR_ARCHS= i386 amd64
+
+HAS_CONFIGURE= yes
+CONFIGURE_ARGS+= --build-headless
+CONFIGURE_ARGS+= --disable-alsa \
+ --disable-dbus \
+ --disable-docs \
+ --disable-libvpx \
+ --disable-pulse \
+ --disable-python \
+ --disable-sdl-ttf \
+ --disable-xpcom
+CONFIGURE_ARGS+= --nofatal --with-gcc="${CC}" --with-g++="${CXX}"
+
+CONFLICTS_INSTALL= virtualbox-ose-kmod-devel-* \
+ virtualbox-ose-kmod-*
+
+OPTIONS_DEFINE= DEBUG VIMAGE
+OPTIONS_DEFAULT=VIMAGE
+OPTIONS_SUB= yes
+DEBUG_DESC= Debug symbols, additional logs and assertions
+VIMAGE_DESC= VIMAGE virtual networking support
+
+.include <bsd.port.options.mk>
+
+VBOX_BIN= ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/src
+VBOX_KMODS= vboxdrv \
+ vboxnetadp \
+ vboxnetflt
+
+BUILD_WRKSRC= ${VBOX_BIN}
+
+KMK_BUILDTYPE= release
+KMK_CONFIG= VBOX_LIBPATH_X11=${LOCALBASE} VBOX_FREEBSD_SRC=${SRC_BASE}/sys
+KMK_FLAGS= HostDrivers-scripts vboxdrv-src VBoxNetFlt-src VBoxNetAdp-src
+
+.if ${PORT_OPTIONS:MDEBUG}
+KMK_FLAGS+= BUILD_TYPE=debug
+KMK_BUILDTYPE= debug
+EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-src-VBox-HostDrivers-Support-freebsd-Makefile
+MAKE_ARGS+= DEBUG_FLAGS="-O1 -g"
+.endif
+
+.if ${ARCH} == i386
+KMK_ARCH= freebsd.x86
+.else
+KMK_ARCH= freebsd.${ARCH}
+.endif
+
+.include <bsd.port.pre.mk>
+
+SYMBOLSUFFIX= debug
+PLIST_SUB+= SYMBOLSUFFIX=${SYMBOLSUFFIX}
+
+post-patch:
+ @${ECHO_CMD} 'VBOX_WITH_VBOXDRV = 1' > ${WRKSRC}/LocalConfig.kmk
+ @${ECHO_CMD} 'VBOX_WITH_NETFLT = 1' >> ${WRKSRC}/LocalConfig.kmk
+ @${ECHO_CMD} 'VBOX_WITH_NETADP = 1' >> ${WRKSRC}/LocalConfig.kmk
+ @${ECHO_CMD} 'VBOX_WITH_ADDITIONS =' >> ${WRKSRC}/LocalConfig.kmk
+.if ${PORT_OPTIONS:MVIMAGE}
+ @${ECHO_CMD} 'VBOX_WITH_NETFLT_VIMAGE = 1' >> ${WRKSRC}/LocalConfig.kmk
+.endif
+ @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
+ ${WRKSRC}/Config.kmk ${WRKSRC}/configure
+ @${REINPLACE_CMD} \
+ -e 's|\$$KBUILDDIR_BIN/kmk_sed|${LOCALBASE}/bin/kmk_sed|g' \
+ ${WRKSRC}/configure
+
+pre-build:
+ cd ${WRKSRC}/src/VBox/HostDrivers && ${SH} -c \
+ '. ${WRKSRC}/env.sh && ${KMK_CONFIG} ${LOCALBASE}/bin/kmk ${KMK_FLAGS}'
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${KMODDIR}
+.for i in ${VBOX_KMODS}
+ ${INSTALL_KLD} ${VBOX_BIN}/${i}/${i}.ko ${STAGEDIR}${KMODDIR}
+.if ${PORT_OPTIONS:MDEBUG}
+ ${INSTALL_KLD} ${VBOX_BIN}/${i}/${i}.ko.${SYMBOLSUFFIX} ${STAGEDIR}${KMODDIR}
+.endif
+.endfor
+
+.include <bsd.port.post.mk>
diff --git a/emulators/virtualbox-ose-kmod-legacy/distinfo b/emulators/virtualbox-ose-kmod-legacy/distinfo
new file mode 100644
index 000000000000..2ca899b86014
--- /dev/null
+++ b/emulators/virtualbox-ose-kmod-legacy/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1594821147
+SHA256 (VirtualBox-5.2.44.tar.bz2) = ad83b11cfae2734f7d6f619dd2f8bdada7d33492cd7682fab98cb4053122295e
+SIZE (VirtualBox-5.2.44.tar.bz2) = 124016934
diff --git a/emulators/virtualbox-ose-kmod-legacy/files/vboxnet.in b/emulators/virtualbox-ose-kmod-legacy/files/vboxnet.in
new file mode 100644
index 000000000000..8c69dcc0ebd6
--- /dev/null
+++ b/emulators/virtualbox-ose-kmod-legacy/files/vboxnet.in
@@ -0,0 +1,70 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: vboxnet
+# BEFORE: NETWORKING
+# REQUIRE: FILESYSTEMS
+# KEYWORD: nojail
+
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# vboxnet_enable (bool): Set to NO by default.
+# Set it to YES to load network related kernel modules on startup
+
+. /etc/rc.subr
+
+name="vboxnet"
+rcvar=vboxnet_enable
+start_cmd="vboxnet_start"
+stop_cmd="vboxnet_stop"
+
+vboxnet_modules="vboxdrv vboxnetflt:ng_vboxnetflt vboxnetadp"
+
+vboxnet_start()
+{
+ local _k _m
+
+ for _m in ${vboxnet_modules}; do
+ _k=${_m%:*}
+ _m=${_m#*:}
+ if ! kldstat -q -m ${_m}; then
+ if ! kldload ${_k} > /dev/null 2>&1; then
+ warn "Can't load ${_k} module."
+ return 1
+ fi
+ fi
+ done
+
+ # initialize configured host-only interfaces
+ LD_LIBRARY_PATH=%%PREFIX%%/lib %%PREFIX%%/bin/VBoxManage list hostonlyifs >/dev/null
+}
+
+vboxnet_stop()
+{
+ local _k _m _r
+
+ _r=
+ for _m in ${vboxnet_modules}; do
+ _r="${_m} ${_r}"
+ done
+ for _m in ${_r}; do
+ _k=${_m%:*}
+ _m=${_m#*:}
+ if kldstat -q -m ${_m}; then
+ if ! kldunload ${_k} > /dev/null 2>&1; then
+ warn "Can't unload ${_k} module."
+ return 1
+ fi
+ fi
+ done
+}
+
+load_rc_config $name
+
+: ${vboxnet_enable="NO"}
+
+run_rc_command "$1"
diff --git a/emulators/virtualbox-ose-kmod-legacy/pkg-descr b/emulators/virtualbox-ose-kmod-legacy/pkg-descr
new file mode 100644
index 000000000000..e9481f3a81fa
--- /dev/null
+++ b/emulators/virtualbox-ose-kmod-legacy/pkg-descr
@@ -0,0 +1,7 @@
+VirtualBox is a family of powerful x86 virtualization products for
+enterprise as well as home use. Not only is VirtualBox an extremely
+feature rich, high performance product for enterprise customers, it
+is also the only professional solution that is freely available as
+Open Source Software under the terms of the GNU General Public License.
+
+WWW: https://www.virtualbox.org/
diff --git a/emulators/virtualbox-ose-kmod-legacy/pkg-plist b/emulators/virtualbox-ose-kmod-legacy/pkg-plist
new file mode 100644
index 000000000000..b08a5706a028
--- /dev/null
+++ b/emulators/virtualbox-ose-kmod-legacy/pkg-plist
@@ -0,0 +1,6 @@
+/%%KMODDIR%%/vboxdrv.ko
+%%DEBUG%%/%%KMODDIR%%/vboxdrv.ko.%%SYMBOLSUFFIX%%
+/%%KMODDIR%%/vboxnetadp.ko
+%%DEBUG%%/%%KMODDIR%%/vboxnetadp.ko.%%SYMBOLSUFFIX%%
+/%%KMODDIR%%/vboxnetflt.ko
+%%DEBUG%%/%%KMODDIR%%/vboxnetflt.ko.%%SYMBOLSUFFIX%%