support symlinks within ynh-dev path

When there are symlinks in directories contains by current path then lxc fails with :
Error: Invalid devices: Device validation failed "ynhdev-shared-folder": Missing source "(...)/ynh-dev" for disk "ynhdev-shared-folder"

using readlink -f to obtain full path.
This commit is contained in:
philippe lhardy 2020-05-21 15:12:16 +02:00
parent ce101f9b66
commit c2c5d041de

View file

@ -146,7 +146,7 @@ function start_ynhdev()
then then
sudo lxc config set $BOX security.nesting true # Need this for buster because it is using apparmor sudo lxc config set $BOX security.nesting true # Need this for buster because it is using apparmor
fi fi
sudo lxc config device add $BOX ynhdev-shared-folder disk path=/ynh-dev source="$PWD" sudo lxc config device add $BOX ynhdev-shared-folder disk path=/ynh-dev source="$(readlink -f $(pwd))"
set +x set +x
info "Now attaching to the container" info "Now attaching to the container"
else else