forked from pool/virtualbox
Accepting request 655353 from home:frispete:kernel
Now it builds for 42.3 as well - replace switch_to_python3.6.patch with switch_to_python3.4+.patch - remove fixes_for_leap15.patch, upstream has incorporated it - add conflict with i4l-vbox due to shared /etc/vbox - adjust /etc/vbox permissions - add /etc/vbox/autostart.cfg - fix vboxdrv.sh: apply new autostart mechanics to stop_vms() - remove obsolete shutdown section in /etc/default/virtualbox - add VBOXAUTOSTART_{DB,CONFIG} to /etc/default/virtualbox - supply README.autostart OBS-URL: https://build.opensuse.org/request/show/655353 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=459
This commit is contained in:
parent
19f1afc1f5
commit
35fb819fbd
36
README.autostart
Normal file
36
README.autostart
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
Prerequisites
|
||||||
|
=============
|
||||||
|
|
||||||
|
Users, that want to use the VirtualBox autostart feature, have to be
|
||||||
|
members of the vboxusers group.
|
||||||
|
|
||||||
|
E.g.:
|
||||||
|
sudo usermod -aG vboxusers USERNAME
|
||||||
|
|
||||||
|
Preparation
|
||||||
|
===========
|
||||||
|
|
||||||
|
For each autostart user, add a section in /etc/vbox/autostart.cfg:
|
||||||
|
|
||||||
|
USERNAME = {
|
||||||
|
allow = true
|
||||||
|
}
|
||||||
|
|
||||||
|
Users work
|
||||||
|
==========
|
||||||
|
|
||||||
|
The *first* time a user configures autostart, the command:
|
||||||
|
VBoxManage setproperty autostartdbpath /etc/vbox
|
||||||
|
needs to be run.
|
||||||
|
|
||||||
|
Note: The autostart options are stored in the /etc/vbox file, and in the
|
||||||
|
VM itself. If moving a VM, these options may need to be set again.
|
||||||
|
|
||||||
|
Prepare a VM to start automatically:
|
||||||
|
VBoxManage modifyvm <uuid|vmname> --autostart-enabled <on|off>
|
||||||
|
|
||||||
|
Choose a shut down mode:
|
||||||
|
VBoxManage modifyvm <uuid|vmname> --autostop-type <disabled|savestate|poweroff|acpishutdown>
|
||||||
|
|
||||||
|
Restart the vboxdrv service to start the VMs in question
|
||||||
|
sudo service vboxdrv restart
|
@ -1,44 +0,0 @@
|
|||||||
Index: VirtualBox-5.2.8/src/VBox/Runtime/r0drv/linux/waitqueue-r0drv-linux.h
|
|
||||||
===================================================================
|
|
||||||
--- VirtualBox-5.2.8.orig/src/VBox/Runtime/r0drv/linux/waitqueue-r0drv-linux.h
|
|
||||||
+++ VirtualBox-5.2.8/src/VBox/Runtime/r0drv/linux/waitqueue-r0drv-linux.h
|
|
||||||
@@ -46,7 +46,7 @@
|
|
||||||
typedef struct RTR0SEMLNXWAIT
|
|
||||||
{
|
|
||||||
/** The wait queue entry. */
|
|
||||||
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
|
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
|
||||||
wait_queue_entry_t WaitQE;
|
|
||||||
#else
|
|
||||||
wait_queue_t WaitQE;
|
|
||||||
Index: VirtualBox-5.2.8/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
|
|
||||||
===================================================================
|
|
||||||
--- VirtualBox-5.2.8.orig/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
|
|
||||||
+++ VirtualBox-5.2.8/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
|
|
||||||
@@ -150,6 +150,10 @@ typedef struct VBOXNETFLTNOTIFIER *PVBOX
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+# if 1
|
|
||||||
+#define SKB_GSO_UDP 0
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
|
|
||||||
# define VBOX_HAVE_SKB_VLAN
|
|
||||||
#else
|
|
||||||
Index: VirtualBox-5.2.8/src/VBox/Additions/linux/drm/vbox_mode.c
|
|
||||||
===================================================================
|
|
||||||
--- VirtualBox-5.2.8.orig/src/VBox/Additions/linux/drm/vbox_mode.c
|
|
||||||
+++ VirtualBox-5.2.8/src/VBox/Additions/linux/drm/vbox_mode.c
|
|
||||||
@@ -401,11 +401,7 @@ static struct drm_encoder *vbox_best_sin
|
|
||||||
|
|
||||||
/* pick the encoder ids */
|
|
||||||
if (enc_id)
|
|
||||||
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
|
|
||||||
return drm_encoder_find(connector->dev, NULL, enc_id);
|
|
||||||
-#else
|
|
||||||
- return drm_encoder_find(connector->dev, enc_id);
|
|
||||||
-#endif
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
@ -1,32 +1,32 @@
|
|||||||
Index: VirtualBox-5.2.20/configure
|
Index: b/configure
|
||||||
===================================================================
|
===================================================================
|
||||||
--- VirtualBox-5.2.20.orig/configure
|
--- a/configure
|
||||||
+++ VirtualBox-5.2.20/configure
|
+++ b/configure
|
||||||
@@ -1959,17 +1959,17 @@ extern "C" int main(void)
|
@@ -1963,17 +1963,17 @@ extern "C" int main(void)
|
||||||
{
|
{
|
||||||
Py_Initialize();
|
Py_Initialize();
|
||||||
printf("found version %s", PY_VERSION);
|
printf("found version %s", PY_VERSION);
|
||||||
-#if PY_VERSION_HEX >= 0x02060000
|
-#if PY_VERSION_HEX >= 0x02060000
|
||||||
+#if PY_VERSION_HEX >= 0x03060000
|
+#if PY_VERSION_HEX >= 0x03040000
|
||||||
printf(", OK.\n");
|
printf(", OK.\n");
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
- printf(", expected version 2.6 or higher\n");
|
- printf(", expected version 2.6 or higher\n");
|
||||||
+ printf(", expected version 3.6 or higher\n");
|
+ printf(", expected version 3.4 or higher\n");
|
||||||
return 1;
|
return 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
found=
|
found=
|
||||||
- SUPPYTHONLIBS="python2.7 python2.6 python3.1 python3.2 python3.3 python3.4 python3.4m python3.5 python3.5m python3.6 python3.6m"
|
- SUPPYTHONLIBS="python2.7 python2.6 python3.1 python3.2 python3.3 python3.4 python3.4m python3.5 python3.5m python3.6 python3.6m"
|
||||||
+ SUPPYTHONLIBS="python3.6m python3.6 python3.7m python3.7"
|
+ SUPPYTHONLIBS="python3.4 python3.4m python3.5 python3.5m python3.6m python3.6 python3.7m python3.7"
|
||||||
for p in $PYTHONDIR; do
|
for p in $PYTHONDIR; do
|
||||||
for d in $SUPPYTHONLIBS; do
|
for d in $SUPPYTHONLIBS; do
|
||||||
for b in lib/x86_64-linux-gnu lib/i386-linux-gnu lib64 lib/64 lib; do
|
for b in lib/x86_64-linux-gnu lib/i386-linux-gnu lib64 lib/64 lib; do
|
||||||
Index: VirtualBox-5.2.20/src/VBox/Installer/linux/routines.sh
|
Index: b/src/VBox/Installer/linux/routines.sh
|
||||||
===================================================================
|
===================================================================
|
||||||
--- VirtualBox-5.2.20.orig/src/VBox/Installer/linux/routines.sh
|
--- a/src/VBox/Installer/linux/routines.sh
|
||||||
+++ VirtualBox-5.2.20/src/VBox/Installer/linux/routines.sh
|
+++ b/src/VBox/Installer/linux/routines.sh
|
||||||
@@ -375,8 +375,8 @@ terminate_proc() {
|
@@ -375,8 +375,8 @@ terminate_proc() {
|
||||||
maybe_run_python_bindings_installer() {
|
maybe_run_python_bindings_installer() {
|
||||||
VBOX_INSTALL_PATH="${1}"
|
VBOX_INSTALL_PATH="${1}"
|
||||||
@ -38,11 +38,11 @@ Index: VirtualBox-5.2.20/src/VBox/Installer/linux/routines.sh
|
|||||||
if sys.version_info >= (2, 6):
|
if sys.version_info >= (2, 6):
|
||||||
print \"test\"' 2> /dev/null`" != "test" ]; then
|
print \"test\"' 2> /dev/null`" != "test" ]; then
|
||||||
echo 1>&2 "Python 2.6 or later not available, skipping bindings installation."
|
echo 1>&2 "Python 2.6 or later not available, skipping bindings installation."
|
||||||
Index: VirtualBox-5.2.20/src/bldprogs/scm.cpp
|
Index: b/src/bldprogs/scm.cpp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- VirtualBox-5.2.20.orig/src/bldprogs/scm.cpp
|
--- a/src/bldprogs/scm.cpp
|
||||||
+++ VirtualBox-5.2.20/src/bldprogs/scm.cpp
|
+++ b/src/bldprogs/scm.cpp
|
||||||
@@ -2031,7 +2031,7 @@ static int scmProcessFileInner(PSCMRWSTA
|
@@ -2033,7 +2033,7 @@ static int scmProcessFileInner(PSCMRWSTA
|
||||||
pszTreatAs = "shell";
|
pszTreatAs = "shell";
|
||||||
else if ( (cchFirst >= 15 && strncmp(pchFirst, "/usr/bin/python", 15) == 0)
|
else if ( (cchFirst >= 15 && strncmp(pchFirst, "/usr/bin/python", 15) == 0)
|
||||||
|| (cchFirst >= 19 && strncmp(pchFirst, "/usr/bin/env python", 19) == 0) )
|
|| (cchFirst >= 19 && strncmp(pchFirst, "/usr/bin/env python", 19) == 0) )
|
||||||
@ -51,10 +51,10 @@ Index: VirtualBox-5.2.20/src/bldprogs/scm.cpp
|
|||||||
else if ( (cchFirst >= 13 && strncmp(pchFirst, "/usr/bin/perl", 13) == 0)
|
else if ( (cchFirst >= 13 && strncmp(pchFirst, "/usr/bin/perl", 13) == 0)
|
||||||
|| (cchFirst >= 17 && strncmp(pchFirst, "/usr/bin/env perl", 17) == 0) )
|
|| (cchFirst >= 17 && strncmp(pchFirst, "/usr/bin/env perl", 17) == 0) )
|
||||||
pszTreatAs = "perl";
|
pszTreatAs = "perl";
|
||||||
Index: VirtualBox-5.2.20/src/libs/libxml2-2.9.4/configure
|
Index: b/src/libs/libxml2-2.9.4/configure
|
||||||
===================================================================
|
===================================================================
|
||||||
--- VirtualBox-5.2.20.orig/src/libs/libxml2-2.9.4/configure
|
--- a/src/libs/libxml2-2.9.4/configure
|
||||||
+++ VirtualBox-5.2.20/src/libs/libxml2-2.9.4/configure
|
+++ b/src/libs/libxml2-2.9.4/configure
|
||||||
@@ -15153,10 +15153,10 @@ PYTHON_SITE_PACKAGES=
|
@@ -15153,10 +15153,10 @@ PYTHON_SITE_PACKAGES=
|
||||||
PYTHON_TESTS=
|
PYTHON_TESTS=
|
||||||
pythondir=
|
pythondir=
|
||||||
@ -79,10 +79,10 @@ Index: VirtualBox-5.2.20/src/libs/libxml2-2.9.4/configure
|
|||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||||
$as_echo_n "checking for $ac_word... " >&6; }
|
$as_echo_n "checking for $ac_word... " >&6; }
|
||||||
if ${ac_cv_path_PYTHON+:} false; then :
|
if ${ac_cv_path_PYTHON+:} false; then :
|
||||||
Index: VirtualBox-5.2.20/src/VBox/ValidationKit/testboxscript/setup.sh
|
Index: b/src/VBox/ValidationKit/testboxscript/setup.sh
|
||||||
===================================================================
|
===================================================================
|
||||||
--- VirtualBox-5.2.20.orig/src/VBox/ValidationKit/testboxscript/setup.sh
|
--- a/src/VBox/ValidationKit/testboxscript/setup.sh
|
||||||
+++ VirtualBox-5.2.20/src/VBox/ValidationKit/testboxscript/setup.sh
|
+++ b/src/VBox/ValidationKit/testboxscript/setup.sh
|
||||||
@@ -644,7 +644,7 @@ import sys;\
|
@@ -644,7 +644,7 @@ import sys;\
|
||||||
x = sys.version_info[0] == 2 and (sys.version_info[1] >= 6 or (sys.version_info[1] == 5 and sys.version_info[2] >= 1));\
|
x = sys.version_info[0] == 2 and (sys.version_info[1] >= 6 or (sys.version_info[1] == 5 and sys.version_info[2] >= 1));\
|
||||||
sys.exit(not x);\
|
sys.exit(not x);\
|
||||||
@ -92,10 +92,10 @@ Index: VirtualBox-5.2.20/src/VBox/ValidationKit/testboxscript/setup.sh
|
|||||||
do
|
do
|
||||||
python=`which ${python} 2> /dev/null`
|
python=`which ${python} 2> /dev/null`
|
||||||
if [ -n "${python}" -a -x "${python}" ]; then
|
if [ -n "${python}" -a -x "${python}" ]; then
|
||||||
Index: VirtualBox-5.2.20/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec
|
Index: b/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec
|
||||||
===================================================================
|
===================================================================
|
||||||
--- VirtualBox-5.2.20.orig/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec
|
--- a/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec
|
||||||
+++ VirtualBox-5.2.20/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec
|
+++ b/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec
|
||||||
@@ -20,7 +20,7 @@
|
@@ -20,7 +20,7 @@
|
||||||
%define %PYTHON% 1
|
%define %PYTHON% 1
|
||||||
%define VBOXDOCDIR %{_defaultdocdir}/%NAME%
|
%define VBOXDOCDIR %{_defaultdocdir}/%NAME%
|
||||||
@ -114,10 +114,10 @@ Index: VirtualBox-5.2.20/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec
|
|||||||
%endif
|
%endif
|
||||||
rm -rf sdk/installer
|
rm -rf sdk/installer
|
||||||
mv nls $RPM_BUILD_ROOT/usr/share/virtualbox
|
mv nls $RPM_BUILD_ROOT/usr/share/virtualbox
|
||||||
Index: VirtualBox-5.2.20/src/libs/libxml2-2.9.4/libxml.spec.in
|
Index: b/src/libs/libxml2-2.9.4/libxml.spec.in
|
||||||
===================================================================
|
===================================================================
|
||||||
--- VirtualBox-5.2.20.orig/src/libs/libxml2-2.9.4/libxml.spec.in
|
--- a/src/libs/libxml2-2.9.4/libxml.spec.in
|
||||||
+++ VirtualBox-5.2.20/src/libs/libxml2-2.9.4/libxml.spec.in
|
+++ b/src/libs/libxml2-2.9.4/libxml.spec.in
|
||||||
@@ -101,11 +101,11 @@ rm -fr %{buildroot}
|
@@ -101,11 +101,11 @@ rm -fr %{buildroot}
|
||||||
|
|
||||||
make install DESTDIR=%{buildroot}
|
make install DESTDIR=%{buildroot}
|
||||||
@ -133,10 +133,10 @@ Index: VirtualBox-5.2.20/src/libs/libxml2-2.9.4/libxml.spec.in
|
|||||||
|
|
||||||
|
|
||||||
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
|
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
|
||||||
Index: VirtualBox-5.2.20/src/libs/libxml2-2.9.4/libxml2.spec
|
Index: b/src/libs/libxml2-2.9.4/libxml2.spec
|
||||||
===================================================================
|
===================================================================
|
||||||
--- VirtualBox-5.2.20.orig/src/libs/libxml2-2.9.4/libxml2.spec
|
--- a/src/libs/libxml2-2.9.4/libxml2.spec
|
||||||
+++ VirtualBox-5.2.20/src/libs/libxml2-2.9.4/libxml2.spec
|
+++ b/src/libs/libxml2-2.9.4/libxml2.spec
|
||||||
@@ -103,7 +103,7 @@ make install DESTDIR=%{buildroot}
|
@@ -103,7 +103,7 @@ make install DESTDIR=%{buildroot}
|
||||||
|
|
||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
@ -146,10 +146,10 @@ Index: VirtualBox-5.2.20/src/libs/libxml2-2.9.4/libxml2.spec
|
|||||||
make install DESTDIR=%{buildroot}
|
make install DESTDIR=%{buildroot}
|
||||||
%endif # with_python3
|
%endif # with_python3
|
||||||
|
|
||||||
Index: VirtualBox-5.2.20/src/libs/xpcom18a4/python/src/ErrorUtils.cpp
|
Index: b/src/libs/xpcom18a4/python/src/ErrorUtils.cpp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- VirtualBox-5.2.20.orig/src/libs/xpcom18a4/python/src/ErrorUtils.cpp
|
--- a/src/libs/xpcom18a4/python/src/ErrorUtils.cpp
|
||||||
+++ VirtualBox-5.2.20/src/libs/xpcom18a4/python/src/ErrorUtils.cpp
|
+++ b/src/libs/xpcom18a4/python/src/ErrorUtils.cpp
|
||||||
@@ -439,8 +439,10 @@ char *PyTraceback_AsString(PyObject *exc
|
@@ -439,8 +439,10 @@ char *PyTraceback_AsString(PyObject *exc
|
||||||
{ // a temp scope so I can use temp locals.
|
{ // a temp scope so I can use temp locals.
|
||||||
#if PY_MAJOR_VERSION <= 2
|
#if PY_MAJOR_VERSION <= 2
|
||||||
@ -162,10 +162,10 @@ Index: VirtualBox-5.2.20/src/libs/xpcom18a4/python/src/ErrorUtils.cpp
|
|||||||
#endif
|
#endif
|
||||||
result = (char *)PyMem_Malloc(strlen(tempResult)+1);
|
result = (char *)PyMem_Malloc(strlen(tempResult)+1);
|
||||||
if (result==NULL)
|
if (result==NULL)
|
||||||
Index: VirtualBox-5.2.20/src/libs/xpcom18a4/python/src/PyGBase.cpp
|
Index: b/src/libs/xpcom18a4/python/src/PyGBase.cpp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- VirtualBox-5.2.20.orig/src/libs/xpcom18a4/python/src/PyGBase.cpp
|
--- a/src/libs/xpcom18a4/python/src/PyGBase.cpp
|
||||||
+++ VirtualBox-5.2.20/src/libs/xpcom18a4/python/src/PyGBase.cpp
|
+++ b/src/libs/xpcom18a4/python/src/PyGBase.cpp
|
||||||
@@ -183,7 +183,11 @@ PyG_Base::~PyG_Base()
|
@@ -183,7 +183,11 @@ PyG_Base::~PyG_Base()
|
||||||
// Get the correct interface pointer for this object given the IID.
|
// Get the correct interface pointer for this object given the IID.
|
||||||
void *PyG_Base::ThisAsIID( const nsIID &iid )
|
void *PyG_Base::ThisAsIID( const nsIID &iid )
|
67
vboxdrv.sh
67
vboxdrv.sh
@ -297,51 +297,27 @@ stop()
|
|||||||
succ_msg "VirtualBox services stopped"
|
succ_msg "VirtualBox services stopped"
|
||||||
}
|
}
|
||||||
|
|
||||||
# enter the following variables in /etc/default/virtualbox:
|
|
||||||
# SHUTDOWN_USERS="foo bar"
|
|
||||||
# check for running VMs of user foo and user bar
|
|
||||||
# SHUTDOWN=poweroff
|
|
||||||
# SHUTDOWN=acpibutton
|
|
||||||
# SHUTDOWN=savestate
|
|
||||||
# select one of these shutdown methods for running VMs
|
|
||||||
stop_vms()
|
stop_vms()
|
||||||
{
|
{
|
||||||
wait=0
|
OLD_IFS=$IFS
|
||||||
for i in $SHUTDOWN_USERS; do
|
IFS=$'\n'
|
||||||
# don't create the ipcd directory with wrong permissions!
|
# read config file
|
||||||
if [ -d /tmp/.vbox-$i-ipc ]; then
|
[ -r /etc/default/virtualbox ] && . /etc/default/virtualbox
|
||||||
export VBOX_IPC_SOCKETID="$i"
|
[ -z "$VBOXAUTOSTART_DB" ] && return
|
||||||
VMS=`$VBOXMANAGE --nologo list runningvms | sed -e 's/^".*".*{\(.*\)}/\1/' 2>/dev/null`
|
[ -z "$VBOXAUTOSTART_CONFIG" ] && return
|
||||||
if [ -n "$VMS" ]; then
|
# read autostart config file
|
||||||
if [ "$SHUTDOWN" = "poweroff" ]; then
|
if [ -r $VBOXAUTOSTART_CONFIG ]; then
|
||||||
begin_msg "Powering off remaining VMs"
|
# find all the files of type username.stop
|
||||||
for v in $VMS; do
|
var=$(ls $VBOXAUTOSTART_DB | grep stop | grep -v auto)
|
||||||
$VBOXMANAGE --nologo controlvm $v poweroff
|
# process each file of that type
|
||||||
|
for i in $var; do
|
||||||
|
# Extract the user name - the first word on the line
|
||||||
|
user=$(echo $i | head -n1 | cut -d "." -f1)
|
||||||
|
# autostop the VMs for that user
|
||||||
|
su - $user -c "/usr/lib/virtualbox/VBoxAutostart --stop --config $VBOXAUTOSTART_CONFIG"
|
||||||
done
|
done
|
||||||
succ_msg "Remaining VMs powered off"
|
|
||||||
elif [ "$SHUTDOWN" = "acpibutton" ]; then
|
|
||||||
begin_msg "Sending ACPI power button event to remaining VMs"
|
|
||||||
for v in $VMS; do
|
|
||||||
$VBOXMANAGE --nologo controlvm $v acpipowerbutton
|
|
||||||
wait=30
|
|
||||||
done
|
|
||||||
succ_msg "ACPI power button event sent to remaining VMs"
|
|
||||||
elif [ "$SHUTDOWN" = "savestate" ]; then
|
|
||||||
begin_msg "Saving state of remaining VMs"
|
|
||||||
for v in $VMS; do
|
|
||||||
$VBOXMANAGE --nologo controlvm $v savestate
|
|
||||||
done
|
|
||||||
succ_msg "State of remaining VMs saved"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
# wait for some seconds when doing ACPI shutdown
|
|
||||||
if [ "$wait" -ne 0 ]; then
|
|
||||||
begin_msg "Waiting for $wait seconds for VM shutdown"
|
|
||||||
sleep $wait
|
|
||||||
succ_msg "Waited for $wait seconds for VM shutdown"
|
|
||||||
fi
|
fi
|
||||||
|
IFS=$OLD_IFS
|
||||||
}
|
}
|
||||||
|
|
||||||
start_vms()
|
start_vms()
|
||||||
@ -350,22 +326,21 @@ OLD_IFS=$IFS
|
|||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
# read config file
|
# read config file
|
||||||
[ -r /etc/default/virtualbox ] && . /etc/default/virtualbox
|
[ -r /etc/default/virtualbox ] && . /etc/default/virtualbox
|
||||||
#echo "Symbols are $VBOXAUTOSTART_DB and $VBOXAUTOSTART_CONFIG"
|
[ -z "$VBOXAUTOSTART_DB" ] && return
|
||||||
|
[ -z "$VBOXAUTOSTART_CONFIG" ] && return
|
||||||
# read autostart config file
|
# read autostart config file
|
||||||
if [ -r $VBOXAUTOSTART_CONFIG ]; then
|
if [ -r $VBOXAUTOSTART_CONFIG ]; then
|
||||||
VBoxManage list vms
|
# find all the files of type username.start
|
||||||
# find all the files of type user.start
|
|
||||||
var=$(ls $VBOXAUTOSTART_DB | grep start | grep -v auto)
|
var=$(ls $VBOXAUTOSTART_DB | grep start | grep -v auto)
|
||||||
# process each file of that type
|
# process each file of that type
|
||||||
for i in $var; do
|
for i in $var; do
|
||||||
# Extract the user name - the first word on the line
|
# Extract the user name - the first word on the line
|
||||||
user=$(echo $i | head -n1 | cut -d "." -f1)
|
user=$(echo $i | head -n1 | cut -d "." -f1)
|
||||||
# autostart the VMs for that user
|
# autostart the VMs for that user
|
||||||
su $user -c "/usr/lib/virtualbox/VBoxAutostart --start --config $VBOXAUTOSTART_CONFIG"
|
su - $user -c "/usr/lib/virtualbox/VBoxAutostart --background --start --config $VBOXAUTOSTART_CONFIG"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
IFS=$OLD_IFS
|
IFS=$OLD_IFS
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup()
|
cleanup()
|
||||||
|
@ -1,19 +1,10 @@
|
|||||||
# /etc/default/virtualbox
|
# /etc/default/virtualbox
|
||||||
#
|
#
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
# In the "SHUTDOWN_USERS" list all users for which a check for runnings VMs should be done during
|
# Autostart
|
||||||
# shutdown of "vboxdrv" resp. the server:
|
|
||||||
# SHUTDOWN_USERS="foo bar"
|
|
||||||
#
|
|
||||||
# Set "SHUTDOWN" to one of "poweroff", "acpibutton" or "savestate" depending on which of the
|
|
||||||
# shutdown methods for running VMs are wanted:
|
|
||||||
# SHUTDOWN="poweroff"
|
|
||||||
# SHUTDOWN="acpibutton"
|
|
||||||
# SHUTDOWN="savestate"
|
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
#
|
VBOXAUTOSTART_DB=/etc/vbox
|
||||||
#SHUTDOWN_USERS="foo bar"
|
VBOXAUTOSTART_CONFIG=/etc/vbox/autostart.cfg
|
||||||
#SHUTDOWN="savestate"
|
|
||||||
|
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
# By default, vboxdrv creates a file /etc/udev/rules.d/60-vboxdrv.rules every time, it is started,
|
# By default, vboxdrv creates a file /etc/udev/rules.d/60-vboxdrv.rules every time, it is started,
|
||||||
|
@ -1,3 +1,20 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Dec 5 12:10:20 UTC 2018 - Hans-Peter Jansen <hpj@urpla.net>
|
||||||
|
|
||||||
|
- replace switch_to_python3.6.patch with switch_to_python3.4+.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Dec 4 21:43:02 UTC 2018 - Hans-Peter Jansen <hpj@urpla.net>
|
||||||
|
|
||||||
|
- remove fixes_for_leap15.patch, upstream has incorporated it
|
||||||
|
- add conflict with i4l-vbox due to shared /etc/vbox
|
||||||
|
- adjust /etc/vbox permissions
|
||||||
|
- add /etc/vbox/autostart.cfg
|
||||||
|
- fix vboxdrv.sh: apply new autostart mechanics to stop_vms()
|
||||||
|
- remove obsolete shutdown section in /etc/default/virtualbox
|
||||||
|
- add VBOXAUTOSTART_{DB,CONFIG} to /etc/default/virtualbox
|
||||||
|
- supply README.autostart
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Nov 27 01:04:06 UTC 2018 - Larry Finger <Larry.Finger@gmail.com>
|
Tue Nov 27 01:04:06 UTC 2018 - Larry Finger <Larry.Finger@gmail.com>
|
||||||
|
|
||||||
|
@ -68,6 +68,7 @@ Source16: vboxconfig.sh
|
|||||||
Source17: vboxguestconfig.sh
|
Source17: vboxguestconfig.sh
|
||||||
Source18: fix_usb_rules.sh
|
Source18: fix_usb_rules.sh
|
||||||
Source19: vboxdrv.sh
|
Source19: vboxdrv.sh
|
||||||
|
Source20: README.autostart
|
||||||
Source98: %{name}-rpmlintrc
|
Source98: %{name}-rpmlintrc
|
||||||
Source99: %{name}-patch-source.sh
|
Source99: %{name}-patch-source.sh
|
||||||
#rework init scripts to fit suse needs
|
#rework init scripts to fit suse needs
|
||||||
@ -117,16 +118,14 @@ Patch115: vbox_fix_for_gcc7.patch
|
|||||||
Patch116: Fix_for_server_1.19.patch
|
Patch116: Fix_for_server_1.19.patch
|
||||||
# Fix invalid use of internal headers
|
# Fix invalid use of internal headers
|
||||||
Patch118: internal-headers.patch
|
Patch118: internal-headers.patch
|
||||||
# Fix kernel API change in Leap 15
|
|
||||||
Patch119: fixes_for_leap15.patch
|
|
||||||
# Fix rpmlint error for script /lib/usr/virtualbox/vboxshell.py
|
# Fix rpmlint error for script /lib/usr/virtualbox/vboxshell.py
|
||||||
Patch120: fixes_for_python.patch
|
Patch120: fixes_for_python.patch
|
||||||
# Remove vboxvideo from build
|
# Remove vboxvideo from build
|
||||||
Patch121: remove_vbox_video_build.patch
|
Patch121: remove_vbox_video_build.patch
|
||||||
# Fix build for Qt 5.11
|
# Fix build for Qt 5.11
|
||||||
Patch122: fixes_for_Qt5.11.patch
|
Patch122: fixes_for_Qt5.11.patch
|
||||||
# Switch to Python 3.6
|
# Switch to Python 3.4+
|
||||||
Patch123: switch_to_python3.6.patch
|
Patch123: switch_to_python3.4+.patch
|
||||||
Patch124: fix_32_bit_builds.patch
|
Patch124: fix_32_bit_builds.patch
|
||||||
# Fix API changes for kernel 4.20+
|
# Fix API changes for kernel 4.20+
|
||||||
Patch125: fixes_for_4.20.patch
|
Patch125: fixes_for_4.20.patch
|
||||||
@ -229,6 +228,10 @@ BuildRequires: xorg-x11-libXmu-devel-32bit
|
|||||||
BuildRequires: xorg-x11-libXt-devel-32bit
|
BuildRequires: xorg-x11-libXt-devel-32bit
|
||||||
%endif
|
%endif
|
||||||
%{?systemd_requires}
|
%{?systemd_requires}
|
||||||
|
# package i4l-vbox from source package i4l-base shares the directory /etc/vbox
|
||||||
|
# with us, but with different owner.
|
||||||
|
Conflicts: i4l-vbox
|
||||||
|
|
||||||
%posttrans
|
%posttrans
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -427,9 +430,6 @@ as an "extpack" for VirtualBox. The implementation is licensed under GPL.
|
|||||||
%patch115 -p1
|
%patch115 -p1
|
||||||
%patch116 -p1
|
%patch116 -p1
|
||||||
%patch118 -p1
|
%patch118 -p1
|
||||||
%if 0%{suse_version} == 1500
|
|
||||||
%patch119 -p1
|
|
||||||
%endif
|
|
||||||
%patch120 -p1
|
%patch120 -p1
|
||||||
%patch121 -p1
|
%patch121 -p1
|
||||||
%patch122 -p1
|
%patch122 -p1
|
||||||
@ -442,6 +442,8 @@ as an "extpack" for VirtualBox. The implementation is licensed under GPL.
|
|||||||
cp %{SOURCE1} UserManual.pdf
|
cp %{SOURCE1} UserManual.pdf
|
||||||
#copy kbuild config
|
#copy kbuild config
|
||||||
cp %{SOURCE10} LocalConfig.kmk
|
cp %{SOURCE10} LocalConfig.kmk
|
||||||
|
#copy autostart doc
|
||||||
|
cp %{SOURCE20} README.autostart
|
||||||
#
|
#
|
||||||
##########################
|
##########################
|
||||||
####workaround kmk_sed --v
|
####workaround kmk_sed --v
|
||||||
@ -690,6 +692,7 @@ install -m 644 %{SOURCE9} %{buildroot}%{_bindir}/VirtualBox
|
|||||||
|
|
||||||
# Service files to load kernel modules on boot
|
# Service files to load kernel modules on boot
|
||||||
install -m 0644 %{SOURCE14} %{buildroot}%{_unitdir}/vboxdrv.service
|
install -m 0644 %{SOURCE14} %{buildroot}%{_unitdir}/vboxdrv.service
|
||||||
|
ln -s -f %{_sbindir}/service %{buildroot}%{_sbindir}/rcvboxdrv
|
||||||
install -m 0644 %{SOURCE15} %{buildroot}%{_unitdir}/vboxadd-service.service
|
install -m 0644 %{SOURCE15} %{buildroot}%{_unitdir}/vboxadd-service.service
|
||||||
install -m 0755 %{SOURCE16} %{buildroot}/sbin/vboxconfig
|
install -m 0755 %{SOURCE16} %{buildroot}/sbin/vboxconfig
|
||||||
install -m 0755 %{SOURCE17} %{buildroot}/sbin/vboxguestconfig
|
install -m 0755 %{SOURCE17} %{buildroot}/sbin/vboxguestconfig
|
||||||
@ -703,6 +706,14 @@ ln -sf %{_unitdir}/vboxadd-service.service %{buildroot}%{_unitdir}/multi-user.ta
|
|||||||
# config file for vboxdrv script and vboxweb
|
# config file for vboxdrv script and vboxweb
|
||||||
install -d -m 755 %{buildroot}%{_sysconfdir}/vbox
|
install -d -m 755 %{buildroot}%{_sysconfdir}/vbox
|
||||||
echo -e "#settings for vboxwebsrn\nVBOXWEB_USER=root" > %{buildroot}%{_sysconfdir}/vbox/vbox.cfg
|
echo -e "#settings for vboxwebsrn\nVBOXWEB_USER=root" > %{buildroot}%{_sysconfdir}/vbox/vbox.cfg
|
||||||
|
cat > %{buildroot}%{_sysconfdir}/vbox/autostart.cfg << EOF
|
||||||
|
default_policy = deny
|
||||||
|
# Create an entry for each user allowed to use autostart
|
||||||
|
myusername = {
|
||||||
|
allow = true
|
||||||
|
}
|
||||||
|
|
||||||
|
EOF
|
||||||
# install udev helper script for creating usb devices
|
# install udev helper script for creating usb devices
|
||||||
install -m 0755 -D src/VBox/Installer/linux/VBoxCreateUSBNode.sh %{buildroot}%{_vbox_instdir}/VBoxCreateUSBNode.sh
|
install -m 0755 -D src/VBox/Installer/linux/VBoxCreateUSBNode.sh %{buildroot}%{_vbox_instdir}/VBoxCreateUSBNode.sh
|
||||||
######################################################
|
######################################################
|
||||||
@ -859,7 +870,7 @@ export DISABLE_RESTART_ON_UPDATE=yes
|
|||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-, root, root)
|
%defattr(-, root, root)
|
||||||
%doc UserManual.pdf
|
%doc README.autostart UserManual.pdf
|
||||||
%{_bindir}/VBoxManage
|
%{_bindir}/VBoxManage
|
||||||
%{_bindir}/VBoxHeadless
|
%{_bindir}/VBoxHeadless
|
||||||
%{_bindir}/VBoxTunctl
|
%{_bindir}/VBoxTunctl
|
||||||
@ -916,9 +927,11 @@ export DISABLE_RESTART_ON_UPDATE=yes
|
|||||||
/usr/lib/virtualbox/vboxdrv.sh
|
/usr/lib/virtualbox/vboxdrv.sh
|
||||||
%{_unitdir}/vboxdrv.service
|
%{_unitdir}/vboxdrv.service
|
||||||
%{_unitdir}/multi-user.target.wants/vboxdrv.service
|
%{_unitdir}/multi-user.target.wants/vboxdrv.service
|
||||||
|
%{_sbindir}/rcvboxdrv
|
||||||
%dir %{_sysconfdir}/vbox
|
%dir %{_sysconfdir}/vbox
|
||||||
##%attr(1775,root,vboxusers) %{_sysconfdir}/vbox
|
%attr(1775,root,vboxusers) %{_sysconfdir}/vbox
|
||||||
%config %{_sysconfdir}/vbox/vbox.cfg
|
%config %{_sysconfdir}/vbox/vbox.cfg
|
||||||
|
%config %{_sysconfdir}/vbox/autostart.cfg
|
||||||
/sbin/vboxconfig
|
/sbin/vboxconfig
|
||||||
%{_vbox_instdir}/VBoxCreateUSBNode.sh
|
%{_vbox_instdir}/VBoxCreateUSBNode.sh
|
||||||
%verify(not mode) %attr(0755,root,vboxusers) %{_vbox_instdir}/VBoxNetNAT
|
%verify(not mode) %attr(0755,root,vboxusers) %{_vbox_instdir}/VBoxNetNAT
|
||||||
|
Loading…
Reference in New Issue
Block a user