diff options
author | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2018-03-11 23:46:21 +0100 |
---|---|---|
committer | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2018-03-11 23:50:08 +0100 |
commit | 21273a66c4a619a71e1e6bee7a6694cf8bb278d1 (patch) | |
tree | 31be5165528dd2a82c05bf2b3a28a8e1b31bbe3b | |
parent | d6c6e357854725975797c3ac0805781220885eed (diff) |
lib.sh: Add missing `sudo` for `losetup`
Change-Id: I1c5e3d7a0dbac14bf242730d6ac8d2b1d0817907
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-rw-r--r-- | mcp/scripts/lib.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh index 5be4c556d..7d57fcf5f 100644 --- a/mcp/scripts/lib.sh +++ b/mcp/scripts/lib.sh @@ -120,7 +120,7 @@ function mount_image { break fi done - OPNFV_LOOP_DEV=$(losetup -f) + OPNFV_LOOP_DEV=$(sudo losetup -f) OPNFV_MAP_DEV=/dev/mapper/$(basename "${OPNFV_NBD_DEV}")p1 export OPNFV_MNT_DIR OPNFV_LOOP_DEV [ -n "${OPNFV_NBD_DEV}" ] && [ -n "${OPNFV_LOOP_DEV}" ] || exit 1 @@ -213,7 +213,7 @@ function cleanup_mounts { fi fi if [ -n "${OPNFV_LOOP_DEV}" ] && \ - losetup "${OPNFV_LOOP_DEV}" 1>&2 > /dev/null; then + sudo losetup "${OPNFV_LOOP_DEV}" 1>&2 > /dev/null; then sudo losetup -d "${OPNFV_LOOP_DEV}" fi if [ -n "${OPNFV_NBD_DEV}" ]; then |