mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-02-13 22:28:27 +00:00
Move buildd image building to binary hooks
This commit is contained in:
parent
6e9d7f35ca
commit
6c9fc6f3ec
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -2,6 +2,7 @@ livecd-rootfs (2.408.43) UNRELEASED; urgency=medium
|
||||
|
||||
* Add a buildd subproject.
|
||||
* Add a LXD image to builds for the buildd subproject.
|
||||
* Move buildd image building to binary hooks.
|
||||
|
||||
-- Colin Watson <cjwatson@ubuntu.com> Mon, 14 Jan 2019 17:45:38 +0000
|
||||
|
||||
|
@ -17,7 +17,7 @@ fi
|
||||
|
||||
. config/functions
|
||||
|
||||
# Link output files somewhere BuildLiveCD will be able to find them.
|
||||
# Link output files somewhere launchpad-buildd will be able to find them.
|
||||
PREFIX="livecd.$PROJECT${SUBARCH:+-$SUBARCH}"
|
||||
|
||||
if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then
|
||||
@ -405,28 +405,6 @@ if [ -e "binary/$INITFS/filesystem.dir" ]; then
|
||||
chmod 644 "$PREFIX.rootfs.tar.gz"
|
||||
elif [ -e binary-tar.tar.gz ]; then
|
||||
cp -a binary-tar.tar.gz "$PREFIX.rootfs.tar.gz"
|
||||
elif [ "$SUBPROJECT" = buildd ]; then
|
||||
# A few things (launchpad-buildd, sbuild-launchpad-chroot) rely on
|
||||
# the top-level directory being "chroot-autobuild", so we have to do
|
||||
# this ourselves.
|
||||
# gzip was chosen for fastest decompression speed: it decompresses
|
||||
# buildd chroots about twice as fast as xz and about five times as
|
||||
# fast as bzip2.
|
||||
tar --transform='s,^binary,chroot-autobuild,' \
|
||||
--sort=name --numeric-owner --xattrs \
|
||||
-czf "$PREFIX.rootfs.tar.gz" binary
|
||||
|
||||
# Build a LXD image as well, which is preferable for some build types.
|
||||
TMPDIR="$(mktemp -d)"
|
||||
config/make-lxd-metadata "${LB_DISTRIBUTION%-*}" "$ARCH" >"$TMPDIR/metadata.yaml"
|
||||
tar --numeric-owner -cf "$PREFIX.lxd.tar" -C "$TMPDIR" metadata.yaml
|
||||
rm -rf "$TMPDIR"
|
||||
# When using the combined metadata/rootfs form, the rootfs must be
|
||||
# under rootfs/ rather than under chroot-autobuild/.
|
||||
tar --transform='s,^binary,rootfs,' \
|
||||
--sort=name --numeric-owner \
|
||||
-rf "$PREFIX.lxd.tar" binary
|
||||
gzip -9 "$PREFIX.lxd.tar"
|
||||
fi
|
||||
|
||||
if [ "$PROJECT:${SUBPROJECT:-}" = "ubuntu-core:system-image" ]; then
|
||||
|
10
live-build/buildd/hooks/50-buildd-tar.binary
Executable file
10
live-build/buildd/hooks/50-buildd-tar.binary
Executable file
@ -0,0 +1,10 @@
|
||||
#! /bin/sh
|
||||
# A few things (launchpad-buildd, sbuild-launchpad-chroot) rely on the
|
||||
# top-level directory being "chroot-autobuild", so we have to do this
|
||||
# ourselves.
|
||||
set -e
|
||||
|
||||
# gzip was chosen for fastest decompression speed: it decompresses buildd
|
||||
# chroots about twice as fast as xz and about five times as fast as bzip2.
|
||||
tar --transform='s,^binary,chroot-autobuild,' --sort=name --numeric-owner \
|
||||
-czf "livecd.$PROJECT.rootfs.tar.gz" binary
|
16
live-build/buildd/hooks/51-buildd-lxd.binary
Executable file
16
live-build/buildd/hooks/51-buildd-lxd.binary
Executable file
@ -0,0 +1,16 @@
|
||||
#! /bin/sh
|
||||
# Some build types prefer a LXD image over a traditional chroot tarball.
|
||||
set -e
|
||||
|
||||
. config/bootstrap
|
||||
|
||||
TMPDIR="$(mktemp -d)"
|
||||
config/make-lxd-metadata "${LB_DISTRIBUTION%-*}" "$ARCH" \
|
||||
>"$TMPDIR/metadata.yaml"
|
||||
tar --numeric-owner -cf "livecd.$PROJECT.lxd.tar" -C "$TMPDIR" metadata.yaml
|
||||
rm -rf "$TMPDIR"
|
||||
# When using the combined metadata/rootfs form, the rootfs must be under
|
||||
# rootfs/ rather than under chroot-autobuild/.
|
||||
tar --transform='s,^binary,rootfs,' --sort=name --numeric-owner \
|
||||
-rf "livecd.$PROJECT.lxd.tar" binary
|
||||
gzip -9 "livecd.$PROJECT.lxd.tar"
|
Loading…
x
Reference in New Issue
Block a user