aboutsummaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authorBernhard Froehlich <decke@FreeBSD.org>2011-07-01 13:24:42 +0000
committerBernhard Froehlich <decke@FreeBSD.org>2011-07-01 13:24:42 +0000
commit7265cde2264c7b75c7d87691cea62585264e1efe (patch)
tree243eea7b2c1894fbe0199f4fed2f5ce4c8af6ff5 /emulators
parent939332056cb2e4e9458caa99b1cec4da3c4a6bbb (diff)
downloadports-7265cde2264c7b75c7d87691cea62585264e1efe.tar.gz
ports-7265cde2264c7b75c7d87691cea62585264e1efe.zip
Notes
Diffstat (limited to 'emulators')
-rw-r--r--emulators/virtualbox-ose-legacy/Makefile2
-rw-r--r--emulators/virtualbox-ose-legacy/files/patch-src-VBox-Main-freebsd-HostHardwareFreeBSD.cpp33
-rw-r--r--emulators/virtualbox-ose-legacy/files/vboxheadless.in19
3 files changed, 50 insertions, 4 deletions
diff --git a/emulators/virtualbox-ose-legacy/Makefile b/emulators/virtualbox-ose-legacy/Makefile
index ff85060cb4d5..795a474dd6c8 100644
--- a/emulators/virtualbox-ose-legacy/Makefile
+++ b/emulators/virtualbox-ose-legacy/Makefile
@@ -7,7 +7,7 @@
PORTNAME= virtualbox-ose
DISTVERSION= 3.2.12
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= emulators
MASTER_SITES= http://tmp.chruetertee.ch/ \
http://freebsd.unixfreunde.de/sources/ \
diff --git a/emulators/virtualbox-ose-legacy/files/patch-src-VBox-Main-freebsd-HostHardwareFreeBSD.cpp b/emulators/virtualbox-ose-legacy/files/patch-src-VBox-Main-freebsd-HostHardwareFreeBSD.cpp
new file mode 100644
index 000000000000..673526554ff4
--- /dev/null
+++ b/emulators/virtualbox-ose-legacy/files/patch-src-VBox-Main-freebsd-HostHardwareFreeBSD.cpp
@@ -0,0 +1,33 @@
+--- src/VBox/Main/freebsd/HostHardwareFreeBSD.cpp.cpp.orig 2011-05-16 12:33:46.000000000 -0400
++++ src/VBox/Main/freebsd/HostHardwareFreeBSD.cpp 2011-06-24 16:03:37.000000000 -0400
+@@ -35,6 +35,7 @@
+ #include <iprt/string.h>
+
+ #ifdef RT_OS_FREEBSD
++# include <sys/param.h>
+ # include <sys/types.h>
+ # include <sys/stat.h>
+ # include <unistd.h>
+@@ -186,11 +187,17 @@ static int getDVDInfoFromCAM(DriveInfoLi
+ DeviceMatchPattern.pattern.device_pattern.target_id = CAM_TARGET_WILDCARD;
+ DeviceMatchPattern.pattern.device_pattern.target_lun = CAM_LUN_WILDCARD;
+ DeviceMatchPattern.pattern.device_pattern.flags = DEV_MATCH_INQUIRY;
+- DeviceMatchPattern.pattern.device_pattern.inq_pat.type = T_CDROM;
+- DeviceMatchPattern.pattern.device_pattern.inq_pat.media_type = SIP_MEDIA_REMOVABLE | SIP_MEDIA_FIXED;
+- DeviceMatchPattern.pattern.device_pattern.inq_pat.vendor[0] = '*'; /* Matches anything */
+- DeviceMatchPattern.pattern.device_pattern.inq_pat.product[0] = '*'; /* Matches anything */
+- DeviceMatchPattern.pattern.device_pattern.inq_pat.revision[0] = '*'; /* Matches anything */
++#if __FreeBSD_version >= 900000
++#define INQ_PAT data.inq_pat
++#else
++#define INQ_PAT inq_pat
++#endif
++ DeviceMatchPattern.pattern.device_pattern.INQ_PAT.type = T_CDROM;
++ DeviceMatchPattern.pattern.device_pattern.INQ_PAT.media_type = SIP_MEDIA_REMOVABLE | SIP_MEDIA_FIXED;
++ DeviceMatchPattern.pattern.device_pattern.INQ_PAT.vendor[0] = '*'; /* Matches anything */
++ DeviceMatchPattern.pattern.device_pattern.INQ_PAT.product[0] = '*'; /* Matches anything */
++ DeviceMatchPattern.pattern.device_pattern.INQ_PAT.revision[0] = '*'; /* Matches anything */
++#undef INQ_PAT
+ DeviceCCB.cdm.num_patterns = 1;
+ DeviceCCB.cdm.pattern_buf_len = sizeof(struct dev_match_result);
+ DeviceCCB.cdm.patterns = &DeviceMatchPattern;
diff --git a/emulators/virtualbox-ose-legacy/files/vboxheadless.in b/emulators/virtualbox-ose-legacy/files/vboxheadless.in
index f0a04a6b1aa1..8913f192ffb8 100644
--- a/emulators/virtualbox-ose-legacy/files/vboxheadless.in
+++ b/emulators/virtualbox-ose-legacy/files/vboxheadless.in
@@ -13,9 +13,15 @@
# vboxheadless_machines (str): Space separated list of machines
# vboxheadless_user (str): Default user account to run with.
# (default: %%VBOXUSER%%)
+# vboxheadless_stop (str): Default stop cmd for VBoxManage controlvm.
+# (default: savestate)
+# vboxheadless_delay (int): Default startup/shutdown delay in seconds.
+# (default: 0)
# vboxheadless_<machine>_name (str): Virtualbox machine name or UUID.
# vboxheadless_<machine>_user (str): User account to run with.
# vboxheadless_<machine>_flags (str): Additional flags for VBoxHeadless.
+# vboxheadless_<machine>_stop (str): Stop command for VBoxManage controlvm.
+# vboxheadless_<machine>_delay (int): Startup and shutdown delay in seconds.
. /etc/rc.subr
@@ -31,7 +37,7 @@ status_cmd="${name}_status"
vboxheadless_start()
{
- local machine mpidfile pid vmname vmuser vmflags
+ local machine mpidfile pid vmname vmuser vmflags vmdelay
echo "Starting Virtual Machines:"
for machine in ${vboxheadless_machines}; do
@@ -40,6 +46,7 @@ vboxheadless_start()
eval vmname="\${vboxheadless_${machine}_name:-${machine}}"
eval vmuser="\${vboxheadless_${machine}_user:-${vboxheadless_user}}"
eval vmflags="\${vboxheadless_${machine}_flags:-}"
+ eval vmdelay="\${vboxheadless_${machine}_delay:-${vboxheadless_delay}}"
HOME=$(/usr/sbin/pw usershow -7 -n "${vmuser}" | /usr/bin/cut -d: -f6)
@@ -57,6 +64,7 @@ vboxheadless_start()
continue
fi
+ /bin/sleep ${vmdelay}
/usr/bin/install -o ${vmuser} -g wheel -m 644 /dev/null ${mpidfile}
/usr/sbin/daemon -f -p ${mpidfile} -u ${vmuser} ${command} --startvm "${vmname}" ${vmflags}
echo "Started"
@@ -65,7 +73,7 @@ vboxheadless_start()
vboxheadless_stop()
{
- local machine mpidfile pid vmname vmuser
+ local machine mpidfile pid vmname vmuser vmstop vmdelay
echo "Saving states for Virtual Machines:"
for machine in ${vboxheadless_machines}; do
@@ -73,11 +81,14 @@ vboxheadless_stop()
pid=$(check_pidfile $mpidfile $command)
eval vmname="\${vboxheadless_${machine}_name:-${machine}}"
eval vmuser="\${vboxheadless_${machine}_user:-${vboxheadless_user}}"
+ eval vmstop="\${vboxheadless_${machine}_stop:-${vboxheadless_stop}}"
+ eval vmdelay="\${vboxheadless_${machine}_delay:-${vboxheadless_delay}}"
/usr/bin/printf "%25s " "${vmname}"
if [ -n "${pid}" ]; then
- /usr/bin/su ${vmuser} -c "%%PREFIX%%/bin/VBoxManage controlvm '${vmname}' savestate >/dev/null" 2>/dev/null
+ /bin/sleep ${vmdelay}
+ /usr/bin/su ${vmuser} -c "%%PREFIX%%/bin/VBoxManage controlvm '${vmname}' ${vmstop} >/dev/null" 2>/dev/null
wait_for_pids $pid >/dev/null
echo "Stopped"
else
@@ -115,6 +126,8 @@ load_rc_config $name
: ${vboxheadless_enable="NO"}
: ${vboxheadless_user="%%VBOXUSER%%"}
+: ${vboxheadless_stop="savestate"}
+: ${vboxheadless_delay="0"}
cmd_arg="$1" ; shift