From 8b141ef85ad3c4ec4e05acd2948cfadc1b3c63b4 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Mon, 8 May 2017 21:04:47 +0200 Subject: [PATCH 1/2] Mark autopkgtests isolation-machine since debootstrap won't work in a container. --- debian/changelog | 7 +++++++ debian/tests/control | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c439a56a..b36f084f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.441.3) UNRELEASED; urgency=medium + + * Mark autopkgtests isolation-machine since debootstrap won't work in a + container. + + -- Steve Langasek Fri, 28 Apr 2017 17:41:05 -0700 + livecd-rootfs (2.441.2) zesty; urgency=medium * The ubuntu-server:live should use a casper-based initramfs to work diff --git a/debian/tests/control b/debian/tests/control index a37a5d79..b40640f9 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,3 +1,3 @@ Tests: default-bootstraps Depends: @, lsb-release -Restrictions: needs-root +Restrictions: needs-root isolation-machine From 1b95302ef727b120671bd9f3cf913eb71735bdd0 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Thu, 11 May 2017 15:31:29 +0200 Subject: [PATCH 2/2] Resurrect Balint's fix from lp:~rbalint/livecd-rootfs/livecd-rootfs-autopkgtest-fix to wrap kpartx and trap spurious errors, since the problem is still being seen intermittently on i386 despite us calling sync before kpartx. (LP: #1684090) --- debian/changelog | 4 ++++ live-build/functions | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b36f084f..22e44bf4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,9 @@ livecd-rootfs (2.441.3) UNRELEASED; urgency=medium + * Resurrect Balint's fix from + lp:~rbalint/livecd-rootfs/livecd-rootfs-autopkgtest-fix to wrap kpartx + and trap spurious errors, since the problem is still being seen + intermittently on i386 despite us calling sync before kpartx. (LP: #1684090) * Mark autopkgtests isolation-machine since debootstrap won't work in a container. diff --git a/live-build/functions b/live-build/functions index 5abdeea1..c72c59a2 100644 --- a/live-build/functions +++ b/live-build/functions @@ -11,9 +11,22 @@ backing_img= apt-get -qqy install dosfstools gdisk clean_loops() { + local kpartx_ret + local kpartx_stdout if [ -n "${backing_img}" ]; then - kpartx -v -d "${backing_img}" + # sync before removing loop to avoid "Device or resource busy" errors + sync + kpartx_ret="" + kpartx_stdout=$(kpartx -v -d "${backing_img}") || kpartx_ret=$? + echo "$kpartx_stdout" + if [ -n "$kpartx_ret" ]; then + if echo "$kpartx_stdout" | grep -q "loop deleted: "; then + echo "Suppressing kpartx returning error (#860894)" + else + exit $kpartx_ret + fi + fi unset backing_img fi