From 8a3e52019315a00f8fee222ecdc803a914608068 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Fri, 16 Jun 2017 11:08:11 +0100 Subject: Add support for layer extraction in qcow2 images Add support for extracting image layers in qcow2 format. Avoid requirement for root privileges by using libguestfs. - Use "qemu-img" to create backing chain which links the layers. - Use "virt-format" to format the qcow2 image. - Use "virt-tar-in" to extract each tar archives in the qcow2 image. --- virt-bootstrap.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'virt-bootstrap.py') diff --git a/virt-bootstrap.py b/virt-bootstrap.py index ee92f92..d5021c8 100755 --- a/virt-bootstrap.py +++ b/virt-bootstrap.py @@ -56,6 +56,7 @@ def get_source(args): return clazz(url, args.username, args.password, + args.format, args.not_secure, args.no_cache) except Exception: @@ -112,7 +113,9 @@ def main(): help=_("Root password to set in the created rootfs")) parser.add_argument("--no-cache", action="store_true", help=_("Do not store downloaded Docker images")) - # TODO add --format [qcow2,dir] parameter + parser.add_argument("-f", "--format", default='dir', + choices=['dir', 'qcow2'], + help=_("Format to be used for the root filesystem")) # TODO add UID / GID mapping parameters try: -- cgit