commit 5b42b948cf3b5e8d1256af1aba9aa468d85bd028
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Tue Jun 9 20:36:07 2020 +0100
Rfbz #3966, not using anymore systemd-modules-load.service
Instead we use one systemd service (vboxdrv.service) to load the server modules.
96-vbox-server.preset | 7 +++++++
96-vbox.preset | 3 +++
VirtualBox-6.1.0-strings.patch | 16 ++++++++--------
VirtualBox.modules | 3 ---
VirtualBox.spec | 35 ++++++++++++++++++++++++++---------
vboxdrv.service | 17 +++++++++++++++++
6 files changed, 61 insertions(+), 20 deletions(-)
---
diff --git a/96-vbox-server.preset b/96-vbox-server.preset
new file mode 100644
index 0000000..789679b
--- /dev/null
+++ b/96-vbox-server.preset
@@ -0,0 +1,7 @@
+# Also see:
+# New wiki:
+#
https://docs.fedoraproject.org/en-US/packaging-guidelines/DefaultServices/
+# Old wiki:
+#
https://fedoraproject.org/wiki/Starting_services_by_default
+
+enable vboxdrv.service
diff --git a/96-vbox.preset b/96-vbox.preset
index 85dde97..9d42a25 100644
--- a/96-vbox.preset
+++ b/96-vbox.preset
@@ -1,4 +1,7 @@
# Also see:
+# New wiki:
+#
https://docs.fedoraproject.org/en-US/packaging-guidelines/DefaultServices/
+# Old wiki:
#
https://fedoraproject.org/wiki/Starting_services_by_default
# Installing presets is not the preferred solution but until another one
diff --git a/VirtualBox-6.1.0-strings.patch b/VirtualBox-6.1.0-strings.patch
index 1f9ee37..2e44b14 100644
--- a/VirtualBox-6.1.0-strings.patch
+++ b/VirtualBox-6.1.0-strings.patch
@@ -13,7 +13,7 @@
+ " <font color=blue>dnf install akmod-VirtualBox kernel-devel-$(uname
-r)</font>"
+ "If you installed VirtualBox packages and don't want reboot the system, you
may need load the "
+ "kernel driver, doing as root:"
-+ " <font color=blue>akmods; systemctl restart
systemd-modules-load.service</font><br/><br/>"
++ " <font color=blue>akmods; systemctl restart
vboxdrv.service</font><br/><br/>"
"If your system has EFI Secure Boot enabled you may also need to sign "
"the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before "
"you can load them. Please see your Linux system's documentation for
"
@@ -25,7 +25,7 @@
- "VirtualBox."
- );
+ "successful. Executing<br/><br/>"
-+ " <font color=blue>rmmod vboxnetadp vboxnetflt vboxpci vboxdrv;
systemctl restart systemd-modules-load.service</font> as
root<br/><br/>"
++ " <font color=blue>rmmod vboxnetadp vboxnetflt vboxpci vboxdrv;
systemctl restart vboxdrv.service</font> as root<br/><br/>"
+ "may correct this. Make sure that you do not mix the "
+ "RPMFusion version and the Oracle version of VirtualBox."
+
@@ -38,7 +38,7 @@
- " <font
color=blue>'/sbin/vboxconfig'</font><br/><br/>"
- "may correct this. Make sure that you are not mixing builds "
- "of VirtualBox from different sources."
-+ " <font color=blue>rmmod vboxnetadp vboxnetflt vboxpci vboxdrv;
systemctl restart systemd-modules-load.service</font> as
root<br/><br/>"
++ " <font color=blue>rmmod vboxnetadp vboxnetflt vboxpci vboxdrv;
systemctl restart vboxdrv.service</font> as root<br/><br/>"
+ "may correct this. Make sure that you do not mix the "
+ "RPMFusion version and the Oracle version of VirtualBox."
);
@@ -67,7 +67,7 @@ diff -uNdr VirtualBox-6.0.6_orig/src/VBox/Installer/linux/VBox.sh
VirtualBox-6.0
- sudo /sbin/vboxconfig
+ dnf install akmod-VirtualBox kernel-devel-$(uname -r)
-+ akmods --kernels $(uname -r) && systemctl restart
systemd-modules-load.service
++ akmods --kernels $(uname -r) && systemctl restart vboxdrv.service
You will not be able to start VMs until this problem is fixed.
EOF
@@ -78,7 +78,7 @@ diff -uNdr VirtualBox-6.0.6_orig/src/VBox/Installer/linux/VBox.sh
VirtualBox-6.0
- sudo /sbin/vboxconfig
+ dnf install akmod-VirtualBox kernel-devel-$(uname -r)
-+ akmods --kernels $(uname -r) && systemctl restart
systemd-modules-load.service
++ akmods --kernels $(uname -r) && systemctl restart vboxdrv.service
- and if that is not successful, try to re-install the package.
+ and if that is not successful, try see if
@@ -94,7 +94,7 @@ diff -uNdr VirtualBox-6.0.6_orig/src/VBox/Installer/linux/VBox.sh
VirtualBox-6.0
"way for your host system. Then try to recompile
and reload the "
"kernel modules by executing "
- "'/sbin/vboxconfig' as root");
-+ "'akmods && systemctl restart
systemd-modules-load.service' as root");
++ "'akmods && systemctl restart
vboxdrv.service' as root");
break;
#endif
@@ -107,7 +107,7 @@ diff -uNdr VirtualBox-6.0.6_orig/src/VBox/Installer/linux/VBox.sh
VirtualBox-6.0
- "'/sbin/vboxconfig' as root");
+ "in the right way for your system."
+ "Load the kernel module by executing "
-+ "'systemctl restart
systemd-modules-load.service' as root");
++ "'systemctl restart vboxdrv.service' as
root");
#else
pszError = N_("VirtualBox kernel driver not loaded");
#endif
@@ -120,7 +120,7 @@ diff -uNdr VirtualBox-6.0.6_orig/src/VBox/Installer/linux/VBox.sh
VirtualBox-6.0
- "'/sbin/vboxconfig' as root");
+ "in the right way for your system."
+ "Install the kernel module by executing 'dnf
install akmod-VirtualBox kernel-devel-$(uname -r)'"
-+ "and 'akmods && systemctl restart
systemd-modules-load.service' as root");
++ "and 'akmods && systemctl restart
vboxdrv.service' as root");
#else
pszError = N_("VirtualBox kernel driver not installed");
#endif
diff --git a/VirtualBox.spec b/VirtualBox.spec
index f8864bb..3c985b7 100644
--- a/VirtualBox.spec
+++ b/VirtualBox.spec
@@ -46,7 +46,7 @@
Name: VirtualBox
Version: 6.1.10
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A general-purpose full virtualizer for PC hardware
License: GPLv2 or (GPLv2 and CDDL)
@@ -61,10 +61,11 @@ Source0:
https://download.virtualbox.org/virtualbox/%{version}%{?prereltag}/V
Source1:
https://download.virtualbox.org/virtualbox/%{version}%{?prereltag}/UserMa...
Source2: VirtualBox.appdata.xml
Source3: VirtualBox-60-vboxdrv.rules
-Source4: VirtualBox.modules
+Source4: vboxdrv.service
Source5: VirtualBox-60-vboxguest.rules
Source7: vboxservice.service
Source8: 96-vbox.preset
+Source9: 96-vbox-server.preset
Source10: vboxweb.service
Source20: os_mageia.png
Source21: os_mageia_64.png
@@ -515,7 +516,6 @@ ln -s ../..%{_libdir}/virtualbox/vbox-img
%{buildroot}%{_bindir}/vbox-img
#ln -s /usr/share/virtualbox/src/vboxhost $RPM_BUILD_ROOT/usr/src/vboxhost-%VER%
-
# Components, preserve symlinks
cp -a obj/bin/components/* %{buildroot}%{_libdir}/virtualbox/components/
cp obj/bin/UnattendedTemplates/* %{buildroot}%{_libdir}/virtualbox/UnattendedTemplates
@@ -625,8 +625,10 @@ echo 'INSTALL_DIR=%{_libdir}/virtualbox' >
%{buildroot}%{_sysconfdir}/vbox/vbox.
install -p -m 0755 -D obj/bin/VBoxCreateUSBNode.sh
%{buildroot}%{_prefix}/lib/udev/VBoxCreateUSBNode.sh
install -p -m 0644 -D %{SOURCE3} %{buildroot}%{_udevrulesdir}/60-vboxdrv.rules
-# Install modules load script
-install -p -m 0644 -D %{SOURCE4} %{buildroot}%{_prefix}/lib/modules-load.d/%{name}.conf
+# Install service to load server modules
+install -p -m 0644 -D %{SOURCE4} %{buildroot}%{_unitdir}/vboxdrv.service
+install -p -m 0644 -D %{SOURCE9} %{buildroot}%{_presetdir}/96-vbox-server.preset
+
# Menu entry
desktop-file-install --dir=%{buildroot}%{_datadir}/applications \
@@ -661,9 +663,13 @@ then
/sbin/udevadm trigger --subsystem-match=usb --action=add >/dev/null 2>&1 ||
:
/sbin/udevadm settle >/dev/null 2>&1 || :
fi
+%systemd_post vboxdrv.service
+
+%preun server
+%systemd_preun vboxdrv.service
-# should be in kmod package, not here
-/bin/systemctl restart systemd-modules-load.service >/dev/null 2>&1 || :
+%postun server
+%systemd_postun_with_restart vboxdrv.service
# Need review, I don't know the rules of Icon Cache, mimeinfo and Desktop databases
for epel 8
%if 0%{?rhel} && 0%{?rhel} < 8
@@ -711,7 +717,6 @@ getent group vboxsf >/dev/null || groupadd -r vboxsf 2>&1
getent passwd vboxadd >/dev/null || \
useradd -r -g 1 -d /var/run/vboxadd -s /sbin/nologin vboxadd 2>&1
-
# Guest additions install
%post guest-additions
/sbin/ldconfig
@@ -807,7 +812,8 @@ getent passwd vboxadd >/dev/null || \
%dir %{_sysconfdir}/vbox
%config %{_sysconfdir}/vbox/vbox.cfg
%{_udevrulesdir}/60-vboxdrv.rules
-%{_prefix}/lib/modules-load.d/%{name}.conf
+%{_unitdir}/vboxdrv.service
+%{_presetdir}/96-vbox-server.preset
%{_prefix}/lib/udev/VBoxCreateUSBNode.sh
%files
@@ -875,6 +881,17 @@ getent passwd vboxadd >/dev/null || \
%{_datadir}/%{name}-kmod-%{version}
%changelog
+* Mon Jun 08 2020 Sérgio Basto <sergio(a)serjux.com> - 6.1.10-2
+- Rfbz #3966, not using anymore systemd-modules-load.service
+ Instead we use one systemd service (vboxdrv.service) to load the server modules.
+- Only in epel7 run the scriptlets of Icon Cache, mimeinfo and Desktop databases
+- Move icons files from server sub-package to main (Qt/Desktop) sub-package
+- Also scriptlets of usb moved to server sub-package
+- Minor fixes
+ Rename patch VirtualBox-6.1.4-hacks to VirtualBox-6.1.4-gcc10
+ Syncronize vboxservice.service with virtualbox-guest-additions from Fedora
+ Remove bundled src/libs/openssl
+
* Sat Jun 06 2020 Sérgio Basto <sergio(a)serjux.com> - 6.1.10-1
- Update VBox to 6.1.10
diff --git a/vboxdrv.service b/vboxdrv.service
new file mode 100644
index 0000000..189f48c
--- /dev/null
+++ b/vboxdrv.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Linux kernel module init script
+
+[Service]
+Type=oneshot
+ExecStart=/sbin/modprobe vboxdrv
+ExecStart=/sbin/modprobe vboxnetflt
+ExecStart=/sbin/modprobe vboxnetadp
+ExecStop=/sbin/modprobe -r vboxnetadp
+ExecStop=/sbin/modprobe -r vboxnetflt
+ExecStop=/sbin/modprobe -r vboxdrv
+
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
+