diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 0000000..8e991bb --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,14 @@ +- job: + name: generate-test-images + parent: tox + description: | + Build sample images with "tox" + vars: + tox_envlist: generate +- project: + check: + jobs: + - generate-test-images + gate: + jobs: + - generate-test-images diff --git a/README b/README new file mode 100644 index 0000000..ab65a6f --- /dev/null +++ b/README @@ -0,0 +1,10 @@ +This repo contains instructions and scripts for a variety of sample image +formats. The images are described in manifest.yaml and generated using the +generate.py script. + +Usage: +``` +$ tox -e generate +``` + +Images will (by default) be created in `images/`. diff --git a/bindep.txt b/bindep.txt new file mode 100644 index 0000000..736258e --- /dev/null +++ b/bindep.txt @@ -0,0 +1,5 @@ +mkisofs [platform:rpm] +genisoimage [platform:dpkg] +parted +qemu-img [platform:rpm] +qemu-utils [platform:dpkg] diff --git a/generate.py b/generate.py new file mode 100755 index 0000000..34ed9a9 --- /dev/null +++ b/generate.py @@ -0,0 +1,99 @@ +#!/usr/bin/python + +import argparse +import logging +import os +import struct +import subprocess +import sys + +import yaml + +LOG = logging.getLogger('generate') + + +def footerify_vmdk(fn): + """Convert a monolithicSparse to use a footer instead of just a header""" + GD_AT_END = 0xffffffffffffffff + + with open(fn, 'rb+') as f: + header = f.read(512) + # Write the "expect a footer" sentinel into the header + f.seek(56) + f.write(struct.pack('