From 21273a66c4a619a71e1e6bee7a6694cf8bb278d1 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Sun, 11 Mar 2018 23:46:21 +0100 Subject: lib.sh: Add missing `sudo` for `losetup` Change-Id: I1c5e3d7a0dbac14bf242730d6ac8d2b1d0817907 Signed-off-by: Alexandru Avadanii --- mcp/scripts/lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mcp/scripts') 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 -- cgit 1.2.3-korg