View | Details | Raw Unified | Return to bug 280062 | Differences between
and this patch

Collapse All | Expand All

(-)b/emulators/virtualbox-ose-legacy/Makefile (-2 / +2 lines)
Lines 1-6 Link Here
1
PORTNAME=	virtualbox-ose
1
PORTNAME=	virtualbox-ose
2
PORTVERSION=	5.2.44
2
PORTVERSION=	5.2.44
3
PORTREVISION?=	19
3
PORTREVISION?=	20
4
CATEGORIES=	emulators
4
CATEGORIES=	emulators
5
MASTER_SITES=	https://download.oracle.com/virtualbox/${PORTVERSION}/:src \
5
MASTER_SITES=	https://download.oracle.com/virtualbox/${PORTVERSION}/:src \
6
		LOCAL/bofh/emulators/virtualbox-ose-legacy:docs
6
		LOCAL/bofh/emulators/virtualbox-ose-legacy:docs
Lines 159-165 PLIST_SUB+= QT="@comment " Link Here
159
.endif
159
.endif
160
160
161
.if ${PORT_OPTIONS:MWEBSERVICE}
161
.if ${PORT_OPTIONS:MWEBSERVICE}
162
USE_RC_SUBR+=	vboxwebsrv
162
USE_RC_SUBR+=	vboxinit vboxwebsrv
163
VBOX_LINKS+=	vboxwebsrv
163
VBOX_LINKS+=	vboxwebsrv
164
VBOX_UTILS+=	vboxwebsrv webtest
164
VBOX_UTILS+=	vboxwebsrv webtest
165
.endif
165
.endif
(-)b/emulators/virtualbox-ose-legacy/files/vboxinit.in (+91 lines)
Added Link Here
1
#!/bin/sh
2
3
# PROVIDE: vboxinit
4
# REQUIRE: LOGIN vboxnet vboxwebsrv sshd
5
# KEYWORD: shutdown
6
#
7
# Add the following line to /etc/rc.conf[.local] to enable vboxinit
8
#
9
# vboxinit_enable (bool):	Set to "NO" by default.
10
#				Set it to "YES" to enable vboxinit.
11
#				stop and faststop are always enabled.
12
# vboxinit_user (str):		Default user account to run with.
13
# 				(default: %%VBOXUSER%%)
14
# vboxinit_home (str):		Default home directory to run with.
15
#				(default: home of user ${vboxinit_user}
16
# vboxinit_stop (str):		Default stop cmd for VBoxManage controlvm.
17
#				(default: savestate)
18
# vboxinit_start_delay (int):	Default startup delay in seconds.
19
#				(default: 0)
20
# vboxinit_stop_delay (int):	Default shutdown delay in seconds.
21
#				(default: 0)
22
#
23
# Set the "Startup Mode" to "Automatic" for the virtual machine in
24
# phpvirtualbox to automatically start the virtual machine during OS boot.
25
#
26
27
. /etc/rc.subr
28
29
name="vboxinit"
30
rcvar="${name}_enable"
31
32
start_cmd="${name}_start"
33
stop_cmd="${name}_stop"
34
status_cmd="${name}_status"
35
restart_cmd="${name}_restart"
36
37
vboxinit_start()
38
{
39
	# Get a list of all machines with autorun enabled in phpvirtualbox
40
	${su_command} "${command} list vms | /usr/bin/tr -d '{}\"'" | while read VMNAME UUID; do
41
		STARTUP=$(${su_command} "${command} getextradata ${UUID} 'pvbx/startupMode'" | /usr/bin/cut -d' ' -f2)
42
		if [ "${STARTUP}" == "auto" ]; then
43
			echo "${name}: starting machine ${VMNAME} ..."
44
			${su_command} "${command} startvm ${UUID} --type headless"
45
			sleep "${vboxinit_start_delay}"
46
		fi
47
	done
48
}
49
50
vboxinit_stop()
51
{
52
	# Get all running machines
53
	${su_command} "${command} list runningvms | /usr/bin/tr -d '{}\"'" | while read VMNAME UUID; do
54
		echo "${name}: stopping machine ${VMNAME} with action '${vboxinit_stop}' ..."
55
		${su_command} "${command} controlvm ${UUID} ${vboxinit_stop}"
56
		sleep "${vboxinit_stop_delay}"
57
	done
58
}
59
60
vboxinit_status()
61
{
62
	# List all running machines
63
	${su_command} "${command} list runningvms"
64
}
65
66
vboxinit_restart()
67
{
68
	vboxinit_stop
69
	vboxinit_start
70
}
71
72
load_rc_config $name
73
74
: ${vboxinit_enable="NO"}
75
: ${vboxinit_user="%%VBOXUSER%%"}
76
: ${vboxinit_home=$(/usr/sbin/pw usershow -7 -n "${vboxinit_user}" | /usr/bin/cut -d: -f6)}
77
: ${vboxinit_stop="savestate"}
78
: ${vboxinit_start_delay="0"}
79
: ${vboxinit_stop_delay="0"}
80
HOME=${vboxinit_home}
81
USER=${vboxinit_user}
82
export HOME USER
83
84
command="%%VBOXDIR%%/VBoxManage"
85
su_command="/usr/bin/su -m ${vboxinit_user} -c"
86
87
if [ "x$1" = "xstop" ] || [ "x$1" = "xfaststop" ]; then
88
	vboxinit_enable="YES"
89
fi
90
91
run_rc_command "$1"
(-)b/emulators/virtualbox-ose-nox11-legacy/Makefile (-1 / +1 lines)
Lines 1-4 Link Here
1
PORTREVISION=	17
1
PORTREVISION=	18
2
PKGNAMESUFFIX=	-nox11-legacy
2
PKGNAMESUFFIX=	-nox11-legacy
3
3
4
OPTIONS_EXCLUDE=	ALSA DBUS DEBUG GUESTADDITIONS DOCS NLS PULSEAUDIO
4
OPTIONS_EXCLUDE=	ALSA DBUS DEBUG GUESTADDITIONS DOCS NLS PULSEAUDIO
(-)b/emulators/virtualbox-ose-nox11/Makefile (-1 / +1 lines)
Lines 1-4 Link Here
1
PORTREVISION=	0
1
PORTREVISION=	1
2
PKGNAMESUFFIX=	-nox11
2
PKGNAMESUFFIX=	-nox11
3
3
4
OPTIONS_EXCLUDE=	ALSA DBUS DEBUG GUESTADDITIONS DOCS NLS PULSEAUDIO \
4
OPTIONS_EXCLUDE=	ALSA DBUS DEBUG GUESTADDITIONS DOCS NLS PULSEAUDIO \
(-)b/emulators/virtualbox-ose/Makefile (-2 / +6 lines)
Lines 1-6 Link Here
1
PORTNAME=	virtualbox-ose
1
PORTNAME=	virtualbox-ose
2
PORTVERSION=	6.1.50
2
PORTVERSION=	6.1.50
3
PORTREVISION?=	2
3
PORTREVISION?=	3
4
CATEGORIES=	emulators
4
CATEGORIES=	emulators
5
MASTER_SITES=	https://download.virtualbox.org/virtualbox/${PORTVERSION}/:src \
5
MASTER_SITES=	https://download.virtualbox.org/virtualbox/${PORTVERSION}/:src \
6
		LOCAL/bofh/emulators/virtualbox-ose:docs
6
		LOCAL/bofh/emulators/virtualbox-ose:docs
Lines 167-173 PLIST_SUB+= QT="@comment " Link Here
167
.endif
167
.endif
168
168
169
.if ${PORT_OPTIONS:MWEBSERVICE}
169
.if ${PORT_OPTIONS:MWEBSERVICE}
170
USE_RC_SUBR+=	vboxwebsrv
170
USE_RC_SUBR+=	vboxinit vboxwebsrv
171
VBOX_LINKS+=	vboxwebsrv
171
VBOX_LINKS+=	vboxwebsrv
172
VBOX_UTILS+=	vboxwebsrv webtest
172
VBOX_UTILS+=	vboxwebsrv webtest
173
.endif
173
.endif
Lines 282-287 post-patch: Link Here
282
	    ${WRKSRC}/LocalConfig.kmk
282
	    ${WRKSRC}/LocalConfig.kmk
283
	@${ECHO_CMD} 'VBOX_GCC_PEDANTIC_CXX = -Wshadow $$(VBOX_GCC_WARN) -Wno-long-long' >> \
283
	@${ECHO_CMD} 'VBOX_GCC_PEDANTIC_CXX = -Wshadow $$(VBOX_GCC_WARN) -Wno-long-long' >> \
284
	    ${WRKSRC}/LocalConfig.kmk
284
	    ${WRKSRC}/LocalConfig.kmk
