Merge lp:~rbalint/livecd-rootfs/livecd-rootfs-autopkgtest-fix-for-yakkety into lp:~ubuntu-core-dev/livecd-rootfs/yakkety-proposed

Proposed by Balint Reczey
Status: Merged
Merged at revision: 1451
Proposed branch: lp:~rbalint/livecd-rootfs/livecd-rootfs-autopkgtest-fix-for-yakkety
Merge into: lp:~ubuntu-core-dev/livecd-rootfs/yakkety-proposed
Diff against target: 275 lines (+140/-10)
12 files modified
debian/changelog (+17/-0)
debian/tests/control (+3/-0)
debian/tests/default-bootstraps (+97/-0)
live-build/ubuntu-cpc/functions (+14/-1)
live-build/ubuntu-cpc/hooks/032-disk-image.binary (+2/-2)
live-build/ubuntu-cpc/hooks/032-root-squashfs.binary (+1/-1)
live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary (+1/-1)
live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary (+1/-1)
live-build/ubuntu-cpc/hooks/040-qcow2-image.binary (+1/-1)
live-build/ubuntu-cpc/hooks/040-vmdk-image.binary (+1/-1)
live-build/ubuntu-cpc/hooks/042-vagrant.binary (+1/-1)
live-build/ubuntu-cpc/hooks/999-extras.binary (+1/-1)
To merge this branch: bzr merge lp:~rbalint/livecd-rootfs/livecd-rootfs-autopkgtest-fix-for-yakkety
Reviewer Review Type Date Requested Status
Steve Langasek Pending
Review via email: mp+323933@code.launchpad.net
To post a comment you must log in.
1456. By Balint Reczey

