force host tools for specific filesystems
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
parent
dbe827937a
commit
55fdf58766
27
docker/mount
27
docker/mount
|
|
@ -1,5 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
container_supported_filesystems=(
|
||||
"ext2"
|
||||
"ext3"
|
||||
"ext4"
|
||||
"ext4dev"
|
||||
"xfs"
|
||||
"vfat"
|
||||
"nfs"
|
||||
"nfs3"
|
||||
"nfs4"
|
||||
"cifs"
|
||||
"smb"
|
||||
"smb3"
|
||||
"bind"
|
||||
)
|
||||
|
||||
while getopts "t:" opt; do
|
||||
case "$opt" in
|
||||
t)
|
||||
[[ "${OPTARG,,}" == "zfs" ]] && USE_HOST_MOUNT_TOOLS=1
|
||||
[[ "${OPTARG,,}" == "lustre" ]] && USE_HOST_MOUNT_TOOLS=1
|
||||
[[ "${OPTARG,,}" == "onedata" ]] && USE_HOST_MOUNT_TOOLS=1
|
||||
#(printf '%s\0' "${container_supported_filesystems[@]}" | grep -Fqxz -- "${OPTARG}") || USE_HOST_MOUNT_TOOLS=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ ${USE_HOST_MOUNT_TOOLS} -eq 1 ]];then
|
||||
chroot /host /usr/bin/env -i PATH="/sbin:/bin:/usr/bin:/usr/sbin" mount "${@:1}"
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1,5 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
container_supported_filesystems=(
|
||||
"ext2"
|
||||
"ext3"
|
||||
"ext4"
|
||||
"ext4dev"
|
||||
"xfs"
|
||||
"vfat"
|
||||
"nfs"
|
||||
"nfs3"
|
||||
"nfs4"
|
||||
"cifs"
|
||||
"smb"
|
||||
"smb3"
|
||||
"bind"
|
||||
)
|
||||
|
||||
while getopts "t:" opt; do
|
||||
case "$opt" in
|
||||
t)
|
||||
[[ "${OPTARG,,}" == "zfs" ]] && USE_HOST_MOUNT_TOOLS=1
|
||||
[[ "${OPTARG,,}" == "lustre" ]] && USE_HOST_MOUNT_TOOLS=1
|
||||
[[ "${OPTARG,,}" == "onedata" ]] && USE_HOST_MOUNT_TOOLS=1
|
||||
#(printf '%s\0' "${container_supported_filesystems[@]}" | grep -Fqxz -- "${OPTARG}") || USE_HOST_MOUNT_TOOLS=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ ${USE_HOST_MOUNT_TOOLS} -eq 1 ]];then
|
||||
chroot /host /usr/bin/env -i PATH="/sbin:/bin:/usr/bin:/usr/sbin" umount "${@:1}"
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue