#!/bin/sh -efu
### This file is covered by the GNU General Public License
### version 2 or later.
###
### Copyright (C) 2018  ALT Linux Team
### Author: Leonid Krivoshein <klark@altlinux.org>

if [ -z "${__included_rescue_launcher_vbox-}" ]; then
__included_rescue_launcher_vbox=1

# VirtualBox Shared Folder
autorun_probe_vbox_method() {
	local label="${AUTORUN_LABEL:-alt-autorun}"
	local opts="ro,nosuid" module="vboxsf"

	autorun_debug "Probing VBOX..."
	if grep -wqs $module /proc/filesystems; then
		autorun_mount -t $module -o $opts "$label" || return 1
	else
		autorun_spawn modprobe $module ||:
		autorun_mount -t $module -o $opts "$label" || {
			autorun_spawn rmmod $module ||:
			return 1
		}
	fi

	return 0
}

fi #__included_rescue_launcher_vbox
