diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2017-08-11 08:33:28 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2017-09-05 13:17:23 +0000 |
commit | f0e51002706260e3cfb4bbcef92428fb23d800ac (patch) | |
tree | 5431630bd15f38fc59ca322a343269b14207fdf3 /start-container-qemu.sh | |
parent | e18484a0af50ce198a06a4ce1c2f3814b68e881f (diff) |
start-container-qemu.sh: Fix handling of bind-mounts / NFS mounts
NFS mounts need to explicitly specify v3 of protocol to use UDP.
Also fix parsing of docker-style read-only bind-mounts A:B:ro.
Change-Id: Icef6df08b63b23c9b0e1eb1240787ddda0095d64
Diffstat (limited to 'start-container-qemu.sh')
-rwxr-xr-x | start-container-qemu.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/start-container-qemu.sh b/start-container-qemu.sh index dbf739a1..4521e6c4 100755 --- a/start-container-qemu.sh +++ b/start-container-qemu.sh @@ -65,11 +65,13 @@ nfsip=$(docker -H $host:2375 inspect --format {{.NetworkSettings.IPAddress}} "$c bind_mounts=($(print_bind_mounts "$task")) echo "$nfsroot *(rw,async,no_root_squash,no_subtree_check,insecure)" | container_exec sudo tee -a /etc/exports for bind_mount in "${bind_mounts[@]}"; do - dir="${bind_mount##*:}" + dir="$(echo $bind_mount | cut -s -d: -f 2)" + rw="$(echo $bind_mount | cut -s -d: -f 3)" + rw="${rw:-rw}" mkdir -p "$nfsroot/$dir" - echo "$dir *(rw,async,no_root_squash,no_subtree_check,insecure)" | container_exec sudo tee -a /etc/exports - echo "$nfsip:$dir $dir nfs defaults,proto=udp 0 0" | container_exec sudo tee -a "$nfsroot/etc/fstab" + echo "$dir *($rw,async,no_root_squash,no_subtree_check,insecure)" | container_exec sudo tee -a /etc/exports + echo "$nfsip:$dir $dir nfs defaults,$rw,vers=3,proto=udp 0 0" | container_exec sudo tee -a "$nfsroot/etc/fstab" done container_exec sudo /etc/init.d/rpcbind start container_exec sudo /etc/init.d/nfs-kernel-server start |