summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-04-06 09:59:43 +0100
committerLars Wirzenius <liw@liw.fi>2013-04-06 09:59:43 +0100
commit5eed09212dabcd4f1f374dbc6595b9219729d59e (patch)
treedd0b3b3b4a13422adbd4025388f7d64bb306e101
parent86e9ccdb20dea2645a8efe4359fd5d125159872a (diff)
downloadvmdebootstrap-5eed09212dabcd4f1f374dbc6595b9219729d59e.tar.gz
Erf, undo the removal of mbr
Faulty testing on my part.
-rw-r--r--README1
-rwxr-xr-xvmdebootstrap7
2 files changed, 7 insertions, 1 deletions
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]