From 5bc1f50c70301fab602ed8cc64dfab18f7b47a6a Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 17:54:48 +0100 Subject: [PATCH] fix udev rule for usb support; require user in vboxusers [release 5.0.2-2mamba;Wed Aug 26 2015] --- VirtualBox.spec | 234 ++++++++++++++++++++++++++---------------------- 1 file changed, 127 insertions(+), 107 deletions(-) diff --git a/VirtualBox.spec b/VirtualBox.spec index afcbe62..19e836a 100644 --- a/VirtualBox.spec +++ b/VirtualBox.spec @@ -17,8 +17,8 @@ %endif Name: VirtualBox -Version: 4.3.28 -Release: 1mamba +Version: 5.0.2 +Release: 2mamba Summary: A general-purpose full virtualizer for x86 hardware Group: Graphical Desktop/Applications/Utilities Vendor: openmamba @@ -156,7 +156,7 @@ Kernel DRM driver for VirtualBox guest machines. #%patch1 -p1 #%patch2 -p1 #%patch4 -p1 -%patch3 -p1 +#%patch3 -p1 %patch5 -p1 %build @@ -181,7 +181,13 @@ export CXXFLAGS="%optflags" kmk %{?_smp_mflags} VBOX_GCC_WERR= \ VBOX_VERSION_STRING='$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)'_openmamba \ VBOX_JAVA_HOME=%{_jvmdir}/jdk \ - EB_LD=ld.bfd + EB_LD=ld.bfd || true + +# workaround +kmk VBOX_GCC_WERR= \ + VBOX_VERSION_STRING='$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)'_openmamba \ + VBOX_JAVA_HOME=%{_jvmdir}/jdk \ + EB_LD=ld.bfd || true ## files that needs editing before they can be included in the generic installer. #sed "s|\%NOLSB\%|yes|g; \ @@ -198,51 +204,49 @@ kmk %{?_smp_mflags} VBOX_GCC_WERR= \ %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" -install -d %{buildroot}/opt/%{name} -cp -a out/*/release/bin/* %{buildroot}/opt/%{name} +install -d %{buildroot}%{_libdir}/%{name} +cp -a out/*/release/bin/* %{buildroot}%{_libdir}/%{name}/ +cp -a out/*/release/obj/VirtualBox/VirtualBox %{buildroot}%{_libdir}/%{name}/ install -d %{buildroot}%{_libdir}/xorg/modules/drivers -mv %{buildroot}/opt/%{name}/additions/vboxvideo_drv_%{xorgdrvver}.so %{buildroot}%{_libdir}/xorg/modules/drivers/vboxvideo_drv.so -rm -f %{buildroot}/opt/%{name}/additions/vboxvideo_drv* +mv %{buildroot}%{_libdir}/%{name}/additions/vboxvideo_drv_%{xorgdrvver}.so %{buildroot}%{_libdir}/xorg/modules/drivers/vboxvideo_drv.so +rm -f %{buildroot}%{_libdir}/%{name}/additions/vboxvideo_drv* install -d %{buildroot}%{_libdir}/dri -mv %{buildroot}/opt/%{name}/additions/VBoxOGL.so %{buildroot}%{_libdir}/dri/vboxvideo_dri.so +mv %{buildroot}%{_libdir}/%{name}/additions/VBoxOGL.so %{buildroot}%{_libdir}/dri/vboxvideo_dri.so #install -d %{buildroot}%{_libdir}/xorg/modules/input -#mv %{buildroot}/opt/%{name}/additions/vboxmouse_drv_%{xorgdrvver}.so* %{buildroot}%{_libdir}/xorg/modules/input/vboxmouse_drv.so -rm -f %{buildroot}/opt/%{name}/additions/vboxmouse_drv* +#mv %{buildroot}%{_libdir}/%{name}/additions/vboxmouse_drv_%{xorgdrvver}.so* %{buildroot}%{_libdir}/xorg/modules/input/vboxmouse_drv.so +rm -f %{buildroot}%{_libdir}/%{name}/additions/vboxmouse_drv* # install desktop menu icon install -d %{buildroot}%{_datadir}/pixmaps/ -cp %{buildroot}/opt/%{name}/VBox.png %{buildroot}%{_datadir}/pixmaps/VBox.png - -# install service -install -D -m 755 %{S:2} %{buildroot}%{_initrddir}/%{name} +cp %{buildroot}%{_libdir}/%{name}/VBox.png %{buildroot}%{_datadir}/pixmaps/VBox.png ## install modprobe file #install -D -m 644 %{S:5} %{buildroot}%{_sysconfdir}/modprobe.d/vboxdrv.conf # fixup strange shared library permissions -for library in $(find %{buildroot}/opt/%{name} -name \*.so); do +for library in $(find %{buildroot}%{_libdir}/%{name} -name \*.so); do chmod 755 $library done # install wrappers install -d %{buildroot}%{_sysconfdir}/vbox cat > %{buildroot}%{_sysconfdir}/vbox/vbox.cfg << EOF - # VirtualBox installation directory -INSTALL_DIR="/opt/%{name}" +INSTALL_DIR="%{_libdir}/%{name}" EOF -install -m 755 %{S:1} %{buildroot}/opt/%{name}/vbox-run.sh + +install -m 755 %{S:1} %{buildroot}%{_libdir}/%{name}/vbox-run.sh install -d %{buildroot}%{_bindir} %{buildroot}%{_sbindir} -ln -s /opt/%{name}/vbox-run.sh %{buildroot}%{_bindir}/VirtualBox -ln -s /opt/%{name}/vbox-run.sh %{buildroot}%{_bindir}/VBoxManage -ln -s /opt/%{name}/vbox-run.sh %{buildroot}%{_bindir}/VBoxSDL -ln -s /opt/%{name}/vbox-run.sh %{buildroot}%{_bindir}/vditool +ln -s %{_libdir}/%{name}/vbox-run.sh %{buildroot}%{_bindir}/VirtualBox +ln -s %{_libdir}/%{name}/vbox-run.sh %{buildroot}%{_bindir}/VBoxManage +ln -s %{_libdir}/%{name}/vbox-run.sh %{buildroot}%{_bindir}/VBoxSDL +ln -s %{_libdir}/%{name}/vbox-run.sh %{buildroot}%{_bindir}/vditool # vboxwebsrv -ln -s /opt/%{name}/vboxwebsrv %{buildroot}%{_bindir}/vboxwebsrv +ln -s %{_libdir}/%{name}/vboxwebsrv %{buildroot}%{_bindir}/vboxwebsrv install -D -m0755 src/VBox/Installer/linux/vboxweb-service.sh %{buildroot}%{_initrddir}/vboxweb-service #install -D -m0755 src/VBox/Installer/linux/vboxballoonctrl-service.sh.in %{buildroot}%{_initrddir}/vboxballoon-service @@ -251,14 +255,14 @@ install -D -m0755 src/VBox/Installer/linux/vboxweb-service.sh %{buildroot}%{_ini install -d %{buildroot}/lib/udev/rules.d/ cat > %{buildroot}/lib/udev/rules.d/59-vboxdrv.rules << EOF KERNEL=="vboxdrv", MODE="0666" -SUBSYSTEM=="usb_device", ACTION=="add", RUN="VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}" -SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN="VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}" -SUBSYSTEM=="usb_device", ACTION=="remove", RUN="VBoxCreateUSBNode.sh --remove $major $minor" -SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN="VBoxCreateUSBNode.sh --remove $major $minor" +SUBSYSTEM=="usb_device", ACTION=="add", RUN="VBoxCreateUSBNode.sh \$major \$minor \$attr{bDeviceClass}" +SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN="VBoxCreateUSBNode.sh \$major \$minor \$attr{bDeviceClass}" +SUBSYSTEM=="usb_device", ACTION=="remove", RUN="VBoxCreateUSBNode.sh --remove \$major \$minor" +SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN="VBoxCreateUSBNode.sh --remove \$major \$minor" EOF install -d -m0755 %{buildroot}/lib/udev/ -mv %{buildroot}/opt/VirtualBox/VBoxCreateUSBNode.sh \ +mv %{buildroot}%{_libdir}/VirtualBox/VBoxCreateUSBNode.sh \ %{buildroot}/lib/udev/VBoxCreateUSBNode.sh # install icons @@ -271,21 +275,21 @@ done install -D -m 644 %{S:3} %{buildroot}%{_datadir}/applications/%{name}.desktop # install VirtualBox Guest Additions -install -m 644 %{S:4} %{buildroot}/opt/%{name}/additions/VBoxGuestAdditions.iso +install -m 644 %{S:4} %{buildroot}%{_libdir}/%{name}/additions/VBoxGuestAdditions.iso # remove unpackaged files -rm -rf %{buildroot}/opt/%{name}/{src,sdk,testcase} -rm -rf %{buildroot}/opt/%{name}/additions/src -rm -f %{buildroot}/opt/%{name}/tst* -#rm -f %{buildroot}/opt/%{name}/*.ko +rm -rf %{buildroot}%{_libdir}/%{name}/{src,sdk,testcase} +rm -rf %{buildroot}%{_libdir}/%{name}/additions/src +rm -f %{buildroot}%{_libdir}/%{name}/tst* +#rm -f %{buildroot}%{_libdir}/%{name}/*.ko -rm -rf %{buildroot}/opt/%{name}/VBoxPython2_4.so +rm -rf %{buildroot}%{_libdir}/%{name}/VBoxPython2_4.so # install additions -mv %{buildroot}/opt/%{name}/additions/VBoxOGL*.so %{buildroot}%{_libdir}/ -mv %{buildroot}/opt/%{name}/additions/vboxadd-service %{buildroot}%{_initrddir}/vboxadd +mv %{buildroot}%{_libdir}/%{name}/additions/VBoxOGL*.so %{buildroot}%{_libdir}/ +mv %{buildroot}%{_libdir}/%{name}/additions/vboxadd-service %{buildroot}%{_initrddir}/vboxadd install -d -m 0755 %{buildroot}%{_sbindir} -mv %{buildroot}/opt/%{name}/additions/{VBoxService,VBoxClient,VBoxControl} %{buildroot}%{_sbindir}/ +mv %{buildroot}%{_libdir}/%{name}/additions/{VBoxService,VBoxClient,VBoxControl} %{buildroot}%{_sbindir}/ # install suspend configuration file to fix suspend/hibernate since 4.1.0 install -d -m0755 %{buildroot}%{_sysconfdir}/pm/config.d/ @@ -366,9 +370,18 @@ REMAKE_INITRD=no AUTOINSTALL=yes _EOF +# load modules at boot +install -d %{buildroot}%{_prefix}/lib/modules-load.d/virtualbox.conf << _EOF +vboxdrv +vboxnetflt +vboxnetadp +vboxpci +_EOF + # build and install vdfuse cd vdfuse -export INSTALL_DIR=%{buildroot}/opt/%{name} +sed -i "s|-l:||" vdbuild_new +export INSTALL_DIR=%{buildroot}%{_libdir}/%{name} sh ./vdbuild_new ../include/ vdfuse.c install -m0755 vdfuse %{buildroot}%{_bindir}/vdfuse cd .. @@ -383,11 +396,8 @@ fi : %post -# new install -if [ $1 -eq 1 ]; then - systemctl daemon-reload - systemctl enable %{name} - systemctl start %{name} +if [ $1 -ge 1 ]; then + systemctl -q daemon-reload fi /sbin/ldconfig : @@ -402,8 +412,6 @@ dkms remove -q -m %{name} -v 4.2.18 --all || true if [ $1 -eq 0 ]; then %{_sbindir}/groupdel vboxusers 2>/dev/null dkms remove -q -m %{name} -v %{version} --all - systemctl stop %{name} - systemctl disable %{name} fi : @@ -479,9 +487,7 @@ fi %config %{_sysconfdir}/vbox/vbox.cfg %config(noreplace) %{_sysconfdir}/default/virtualbox %{_sysconfdir}/pm/config.d/vboxdrv -#%{_sysconfdir}/modprobe.d/vboxdrv.conf -%{_initrddir}/%{name} -#%{_initrddir}/vboxballoon-service +%{_prefix}/lib/modules-load.d/virtualbox.conf %{_bindir}/VBoxManage %{_bindir}/VBoxSDL %{_bindir}/VirtualBox @@ -489,59 +495,65 @@ fi %{_bindir}/vditool /lib/udev/rules.d/59-vboxdrv.rules /lib/udev/VBoxCreateUSBNode.sh -%dir /opt/%{name} -/opt/%{name}/DBGCPlugInDiggers.so -#/opt/%{name}/EfiThunk -/opt/%{name}/SUPInstall -/opt/%{name}/SUPUninstall -/opt/%{name}/VBox* -/opt/%{name}/VMMGC.gc -/opt/%{name}/VMMR0.r0 -/opt/%{name}/VMMGC.debug -/opt/%{name}/VMMR0.debug -/opt/%{name}/iPxeBaseBin -/opt/%{name}/VirtualBox -%dir /opt/%{name}/components -/opt/%{name}/components/VBox*.so -/opt/%{name}/components/VBoxXPCOMBase.xpt -/opt/%{name}/components/VirtualBox_XPCOM.xpt -%dir /opt/VirtualBox/ExtensionPacks -%dir /opt/VirtualBox/ExtensionPacks/VNC -/opt/VirtualBox/ExtensionPacks/VNC/* -%dir /opt/VirtualBox/dtrace -%dir /opt/VirtualBox/dtrace/lib -/opt/VirtualBox/dtrace/lib/* -%dir /opt/VirtualBox/dtrace/testcase -/opt/VirtualBox/dtrace/testcase/* -%dir /opt/%{name}/helpers -/opt/%{name}/helpers/generate_service_file -%dir /opt/%{name}/icons -/opt/%{name}/icons/* +%dir %{_libdir}/%{name} +%{_libdir}/%{name}/DbgPlugInDiggers.so +%{_libdir}/%{name}/vboxautostart-service.sh +%{_libdir}/%{name}/vboxballoonctrl-service.sh +%{_libdir}/%{name}/vboxweb-service.sh +%{_libdir}/%{name}/SUPInstall +%{_libdir}/%{name}/SUPUninstall +%{_libdir}/%{name}/VirtualBox +%{_libdir}/%{name}/VBox* +%{_libdir}/%{name}/VMMRC.rc +%{_libdir}/%{name}/VMMRC.debug +%{_libdir}/%{name}/VMMR0.r0 +%{_libdir}/%{name}/VMMR0.debug +%{_libdir}/%{name}/iPxeBaseBin +%dir %{_libdir}/%{name}/components +%{_libdir}/%{name}/components/VBox*.so +%{_libdir}/%{name}/components/VBoxXPCOMBase.xpt +%{_libdir}/%{name}/components/VirtualBox_XPCOM.xpt +%dir %{_libdir}/VirtualBox/ExtensionPacks +%dir %{_libdir}/VirtualBox/ExtensionPacks/VNC +%{_libdir}/VirtualBox/ExtensionPacks/VNC/* +%dir %{_libdir}/%{name}/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack +%{_libdir}/%{name}/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/* +%dir %{_libdir}/%{name}/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/linux.*/ +%{_libdir}/%{name}/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/linux.*/* +%dir %{_libdir}/VirtualBox/dtrace +%dir %{_libdir}/VirtualBox/dtrace/lib +%{_libdir}/VirtualBox/dtrace/lib/* +%dir %{_libdir}/VirtualBox/dtrace/testcase +%{_libdir}/VirtualBox/dtrace/testcase/* +%dir %{_libdir}/%{name}/helpers +%{_libdir}/%{name}/helpers/generate_service_file +%dir %{_libdir}/%{name}/icons +%{_libdir}/%{name}/icons/* %if "%{stage1}" != "1" -/opt/%{name}/libvboxjxpcom.so +%{_libdir}/%{name}/libvboxjxpcom.so %endif -/opt/%{name}/load.sh -/opt/%{name}/loadall.sh -%dir /opt/%{name}/nls -/opt/%{name}/nls/VirtualBox_*.qm -/opt/%{name}/nls/qt_*.qm -%dir /opt/%{name}/scripts -/opt/%{name}/scripts/* -/opt/%{name}/tools/* -#/opt/%{name}/scm -#/opt/%{name}/nls3/qt_*.qm -#/opt/%{name}/nls3/VirtualBox_*.qm -/opt/%{name}/SUPLoggerCtl -/opt/%{name}/UserManual.pdf -#/opt/%{name}/webtest -#%lang(fr) /opt/%{name}/UserManual_fr_FR.pdf -/opt/%{name}/vbox-img -/opt/%{name}/vbox-run.sh -/opt/%{name}/vboxkeyboard.tar.bz2 -/opt/%{name}/vboxshell.py -/opt/%{name}/virtualbox.desktop -/opt/%{name}/virtualbox.xml -/opt/%{name}/xpidl +%{_libdir}/%{name}/load.sh +%{_libdir}/%{name}/loadall.sh +%dir %{_libdir}/%{name}/nls +%{_libdir}/%{name}/nls/VirtualBox_*.qm +%{_libdir}/%{name}/nls/qt_*.qm +%dir %{_libdir}/%{name}/scripts +%{_libdir}/%{name}/scripts/* +%{_libdir}/%{name}/tools/* +#%{_libdir}/%{name}/scm +#%{_libdir}/%{name}/nls3/qt_*.qm +#%{_libdir}/%{name}/nls3/VirtualBox_*.qm +%{_libdir}/%{name}/SUPLoggerCtl +#%{_libdir}/%{name}/UserManual.pdf +#%{_libdir}/%{name}/webtest +#%lang(fr) %{_libdir}/%{name}/UserManual_fr_FR.pdf +%{_libdir}/%{name}/vbox-img +%{_libdir}/%{name}/vbox-run.sh +%{_libdir}/%{name}/vboxkeyboard.tar.bz2 +%{_libdir}/%{name}/vboxshell.py +%{_libdir}/%{name}/virtualbox.desktop +%{_libdir}/%{name}/virtualbox.xml +%{_libdir}/%{name}/xpidl %{_datadir}/icons/hicolor/*/apps/%{name}.png %{_datadir}/applications/%{name}.desktop %{_datadir}/pixmaps/VBox.png @@ -555,7 +567,7 @@ fi %defattr(-,root,root) %{_initrddir}/vboxweb-service %{_bindir}/vboxwebsrv -#/opt/%{name}/vboxwebsrv +#%{_libdir}/%{name}/vboxwebsrv %files -n xorg-drv-video-vboxvideo %defattr(-,root,root) @@ -569,15 +581,15 @@ fi %{_sbindir}/VBoxClient %{_sbindir}/VBoxControl %{_sbindir}/VBoxService -/opt/%{name}/additions/autorun.sh -/opt/%{name}/additions/mount.vboxsf -/opt/%{name}/additions/pam_vbox.so -/opt/%{name}/additions/runasroot.sh -/opt/%{name}/additions/vboxadd* +%{_libdir}/%{name}/additions/autorun.sh +%{_libdir}/%{name}/additions/mount.vboxsf +%{_libdir}/%{name}/additions/pam_vbox.so +%{_libdir}/%{name}/additions/runasroot.sh +%{_libdir}/%{name}/additions/vboxadd* %files additions-VBoxGuest %defattr(-,root,root) -/opt/%{name}/additions/VBoxGuestAdditions.iso +%{_libdir}/%{name}/additions/VBoxGuestAdditions.iso %files vboxguest %defattr(-,root,root) @@ -587,6 +599,14 @@ fi %{_prefix}/src/vboxvideo-%{version}/* %changelog +* Wed Aug 26 2015 Silvan Calarco 5.0.2-2mamba +- fix udev rule for usb support; require user in vboxusers + +* Wed Aug 26 2015 Automatic Build System 5.0.2-1mamba +- automatic version update by autodist +- move from /opt/VirtualBox to %_libdir/VirtualBox +- remove initrd service, use modules-load.d to load modules at boot + * Wed May 20 2015 Automatic Build System 4.3.28-1mamba - automatic version update by autodist