diff options
author | Neil Williams <codehelp@debian.org> | 2015-09-08 22:59:41 +0100 |
---|---|---|
committer | Neil Williams <codehelp@debian.org> | 2015-09-08 22:59:41 +0100 |
commit | 1001c3b9f14f139a1e46d442dd39acde348c9264 (patch) | |
tree | 62ce898b570c0a3db918c592e9b12674a1255944 /vmdebootstrap/uefi.py | |
parent | 9f427b60af348bb7e9f5789275fd03529eb8a0e0 (diff) | |
download | vmdebootstrap-1001c3b9f14f139a1e46d442dd39acde348c9264.tar.gz |
move the uefi settings checks into the helper
Diffstat (limited to 'vmdebootstrap/uefi.py')
-rw-r--r-- | vmdebootstrap/uefi.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/vmdebootstrap/uefi.py b/vmdebootstrap/uefi.py index 08da7c7..147405a 100644 --- a/vmdebootstrap/uefi.py +++ b/vmdebootstrap/uefi.py @@ -44,6 +44,34 @@ class Uefi(Base): super(Uefi, self).__init__() self.bootdir = None + def check_settings(self): + 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') + if self.settings['arch'] in arch_table and\ + arch_table[self.settings['arch']]['exclusive'] and\ + not self.settings['use-uefi']: + raise cliapp.AppException( + 'Only UEFI is supported on %s' % self.settings['arch']) + elif self.settings['use-uefi'] and self.settings['arch'] not in arch_table: + raise cliapp.AppException( + '%s is not a supported UEFI architecture' % self.settings['arch']) + if self.settings['use-uefi'] and ( + self.settings['bootsize'] or + self.settings['bootoffset']): + raise cliapp.AppException( + 'A separate boot partition is not supported with UEFI') + + if self.settings['use-uefi'] and not self.settings['grub']: + raise cliapp.AppException( + '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 self.settings['arch'] != 'amd64' and self.settings['use-uefi']: + raise cliapp.AppException( + 'Only amd64 supports UEFI in Wheezy') + def efi_packages(self): packages = [] if not self.settings['use-uefi'] or\ |