summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/vmdebootstrap8
-rw-r--r--vmdebootstrap/uefi.py4
2 files changed, 7 insertions, 5 deletions
diff --git a/bin/vmdebootstrap b/bin/vmdebootstrap
index b5f60ef..210b94c 100755
--- a/bin/vmdebootstrap
+++ b/bin/vmdebootstrap
@@ -101,7 +101,7 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth
'using provided program (ie binfmt handler)')
self.settings.string_list(
['debootstrapopts'],
- 'pass additional options to debootstrap'),
+ 'pass additional options to debootstrap')
self.settings.boolean(
['extlinux'], 'install extlinux?',
default=True)
@@ -212,7 +212,9 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth
'%s is not a valid Debian or Ubuntu suite or codename.'
% self.settings['distribution'])
uefi = self.handlers[Uefi.name]
- uefi.check_settings()
+ oldstable = distro.was_oldstable(datetime.date(2015, 4, 26))
+ uefi.check_settings(oldstable=oldstable)
+
if os.geteuid() != 0:
sys.exit("You need to have root privileges to run this script.")
self.start_ops()
@@ -463,7 +465,7 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth
for opt in self.settings['debootstrapopts']:
for part in opt.split(' '):
args.append('--%s' % part)
- self.logging.debug("debootstrap arguments: %s", args)
+ logging.debug("debootstrap arguments: %s", args)
args += [self.settings['distribution'],
rootdir, self.settings['mirror']]
logging.debug(" ".join(args))
diff --git a/vmdebootstrap/uefi.py b/vmdebootstrap/uefi.py
index 147405a..bf04ae8 100644
--- a/vmdebootstrap/uefi.py
+++ b/vmdebootstrap/uefi.py
@@ -44,7 +44,7 @@ class Uefi(Base):
super(Uefi, self).__init__()
self.bootdir = None
- def check_settings(self):
+ def check_settings(self, oldstable=False):
if not self.settings['use-uefi'] and self.settings['esp-size'] != 5242880:
raise cliapp.AppException(
'You must specify use-uefi for esp-size to have effect')
@@ -67,7 +67,7 @@ class Uefi(Base):
'UEFI without Grub is not supported.')
# wheezy (which became oldstable on 04/25/2015) only had amd64 uefi
- if distro.was_oldstable(datetime.date(2015, 4, 26)):
+ if oldstable:
if self.settings['arch'] != 'amd64' and self.settings['use-uefi']:
raise cliapp.AppException(
'Only amd64 supports UEFI in Wheezy')