wok-current view virtualbox-ose-guestutils/receipt @ rev 15795
Up slitaz-tools (5.5.1)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sun Jan 19 14:21:08 2014 +0100 (2014-01-19) |
parents | 400979d11723 |
children | 4e519df1c7b9 |
line source
1 # SliTaz package receipt.
3 PACKAGE="virtualbox-ose-guestutils"
4 VERSION="4.2.6"
5 CATEGORY="misc"
6 SHORT_DESC="VirtualBox Guest userspace utilities, useful for running Slitaz inside a virtual machine"
7 MAINTAINER="slaxemulator@gmail.com"
8 LICENSE="GPL2"
9 WANTED="virtualbox-ose"
10 WEB_SITE="https://www.virtualbox.org/"
12 DEPENDS="xorg-libXfixes xorg-libXmu xorg-xrandr"
13 BUILD_DEPENDS=""
15 # Rules to gen a SliTaz package suitable for Tazpkg.
16 genpkg_rules()
17 {
18 # virtualbox-ose-additions
19 source $src/env.sh
20 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions"
21 mkdir -p $fs/usr/bin
22 mkdir -p $fs/sbin
23 mkdir -p $fs/etc/X11/xorg.conf.d
24 mkdir -p $fs/etc/init.d
26 install -m755 VBoxClient VBoxControl VBoxService "$fs/usr/bin"
27 install -m755 mount.vboxsf "$fs/sbin"
29 install -m755 -D $src/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
30 $fs/usr/bin/VBoxClient-all
31 install -m755 -D $src/src/VBox/Additions/x11/Installer/vboxclient.desktop \
32 $fs/etc/xdg/autostart/vboxclient.desktop
34 install -D vboxvideo_drv_112.so \
35 "$fs/usr/lib/X11/modules/drivers/vboxvideo.so"
36 install -d "$fs/usr/lib/dri"
37 install -m755 VBoxOGL*.so "$fs/usr/lib"
38 ln -s /usr/lib/VBoxOGL.so "$fs/usr/lib/dri/vboxvideo_dri.so"
39 install -m755 -D pam_vbox.so "$fs/lib/security/pam_vbox.so"
41 # virtualbox-ose-additions-modules
42 KERNEL_VERSION=$(grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g')
43 #cooking installs modules in linux major version dir
44 KBASEVER="${KERNEL_VERSION:0:3}"
46 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
48 cd vboxguest
49 install -D -m644 vboxguest.ko \
50 "$fs/lib/modules/$KBASEVER-slitaz/misc/vboxguest.ko"
52 cd ../vboxsf
53 install -D -m644 vboxsf.ko \
54 "$fs/lib/modules/$KBASEVER-slitaz/misc/vboxsf.ko"
56 cd ../vboxvideo
57 install -D -m644 vboxvideo.ko \
58 "$fs/lib/modules/$KBASEVER-slitaz/misc/vboxvideo.ko"
60 install -D -m 0644 "$stuff/60-vboxguest.rules" \
61 "$fs/etc/udev/rules.d/60-vboxguest.rules"
63 install -D -m 0755 "$stuff/VBoxService" \
64 "$fs/etc/init.d/VBoxService"
65 }
67 pre_remove()
68 {
69 if chroot $1/ lspci | grep -qi virtualbox; then
70 sed -i "s/vboxguest vboxsf vboxvideo //" $1/etc/rcS.conf
71 sed -i '/# VBoxService daemon options./{N;N;N;d}' $1/etc/daemons.conf
72 sed -i 's/VBoxService //' $1/etc/rcS.conf
73 chroot $1/ delgroup vboxsf
74 sed -i 's/^\tDriver.*$/\tDriver "vesa"/' $1/etc/X11/xorg.conf.d/60-Device.conf
75 fi
76 }
78 post_install()
79 {
80 if chroot $1/ lspci | grep -qi virtualbox; then
81 #chroot $1/ udevadm control --reload
82 grep -qs VBOXSERVICE_OPTIONS $1/etc/daemons.conf ||
83 cat >> $1/etc/daemons.conf << "EOT"
84 # VBoxService daemon options.
85 VBOXSERVICE_OPTIONS=""
87 EOT
88 KERNEL_VERSION=$( chroot $1/ uname -r)
89 chroot $1/ depmod -a $KERNEL_VERSION
90 #chroot $1/ modprobe -a vboxguest vboxsf vboxvideo
91 sed -i 's/^\tDriver.*$/\tDriver "vboxvideo"/' $1/etc/X11/xorg.conf.d/60-Device.conf
92 grep -qs vboxguest $1/etc/rcS.conf ||
93 sed -i 's/LOAD_MODULES="/&vboxguest vboxsf vboxvideo /' $1/etc/rcS.conf
94 grep -qs VBoxService $1/etc/rcS.conf ||
95 sed -i 's/RUN_DAEMONS="/&VBoxService /' $1/etc/rcS.conf
96 grep -qs vboxsf $1/etc/group || chroot $1/ addgroup -g 109 vboxsf
97 echo "add yourself to vboxsf group if you want to access"
98 echo "host shared folder: addgroup $USER vboxsf"
99 #i can't get udev to do its work
100 #echo "then logout and login again"
101 #chroot $1/ /etc/init.d/VBoxService start &> /dev/null
102 echo "then reboot"
103 else
104 echo "this is not a virtual machine,"
105 echo "i'm useless here and you probably"
106 echo "may want to remove me."
107 fi
108 }