Merge lp:~rbalint/livecd-rootfs/use-ubuntu-image into lp:livecd-rootfs

Proposed by Balint Reczey
Status: Merged
Merged at revision: 1469
Proposed branch: lp:~rbalint/livecd-rootfs/use-ubuntu-image
Merge into: lp:livecd-rootfs
Diff against target: 135 lines (+74/-10)
4 files modified
debian/changelog (+5/-1)
debian/control (+19/-1)
live-build/auto/build (+11/-0)
live-build/auto/config (+39/-8)
To merge this branch: bzr merge lp:~rbalint/livecd-rootfs/use-ubuntu-image
Reviewer Review Type Date Requested Status
Steve Langasek Needs Information
Adam Conrad Pending
Review via email: mp+322323@code.launchpad.net

Description of the change

  * 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

To post a comment you must log in.
Revision history for this message
Balint Reczey (rbalint) wrote :

Changed Adam's original code a little to avoid pkg installation during script runs.

Maybe I can add this to autopkgtests, it got merged now.

Revision history for this message
Adam Conrad (adconrad) wrote :

Not depending on ubuntu-image was an intentional choice, to avoid livecd-rootfs requiring a massive dep chain for *all* builds, when only a small subset actually use those bits.

Revision history for this message
Balint Reczey (rbalint) wrote :

I guessed so but changing the system in lb config (any config step) is so bad I pushed them to dependencies instead.
An other option could be adding them to Suggest: and raising error when the tools are not present.

Revision history for this message
Balint Reczey (rbalint) wrote :

Pulling in a few more dependencies is really negligible both time- and resources-wise compared to a single lb build run thus making the package cleaner is really worth it here.

Revision history for this message
Balint Reczey (rbalint) wrote :

I like the diversion part less and less, I'll give the patch a try without it tomorrow.

1468. By Steve Langasek

Merge lp:~rbalint/livecd-rootfs/livecd-rootfs-autopkgtest-fix, w/ modifications

Only call sync, don't wrap kpartx and parse its output (doesn't appear to be
needed)

Revision history for this message
Adam Conrad (adconrad) :
Revision history for this message
Balint Reczey (rbalint) :
1469. By Balint Reczey

Sort and list dependencies nicely

1470. By Balint Reczey

ddd

1471. By Balint Reczey

Require PROJECT environment to be set for lb build

1472. By Balint Reczey

Allow overriding IMAGEFORMAT even for ubuntu-cpc and ubuntu-server

1473. By Balint Reczey

Optionally use ubuntu-image for building snap based images

1474. By Balint Reczey

Update changelog

