HVM AMIs now working with extlinux

This commit is contained in:
Anders Ingemann 2014-01-19 15:57:54 +01:00
parent 9ee318e3d9
commit 03db9823f9
2 changed files with 13 additions and 2 deletions

View file

@ -32,7 +32,7 @@ def validate_manifest(data, validator, error):
from common.bytes import Bytes
if data['volume']['backing'] == 'ebs':
volume_size = Bytes('2MiB') if data['volume']['partitions']['type'] == 'msdos' else Bytes(0)
volume_size = Bytes(0)
for key, partition in data['volume']['partitions'].iteritems():
if key != 'type':
volume_size += Bytes(partition['size'])
@ -44,8 +44,10 @@ def validate_manifest(data, validator, error):
if data['virtualization'] == 'pvm' and data['system']['bootloader'] != 'pvgrub':
error('Paravirtualized AMIs only support pvgrub as a bootloader', ['system', 'bootloader'])
if data['virtualization'] == 'hvm' and data['system']['bootloader'] != 'extlinux':
if data['virtualization'] == 'hvm' and data['system']['bootloader'] == 'pvgrub':
error('HVM AMIs only support extlinux as a bootloader', ['system', 'bootloader'])
if data['volume']['partitions']['type'] == 'none' and data['system']['bootloader'] == 'grub':
error('Grub cannot boot from unpartitioned disks', ['system', 'bootloader'])
def resolve_tasks(taskset, manifest):

View file

@ -23,6 +23,15 @@
}
}
},
"system": {
"type": "object",
"properties": {
"bootloader": {
"type": "string",
"enum": ["pvgrub", "extlinux"]
}
}
},
"volume": {
"type": "object",
"properties": {