summarylogtreecommitdiffstats
path: root/mount.vboxsf
diff options
context:
space:
mode:
authorlilac2018-07-29 10:03:29 +0800
committerlilac2018-07-29 10:03:29 +0800
commit7f86a938c2b428f9d0dd0cb35300f6c899e6439a (patch)
treed031f1b3720b2fc9ddaebf16b9d773fdafd6e517 /mount.vboxsf
parenta10246406c16dfc887406df890d0e47894ff3f40 (diff)
downloadaur-7f86a938c2b428f9d0dd0cb35300f6c899e6439a.tar.gz
update by lilac
Diffstat (limited to 'mount.vboxsf')
-rw-r--r--mount.vboxsf17
1 files changed, 17 insertions, 0 deletions
diff --git a/mount.vboxsf b/mount.vboxsf
new file mode 100644
index 000000000000..f833e78d143a
--- /dev/null
+++ b/mount.vboxsf
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# Hopefully this works as intented, supporting both pre-4.16 and newer kernels
+# https://bugs.archlinux.org/task/58272#comment168687
+
+kver_major=$(uname -r | cut -d. -f1)
+kver_minor=$(uname -r | cut -d. -f2)
+
+if ((kver_major * 100 + kver_minor < 416)); then
+ exec /usr/lib/virtualbox/mount.vboxsf "$@"
+fi
+
+# mount(1) annoyingly prepends the current directory to the source
+name=${1#$PWD/}; shift
+
+# Mainline vboxsf accepts regular mount opts
+exec /usr/bin/mount -cit vboxsf "$name" "$@"