From: Lars Wirzenius Date: Sat, 6 Apr 2013 08:59:43 +0000 (+0100) Subject: Erf, undo the removal of mbr X-Git-Url: https://git.siccegge.de//index.cgi?a=commitdiff_plain;h=5eed09212dabcd4f1f374dbc6595b9219729d59e;p=forks%2Fvmdebootstrap.git Erf, undo the removal of mbr Faulty testing on my part. --- 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]