Merge lp:~rbalint/livecd-rootfs/livecd-rootfs-autopkgtest-fix-for-yakkety

ubuntu/yakkety
Steve Langasek 8 years ago
commit 7fd6f602fb

12
debian/changelog vendored

@ -1,3 +1,15 @@
livecd-rootfs (2.435.3) UNRELEASED; urgency=medium
[ Balint Reczey ]
* Source ubuntu-cpc functions from the right place
* Use all config hooks from the proper place, not from /build/
* Add basic but configurable autopkgtest (LP: #1690440)
* sync before calling kpartx to let writing to loop devices finish
* wrap kpartx and trap spurious errors, to work around kpartx
unreliability.
-- Balint Reczey <balint.reczey@canonical.com> Thu, 11 May 2017 16:18:20 +0200
livecd-rootfs (2.435.2) yakkety; urgency=medium livecd-rootfs (2.435.2) yakkety; urgency=medium
[ Chris Glass ] [ Chris Glass ]

@ -0,0 +1,3 @@
Tests: default-bootstraps
Depends: @, lsb-release
Restrictions: needs-root isolation-machine

@ -0,0 +1,97 @@
#!/bin/sh
# autopkgtest check: Build default rootfs for all supported project:subproject pairs
# (C) 2017 Canonical Ltd.
# Author: Balint Reczey <balint.reczey@canonical.com>
set -e
if [ -z "$SUITE"]; then
SUITE=$(lsb_release -c -s)
fi
# Known project:subproject:template combinations.
# Listed subprojects can be combined with other projects as well,
# but this list gives reasonable coverage.
ALL_TRIPLETS="
base::
edubuntu::
edubuntu-dvd::
kubuntu::
kubuntu-active::
kubuntu-dvd::
kubuntu-plasma5::
lubuntu::
lubuntu-next::
mythbuntu::
ubuntu::
ubuntu-base::
ubuntu-budgie::
ubuntu-budgie-desktop::
ubuntu-budgie-live::
ubuntu-core:system-image:ubuntu-core
ubuntu-cpc::ubuntu-cpc
ubuntu-desktop-next:system-image:ubuntu-desktop-next
ubuntu-desktop-next::ubuntu-desktop-next
ubuntu-dvd::
ubuntu-gnome::
ubuntukylin::
ubuntu-mate::
ubuntu-mate-core::
ubuntu-mate-desktop::
ubuntu-mate-live::
ubuntu-netbook::
ubuntu-server::
ubuntu-server:ubuntu-rtm:
ubuntu-server:ubuntu-rtm/foo:
ubuntu-server:wubi:
ubuntu-touch-custom::ubuntu-touch-custom
ubuntu-touch::ubuntu-touch
xubuntu::"
if [ -z "$SELECTED_TRIPLETS" ]; then
SELECTED_TRIPLETS="
ubuntu-base::
ubuntu-cpc::ubuntu-cpc
"
fi
live_build_rootfs() {
PROJECT=${1%%:*}
local SUBPROJECT_TMP=${1%:*}
SUBPROJECT=${SUBPROJECT_TMP#*:}
TEMPLATE=${1##*:}
ARCH=$(dpkg --print-architecture)
echo "Building rootfs for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD"
cp -a /usr/share/livecd-rootfs/live-build/auto .
if [ -n "$TEMPLATE" ]; then
cp -a /usr/share/livecd-rootfs/live-build/$TEMPLATE .
fi
(env PROJECT=$PROJECT \
SUBPROJECT=$SUBPROJECT \
SUITE=$SUITE \
ARCH=$ARCH \
lb config
)
mkdir chroot
# this part needs root rights, but right now the whole script ran as root by autopkgtest
(env PROJECT=$PROJECT \
SUBPROJECT=$SUBPROJECT \
ARCH=$ARCH \
lb build
)
echo "Build results for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD"
du -sh *
echo ""
}
WORKDIR=$(mktemp -d)
trap "RET=\$?; rm -rf $WORKDIR; exit \$RET" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
for i in $SELECTED_TRIPLETS; do
mkdir $i
(cd $i && live_build_rootfs $i)
# clean up after build to avoid filling the disk, needs root rights
rm -rf $i
done

@ -11,9 +11,22 @@ backing_img=
apt-get -qqy install dosfstools gdisk apt-get -qqy install dosfstools gdisk
clean_loops() { clean_loops() {
local kpartx_ret
local kpartx_stdout
if [ -n "${backing_img}" ]; then 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 unset backing_img
fi fi

@ -1,6 +1,6 @@
#!/bin/bash -ex #!/bin/bash -ex
. /build/config/functions . config/functions
BOOTPART_START= BOOTPART_START=
BOOTPART_END= BOOTPART_END=
@ -92,7 +92,7 @@ case $ARCH:$SUBARCH in
# not the best place for this, but neither flash-kernel nor # not the best place for this, but neither flash-kernel nor
# u-boot have provisions for installing u-boot via maintainer # u-boot have provisions for installing u-boot via maintainer
# script # script
/build/config/hooks/raspi2/mkknlimg --dtok \ config/hooks/raspi2/mkknlimg --dtok \
mountpoint/usr/lib/u-boot/rpi_2/u-boot.bin \ mountpoint/usr/lib/u-boot/rpi_2/u-boot.bin \
mountpoint/boot/firmware/uboot.bin mountpoint/boot/firmware/uboot.bin
;; ;;

@ -8,7 +8,7 @@ if [ -n "$SUBARCH" ]; then
exit 0 exit 0
fi fi
. /build/config/functions . config/functions
mkdir binary/boot/squashfs.dir mkdir binary/boot/squashfs.dir
cp -a chroot/* binary/boot/squashfs.dir cp -a chroot/* binary/boot/squashfs.dir

@ -9,7 +9,7 @@ case $ARCH in
;; ;;
esac esac
. /build/config/functions . config/functions
apt-get -qqy install dosfstools gdisk apt-get -qqy install dosfstools gdisk

@ -7,7 +7,7 @@ case $ARCH in
;; ;;
esac esac
. /build/config/functions . config/functions
create_partitions() { create_partitions() {
disk_image="$1" disk_image="$1"

@ -12,7 +12,7 @@ esac
apt-get install -qqy qemu-utils apt-get install -qqy qemu-utils
. /build/config/functions . config/functions
if [ -f binary/boot/disk-uefi.ext4 ]; then if [ -f binary/boot/disk-uefi.ext4 ]; then
convert_to_qcow2 binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.img convert_to_qcow2 binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.img

@ -9,7 +9,7 @@ case $ARCH in
exit 0;; exit 0;;
esac esac
. /build/config/functions . config/functions
if [ -e binary/boot/disk-uefi.ext4 ]; then if [ -e binary/boot/disk-uefi.ext4 ]; then
create_vmdk binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.vmdk create_vmdk binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.vmdk

@ -35,7 +35,7 @@ case $ARCH in
exit 0;; exit 0;;
esac esac
. /build/config/functions . config/functions
# Virtualbox is needed for making a small VMDK # Virtualbox is needed for making a small VMDK
apt-get -qqy install genisoimage qemu-utils apt-get -qqy install genisoimage qemu-utils

@ -9,7 +9,7 @@ if [ ! -d ${my_dir}/extra ]; then
fi fi
# Export the common functions to the extras # Export the common functions to the extras
. /build/config/functions . config/functions
# Cleaner execution # Cleaner execution
/bin/run-parts --regex ".*\.binary" "${extra_d}" /bin/run-parts --regex ".*\.binary" "${extra_d}"

Loading…
Cancel
Save