From: Jan Rękorajski Date: Thu, 17 Oct 2013 20:40:56 +0000 (+0200) Subject: - merged kernel modules into just simple guest and host packages X-Git-Tag: auto/th/VirtualBox-4.3.0-1~5 X-Git-Url: http://git.pld-linux.org/?p=packages%2FVirtualBox.git;a=commitdiff_plain;h=4365ecafce037c761e94152cfcec25d011d0f67f - merged kernel modules into just simple guest and host packages - removed init scripts for kernel modules, it's just unnecessary polution, overy other package with kernel modules does just fine without such hackery - package systemd vboxservice --- diff --git a/VirtualBox-vboxdrv-modules-load.conf b/VirtualBox-vboxdrv-modules-load.conf deleted file mode 100644 index 2efa86e..0000000 --- a/VirtualBox-vboxdrv-modules-load.conf +++ /dev/null @@ -1 +0,0 @@ -vboxdrv diff --git a/VirtualBox-vboxdrv.init b/VirtualBox-vboxdrv.init deleted file mode 100755 index 9f41f6c..0000000 --- a/VirtualBox-vboxdrv.init +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/sh -# -# virtualbox VirtualBox virtualizer for x86 hardware -# chkconfig: 345 82 18 -# description: Oracle VirtualBox is a general-purpose full virtualizer for x86 \ -# hardware. Targeted at server, desktop and embedded use. - -# Source function library -. /etc/rc.d/init.d/functions - -VBOX_DEVICE="/dev/vboxdrv" -VBOX_MODULE="vboxdrv" - -# Get service config - may override defaults -[ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox - -setup() { - modprobe -s $VBOX_MODULE - RETVAL=$? - - if [ -d /dev/.udev ] || [ -d /run/udev/rules.d ]; then - return $RETVAL - fi - - # set proper $VBOX_DEVICE for systems with static dev - show "Setting $VBOX_DEVICE entry"; busy - rm -f $VBOX_DEVICE - VBOX_MAJOR=$(awk -vdevice="${VBOX_DEVICE#/dev/}" '$2 == device {print $1}' /proc/devices) - if [ -n "$VBOX_MAJOR" ]; then - VBOX_MINOR=0 - else - VBOX_MINOR=$(awk -vdevice="${VBOX_DEVICE#/dev/}" '$2 == device {print $1}' /proc/misc) - if [ -n "$VBOX_MINOR" ]; then - VBOX_MAJOR=$(awk '$2 == "misc" {print $1}' /proc/devices) - fi - fi - - if [ -z "$VBOX_MAJOR" ]; then - /sbin/rmmod $VBOX_MODULE - RETVAL=1 - elif ! mknod -m 0660 $VBOX_DEVICE c $VBOX_MAJOR $VBOX_MINOR; then - RETVAL=$? - rmmod $VBOX_MODNAME - fail - elif ! chown root:vbox $VBOX_DEVICE; then - RETVAL=$? - fail - else - ok - fi - return $RETVAL -} - -start() { - if [ -f /var/lock/subsys/$VBOX_MODULE ]; then - return - fi - - setup || exit $? - touch /var/lock/subsys/$VBOX_MODULE -} - -stop() { - # NOTE: rmmod will wait if device is in use, so automatic rmmod probably is not the best idea - /sbin/rmmod $VBOX_MODULE - rm -f /var/lock/subsys/$VBOX_MODULE -} - -condrestart() { - if [ -f /var/lock/subsys/$VBOX_MODULE ]; then - stop - start - else - RETVAL=$1 - fi -} - -RETVAL=0 -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop - start - ;; - try-restart) - condrestart 0 - ;; - force-reload) - condrestart 7 - ;; - setup) - setup - ;; - status) - if ! is_module $VBOX_MODULE; then - echo "$VBOX_MODULE module is loaded" - else - echo "$VBOX_MODULE module is not loaded" - RETVAL=3 - fi - if [ ! -c $VBOX_DEVICE ]; then - echo "$VBOX_DEVICE does not exist" - RETVAL=3 - else - echo "$VBOX_DEVICE exists with major/minor $(ls -l $VBOX_DEVICE | awk '{print $5 $6}')" - fi - ;; - *) - msg_usage "$0 {start|stop|restart|try-restart|force-reload|setup|status}" - exit 3 -esac - -exit $RETVAL diff --git a/VirtualBox-vboxguest.init b/VirtualBox-vboxguest.init deleted file mode 100755 index 51de0df..0000000 --- a/VirtualBox-vboxguest.init +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/sh -# -# virtualbox VirtualBox virtualizer for x86 hardware -# chkconfig: 345 83 17 -# description: Oracle VirtualBox is a general-purpose full virtualizer for x86 \ -# hardware. Targeted at server, desktop and embedded use. - -# Source function library -. /etc/rc.d/init.d/functions - -VBOX_MODULE="vboxguest" -VBOX_GUEST_DEVICE="/dev/vboxguest" -VBOX_USER_DEVICE="/dev/vboxuser" - -# Get service config - may override defaults -[ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox - -setup() { - local VBOX_MODULE=$1 VBOX_DEVICE=$2 - modprobe -s $VBOX_MODULE - RETVAL=$? - - if [ -d /dev/.udev ] || [ -d /run/udev/rules.d ]; then - return $RETVAL - fi - - # set proper $VBOX_DEVICE for systems with static dev - show "Setting $VBOX_DEVICE entry"; busy - rm -f $VBOX_DEVICE - VBOX_MAJOR=$(awk -vdevice="${VBOX_DEVICE#/dev/}" '$2 == device {print $1}' /proc/devices) - if [ -n "$VBOX_MAJOR" ]; then - VBOX_MINOR=0 - else - VBOX_MINOR=$(awk -vdevice="${VBOX_DEVICE#/dev/}" '$2 == device {print $1}' /proc/misc) - if [ -n "$VBOX_MINOR" ]; then - VBOX_MAJOR=$(awk '$2 == "misc" {print $1}' /proc/devices) - fi - fi - - if [ -z "$VBOX_MAJOR" ]; then - /sbin/rmmod $VBOX_MODULE - RETVAL=1 - elif ! mknod -m 0660 $VBOX_DEVICE c $VBOX_MAJOR $VBOX_MINOR; then - RETVAL=$? - rmmod $VBOX_MODNAME - fail - else - ok - fi - return $RETVAL -} - -start() { - if [ -f /var/lock/subsys/$VBOX_MODULE ]; then - return - fi - - setup $VBOX_MODULE $VBOX_GUEST_DEVICE || exit $? - setup $VBOX_MODULE $VBOX_USER_DEVICE || exit $? - touch /var/lock/subsys/$VBOX_MODULE -} - -stop() { - # NOTE: rmmod will wait if device is in use, so automatic rmmod probably is not the best idea - /sbin/rmmod $VBOX_MODULE - rm -f /var/lock/subsys/$VBOX_MODULE -} - -condrestart() { - if [ -f /var/lock/subsys/$VBOX_MODULE ]; then - stop - start - else - RETVAL=$1 - fi -} - -RETVAL=0 -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop - start - ;; - try-restart) - condrestart 0 - ;; - force-reload) - condrestart 7 - ;; - setup) - setup - ;; - status) - if ! is_module $VBOX_MODULE; then - echo "$VBOX_MODULE module is loaded" - else - echo "$VBOX_MODULE module is not loaded" - RETVAL=3 - fi - if [ ! -c $VBOX_DEVICE ]; then - echo "$VBOX_DEVICE does not exist" - RETVAL=3 - else - echo "$VBOX_DEVICE exists with major/minor $(ls -l $VBOX_DEVICE | awk '{print $5 $6}')" - fi - ;; - *) - msg_usage "$0 {start|stop|restart|try-restart|force-reload|setup|status}" - exit 3 -esac - -exit $RETVAL diff --git a/VirtualBox-vboxnetadp-modules-load.conf b/VirtualBox-vboxnetadp-modules-load.conf deleted file mode 100644 index 86be64e..0000000 --- a/VirtualBox-vboxnetadp-modules-load.conf +++ /dev/null @@ -1 +0,0 @@ -vboxnetadp diff --git a/VirtualBox-vboxnetadp.init b/VirtualBox-vboxnetadp.init deleted file mode 100755 index e4cdbc8..0000000 --- a/VirtualBox-vboxnetadp.init +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/sh -# -# virtualbox VirtualBox virtualizer for x86 hardware -# chkconfig: 345 84 16 -# description: Oracle VirtualBox is a general-purpose full virtualizer for x86 \ -# hardware. Targeted at server, desktop and embedded use. - -# Source function library -. /etc/rc.d/init.d/functions - -VBOX_DEVICE="/dev/vboxnetctl" -VBOX_MODULE="vboxnetadp" - -# Get service config - may override defaults -[ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox - -setup() { - modprobe -s $VBOX_MODULE - RETVAL=$? - - if [ -d /dev/.udev ] || [ -d /run/udev/rules.d ]; then - return $RETVAL - fi - - # set proper $VBOX_DEVICE for systems with static dev - show "Setting $VBOX_DEVICE entry"; busy - rm -f $VBOX_DEVICE - VBOX_MAJOR=$(awk -vdevice="${VBOX_DEVICE#/dev/}" '$2 == device {print $1}' /proc/devices) - if [ -n "$VBOX_MAJOR" ]; then - VBOX_MINOR=0 - else - VBOX_MINOR=$(awk -vdevice="${VBOX_DEVICE#/dev/}" '$2 == device {print $1}' /proc/misc) - if [ -n "$VBOX_MINOR" ]; then - VBOX_MAJOR=$(awk '$2 == "misc" {print $1}' /proc/devices) - fi - fi - - if [ -z "$VBOX_MAJOR" ]; then - /sbin/rmmod $VBOX_MODULE - RETVAL=1 - elif ! mknod -m 0660 $VBOX_DEVICE c $VBOX_MAJOR $VBOX_MINOR; then - RETVAL=$? - rmmod $VBOX_MODNAME - fail - elif ! chown root:vbox $VBOX_DEVICE; then - RETVAL=$? - fail - else - ok - fi - return $RETVAL -} - -start() { - if [ -f /var/lock/subsys/$VBOX_MODULE ]; then - return - fi - - setup || exit $? - touch /var/lock/subsys/$VBOX_MODULE -} - -stop() { - # NOTE: rmmod will wait if device is in use, so automatic rmmod probably is not the best idea - /sbin/rmmod $VBOX_MODULE - rm -f /var/lock/subsys/$VBOX_MODULE -} - -condrestart() { - if [ -f /var/lock/subsys/$VBOX_MODULE ]; then - stop - start - else - RETVAL=$1 - fi -} - -RETVAL=0 -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop - start - ;; - try-restart) - condrestart 0 - ;; - force-reload) - condrestart 7 - ;; - setup) - setup - ;; - status) - if ! is_module $VBOX_MODULE; then - echo "$VBOX_MODULE module is loaded" - else - echo "$VBOX_MODULE module is not loaded" - RETVAL=3 - fi - if [ ! -c $VBOX_DEVICE ]; then - echo "$VBOX_DEVICE does not exist" - RETVAL=3 - else - echo "$VBOX_DEVICE exists with major/minor $(ls -l $VBOX_DEVICE | awk '{print $5 $6}')" - fi - ;; - *) - msg_usage "$0 {start|stop|restart|try-restart|force-reload|setup|status}" - exit 3 -esac - -exit $RETVAL diff --git a/VirtualBox-vboxnetflt-modules-load.conf b/VirtualBox-vboxnetflt-modules-load.conf deleted file mode 100644 index 2706e4c..0000000 --- a/VirtualBox-vboxnetflt-modules-load.conf +++ /dev/null @@ -1 +0,0 @@ -vboxnetflt diff --git a/VirtualBox-vboxnetflt.init b/VirtualBox-vboxnetflt.init deleted file mode 100755 index 2cb4b14..0000000 --- a/VirtualBox-vboxnetflt.init +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# -# virtualbox VirtualBox virtualizer for x86 hardware -# chkconfig: 345 84 16 -# description: Oracle VirtualBox is a general-purpose full virtualizer for x86 \ -# hardware. Targeted at server, desktop and embedded use. - -# Source function library -. /etc/rc.d/init.d/functions - -VBOX_MODULE="vboxnetflt" - -# Get service config - may override defaults -[ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox - -start() { - if [ -f /var/lock/subsys/vboxnetflt ]; then - return - fi - - modprobe -s $VBOX_MODULE - touch /var/lock/subsys/vboxnetflt -} - -stop() { - # NOTE: rmmod will wait if device is in use, so automatic rmmod probably is not the best idea - /sbin/rmmod $VBOX_MODULE - rm -f /var/lock/subsys/vboxnetflt -} - -condrestart() { - if [ ! -f /var/lock/subsys/vboxnetflt ]; then - RETVAL=$1 - return - fi - - stop - start -} - -RETVAL=0 -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop - start - ;; - try-restart) - condrestart 0 - ;; - force-reload) - condrestart 7 - ;; - status) - if ! is_module $VBOX_MODULE; then - echo "$VBOX_MODULE module is loaded" - else - echo "$VBOX_MODULE module is not loaded" - RETVAL=3 - fi - ;; - *) - msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}" - exit 3 -esac - -exit $RETVAL diff --git a/VirtualBox-vboxpci-modules-load.conf b/VirtualBox-vboxpci-modules-load.conf deleted file mode 100644 index c8ea693..0000000 --- a/VirtualBox-vboxpci-modules-load.conf +++ /dev/null @@ -1 +0,0 @@ -vboxpci diff --git a/VirtualBox-vboxpci.init b/VirtualBox-vboxpci.init deleted file mode 100755 index 69a44d5..0000000 --- a/VirtualBox-vboxpci.init +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/sh -# -# virtualbox VirtualBox virtualizer for x86 hardware -# chkconfig: 345 84 16 -# description: Oracle VirtualBox is a general-purpose full virtualizer for x86 \ -# hardware. Targeted at server, desktop and embedded use. - -# Source function library -. /etc/rc.d/init.d/functions - -VBOX_MODULE="vboxpci" - -# Get service config - may override defaults -[ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox - -start() { - if [ -f /var/lock/subsys/vboxpci ]; then - return - fi - - modprobe -s $VBOX_MODULE - touch /var/lock/subsys/vboxpci -} - -stop() { - # NOTE: rmmod will wait if device is in use, so automatic rmmod probably is not the best idea - /sbin/rmmod $VBOX_MODULE - rm -f /var/lock/subsys/vboxpci -} - -condrestart() { - if [ -f /var/lock/subsys/vboxpci ]; then - stop - start - else - RETVAL=$1 - fi -} - -RETVAL=0 -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop - start - ;; - try-restart) - condrestart 0 - ;; - force-reload) - condrestart 7 - ;; - status) - if ! is_module $VBOX_MODULE; then - echo "$VBOX_MODULE module is loaded" - else - echo "$VBOX_MODULE module is not loaded" - RETVAL=3 - fi - ;; - *) - msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}" - exit 3 -esac - -exit $RETVAL diff --git a/VirtualBox-vboxsf-modules-load.conf b/VirtualBox-vboxsf-modules-load.conf deleted file mode 100644 index 44e08d5..0000000 --- a/VirtualBox-vboxsf-modules-load.conf +++ /dev/null @@ -1 +0,0 @@ -vboxsf diff --git a/VirtualBox-vboxsf.init b/VirtualBox-vboxsf.init deleted file mode 100755 index 992c151..0000000 --- a/VirtualBox-vboxsf.init +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -# -# virtualbox VirtualBox virtualizer for x86 hardware -# chkconfig: 345 84 16 -# description: Oracle VirtualBox is a general-purpose full virtualizer for x86 \ -# hardware. Targeted at server, desktop and embedded use. - -# Source function library -. /etc/rc.d/init.d/functions - -VBOX_MODULE="vboxsf" - -# Get service config - may override defaults -[ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox - -start() { - if [ -f /var/lock/subsys/vboxsf ]; then - return - fi - - modprobe -s $VBOX_MODULE - run_cmd "Mount VirtualBox Shared Folders:" mount -a -t vboxsf - touch /var/lock/subsys/vboxsf -} - -stop() { - if [ ! -f /var/lock/subsys/vboxsf ]; then - return - fi - run_cmd "Unmount VirtualBox Shared Folders:" umount -a -t vboxsf - - # NOTE: rmmod will say module in use if there are remaining mounts - rmmod -s $VBOX_MODULE - - rm -f /var/lock/subsys/vboxsf -} - -RETVAL=0 -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop - start - ;; - status) - if ! is_module $VBOX_MODULE; then - echo "$VBOX_MODULE module is loaded" - else - echo "$VBOX_MODULE module is not loaded" - RETVAL=3 - fi - ;; - *) - msg_usage "$0 {start|stop|restart|status}" - exit 3 -esac - -exit $RETVAL diff --git a/VirtualBox-vboxguest-modules-load.conf b/VirtualBox-virtualbox-guest-modules-load.conf similarity index 58% rename from VirtualBox-vboxguest-modules-load.conf rename to VirtualBox-virtualbox-guest-modules-load.conf index 7e24969..66dab7d 100644 --- a/VirtualBox-vboxguest-modules-load.conf +++ b/VirtualBox-virtualbox-guest-modules-load.conf @@ -1 +1,2 @@ vboxguest +vboxsf diff --git a/VirtualBox-virtualbox-host-modules-load.conf b/VirtualBox-virtualbox-host-modules-load.conf new file mode 100644 index 0000000..7362977 --- /dev/null +++ b/VirtualBox-virtualbox-host-modules-load.conf @@ -0,0 +1,4 @@ +vboxdrv +vboxnetadp +vboxnetflt +vboxpci diff --git a/VirtualBox.spec b/VirtualBox.spec index 23a61cd..798320a 100644 --- a/VirtualBox.spec +++ b/VirtualBox.spec @@ -6,7 +6,6 @@ # - guest x11 additions: currently incomplete/untested # - enable VDE networking: --enable-vde # - initscripts for webservice -# - install systemd vboxservice.service # # Conditional build: %bcond_without doc # don't build the documentation @@ -46,21 +45,12 @@ Source0: http://download.virtualbox.org/virtualbox/%{version}/%{pname}-%{version Source1: http://download.virtualbox.org/virtualbox/%{version}/VBoxGuestAdditions_%{version}.iso # Source1-md5: 6b72a59aba1660afa4f430faa88d727a Source2: vboxservice.init -Source3: %{pname}-vboxdrv.init -Source4: %{pname}-vboxguest.init -Source5: %{pname}-vboxnetflt.init -Source6: %{pname}-vboxsf.init -Source7: %{pname}-vboxnetadp.init -Source8: %{pname}-vboxpci.init -Source9: %{pname}.sh -Source10: mount.vdi -Source11: udev.rules -Source12: %{pname}-vboxdrv-modules-load.conf -Source13: %{pname}-vboxguest-modules-load.conf -Source14: %{pname}-vboxnetflt-modules-load.conf -Source15: %{pname}-vboxsf-modules-load.conf -Source16: %{pname}-vboxnetadp-modules-load.conf -Source17: %{pname}-vboxpci-modules-load.conf +Source3: vboxservice.service +Source4: %{pname}.sh +Source5: mount.vdi +Source6: udev.rules +Source7: %{pname}-virtualbox-host-modules-load.conf +Source8: %{pname}-virtualbox-guest-modules-load.conf Patch0: %{pname}-configure-spaces.patch Patch1: %{pname}-VBoxSysInfo.patch Patch2: %{pname}-warning_workaround.patch @@ -181,16 +171,7 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) # VBoxEFI64.fd: \0 # # which lead to 'Stripping ... ELF shared libraries... (...)/nls/qt_ro.qm: File format not recognized' -%define _noautostrip .*%{_libdir}/%{name}/.* - -%define vbox_kernel_post(d:) \ -if [ -x /etc/rc.d/init.d/%{-d*} ]; then \ - %{expand:%service %%{-d*} restart %%*} \ -else \ - /sbin/rmmod %{-d*} || : \ - /sbin/modprobe -s %{-d*} || : \ -fi \ -%{nil} +#define _noautostrip .*%{_libdir}/%{name}/.* %description Oracle VirtualBox is a general-purpose full virtualizer for x86 @@ -260,6 +241,8 @@ You should install this package in your Host OS. Summary: VirtualBox Guest tools Group: Base Requires(post,preun): /sbin/chkconfig +Requires(post): systemd-units >= 38 +Requires: systemd-units >= 38 Requires: rc-scripts Suggests: kernel(vboxguest) Suggests: kernel(vboxsf) @@ -302,7 +285,7 @@ Group: Themes # NOTE: '#' in url is lost because rpm treats it as comment, even hacking with # macros doesn't help as rpmbuild takes final result to parse URL: http://www.virtualbox.org/manual/ch09.html#autologon_unix_lightdm -Requires: kernel%{_alt_kernel}-misc-vboxguest +Requires: kernel(vboxguest) Requires: lightdm >= 1.0.1 Provides: lightdm-greeter @@ -333,54 +316,44 @@ X.org video driver for VirtualBox guest OS. %description -n xorg-driver-video-vboxvideo -l pl.UTF-8 Sterownik grafiki dla systemu gościa w VirtualBoksie. -%package kernel-init-host -Summary: SysV initscripts for host kernel modules -Group: Base/Kernel - -%description kernel-init-host -SysV initscripts for host kernel modules. - -%package kernel-init-guest -Summary: SysV initscripts for guest kernel modules -Group: Base/Kernel - -%description kernel-init-guest -SysV initscripts for guest kernel modules. - # KERNEL PACKAGES # KEEP ALL REGULAR SUBPACKAGES BEFORE KERNEL PACKAGES. -%package -n kernel%{_alt_kernel}-misc-vboxguest -Summary: VirtualBox Guest Additions for Linux Module -Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa +%package -n kernel%{_alt_kernel}-virtualbox-guest +Summary: VirtualBox kernel modules for Linux Guest +Summary(pl.UTF-8): Moduły VirtualBoksa do jądra Linuksa dla systemu gościa Release: %{rel}@%{_kernel_ver_str} Group: Base/Kernel Requires(post,postun): /sbin/depmod Requires(post): systemd-units >= 38 Requires: dev >= 2.9.0-7 +Requires: systemd-units >= 38 %if %{with dist_kernel} %requires_releq_kernel +%requires_releq_kernel -n drm Requires(postun): %releq_kernel %endif -Requires: systemd-units >= 38 Suggests: %{name}-kernel-init-guest >= %{version}-%{rel} Provides: kernel(vboxguest) = %{version}-%{rel} -Obsoletes: kernel%{_alt_kernel}-misc-vboxadd -Conflicts: kernel%{_alt_kernel}-misc-vboxdrv - -%description -n kernel%{_alt_kernel}-misc-vboxguest -VirtualBox Guest Additions for Linux Module. - -You should install this package in your Guest OS. - -%description -n kernel%{_alt_kernel}-misc-vboxguest -l pl.UTF-8 -Moduł jądra Linuksa vboxguest dla VirtualBoksa - dodatki dla systemu -gościa. - -%package -n kernel%{_alt_kernel}-misc-vboxdrv -Summary: VirtualBox Support Driver -Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa +Provides: kernel(vboxsf) = %{version}-%{rel} +Provides: kernel(vboxvideo) = %{version}-%{rel} +Obsoletes: kernel-init-guest +Conflicts: kernel%{_alt_kernel}-virtualbox-host + +%description -n kernel%{_alt_kernel}-virtualbox-guest +This package contains VirtualBox Guest Additions for Linux Module, +host file system access (Shared Folders) and DRM support for +Linux guest system. + +%description -n kernel%{_alt_kernel}-virtualbox-guest -l pl.UTF-8 +Ten pakiet zawiera moduł jądra Linuksa vboxguest dla VirtualBoksa - +dodatki dla systemu gościa, dostęp do plików systemu głównego z +poziomu systemu gościa i sterownik obsługi DRM. + +%package -n kernel%{_alt_kernel}-virtualbox-host +Summary: VirtualBox Support Drivers +Summary(pl.UTF-8): Moduły jądra Linuksa dla VirtualBoksa Release: %{rel}@%{_kernel_ver_str} Group: Base/Kernel Requires(post,postun): /sbin/depmod @@ -393,143 +366,21 @@ Requires(postun): %releq_kernel Requires: systemd-units >= 38 Suggests: %{name}-kernel-init-host >= %{version}-%{rel} Provides: kernel(vboxdrv) = %{version}-%{rel} - -%description -n kernel%{_alt_kernel}-misc-vboxdrv -VirtualBox Support Driver. - -You should install this package in your Host OS. - -%description -n kernel%{_alt_kernel}-misc-vboxdrv -l pl.UTF-8 -Moduł jądra Linuksa dla VirtualBoksa - sterownik wsparcia dla systemu -głównego. - -%package -n kernel%{_alt_kernel}-misc-vboxnetadp -Summary: VirtualBox Network Adapter Driver -Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa -Release: %{rel}@%{_kernel_ver_str} -Group: Base/Kernel -Requires(post,postun): /sbin/depmod -Requires(post): systemd-units >= 38 -Requires: dev >= 2.9.0-7 -Requires: kernel%{_alt_kernel}-misc-vboxdrv -%if %{with dist_kernel} -%requires_releq_kernel -Requires(postun): %releq_kernel -%endif -Requires: systemd-units >= 38 -Suggests: %{name}-kernel-init-host >= %{version}-%{rel} -Provides: kernel(vboxnetflt) = %{version}-%{rel} - -%description -n kernel%{_alt_kernel}-misc-vboxnetadp -VirtualBox Network Adapter Driver. - -You should install this package in your Host OS. - -%description -n kernel%{_alt_kernel}-misc-vboxnetadp -l pl.UTF-8 -Moduł jądra Linuksa dla VirtualBoksa - sterownik witrualnej karty -sieciowej. - -%package -n kernel%{_alt_kernel}-misc-vboxnetflt -Summary: VirtualBox Network Filter Driver -Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa -Release: %{rel}@%{_kernel_ver_str} -Group: Base/Kernel -Requires(post,postun): /sbin/depmod -Requires(post): systemd-units >= 38 -Requires: dev >= 2.9.0-7 -Requires: kernel%{_alt_kernel}-misc-vboxdrv -%if %{with dist_kernel} -%requires_releq_kernel -Requires(postun): %releq_kernel -%endif -Requires: systemd-units >= 38 -Suggests: %{name}-kernel-init-host >= %{version}-%{rel} +Provides: kernel(vboxnetadp) = %{version}-%{rel} Provides: kernel(vboxnetflt) = %{version}-%{rel} - -%description -n kernel%{_alt_kernel}-misc-vboxnetflt -VirtualBox Network Filter Driver. - -You should install this package in your Host OS. - -%description -n kernel%{_alt_kernel}-misc-vboxnetflt -l pl.UTF-8 -Moduł jądra Linuksa dla VirtualBoksa - sterownik filtrowania sieci dla -systemu głównego. - -%package -n kernel%{_alt_kernel}-misc-vboxpci -Summary: VirtualBox PCI card passthrough Driver -Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa -Release: %{rel}@%{_kernel_ver_str} -Group: Base/Kernel -Requires(post,postun): /sbin/depmod -Requires(post): systemd-units >= 38 -Requires: dev >= 2.9.0-7 -Requires: kernel%{_alt_kernel}-misc-vboxdrv -%if %{with dist_kernel} -%requires_releq_kernel -Requires(postun): %releq_kernel -%endif -Requires: systemd-units >= 38 -Suggests: %{name}-kernel-init-host >= %{version}-%{rel} Provides: kernel(vboxpci) = %{version}-%{rel} +Obsoletes: kernel-init-host -%description -n kernel%{_alt_kernel}-misc-vboxpci -VirtualBox PCI card passthrough driver that works as host proxy -between guest and PCI hardware. - -You should install this package in your Host OS. - -%description -n kernel%{_alt_kernel}-misc-vboxnetflt -l pl.UTF-8 -Moduł jądra Linuksa dla VirtualBoksa - sterownik, ktory działa jako -proxy między gościem i gospodarzem sprzętu PCI. - -%package -n kernel%{_alt_kernel}-misc-vboxsf -Summary: Host file system access (Shared Folders) for VirtualBox -Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa -Release: %{rel}@%{_kernel_ver_str} -Group: Base/Kernel -Requires(post,postun): /sbin/depmod -Requires(post): systemd-units >= 38 -Requires: dev >= 2.9.0-7 -Requires: kernel%{_alt_kernel}-misc-vboxguest -%if %{with dist_kernel} -%requires_releq_kernel -Requires(postun): %releq_kernel -%endif -Requires: systemd-units >= 38 -Suggests: %{name}-kernel-init-guest >= %{version}-%{rel} -Provides: kernel(vboxsf) = %{version}-%{rel} -Obsoletes: kernel%{_alt_kernel}-misc-vboxvfs - -%description -n kernel%{_alt_kernel}-misc-vboxsf -Host file system access (Shared Folders) for VirtualBox. - -You should install this package in your Guest OS. - -%description -n kernel%{_alt_kernel}-misc-vboxsf -l pl.UTF-8 -Moduł jądra Linuksa dla VirtualBoksa - dostęp do plików systemu -głównego z poziomu systemu gościa. - -%package -n kernel%{_alt_kernel}-video-vboxvideo -Summary: DRM support for VirtualBox -Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa -Release: %{rel}@%{_kernel_ver_str} -Group: Base/Kernel -Requires(post,postun): /sbin/depmod -Requires: dev >= 2.9.0-7 -%if %{with dist_kernel} -%requires_releq_kernel -%requires_releq_kernel -n drm -Requires(postun): %releq_kernel -%endif -Provides: kernel(vboxvideo) = %{version}-%{rel} - -%description -n kernel%{_alt_kernel}-video-vboxvideo -DRM support for VirtualBox. - -You should install this package in your Guest OS. +%description -n kernel%{_alt_kernel}-virtualbox-host +This package contains VirtualBox Support Driver, Network Adapter +Driver, Network Filter Driver and PCI card passthrough driver that +works as host proxy between guest and PCI hardware. -%description -n kernel%{_alt_kernel}-video-vboxvideo -l pl.UTF-8 -Moduł jądra Linuksa dla VirtualBoksa - sterownik obsługi DRM. +%description -n kernel%{_alt_kernel}-virtualbox-host -l pl.UTF-8 +Ten pakiet zawiera sterownik wsparcia dla systemu głównego, sterownik +witrualnej karty sieciowej, sterownik filtrowania sieci dla systemu +głównego oraz sterownik, ktory działa jako proxy między gościem i +gospodarzem sprzętu PCI. %prep %setup -q -n %{pname}-%{version} @@ -548,7 +399,7 @@ Moduł jądra Linuksa dla VirtualBoksa - sterownik obsługi DRM. %{__sed} -i -e "s@_LDFLAGS\.%{vbox_arch}*.*=@& %{rpmldflags}@g" \ -i Config.kmk src/libs/xpcom18a4/Config.kmk -%{__sed} 's#@LIBDIR@#%{_libdir}#' < %{SOURCE9} > VirtualBox-wrapper.sh +%{__sed} 's#@LIBDIR@#%{_libdir}#' < %{SOURCE4} > VirtualBox-wrapper.sh install -d PLD-MODULE-BUILD/{GuestDrivers,HostDrivers} cd PLD-MODULE-BUILD @@ -622,7 +473,8 @@ rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT{%{_bindir},/sbin,%{_sbindir},%{_libdir}/%{pname}/ExtensionPacks} \ $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \ $RPM_BUILD_ROOT%{_libdir}/xorg/modules/{drivers,dri,input} \ - $RPM_BUILD_ROOT{/lib/udev,/etc/udev/rules.d} + $RPM_BUILD_ROOT{/lib/udev,/etc/udev/rules.d} \ + $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{systemdunitdir}} # test if we can hardlink -- %{_builddir} and $RPM_BUILD_ROOT on same partition if cp -al VBox.png $RPM_BUILD_ROOT/Vbox.png 2>/dev/null; then @@ -639,12 +491,15 @@ ln -sf %{_docdir}/%{pname}-doc-%{version}/UserManual_fr_FR.pdf $RPM_BUILD_ROOT%{ install -d $RPM_BUILD_ROOT%{_libdir}/%{pname}/additions cp -a$l %{SOURCE1} $RPM_BUILD_ROOT%{_libdir}/%{pname}/additions/VBoxGuestAdditions.iso -install -p %{SOURCE10} $RPM_BUILD_ROOT/sbin/mount.vdi +install -p %{SOURCE5} $RPM_BUILD_ROOT/sbin/mount.vdi install -p VirtualBox-wrapper.sh $RPM_BUILD_ROOT%{_libdir}/%{pname} for f in {VBox{BFE,Headless,Manage,SDL,SVC,Tunctl,XPCOMIPCD},VirtualBox}; do ln -s %{_libdir}/%{pname}/VirtualBox-wrapper.sh $RPM_BUILD_ROOT%{_bindir}/$f done +install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/vboxservice +install -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/vboxservice.service + %{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname}/VBox.png,%{_pixmapsdir}/virtualbox.png} %{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname},%{_desktopdir}}/virtualbox.desktop @@ -659,7 +514,7 @@ done %{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname}/additions,%{_libdir}}/VBoxOGLpackspu.so %{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname}/additions,%{_libdir}}/VBoxOGLpassthroughspu.so -cp -a %{SOURCE11} $RPM_BUILD_ROOT/etc/udev/rules.d/virtualbox.rules +cp -a %{SOURCE6} $RPM_BUILD_ROOT/etc/udev/rules.d/virtualbox.rules %{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname},/lib/udev}/VBoxCreateUSBNode.sh install -d $RPM_BUILD_ROOT/%{_lib}/security @@ -718,14 +573,7 @@ cp -p %{objdir}/Additions/Installer/linux/share/VBoxGuestAdditions/vbox-greeter. %endif %if %{with kernel} -install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,modules-load.d},/sbin,%{systemdunitdir}} -install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/vboxservice -install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/vboxdrv -install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/vboxguest -install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/vboxnetflt -install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/vboxsf -install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/vboxnetadp -install -p %{SOURCE8} $RPM_BUILD_ROOT/etc/rc.d/init.d/vboxpci +install -d $RPM_BUILD_ROOT{/etc/modules-load.d,/sbin} %install_kernel_modules -m PLD-MODULE-BUILD/HostDrivers/vboxdrv/vboxdrv -d misc %install_kernel_modules -m PLD-MODULE-BUILD/HostDrivers/vboxnetadp/vboxnetadp -d misc %install_kernel_modules -m PLD-MODULE-BUILD/HostDrivers/vboxnetflt/vboxnetflt -d misc @@ -737,20 +585,8 @@ install -p %{SOURCE8} $RPM_BUILD_ROOT/etc/rc.d/init.d/vboxpci install -p mount.vboxsf $RPM_BUILD_ROOT/sbin/mount.vboxsf # Tell systemd to load modules -cp -p %{SOURCE12} $RPM_BUILD_ROOT/etc/modules-load.d/vboxdrv.conf -cp -p %{SOURCE13} $RPM_BUILD_ROOT/etc/modules-load.d/vboxguest.conf -cp -p %{SOURCE14} $RPM_BUILD_ROOT/etc/modules-load.d/vboxnetflt.conf -cp -p %{SOURCE15} $RPM_BUILD_ROOT/etc/modules-load.d/vboxsf.conf -cp -p %{SOURCE16} $RPM_BUILD_ROOT/etc/modules-load.d/vboxnetadp.conf -cp -p %{SOURCE17} $RPM_BUILD_ROOT/etc/modules-load.d/vboxpci.conf - -# And mask module-loading services -ln -sf /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/vboxdrv.service -ln -sf /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/vboxguest.service -ln -sf /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/vboxnetflt.service -ln -sf /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/vboxsf.service -ln -sf /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/vboxnetadp.service -ln -sf /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/vboxpci.service +cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/modules-load.d/virtualbox-host.conf +cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/modules-load.d/virtualbox-guest.conf %endif %clean @@ -772,18 +608,11 @@ for i in /sys/bus/usb/devices/*; do done cat << 'EOF' -You must install vboxdrv kernel module for this software to work: - kernel-misc-vboxdrv-%{version}-%{rel}@%{_kernel_ver_str} - -Additionally you might want to install: - kernel-misc-vboxnetadp-%{version}-%{rel}@%{_kernel_ver_str} - kernel-misc-vboxnetflt-%{version}-%{rel}@%{_kernel_ver_str} - kernel-misc-vboxpci-%{version}-%{rel}@%{_kernel_ver_str} +You must install vboxdrv kernel modules for this software to work: + kernel%{_alt_kernel}-virtualbox-host-%{version}-%{rel}@%{_kernel_ver_str} On Guest Linux system you might want to install: - kernel-misc-vboxguest-%{version}-%{rel}@%{_kernel_ver_str} - kernel-misc-vboxsf-%{version}-%{rel}@%{_kernel_ver_str} - kernel-video-vboxvideo-%{version}-%{rel}@%{_kernel_ver_str} + kernel%{_alt_kernel}-virtualbox-guest-%{version}-%{rel}@%{_kernel_ver_str} EOF @@ -795,126 +624,36 @@ fi %post guest /sbin/chkconfig --add vboxservice %service vboxservice restart +%systemd_post vboxservice.service %preun guest if [ "$1" = "0" ]; then /sbin/chkconfig --del vboxservice %service vboxservice -q stop fi +%systemd_preun vboxservice.service -%pre -n lightdm-greeter-vbox -%addusertogroup xdm vbox - -%post -n kernel%{_alt_kernel}-misc-vboxdrv -%depmod %{_kernel_ver} -%vbox_kernel_post -d vboxdrv VirtualBox Support Driver - -%preun -n kernel%{_alt_kernel}-misc-vboxdrv -if [ "$1" = "0" ]; then - %service vboxdrv stop -fi - -%postun -n kernel%{_alt_kernel}-misc-vboxdrv -%depmod %{_kernel_ver} - -%post -n kernel%{_alt_kernel}-misc-vboxnetadp -%depmod %{_kernel_ver} -%vbox_kernel_post -d vboxnetadp VirtualBox Network HostOnly driver - -%preun -n kernel%{_alt_kernel}-misc-vboxnetadp -if [ "$1" = "0" ]; then - %service vboxnetadp stop -fi - -%postun -n kernel%{_alt_kernel}-misc-vboxnetadp -%depmod %{_kernel_ver} - -%post -n kernel%{_alt_kernel}-misc-vboxnetflt -%depmod %{_kernel_ver} -%vbox_kernel_post -d vboxnetflt VirtualBox Network Filter driver - -%preun -n kernel%{_alt_kernel}-misc-vboxnetflt -if [ "$1" = "0" ]; then - %service vboxnetflt stop -fi - -%postun -n kernel%{_alt_kernel}-misc-vboxnetflt -%depmod %{_kernel_ver} - -%post -n kernel%{_alt_kernel}-misc-vboxpci -%depmod %{_kernel_ver} -%vbox_kernel_post -d vboxpci VirtualBox PCI passthrough driver - -%preun -n kernel%{_alt_kernel}-misc-vboxpci -if [ "$1" = "0" ]; then - %service vboxpci stop -fi - -%postun -n kernel%{_alt_kernel}-misc-vboxpci -%depmod %{_kernel_ver} - -%post -n kernel%{_alt_kernel}-misc-vboxguest -%depmod %{_kernel_ver} -%vbox_kernel_post -d vboxguest VirtualBox Guest additions driver +%postun guest +%systemd_reload -%preun -n kernel%{_alt_kernel}-misc-vboxguest -if [ "$1" = "0" ]; then - %service vboxguest stop -fi +%triggerpostun guest -- VirtualBox-guest < 4.3.0-1 +%systemd_trigger vboxservice.service -%postun -n kernel%{_alt_kernel}-misc-vboxguest -%depmod %{_kernel_ver} +%pre -n lightdm-greeter-vbox +%addusertogroup xdm vbox -%post -n kernel%{_alt_kernel}-misc-vboxsf +%post -n kernel%{_alt_kernel}-virtualbox-guest %depmod %{_kernel_ver} -%vbox_kernel_post -d vboxsf VirtualBox Host file system access (Shared Folders) - -%preun -n kernel%{_alt_kernel}-misc-vboxsf -if [ "$1" = "0" ]; then - %service vboxsf stop -fi -%postun -n kernel%{_alt_kernel}-misc-vboxsf +%postun -n kernel%{_alt_kernel}-virtualbox-guest %depmod %{_kernel_ver} -%post -n kernel%{_alt_kernel}-video-vboxvideo +%post -n kernel%{_alt_kernel}-virtualbox-host %depmod %{_kernel_ver} -%postun -n kernel%{_alt_kernel}-video-vboxvideo +%postun -n kernel%{_alt_kernel}-virtualbox-host %depmod %{_kernel_ver} -%post kernel-init-host -/sbin/chkconfig --add vboxdrv -/sbin/chkconfig --add vboxnetadp -/sbin/chkconfig --add vboxnetflt -/sbin/chkconfig --add vboxpci -%systemd_reload - -%preun kernel-init-host -if [ "$1" = "0" ]; then - /sbin/chkconfig --del vboxdrv - /sbin/chkconfig --del vboxnetadp - /sbin/chkconfig --del vboxnetflt - /sbin/chkconfig --del vboxpci -fi - -%postun kernel-init-host -%systemd_reload - -%post kernel-init-guest -/sbin/chkconfig --add vboxguest -/sbin/chkconfig --add vboxsf -%systemd_reload - -%preun kernel-init-guest -if [ "$1" = "0" ]; then - /sbin/chkconfig --del vboxguest - /sbin/chkconfig --del vboxsf -fi - -%postun kernel-init-guest -%systemd_reload - %if %{with userspace} %files %defattr(644,root,root,755) @@ -1054,6 +793,7 @@ fi %defattr(644,root,root,755) %attr(755,root,root) /sbin/mount.vboxsf %attr(754,root,root) /etc/rc.d/init.d/vboxservice +%{systemdunitdir}/vboxservice.service %attr(755,root,root) %{_bindir}/VBoxControl %attr(755,root,root) %{_bindir}/VBoxService @@ -1114,55 +854,17 @@ fi %endif %if %{with kernel} -%files kernel-init-host -%defattr(644,root,root,755) -%attr(754,root,root) /etc/rc.d/init.d/vboxdrv -%attr(754,root,root) /etc/rc.d/init.d/vboxnetadp -%attr(754,root,root) /etc/rc.d/init.d/vboxnetflt -%attr(754,root,root) /etc/rc.d/init.d/vboxpci -%{systemdunitdir}/vboxdrv.service -%{systemdunitdir}/vboxnetadp.service -%{systemdunitdir}/vboxnetflt.service -%{systemdunitdir}/vboxpci.service - -%files kernel-init-guest +%files -n kernel%{_alt_kernel}-virtualbox-guest %defattr(644,root,root,755) -%attr(754,root,root) /etc/rc.d/init.d/vboxguest -%attr(754,root,root) /etc/rc.d/init.d/vboxsf -%{systemdunitdir}/vboxguest.service -%{systemdunitdir}/vboxsf.service - -%files -n kernel%{_alt_kernel}-misc-vboxguest -%defattr(644,root,root,755) -%config(noreplace) %verify(not md5 mtime size) /etc/modules-load.d/vboxguest.conf +%config(noreplace) %verify(not md5 mtime size) /etc/modules-load.d/virtualbox-guest.conf /lib/modules/%{_kernel_ver}/misc/vboxguest.ko* +/lib/modules/%{_kernel_ver}/misc/vboxsf.ko* +/lib/modules/%{_kernel_ver}/misc/vboxvideo.ko* -%files -n kernel%{_alt_kernel}-misc-vboxdrv -%defattr(644,root,root,755) -%config(noreplace) %verify(not md5 mtime size) /etc/modules-load.d/vboxdrv.conf +%files -n kernel%{_alt_kernel}-virtualbox-host +%config(noreplace) %verify(not md5 mtime size) /etc/modules-load.d/virtualbox-host.conf /lib/modules/%{_kernel_ver}/misc/vboxdrv.ko* - -%files -n kernel%{_alt_kernel}-misc-vboxnetadp -%defattr(644,root,root,755) -%config(noreplace) %verify(not md5 mtime size) /etc/modules-load.d/vboxnetadp.conf /lib/modules/%{_kernel_ver}/misc/vboxnetadp.ko* - -%files -n kernel%{_alt_kernel}-misc-vboxnetflt -%defattr(644,root,root,755) -%config(noreplace) %verify(not md5 mtime size) /etc/modules-load.d/vboxnetflt.conf /lib/modules/%{_kernel_ver}/misc/vboxnetflt.ko* - -%files -n kernel%{_alt_kernel}-misc-vboxpci -%defattr(644,root,root,755) -%config(noreplace) %verify(not md5 mtime size) /etc/modules-load.d/vboxpci.conf /lib/modules/%{_kernel_ver}/misc/vboxpci.ko* - -%files -n kernel%{_alt_kernel}-misc-vboxsf -%defattr(644,root,root,755) -%config(noreplace) %verify(not md5 mtime size) /etc/modules-load.d/vboxsf.conf -/lib/modules/%{_kernel_ver}/misc/vboxsf.ko* - -%files -n kernel%{_alt_kernel}-video-vboxvideo -%defattr(644,root,root,755) -/lib/modules/%{_kernel_ver}/misc/vboxvideo.ko* %endif