[Vmdebootstrap-devel] Bug#768870: vmdebootstrap: Should extlinux be installed if grub installation succeed?
Petter Reinholdtsen
pere at hungry.com
Sun Nov 9 19:46:53 UTC 2014
Package: vmdebootstrap
Version: 0.4-1
Tags: patch
At the moment, extlinux is configured also when grub installation is
used. Is this intended? The comment in the code ("failed ... using
extlinux" make me suspect that the intention was to only install
extlinux if grub installation failed. If so, here is a patch I believe
will make this the reality.
diff --git a/vmdebootstrap b/vmdebootstrap
index 126475f..8fba09b 100755
--- a/vmdebootstrap
+++ b/vmdebootstrap
@@ -482,15 +482,18 @@ class VmDebootstrap(cliapp.Application):
'%s' % os.path.join(rootdir, 'proc')])
self.runcmd(['mount', '/sys', '-t', 'sysfs', '-obind',
'%s' % os.path.join(rootdir, 'sys')])
+ failed = True
try:
self.runcmd(['chroot', rootdir, 'update-grub'])
self.runcmd(['chroot', rootdir, 'grub-install', install_dev])
+ failed = False
except cliapp.AppException as e:
self.message("Failed. Is grub2-common installed? Using extlinux.")
self.runcmd(['umount', os.path.join(rootdir, 'sys')])
self.runcmd(['umount', os.path.join(rootdir, 'proc')])
self.runcmd(['umount', os.path.join(rootdir, 'dev')])
- self.install_extlinux(rootdev, rootdir)
+ if failed:
+ self.install_extlinux(rootdev, rootdir)
def install_extlinux(self, rootdev, rootdir):
if not os.path.exists("/usr/bin/extlinux"):
--
Happy hacking
Petter Reinholdtsen
More information about the Vmdebootstrap-devel
mailing list