summaryrefslogtreecommitdiffstats
path: root/virt-bootstrap.py
diff options
context:
space:
mode:
authorRadostin Stoyanov <rstoyanov1@gmail.com>2017-06-16 11:08:11 +0100
committerCédric Bosdonnat <cbosdonnat@suse.com>2017-06-16 18:03:53 +0200
commit8a3e52019315a00f8fee222ecdc803a914608068 (patch)
tree2a96fc67b3a5f0b9513af30429bff233cfd7c0a8 /virt-bootstrap.py
parent9ebc936407911ee29570e05565255b8b7aaa38b2 (diff)
downloadvirt-bootstrap.git-8a3e52019315a00f8fee222ecdc803a914608068.tar.gz
virt-bootstrap.git-8a3e52019315a00f8fee222ecdc803a914608068.tar.xz
virt-bootstrap.git-8a3e52019315a00f8fee222ecdc803a914608068.zip
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.
Diffstat (limited to 'virt-bootstrap.py')
-rwxr-xr-xvirt-bootstrap.py5
1 files changed, 4 insertions, 1 deletions
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: