diff --git a/debian/changelog b/debian/changelog index dc4e4063..78aeed08 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.509) UNRELEASED; urgency=medium + + * Properly handle loop device names when there are > 10 devices on the + system. + + -- Steve Langasek Tue, 06 Mar 2018 10:30:02 +0100 + livecd-rootfs (2.508) bionic; urgency=medium * Use Ubuntu-specific branches when seeding snaps, as required in diff --git a/live-build/functions b/live-build/functions index 239169ad..66aadff1 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