Revision history for this message
Steve Langasek (vorlon) :
review: Needs Information
Revision history for this message
Balint Reczey (rbalint) :

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-04-25 18:46:26 +0000
3+++ debian/changelog 2017-04-28 20:40:28 +0000
4@@ -5,8 +5,12 @@
5 comparison prior to aa-series (LP: #1681548)
6 * live-build/ubuntu-cpc/hooks/999-extras.binary: Exit on first failure
7
8- [Balint Reczey]
9+ [ Balint Reczey ]
10 * sync before calling kpartx to let writing to loop devices finish
11+ * Sort and list dependencies nicely
12+ * Require PROJECT environment to be set for lb build
13+ * Allow overwriting IMAGEFORMAT even for ubuntu-cpc and ubuntu-server
14+ * Optionally use ubuntu-image for building snap based images
15
16 -- Steve Langasek <steve.langasek@ubuntu.com> Thu, 13 Apr 2017 10:38:04 -0700
17
18
19=== modified file 'debian/control'
20--- debian/control 2015-02-04 12:32:24 +0000
21+++ debian/control 2017-04-28 20:40:28 +0000
22@@ -8,7 +8,25 @@
23
24 Package: livecd-rootfs
25 Architecture: any
26-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
27+Depends: ${misc:Depends},
28+ android-tools-fsutils [armhf],
29+ apt-utils,
30+ debootstrap,
31+ e2fsprogs,
32+ germinate (>= 1.25.1),
33+ gnupg,
34+ grep-dctrl,
35+ live-build (>= 3.0~a57-1ubuntu12~),
36+ lsb-release,
37+ lzma,
38+ procps,
39+ python-minimal | python,
40+ python3-software-properties,
41+ rsync,
42+ snapd,
43+ squashfs-tools (>= 1:3.3-1),
44+ sudo,
45+ ubuntu-image
46 Suggests: partimage
47 Breaks: ubuntu-defaults-builder (<< 0.32)
48 Description: construction script for the livecd rootfs
49
50=== modified file 'live-build/auto/build'
51--- live-build/auto/build 2016-08-20 04:56:33 +0000
52+++ live-build/auto/build 2017-04-28 20:40:28 +0000
53@@ -10,6 +10,17 @@
54 Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
55 Set_defaults
56
57+if [ -z "${PROJECT:-}" ]; then
58+ echo "PROJECT environment variable has to be set" >&2
59+ exit 1
60+fi
61+
62+if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then
63+ # Use ubuntu-image instead of live-build
64+ env SNAPPY_STORE_NO_CDN=1 ubuntu-image -o livecd."$PROJECT".img livecd."$PROJECT".model-assertion
65+ exit 0
66+fi
67+
68 # Setup cleanup function
69 Setup_cleanup
70
71
72=== modified file 'live-build/auto/config'
73--- live-build/auto/config 2017-04-12 01:44:25 +0000
74+++ live-build/auto/config 2017-04-28 20:40:28 +0000
75@@ -104,14 +104,16 @@
76 BINARY_HOOKS="${BINARY_HOOKS:+$BINARY_HOOKS }$1"
77 }
78
79-case $PROJECT:$SUBPROJECT in
80- ubuntu-cpc:*)
81- IMAGEFORMAT=ext4
82- ;;
83- ubuntu-server:live)
84- IMAGEFORMAT=plain
85- ;;
86-esac
87+if [ -z "${IMAGEFORMAT:-}" ]; then
88+ case $PROJECT:$SUBPROJECT in
89+ ubuntu-cpc:*)
90+ IMAGEFORMAT=ext4
91+ ;;
92+ ubuntu-server:live)
93+ IMAGEFORMAT=plain
94+ ;;
95+ esac
96+fi
97
98 case $IMAGEFORMAT in
99 ext2|ext3|ext4)
100@@ -145,6 +147,35 @@
101 esac
102 ;;
103
104+ ubuntu-image)
105+ case "$ARCH+${SUBARCH:-}" in
106+ amd64+*)
107+ MODEL=pc-amd64 ;;
108+ i386+*)
109+ MODEL=pc-i386 ;;
110+ arm64+snapdragon)
111+ MODEL=dragonboard ;;
112+ armhf+raspi2)
113+ MODEL=pi2 ;;
114+ armhf+raspi3)
115+ MODEL=pi3 ;;
116+ *)
117+ echo "Model $ARCH+${SUBARCH:-} unknown to livecd-rootfs" >&2
118+ exit 1
119+ ;;
120+ esac
121+ echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common
122+ # Store model assertion in top dir to get it picked up later as a build artifact
123+ env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 model="$MODEL" brand-id=canonical > livecd."$PROJECT".model-assertion
124+ echo "Configured ubuntu-image for the following model assertion:"
125+ cat livecd."$PROJECT".model-assertion
126+ echo "----------------------------------------------------------"
127+ # Fake finished configuration for lb build
128+ mkdir -p .build
129+ touch .build/config
130+ exit 0
131+ ;;
132+
133 *)
134 case $PROJECT in
135 ubuntu-server|ubuntu-touch|ubuntu-touch-custom)

Subscribers

People subscribed via source and target branches