From dfaf2471932a0e7d7623bdae33be57ba2174c9f9 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Sat, 21 Oct 2017 00:54:02 -0700 Subject: [PATCH] Properly handle loop device names when there are > 10 devices on the system. --- debian/changelog | 2 ++ live-build/functions | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 33b74471..7b71efe3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ livecd-rootfs (2.479) UNRELEASED; urgency=medium * Purge initramfs-tools from minimized images. + * Properly handle loop device names when there are > 10 devices on the + system. -- Steve Langasek Fri, 13 Oct 2017 17:14:58 -0400 diff --git a/live-build/functions b/live-build/functions index f05aaf8e..03ede971 100644 --- a/live-build/functions +++ b/live-build/functions @@ -56,7 +56,7 @@ mount_image() { # Find the loop device loop_p1="$(echo -e ${kpartx_mapping} | head -n1 | awk '{print$3}')" - loop_device="/dev/loop$(echo ${loop_p1} | cut -b5)" + loop_device="/dev/${loop_p1%p[0-9]*}" if [ ! -b ${loop_device} ]; then echo "unable to find loop device for ${backing_img}" exit 1