diff --git a/srcpkgs/virtualbox-ose/files/virtualbox-guest.service b/srcpkgs/virtualbox-ose/files/virtualbox-guest.service new file mode 100644 index 00000000000..d238809564e --- /dev/null +++ b/srcpkgs/virtualbox-ose/files/virtualbox-guest.service @@ -0,0 +1,12 @@ +[Unit] +Description=Virtualbox host (de)initialization +DefaultDependencies=no + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/sbin/modprobe -qa vboxguest vboxsf vboxvideo +ExecStop=/sbin/modprobe -rqa vboxvideo vboxsf vboxguest + +[Install] +WantedBy=graphical.target diff --git a/srcpkgs/virtualbox-ose/files/virtualbox.service b/srcpkgs/virtualbox-ose/files/virtualbox.service new file mode 100644 index 00000000000..9452489d8bd --- /dev/null +++ b/srcpkgs/virtualbox-ose/files/virtualbox.service @@ -0,0 +1,12 @@ +[Unit] +Description=Virtualbox host (de)initialization +DefaultDependencies=no + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/sbin/modprobe -qa vboxdrv vboxnetadp vboxnetflt +ExecStop=/sbin/modprobe -rqa vboxnetflt vboxnetadp vboxdrv + +[Install] +WantedBy=graphical.target diff --git a/srcpkgs/virtualbox-ose/template b/srcpkgs/virtualbox-ose/template index 99bb0e83247..3f569fa4d52 100644 --- a/srcpkgs/virtualbox-ose/template +++ b/srcpkgs/virtualbox-ose/template @@ -2,6 +2,7 @@ pkgname=virtualbox-ose _vbox_distver=4.1.4 version=${_vbox_distver} +revision=1 patch_args="-Np1" wrksrc="VirtualBox-${version}_OSE" distfiles="http://download.virtualbox.org/virtualbox/$version/VirtualBox-$version.tar.bz2" @@ -148,6 +149,7 @@ do_install() ${DESTDIR}/usr/share/licenses/${pkgname} # Install the OpenRC service. - install -D -m755 ${FILESDIR}/virtualbox.rc \ - ${DESTDIR}/etc/init.d/virtualbox + vinstall ${FILESDIR}/virtualbox.rc 755 etc/init.d virtualbox + # Install systemd unit. + vinstall ${FILESDIR}/virtualbox.service 644 lib/systemd/system } diff --git a/srcpkgs/virtualbox-ose/virtualbox-ose-guest.template b/srcpkgs/virtualbox-ose/virtualbox-ose-guest.template index 87e564d37e1..1d4f9717fe6 100644 --- a/srcpkgs/virtualbox-ose/virtualbox-ose-guest.template +++ b/srcpkgs/virtualbox-ose/virtualbox-ose-guest.template @@ -8,6 +8,7 @@ long_desc="${long_desc} They provide closer integration and allow to share data through shared folders between the host system and the virtual machine." +revision=1 openrc_services="virtualbox-guest default true" Add_dependency run libgcc @@ -52,4 +53,5 @@ do_install() install -m755 -D pam_vbox.so ${DESTDIR}/lib/security/pam_vbox.so vinstall ${FILESDIR}/virtualbox-guest.rc 755 etc/init.d virtualbox-guest + vinstall ${FILESDIR}/virtualbox-guest.service 644 lib/systemd/system }