From 5eed09212dabcd4f1f374dbc6595b9219729d59e Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 6 Apr 2013 09:59:43 +0100 Subject: [PATCH] Erf, undo the removal of mbr Faulty testing on my part. --- README | 1 + vmdebootstrap | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README b/README index 75e6f3b..31ed67e 100644 --- a/README +++ b/README @@ -18,6 +18,7 @@ In order to use vmdebootstrap, you'll need a few things: * extlinux * qemu-img (in the qemu-utils package in Debian) * parted +* mbr * kpartx * python-cliapp (see http://liw.fi/cliapp/) diff --git a/vmdebootstrap b/vmdebootstrap index b675b22..9dd9ba5 100755 --- a/vmdebootstrap +++ b/vmdebootstrap @@ -1,5 +1,5 @@ #!/usr/bin/python -# Copyright 2011, 2012, 2013 Lars Wirzenius +# Copyright 2011, 2012 Lars Wirzenius # Copyright 2012 Codethink Limited # # This program is free software: you can redistribute it and/or modify @@ -92,6 +92,7 @@ class VmDebootstrap(cliapp.Application): if self.settings['image']: self.create_empty_image() self.partition_image() + self.install_mbr() rootdev = self.setup_kpartx() self.mkfs(rootdev) rootdir = self.mount(rootdev) @@ -164,6 +165,10 @@ class VmDebootstrap(cliapp.Application): self.runcmd(['parted', '-s', self.settings['image'], 'set', '1', 'boot', 'on']) + def install_mbr(self): + self.message('Installing MBR') + self.runcmd(['install-mbr', self.settings['image']]) + def setup_kpartx(self): out = self.runcmd(['kpartx', '-av', self.settings['image']]) devices = [line.split()[2] -- 2.39.2