summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2023-04-29 11:11:21 +0300
committerLars Wirzenius <liw@liw.fi>2023-04-29 11:11:21 +0300
commit8fc51d2777af03e620c3da4b1d582d7eaf6c1070 (patch)
tree2a442bb5fdc7ed84111ad17e08b8e8d1d64d399a
parent0eaa66c2be1d889abd86ba2beddb2a38ede23796 (diff)
downloadvmdb2-8fc51d2777af03e620c3da4b1d582d7eaf6c1070.tar.gz
feat(check-one): --dump, --mklabel
Sponsored-by: author
-rwxr-xr-xcheck-one11
1 files changed, 10 insertions, 1 deletions
diff --git a/check-one b/check-one
index d44da05..3062778 100755
--- a/check-one
+++ b/check-one
@@ -11,17 +11,21 @@ import yaml
class Config:
def __init__(self):
p = argparse.ArgumentParser()
+ p.add_argument("--dump", action="store_true")
p.add_argument("--vmdb", action="store")
p.add_argument("--tarball-directory", action="store", default=".")
p.add_argument("--debian-release", action="store")
p.add_argument("--grub", action="store", choices=["bios", "uefi"])
+ p.add_argument("--mklabel", action="store", choices=["msdos", "gpt"])
p.add_argument("--arch", action="store")
args = p.parse_args()
+ self.dump = args.dump
self.tarball_directory = args.tarball_directory
self.vmdb_filename = args.vmdb
self.vmdb = yaml.safe_load(open(self.vmdb_filename))
+ mklabel = self._step("mklabel")
debootstrap = self._step("debootstrap")
grub = self._step("grub")
@@ -29,6 +33,8 @@ class Config:
debootstrap["debootstrap"] = args.debian_release
if args.arch is not None:
debootstrap["arch"] = args.arch
+ if args.mklabel is not None:
+ mklabel["mklabel"] = args.mklabel
if args.grub is not None:
grub["grub"] = args.grub
@@ -96,7 +102,10 @@ def run_vmdb2(config):
def main():
config = Config()
- run_vmdb2(config)
+ if config.dump:
+ config.write_vmdb("/dev/stdout")
+ else:
+ run_vmdb2(config)
main()