virtualbox-ose-guest: make vboxvideo work, added openrc service.

With this commit gnome3 and gnome-shell works by default, required
guest modules are loaded automatically by the openrc service.
This commit is contained in:
Juan RP 2011-08-14 11:20:10 +02:00
parent 4f39b85984
commit f19e7ca4eb
2 changed files with 40 additions and 2 deletions

View File

@ -0,0 +1,33 @@
#!/sbin/runscript
#
# OpenRC service for VirtualBox Guest.
name="VirtualBox guest module (un)loader"
depend()
{
provide virtualbox-guest
need sysfs
}
start()
{
ebegin "Loading VirtualBox guest modules"
for _mod_ in vboxguest vboxsf vboxvideo; do
if grep -vq '^${_mod_}' /proc/modules; then
modprobe -q ${_mod_}
fi
done
eend $?
}
stop()
{
ebegin "Unloading VirtualBox guest modules"
for _mod_ in vboxvideo vboxsf vboxguest; do
if ! grep -q '^${_mod_}' /proc/modules; then
modprobe -rq ${_mod_}
fi
done
eend $?
}

View File

@ -8,6 +8,9 @@ long_desc="${long_desc}
They provide closer integration and allow to share data through shared folders
between the host system and the virtual machine."
openrc_services="virtualbox-guest default true"
revision=1
Add_dependency run libgcc
Add_dependency run glibc
Add_dependency run libX11
@ -20,7 +23,7 @@ Add_dependency run libXdamage
Add_dependency run libXfixes
Add_dependency run pam
Add_dependency run MesaLib
Add_dependency run ${pkgname}-dkms ">=${version}"
Add_dependency run virtualbox-ose-guest-dkms ">=${version}"
do_install()
{
@ -46,8 +49,10 @@ do_install()
${DESTDIR}/usr/lib/xorg/modules/drivers/vboxvideo.so
install -d ${DESTDIR}/usr/lib/xorg/modules/dri
install -m755 VBoxOGL*.so ${DESTDIR}/usr/lib
cd ${DESTDIR}/usr/lib && ln -s VBoxOGL.so \
ln -sf /usr/lib/VBoxOGL.so \
${DESTDIR}/usr/lib/xorg/modules/dri/vboxvideo_dri.so
cd ${wrksrc}/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions
install -m755 -D pam_vbox.so ${DESTDIR}/lib/security/pam_vbox.so
vinstall ${FILESDIR}/virtualbox-guest.rc 755 etc/init.d virtualbox-guest
}