diff --git a/deploy/iso/minikube-iso/package/automount/minikube-automount b/deploy/iso/minikube-iso/package/automount/minikube-automount index efbbe23e7684..494f86e189ca 100755 --- a/deploy/iso/minikube-iso/package/automount/minikube-automount +++ b/deploy/iso/minikube-iso/package/automount/minikube-automount @@ -71,7 +71,7 @@ if [ ! -n "$BOOT2DOCKER_DATA" ]; then # As there are no partitions, let's make sure the disk is empty for real dd if=$UNPARTITIONED_HD of=device_test_file bs=1k count=256 > /dev/null 2>&1 NON_NUL=$( /dev/null && modprobe vboxsf &> /dev/null; then if grep -q '^docker:' /etc/passwd; then mountOptions="${mountOptions},uid=$(id -u docker),gid=$(id -g docker)" fi - + # try mounting "$name" (which defaults to "$dir") at "$dir", # but quietly clean up empty directories if it fails try_mount_share() { dir="$1" name="${2:-$dir}" - + # normalize "dir" to be definitively root-relative # ie, "/Users" and "Users" will both translate to "/Users" explicitly dir="/${dir#/}" - + mkdir -p "$dir" 2>/dev/null if ! mount -t vboxsf -o "$mountOptions" "$name" "$dir" 2>/dev/null; then rmdir "$dir" 2>/dev/null || true @@ -202,13 +213,13 @@ if modprobe vboxguest &> /dev/null && modprobe vboxsf &> /dev/null; then dir="$(dirname "$dir")" rmdir "$dir" 2>/dev/null || break done - + return 1 fi - + return 0 } - + for line in $(VBoxControl --nologo sharedfolder list -automount | tail -n+3 | cut -d ' ' -f 3); do try_mount_share "$line" done