X-Git-Url: https://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=5e7c807a1a9caf9eaaefb3c5e30a48121724b970;hp=04f8088babfdab1f326ab8ae500f93fedb8a081b;hb=a4ecc329533467739c63ede3348cbb25b3d6f94d;hpb=c1550de65004416b6269d2e58ff6e0014bd36eb2 diff --git a/autoconfig.functions b/autoconfig.functions index 04f8088..5e7c807 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -2300,6 +2300,45 @@ fi # checkbootparam "BOOT_IMAGE=debian2hd } # }}} +config_virtualbox_shared_folders() { +if [ -r /proc/acpi/battery/BAT0/info ] && grep -q 'OEM info:.*innotek' /proc/acpi/battery/BAT0/info ; then + einfo "VirtualBox detected, trying to set up Shared Folders." + if ! modprobe -l | grep -q vboxsf.ko ; then + ewarn "vboxsf driver not present, not setting up VirtualBox Shared Folders." + eend 0 + elif ! [ -x /usr/sbin/VBoxService ] ; then + ewarn "virtualbox-guest-utils not installed, not setting up VirtualBox Shared Folders." + eend 0 + else + eindent + + einfo "Loading vboxsf driver." + lsmod | grep -q vboxsf || modprobe vboxsf + eend $? + + einfo "Adjusting /dev/vboxguest." + chown root:vboxsf /dev/vboxguest + chmod 660 /dev/vboxguest + eend $? + + if [ -n "$CONFIG_FSTAB_USER" ] ; then + fstabuser="$CONFIG_FSTAB_USER" + else + fstabuser=$(getent passwd 1000 | cut -d: -f1) + fi + einfo "Adding $fstabuser to group vboxsf." + adduser grml vboxsf &>/dev/null + eend $? + + einfo "Starting VBoxService." + VBoxService >/dev/null & + eend $? + + eoutdent + fi +fi +} + # {{{ Support customization config_distri(){ if checkbootparam 'distri'; then