From fbe15e53d3c111917a0dcb33e777792725fb9e16 Mon Sep 17 00:00:00 2001 From: "Angus Ainslie (Purism)" Date: Fri, 30 Aug 2019 07:54:36 -0700 Subject: [PATCH] build-image: HACK clean out deleted loop mappings This is a workaround until we fix or deprecate vmdebootstrap /dev/loop0 will fail losetup if it doesn't get cleaned out Signed-off-by: Angus Ainslie (Purism) --- build-image | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build-image b/build-image index 33cb35e..98ee8a3 100755 --- a/build-image +++ b/build-image @@ -207,6 +207,13 @@ echo "Using kernel ${kernel_deb}" escaped_apt_sources=$(echo "${apt_sources}" | sed 's/$/|/g') set -x +# clean out deleted loop maps +stale=$(/sbin/losetup | grep deleted | awk '{ print $1; }') +if [ -n "${stale}" ]; then + echo "cleaning out ${stale}" + sudo kpartx -d "${stale}" +fi + # shellcheck disable=SC2086 sudo pureos_board="${pureos_board}" \ distro="${distro}" \ -- GitLab