From b616075f47715a91db691dc5c5b79b76d7a91f77 Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Fri, 28 Apr 2017 22:26:51 +0200 Subject: [PATCH 1/6] Sort and list dependencies nicely --- debian/control | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 52e4d3b2..dd6c42e6 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,21 @@ 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, squashfs-tools (>= 1:3.3-1), + python-minimal | python, + python3-software-properties, + rsync Suggests: partimage Breaks: ubuntu-defaults-builder (<< 0.32) Description: construction script for the livecd rootfs From cf20be3266ad757e58fce992f0c5b6cfaeae295f Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Fri, 28 Apr 2017 22:27:35 +0200 Subject: [PATCH 2/6] ddd --- debian/control | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index dd6c42e6..4f19c174 100644 --- a/debian/control +++ b/debian/control @@ -19,10 +19,11 @@ Depends: ${misc:Depends}, live-build (>= 3.0~a57-1ubuntu12~), lsb-release, lzma, - procps, squashfs-tools (>= 1:3.3-1), + procps, python-minimal | python, python3-software-properties, - rsync + rsync, + squashfs-tools (>= 1:3.3-1) Suggests: partimage Breaks: ubuntu-defaults-builder (<< 0.32) Description: construction script for the livecd rootfs From 44f9dceeb4786b42e42fb2ebed46ed4c4b81a436 Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Fri, 28 Apr 2017 22:27:50 +0200 Subject: [PATCH 3/6] Require PROJECT environment to be set for lb build --- live-build/auto/build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/live-build/auto/build b/live-build/auto/build index 103b5005..5451f42a 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -10,6 +10,11 @@ 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 + # Setup cleanup function Setup_cleanup From f807c3703a67b70a1f52ec585e0a252ca9df742a Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Fri, 28 Apr 2017 22:27:50 +0200 Subject: [PATCH 4/6] Allow overriding IMAGEFORMAT even for ubuntu-cpc and ubuntu-server --- live-build/auto/config | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/live-build/auto/config b/live-build/auto/config index 77c33db4..4f1feb52 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) From 0109d5304e393f8a5e33f3f8e9f7582785f69836 Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Fri, 28 Apr 2017 22:30:18 +0200 Subject: [PATCH 5/6] Optionally use ubuntu-image for building snap based images --- debian/control | 5 ++++- live-build/auto/build | 6 ++++++ live-build/auto/config | 29 +++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 4f19c174..9ecc7dbe 100644 --- a/debian/control +++ b/debian/control @@ -23,7 +23,10 @@ Depends: ${misc:Depends}, python-minimal | python, python3-software-properties, rsync, - squashfs-tools (>= 1:3.3-1) + 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 5451f42a..cfe00bdd 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -15,6 +15,12 @@ if [ -z "${PROJECT:-}" ]; then 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 4f1feb52..2f8decec 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -147,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) From 63188748c0a6eccafc3415587d3234564e9b66c9 Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Fri, 28 Apr 2017 22:30:22 +0200 Subject: [PATCH 6/6] Update changelog --- debian/changelog | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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