Merge lp:~cjwatson/livecd-rootfs/buildd into lp:livecd-rootfs

Proposed by Colin Watson
Status: Merged
Merged at revision: 1697
Proposed branch: lp:~cjwatson/livecd-rootfs/buildd
Merge into: lp:livecd-rootfs
Diff against target: 256 lines (+143/-0)
16 files modified
debian/changelog (+6/-0)
live-build/auto/build (+10/-0)
live-build/auto/config (+54/-0)
live-build/buildd/hooks/00-kernel-img.chroot (+5/-0)
live-build/buildd/hooks/00-mirror.binary (+12/-0)
live-build/buildd/hooks/01-pkgbinarymangler.chroot (+10/-0)
live-build/buildd/hooks/02-user.chroot (+9/-0)
live-build/buildd/includes.chroot/etc/apt/apt.conf.d/99buildd (+2/-0)
live-build/buildd/includes.chroot/etc/apt/preferences.d/backports (+3/-0)
live-build/buildd/includes.chroot/etc/fstab (+1/-0)
live-build/buildd/includes.chroot/etc/hostname (+1/-0)
live-build/buildd/includes.chroot/etc/hosts (+9/-0)
live-build/buildd/includes.chroot/usr/local/sbin/policy-rc.d (+13/-0)
live-build/buildd/preseed/debconf.preseed (+2/-0)
live-build/buildd/preseed/man-db.preseed (+3/-0)
live-build/buildd/preseed/sun-java6.preseed (+3/-0)
To merge this branch: bzr merge lp:~cjwatson/livecd-rootfs/buildd
Reviewer Review Type Date Requested Status
Adam Conrad (community) Approve
Review via email: mp+344767@code.launchpad.net

Commit message

Add a buildd subproject.

Description of the change

This can be used for building buildd chroots. The necessary launchpad-buildd metadata dictionary is:

  {"project": "ubuntu-base", "subproject": "buildd", "image_format": "none"}

The differences from a baseline bionic amd64 chroot look sensible. I'm still working on testing this on more architectures, and we may want to backport it to earlier series eventually, but it's at least ready for initial review.

To post a comment you must log in.
lp:~cjwatson/livecd-rootfs/buildd updated
1670. By Colin Watson

Use a more generic version number.

1671. By Colin Watson

Use a public-facing mirror URL in the final buildd /etc/apt/sources.list.

1672. By Colin Watson

Sort buildd tarballs by name and use numeric user and group IDs.

1673. By Colin Watson

Fix sedding of /etc/apt/sources.list.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

This looks OK to me but I don't know if I'm qualified for a full review. A few comments mostly about stuff I think is redundant.

lp:~cjwatson/livecd-rootfs/buildd updated
1674. By Colin Watson

Remove some unnecessary buildd configuration.

1675. By Colin Watson

Move some buildd hooks to includes.chroot.

1676. By Colin Watson

Explicitly order remaining buildd hooks.

Revision history for this message
Colin Watson (cjwatson) wrote :

Thanks - your suggestions all seem reasonable, and I've applied them all.

lp:~cjwatson/livecd-rootfs/buildd updated
1677. By Colin Watson

Add init to buildd chroots, since it's needed for LXD-based builds.

1678. By Colin Watson

Add an empty /etc/resolv.conf to buildd chroots.

We don't want the symlink to /run/systemd/resolve/stub-resolv.conf, and
launchpad-buildd will inject its own version if it doesn't get confused by a
symlink.

1679. By Colin Watson

We know cosmic's name now.

1680. By Colin Watson

Merge trunk.

1681. By Colin Watson

Generate tar file with --xattrs.

1682. By Colin Watson

Merge trunk.

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

LGTM on the Nth pass of reviewing this, please make with the merging and uploading.

