diff --git a/debian/changelog b/debian/changelog index 20af71b4..198275bf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,8 +5,12 @@ livecd-rootfs (2.442) UNRELEASED; urgency=medium comparison prior to aa-series (LP: #1681548) * live-build/ubuntu-cpc/hooks/999-extras.binary: Exit on first failure - [Balint Reczey] + [ Balint Reczey ] * sync before calling kpartx to let writing to loop devices finish + * Sort and list dependencies nicely + * Require PROJECT environment to be set for lb build + * Allow overwriting IMAGEFORMAT even for ubuntu-cpc and ubuntu-server + * Optionally use ubuntu-image for building snap based images -- Steve Langasek Thu, 13 Apr 2017 10:38:04 -0700 diff --git a/debian/control b/debian/control index 52e4d3b2..9ecc7dbe 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,25 @@ Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-core-dev/livecd-rootfs/trunk Package: livecd-rootfs Architecture: any -Depends: ${misc:Depends}, debootstrap, rsync, python-minimal | python, procps, squashfs-tools (>= 1:3.3-1), grep-dctrl, lsb-release, lzma, e2fsprogs, germinate (>= 1.25.1), apt-utils, gnupg, live-build (>= 3.0~a57-1ubuntu12~), android-tools-fsutils [armhf], python3-software-properties +Depends: ${misc:Depends}, + android-tools-fsutils [armhf], + apt-utils, + debootstrap, + e2fsprogs, + germinate (>= 1.25.1), + gnupg, + grep-dctrl, + live-build (>= 3.0~a57-1ubuntu12~), + lsb-release, + lzma, + procps, + python-minimal | python, + python3-software-properties, + rsync, + snapd, + squashfs-tools (>= 1:3.3-1), + sudo, + ubuntu-image Suggests: partimage Breaks: ubuntu-defaults-builder (<< 0.32) Description: construction script for the livecd rootfs diff --git a/live-build/auto/build b/live-build/auto/build index 103b5005..cfe00bdd 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -10,6 +10,17 @@ Arguments "${@}" Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source Set_defaults +if [ -z "${PROJECT:-}" ]; then + echo "PROJECT environment variable has to be set" >&2 + exit 1 +fi + +if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then + # Use ubuntu-image instead of live-build + env SNAPPY_STORE_NO_CDN=1 ubuntu-image -o livecd."$PROJECT".img livecd."$PROJECT".model-assertion + exit 0 +fi + # Setup cleanup function Setup_cleanup diff --git a/live-build/auto/config b/live-build/auto/config index 77c33db4..2f8decec 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -104,14 +104,16 @@ add_binary_hook () BINARY_HOOKS="${BINARY_HOOKS:+$BINARY_HOOKS }$1" } -case $PROJECT:$SUBPROJECT in - ubuntu-cpc:*) - IMAGEFORMAT=ext4 - ;; - ubuntu-server:live) - IMAGEFORMAT=plain - ;; -esac +if [ -z "${IMAGEFORMAT:-}" ]; then + case $PROJECT:$SUBPROJECT in + ubuntu-cpc:*) + IMAGEFORMAT=ext4 + ;; + ubuntu-server:live) + IMAGEFORMAT=plain + ;; + esac +fi case $IMAGEFORMAT in ext2|ext3|ext4) @@ -145,6 +147,35 @@ case $IMAGEFORMAT in esac ;; + ubuntu-image) + case "$ARCH+${SUBARCH:-}" in + amd64+*) + MODEL=pc-amd64 ;; + i386+*) + MODEL=pc-i386 ;; + arm64+snapdragon) + MODEL=dragonboard ;; + armhf+raspi2) + MODEL=pi2 ;; + armhf+raspi3) + MODEL=pi3 ;; + *) + echo "Model $ARCH+${SUBARCH:-} unknown to livecd-rootfs" >&2 + exit 1 + ;; + esac + echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common + # Store model assertion in top dir to get it picked up later as a build artifact + env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 model="$MODEL" brand-id=canonical > livecd."$PROJECT".model-assertion + echo "Configured ubuntu-image for the following model assertion:" + cat livecd."$PROJECT".model-assertion + echo "----------------------------------------------------------" + # Fake finished configuration for lb build + mkdir -p .build + touch .build/config + exit 0 + ;; + *) case $PROJECT in ubuntu-server|ubuntu-touch|ubuntu-touch-custom)