Update changelog

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2017-03-17 18:47:25 +0000
3+++ debian/changelog 2017-05-12 20:07:00 +0000
4@@ -1,3 +1,20 @@
5+livecd-rootfs (2.435.3) UNRELEASED; urgency=medium
6+
7+ [ Balint Reczey ]
8+ * Source ubuntu-cpc functions from the right place
9+ * Use all config hooks from the proper place, not from /build/
10+ * Add basic but configurable autopkgtest (LP: #1690440)
11+ * sync before calling kpartx to let writing to loop devices finish
12+
13+ [ Steve Langasek ]
14+ * Mark autopkgtests isolation-machine since debootstrap won't work in a container.
15+ * Resurrect Balint's fix from
16+ lp:~rbalint/livecd-rootfs/livecd-rootfs-autopkgtest-fix to wrap kpartx
17+ and trap spurious errors, since the problem is still being seen
18+ intermittently on i386 despite us calling sync before kpartx. (LP: #1684090)
19+
20+ -- Balint Reczey <balint.reczey@canonical.com> Thu, 11 May 2017 16:18:20 +0200
21+
22 livecd-rootfs (2.435.2) yakkety; urgency=medium
23
24 [ Chris Glass ]
25
26=== added directory 'debian/tests'
27=== added file 'debian/tests/control'
28--- debian/tests/control 1970-01-01 00:00:00 +0000
29+++ debian/tests/control 2017-05-12 20:07:00 +0000
30@@ -0,0 +1,3 @@
31+Tests: default-bootstraps
32+Depends: @, lsb-release
33+Restrictions: needs-root isolation-machine
34
35=== added file 'debian/tests/default-bootstraps'
36--- debian/tests/default-bootstraps 1970-01-01 00:00:00 +0000
37+++ debian/tests/default-bootstraps 2017-05-12 20:07:00 +0000
38@@ -0,0 +1,97 @@
39+#!/bin/sh
40+# autopkgtest check: Build default rootfs for all supported project:subproject pairs
41+# (C) 2017 Canonical Ltd.
42+# Author: Balint Reczey <balint.reczey@canonical.com>
43+
44+set -e
45+
46+if [ -z "$SUITE"]; then
47+ SUITE=$(lsb_release -c -s)
48+fi
49+
50+# Known project:subproject:template combinations.
51+# Listed subprojects can be combined with other projects as well,
52+# but this list gives reasonable coverage.
53+ALL_TRIPLETS="
54+ base::
55+ edubuntu::
56+ edubuntu-dvd::
57+ kubuntu::
58+ kubuntu-active::
59+ kubuntu-dvd::
60+ kubuntu-plasma5::
61+ lubuntu::
62+ lubuntu-next::
63+ mythbuntu::
64+ ubuntu::
65+ ubuntu-base::
66+ ubuntu-budgie::
67+ ubuntu-budgie-desktop::
68+ ubuntu-budgie-live::
69+ ubuntu-core:system-image:ubuntu-core
70+ ubuntu-cpc::ubuntu-cpc
71+ ubuntu-desktop-next:system-image:ubuntu-desktop-next
72+ ubuntu-desktop-next::ubuntu-desktop-next
73+ ubuntu-dvd::
74+ ubuntu-gnome::
75+ ubuntukylin::
76+ ubuntu-mate::
77+ ubuntu-mate-core::
78+ ubuntu-mate-desktop::
79+ ubuntu-mate-live::
80+ ubuntu-netbook::
81+ ubuntu-server::
82+ ubuntu-server:ubuntu-rtm:
83+ ubuntu-server:ubuntu-rtm/foo:
84+ ubuntu-server:wubi:
85+ ubuntu-touch-custom::ubuntu-touch-custom
86+ ubuntu-touch::ubuntu-touch
87+ xubuntu::"
88+
89+if [ -z "$SELECTED_TRIPLETS" ]; then
90+ SELECTED_TRIPLETS="
91+ ubuntu-base::
92+ ubuntu-cpc::ubuntu-cpc
93+"
94+fi
95+
96+live_build_rootfs() {
97+ PROJECT=${1%%:*}
98+ local SUBPROJECT_TMP=${1%:*}
99+ SUBPROJECT=${SUBPROJECT_TMP#*:}
100+ TEMPLATE=${1##*:}
101+ ARCH=$(dpkg --print-architecture)
102+ echo "Building rootfs for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD"
103+ cp -a /usr/share/livecd-rootfs/live-build/auto .
104+ if [ -n "$TEMPLATE" ]; then
105+ cp -a /usr/share/livecd-rootfs/live-build/$TEMPLATE .
106+ fi
107+ (env PROJECT=$PROJECT \
108+ SUBPROJECT=$SUBPROJECT \
109+ SUITE=$SUITE \
110+ ARCH=$ARCH \
111+ lb config
112+ )
113+ mkdir chroot
114+ # this part needs root rights, but right now the whole script ran as root by autopkgtest
115+ (env PROJECT=$PROJECT \
116+ SUBPROJECT=$SUBPROJECT \
117+ ARCH=$ARCH \
118+ lb build
119+ )
120+ echo "Build results for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD"
121+ du -sh *
122+ echo ""
123+}
124+
125+WORKDIR=$(mktemp -d)
126+trap "RET=\$?; rm -rf $WORKDIR; exit \$RET" 0 INT QUIT ABRT PIPE TERM
127+cd $WORKDIR
128+
129+for i in $SELECTED_TRIPLETS; do
130+ mkdir $i
131+ (cd $i && live_build_rootfs $i)
132+ # clean up after build to avoid filling the disk, needs root rights
133+ rm -rf $i
134+done
135+
136
137=== modified file 'live-build/ubuntu-cpc/functions'
138--- live-build/ubuntu-cpc/functions 2017-03-17 18:46:27 +0000
139+++ live-build/ubuntu-cpc/functions 2017-05-12 20:07:00 +0000
140@@ -11,9 +11,22 @@
141 apt-get -qqy install dosfstools gdisk
142
143 clean_loops() {
144+ local kpartx_ret
145+ local kpartx_stdout
146
147 if [ -n "${backing_img}" ]; then
148- kpartx -v -d "${backing_img}"
149+ # sync before removing loop to avoid "Device or resource busy" errors
150+ sync
151+ kpartx_ret=""
152+ kpartx_stdout=$(kpartx -v -d "${backing_img}") || kpartx_ret=$?
153+ echo "$kpartx_stdout"
154+ if [ -n "$kpartx_ret" ]; then
155+ if echo "$kpartx_stdout" | grep -q "loop deleted: "; then
156+ echo "Suppressing kpartx returning error (#860894)"
157+ else
158+ exit $kpartx_ret
159+ fi
160+ fi
161 unset backing_img
162 fi
163
164
165=== modified file 'live-build/ubuntu-cpc/hooks/032-disk-image.binary'
166--- live-build/ubuntu-cpc/hooks/032-disk-image.binary 2016-06-09 09:47:25 +0000
167+++ live-build/ubuntu-cpc/hooks/032-disk-image.binary 2017-05-12 20:07:00 +0000
168@@ -1,6 +1,6 @@
169 #!/bin/bash -ex
170
171-. /build/config/functions
172+. config/functions
173
174 BOOTPART_START=
175 BOOTPART_END=
176@@ -92,7 +92,7 @@
177 # not the best place for this, but neither flash-kernel nor
178 # u-boot have provisions for installing u-boot via maintainer
179 # script
180- /build/config/hooks/raspi2/mkknlimg --dtok \
181+ config/hooks/raspi2/mkknlimg --dtok \
182 mountpoint/usr/lib/u-boot/rpi_2/u-boot.bin \
183 mountpoint/boot/firmware/uboot.bin
184 ;;
185
186=== modified file 'live-build/ubuntu-cpc/hooks/032-root-squashfs.binary'
187--- live-build/ubuntu-cpc/hooks/032-root-squashfs.binary 2016-06-09 09:47:25 +0000
188+++ live-build/ubuntu-cpc/hooks/032-root-squashfs.binary 2017-05-12 20:07:00 +0000
189@@ -8,7 +8,7 @@
190 exit 0
191 fi
192
193-. /build/config/functions
194+. config/functions
195
196 mkdir binary/boot/squashfs.dir
197 cp -a chroot/* binary/boot/squashfs.dir
198
199=== modified file 'live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary'
200--- live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary 2017-03-17 18:46:27 +0000
201+++ live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary 2017-05-12 20:07:00 +0000
202@@ -9,7 +9,7 @@
203 ;;
204 esac
205
206-. /build/config/functions
207+. config/functions
208
209 apt-get -qqy install dosfstools gdisk
210
211
212=== modified file 'live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary'
213--- live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary 2017-03-17 18:46:27 +0000
214+++ live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary 2017-05-12 20:07:00 +0000
215@@ -7,7 +7,7 @@
216 ;;
217 esac
218
219-. /build/config/functions
220+. config/functions
221
222 create_partitions() {
223 disk_image="$1"
224
225=== modified file 'live-build/ubuntu-cpc/hooks/040-qcow2-image.binary'
226--- live-build/ubuntu-cpc/hooks/040-qcow2-image.binary 2016-06-09 09:47:25 +0000
227+++ live-build/ubuntu-cpc/hooks/040-qcow2-image.binary 2017-05-12 20:07:00 +0000
228@@ -12,7 +12,7 @@
229
230 apt-get install -qqy qemu-utils
231
232-. /build/config/functions
233+. config/functions
234
235 if [ -f binary/boot/disk-uefi.ext4 ]; then
236 convert_to_qcow2 binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.img
237
238=== modified file 'live-build/ubuntu-cpc/hooks/040-vmdk-image.binary'
239--- live-build/ubuntu-cpc/hooks/040-vmdk-image.binary 2016-06-09 09:47:25 +0000
240+++ live-build/ubuntu-cpc/hooks/040-vmdk-image.binary 2017-05-12 20:07:00 +0000
241@@ -9,7 +9,7 @@
242 exit 0;;
243 esac
244
245-. /build/config/functions
246+. config/functions
247
248 if [ -e binary/boot/disk-uefi.ext4 ]; then
249 create_vmdk binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.vmdk
250
251=== modified file 'live-build/ubuntu-cpc/hooks/042-vagrant.binary'
252--- live-build/ubuntu-cpc/hooks/042-vagrant.binary 2017-03-17 18:45:42 +0000
253+++ live-build/ubuntu-cpc/hooks/042-vagrant.binary 2017-05-12 20:07:00 +0000
254@@ -35,7 +35,7 @@
255 exit 0;;
256 esac
257
258-. /build/config/functions
259+. config/functions
260
261 # Virtualbox is needed for making a small VMDK
262 apt-get -qqy install genisoimage qemu-utils
263
264=== modified file 'live-build/ubuntu-cpc/hooks/999-extras.binary'
265--- live-build/ubuntu-cpc/hooks/999-extras.binary 2016-01-28 10:07:33 +0000
266+++ live-build/ubuntu-cpc/hooks/999-extras.binary 2017-05-12 20:07:00 +0000
267@@ -9,7 +9,7 @@
268 fi
269
270 # Export the common functions to the extras
271-. /build/config/functions
272+. config/functions
273
274 # Cleaner execution
275 /bin/run-parts --regex ".*\.binary" "${extra_d}"

Subscribers

People subscribed via source and target branches