review: Approve

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 2018-09-18 10:15:23 +0000
3+++ debian/changelog 2018-09-19 14:24:39 +0000
4@@ -1,3 +1,9 @@
5+livecd-rootfs (2.538) UNRELEASED; urgency=medium
6+
7+ * Add a buildd subproject.
8+
9+ -- Colin Watson <cjwatson@ubuntu.com> Wed, 19 Sep 2018 16:19:58 +0200
10+
11 livecd-rootfs (2.537) cosmic; urgency=medium
12
13 * Minimize the number of manually installed packages in images by marking
14
15=== modified file 'live-build/auto/build'
16--- live-build/auto/build 2018-09-18 09:44:06 +0000
17+++ live-build/auto/build 2018-09-19 14:24:39 +0000
18@@ -497,6 +497,16 @@
19 chmod 644 "$PREFIX.rootfs.tar.gz"
20 elif [ -e binary-tar.tar.gz ]; then
21 cp -a binary-tar.tar.gz "$PREFIX.rootfs.tar.gz"
22+elif [ "$SUBPROJECT" = buildd ]; then
23+ # A few things (launchpad-buildd, sbuild-launchpad-chroot) rely on
24+ # the top-level directory being "chroot-autobuild", so we have to do
25+ # this ourselves.
26+ # gzip was chosen for fastest decompression speed: it decompresses
27+ # buildd chroots about twice as fast as xz and about five times as
28+ # fast as bzip2.
29+ tar --transform='s,^binary,chroot-autobuild,' \
30+ --sort=name --numeric-owner --xattrs \
31+ -czf "$PREFIX.rootfs.tar.gz" binary
32 fi
33
34 if [ "$PROJECT:${SUBPROJECT:-}" = "ubuntu-core:system-image" ]; then
35
36=== modified file 'live-build/auto/config'
37--- live-build/auto/config 2018-08-17 00:01:27 +0000
38+++ live-build/auto/config 2018-09-19 14:24:39 +0000
39@@ -642,6 +642,54 @@
40 ;;
41 esac
42
43+case $SUBPROJECT in
44+ buildd)
45+ OPTS="${OPTS:+$OPTS }--archive-areas main"
46+ COMPONENTS='main restricted universe multiverse'
47+ OPTS="${OPTS:+$OPTS }--apt-recommends false"
48+ OPTS="${OPTS:+$OPTS }--apt-secure false"
49+ OPTS="${OPTS:+$OPTS }--parent-mirror-binary ${MIRROR}"
50+ # XXX cjwatson 2018-04-27: We need to work out how to make
51+ # this conditional so that we can do things like building
52+ # buildd chroots with -updates. This probably involves
53+ # either extending the PROPOSED hack or fixing the strange
54+ # way that SUITE is in fact a series; in either case it's
55+ # likely to involve work both here and in launchpad-buildd.
56+ OPTS="${OPTS:+$OPTS }--security false --volatile false"
57+
58+ add_package install adduser
59+ add_package install policyrcd-script-zg2
60+ add_package install pkgbinarymangler
61+ add_package install ca-certificates
62+ add_package install gpg
63+ add_package install gpg-agent
64+ case $SUITE in
65+ precise|trusty|xenial)
66+ # no longer needed in >= artful
67+ add_package install pkg-create-dbgsym
68+ # no longer needed in >= bionic
69+ add_package install apt-transport-https
70+ # no longer needed in >= cosmic
71+ add_package install tzdata
72+ ;;
73+ artful)
74+ # no longer needed in >= bionic
75+ add_package install apt-transport-https
76+ # no longer needed in >= cosmic
77+ add_package install tzdata
78+ ;;
79+ bionic)
80+ # no longer needed in >= cosmic
81+ add_package install tzdata
82+ ;;
83+ esac
84+ add_package install fakeroot
85+ add_package install build-essential
86+ # Needed for LXD-based builds.
87+ add_package install init
88+ ;;
89+esac
90+
91 # we'll expand the base seed given here according to the STRUCTURE file, and
92 # then look in all of the seeds found to see which snaps are seeded
93 case $PROJECT:${SUBPROJECT:-} in
94@@ -946,6 +994,12 @@
95 ;;
96 esac
97
98+case $SUBPROJECT in
99+ buildd)
100+ cp -af /usr/share/livecd-rootfs/live-build/buildd/* config/
101+ ;;
102+esac
103+
104 if [ "$EXTRA_PPAS" ]; then
105 rm -f config/archives/extra-ppas.list.chroot \
106 config/archives/extra-ppas.pref.chroot \
107
108=== added directory 'live-build/buildd'
109=== added directory 'live-build/buildd/hooks'
110=== added file 'live-build/buildd/hooks/00-kernel-img.chroot'
111--- live-build/buildd/hooks/00-kernel-img.chroot 1970-01-01 00:00:00 +0000
112+++ live-build/buildd/hooks/00-kernel-img.chroot 2018-09-19 14:24:39 +0000
113@@ -0,0 +1,5 @@
114+#! /bin/sh
115+set -e
116+
117+# At one point, kernel builds needed this.
118+echo do_initrd = Yes >>/etc/kernel-img.conf
119
120=== added file 'live-build/buildd/hooks/00-mirror.binary'
121--- live-build/buildd/hooks/00-mirror.binary 1970-01-01 00:00:00 +0000
122+++ live-build/buildd/hooks/00-mirror.binary 2018-09-19 14:24:39 +0000
123@@ -0,0 +1,12 @@
124+#! /bin/sh
125+set -e
126+
127+. config/bootstrap
128+
129+# Use a public-facing mirror URL, for the benefit of
130+# sbuild-launchpad-chroot. We deliberately do this only after live-build
131+# has run "apt-get update" for the last time, in order that
132+# /var/lib/apt/lists/ has suitable cached Packages files; this speeds up
133+# builds on buildds.
134+sed -i "s,${LB_PARENT_MIRROR_BINARY},${LB_MIRROR_BINARY},g" \
135+ binary/etc/apt/sources.list
136
137=== added file 'live-build/buildd/hooks/01-pkgbinarymangler.chroot'
138--- live-build/buildd/hooks/01-pkgbinarymangler.chroot 1970-01-01 00:00:00 +0000
139+++ live-build/buildd/hooks/01-pkgbinarymangler.chroot 2018-09-19 14:24:39 +0000
140@@ -0,0 +1,10 @@
141+#! /bin/sh
142+set -e
143+
144+# Configure pkgbinarymangler.
145+sed -i /^enable/s/false/true/ \
146+ /etc/pkgbinarymangler/maintainermangler.conf \
147+ /etc/pkgbinarymangler/striptranslations.conf || true
148+sed -i /^invalid_current/s/ignore/fail/ \
149+ /etc/pkgbinarymangler/maintainermangler.conf \
150+ /etc/pkgbinarymangler/striptranslations.conf || true
151
152=== added file 'live-build/buildd/hooks/02-user.chroot'
153--- live-build/buildd/hooks/02-user.chroot 1970-01-01 00:00:00 +0000
154+++ live-build/buildd/hooks/02-user.chroot 2018-09-19 14:24:39 +0000
155@@ -0,0 +1,9 @@
156+#! /bin/sh
157+set -e
158+
159+# Create the buildd user and group.
160+addgroup --gid 2501 buildd
161+adduser --system --disabled-password --gecos 'Build Daemon user' \
162+ --ingroup buildd --uid 2001 --shell /bin/bash buildd
163+mkdir -p /build/buildd
164+chown buildd:buildd /build/buildd
165
166=== added directory 'live-build/buildd/includes.chroot'
167=== added directory 'live-build/buildd/includes.chroot/etc'
168=== added directory 'live-build/buildd/includes.chroot/etc/apt'
169=== added directory 'live-build/buildd/includes.chroot/etc/apt/apt.conf.d'
170=== added file 'live-build/buildd/includes.chroot/etc/apt/apt.conf.d/99buildd'
171--- live-build/buildd/includes.chroot/etc/apt/apt.conf.d/99buildd 1970-01-01 00:00:00 +0000
172+++ live-build/buildd/includes.chroot/etc/apt/apt.conf.d/99buildd 2018-09-19 14:24:39 +0000
173@@ -0,0 +1,2 @@
174+DPkg::Options {"--force-unsafe-io";};
175+DPkg::Use-Pty "false";
176
177=== added directory 'live-build/buildd/includes.chroot/etc/apt/preferences.d'
178=== added file 'live-build/buildd/includes.chroot/etc/apt/preferences.d/backports'
179--- live-build/buildd/includes.chroot/etc/apt/preferences.d/backports 1970-01-01 00:00:00 +0000
180+++ live-build/buildd/includes.chroot/etc/apt/preferences.d/backports 2018-09-19 14:24:39 +0000
181@@ -0,0 +1,3 @@
182+Package: *
183+Pin: release a=*-backports
184+Pin-Priority: 500
185
186=== added file 'live-build/buildd/includes.chroot/etc/fstab'
187--- live-build/buildd/includes.chroot/etc/fstab 1970-01-01 00:00:00 +0000
188+++ live-build/buildd/includes.chroot/etc/fstab 2018-09-19 14:24:39 +0000
189@@ -0,0 +1,1 @@
190+/dev/root / ext2 noatime,errors=remount-ro 0 1
191
192=== added file 'live-build/buildd/includes.chroot/etc/hostname'
193--- live-build/buildd/includes.chroot/etc/hostname 1970-01-01 00:00:00 +0000
194+++ live-build/buildd/includes.chroot/etc/hostname 2018-09-19 14:24:39 +0000
195@@ -0,0 +1,1 @@
196+INVALID
197
198=== added file 'live-build/buildd/includes.chroot/etc/hosts'
199--- live-build/buildd/includes.chroot/etc/hosts 1970-01-01 00:00:00 +0000
200+++ live-build/buildd/includes.chroot/etc/hosts 2018-09-19 14:24:39 +0000
201@@ -0,0 +1,9 @@
202+127.0.0.1 localhost.localdomain localhost
203+
204+# The following lines are desirable for IPv6 capable hosts
205+::1 ip6-localhost ip6-loopback
206+fe00::0 ip6-localnet
207+ff00::0 ip6-mcastprefix
208+ff02::1 ip6-allnodes
209+ff02::2 ip6-allrouters
210+ff02::3 ip6-allhosts
211
212=== added file 'live-build/buildd/includes.chroot/etc/resolv.conf'
213=== added directory 'live-build/buildd/includes.chroot/usr'
214=== added directory 'live-build/buildd/includes.chroot/usr/local'
215=== added directory 'live-build/buildd/includes.chroot/usr/local/sbin'
216=== added file 'live-build/buildd/includes.chroot/usr/local/sbin/policy-rc.d'
217--- live-build/buildd/includes.chroot/usr/local/sbin/policy-rc.d 1970-01-01 00:00:00 +0000
218+++ live-build/buildd/includes.chroot/usr/local/sbin/policy-rc.d 2018-09-19 14:24:39 +0000
219@@ -0,0 +1,13 @@
220+#!/bin/sh
221+
222+# policy-rc.d script for chroots.
223+# Copyright (c) 2007 Peter Palfrader <peter@palfrader.org>
224+# License: <weasel> MIT, if you want one.
225+
226+while true; do
227+ case "$1" in
228+ -*) shift ;;
229+ makedev) exit 0;;
230+ *) echo "Not running services in chroot."; exit 101 ;;
231+ esac
232+done
233
234=== added directory 'live-build/buildd/preseed'
235=== added file 'live-build/buildd/preseed/debconf.preseed'
236--- live-build/buildd/preseed/debconf.preseed 1970-01-01 00:00:00 +0000
237+++ live-build/buildd/preseed/debconf.preseed 2018-09-19 14:24:39 +0000
238@@ -0,0 +1,2 @@
239+# We never want debconf interaction.
240+debconf debconf/frontend select Noninteractive
241
242=== added file 'live-build/buildd/preseed/man-db.preseed'
243--- live-build/buildd/preseed/man-db.preseed 1970-01-01 00:00:00 +0000
244+++ live-build/buildd/preseed/man-db.preseed 2018-09-19 14:24:39 +0000
245@@ -0,0 +1,3 @@
246+# Avoid unnecessary manual page database builds (see
247+# https://bugs.debian.org/554914).
248+man-db man-db/auto-update boolean false
249
250=== added file 'live-build/buildd/preseed/sun-java6.preseed'
251--- live-build/buildd/preseed/sun-java6.preseed 1970-01-01 00:00:00 +0000
252+++ live-build/buildd/preseed/sun-java6.preseed 2018-09-19 14:24:39 +0000
253@@ -0,0 +1,3 @@
254+# Pre-accept interactive EULA prompts.
255+sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true
256+sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean true

Subscribers

People subscribed via source and target branches