parent
c009af34ff
commit
3298cbd5e3
@ -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
|
@ -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"
|
@ -0,0 +1,49 @@
|
||||
#! /usr/bin/python3
|
||||
|
||||
"""Make a metadata.yaml file for a LXD image."""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import sys
|
||||
import time
|
||||
|
||||
|
||||
# Map dpkg architecture names to LXD architecture names.
|
||||
lxd_arches = {
|
||||
"amd64": "x86_64",
|
||||
"arm64": "aarch64",
|
||||
"armhf": "armv7l",
|
||||
"i386": "i686",
|
||||
"powerpc": "ppc",
|
||||
"ppc64el": "ppc64le",
|
||||
"s390x": "s390x",
|
||||
}
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("series", help="Ubuntu series name")
|
||||
parser.add_argument("architecture", help="Ubuntu architecture name")
|
||||
args = parser.parse_args()
|
||||
|
||||
metadata = {
|
||||
"architecture": lxd_arches[args.architecture],
|
||||
"creation_date": int(time.time()),
|
||||
"properties": {
|
||||
"os": "Ubuntu",
|
||||
"series": args.series,
|
||||
"architecture": args.architecture,
|
||||
"description": "Ubuntu buildd %s %s" % (
|
||||
args.series, args.architecture),
|
||||
},
|
||||
}
|
||||
|
||||
# Encoding this as JSON is good enough, and saves pulling in a YAML
|
||||
# library dependency.
|
||||
json.dump(
|
||||
metadata, sys.stdout, sort_keys=True, indent=4, separators=(",", ": "),
|
||||
ensure_ascii=False)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Reference in new issue