285
#.else
286
#	@${ECHO_CMD} 'VBOX_GCC_PEDANTIC_CXX = -Wno-dynamic-exception-spec \
287
#		-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION' >> \
288
#	    ${WRKSRC}/LocalConfig.kmk
285
.endif
289
.endif
286
.if empty(PORT_OPTIONS:MX11)
290
.if empty(PORT_OPTIONS:MX11)
287
	@${ECHO} 'VBOX_WITH_VMSVGA3D =' >> ${WRKSRC}/LocalConfig.kmk
291
	@${ECHO} 'VBOX_WITH_VMSVGA3D =' >> ${WRKSRC}/LocalConfig.kmk
(-)b/emulators/virtualbox-ose/files/vboxinit.in (+91 lines)
Added Link Here
1
#!/bin/sh
2
3
# PROVIDE: vboxinit
4
# REQUIRE: LOGIN vboxnet vboxwebsrv sshd
5
# KEYWORD: shutdown
6
#
7
# Add the following line to /etc/rc.conf[.local] to enable vboxinit
8
#
9
# vboxinit_enable (bool):	Set to "NO" by default.
10
#				Set it to "YES" to enable vboxinit.
11
#				stop and faststop are always enabled.
12
# vboxinit_user (str):		Default user account to run with.
13
# 				(default: %%VBOXUSER%%)
14
# vboxinit_home (str):		Default home directory to run with.
15
#				(default: home of user ${vboxinit_user}
16
# vboxinit_stop (str):		Default stop cmd for VBoxManage controlvm.
17
#				(default: savestate)
18
# vboxinit_start_delay (int):	Default startup delay in seconds.
19
#				(default: 0)
20
# vboxinit_stop_delay (int):	Default shutdown delay in seconds.
21
#				(default: 0)
22
#
23
# Set the "Startup Mode" to "Automatic" for the virtual machine in
24
# phpvirtualbox to automatically start the virtual machine during OS boot.
25
#
26
27
. /etc/rc.subr
28
29
name="vboxinit"
30
rcvar="${name}_enable"
31
32
start_cmd="${name}_start"
33
stop_cmd="${name}_stop"
34
status_cmd="${name}_status"
35
restart_cmd="${name}_restart"
36
37
vboxinit_start()
38
{
39
	# Get a list of all machines with autorun enabled in phpvirtualbox
40
	${su_command} "${command} list vms | /usr/bin/tr -d '{}\"'" | while read VMNAME UUID; do
41
		STARTUP=$(${su_command} "${command} getextradata ${UUID} 'pvbx/startupMode'" | /usr/bin/cut -d' ' -f2)
42
		if [ "${STARTUP}" == "auto" ]; then
43
			echo "${name}: starting machine ${VMNAME} ..."
44
			${su_command} "${command} startvm ${UUID} --type headless"
45
			sleep "${vboxinit_start_delay}"
46
		fi
47
	done
48
}
49
50
vboxinit_stop()
51
{
52
	# Get all running machines
53
	${su_command} "${command} list runningvms | /usr/bin/tr -d '{}\"'" | while read VMNAME UUID; do
54
		echo "${name}: stopping machine ${VMNAME} with action '${vboxinit_stop}' ..."
55
		${su_command} "${command} controlvm ${UUID} ${vboxinit_stop}"
56
		sleep "${vboxinit_stop_delay}"
57
	done
58
}
59
60
vboxinit_status()
61
{
62
	# List all running machines
63
	${su_command} "${command} list runningvms"
64
}
65
66
vboxinit_restart()
67
{
68
	vboxinit_stop
69
	vboxinit_start
70
}
71
72
load_rc_config $name
73
74
: ${vboxinit_enable="NO"}
75
: ${vboxinit_user="%%VBOXUSER%%"}
76
: ${vboxinit_home=$(/usr/sbin/pw usershow -7 -n "${vboxinit_user}" | /usr/bin/cut -d: -f6)}
77
: ${vboxinit_stop="savestate"}
78
: ${vboxinit_start_delay="0"}
79
: ${vboxinit_stop_delay="0"}
80
HOME=${vboxinit_home}
81
USER=${vboxinit_user}
82
export HOME USER
83
84
command="%%VBOXDIR%%/VBoxManage"
85
su_command="/usr/bin/su -m ${vboxinit_user} -c"
86
87
if [ "x$1" = "xstop" ] || [ "x$1" = "xfaststop" ]; then
88
	vboxinit_enable="YES"
89
fi
90
91
run_rc_command "$1"

Return to bug 280062