mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Add restriction on partition type for HVM AMIs
This commit is contained in:
parent
2ebacf6a3a
commit
612fe46186
1 changed files with 12 additions and 3 deletions
|
@ -37,10 +37,19 @@ def validate_manifest(data, validator, error):
|
||||||
else:
|
else:
|
||||||
validator(data, os.path.join(os.path.dirname(__file__), 'manifest-schema-s3.json'))
|
validator(data, os.path.join(os.path.dirname(__file__), 'manifest-schema-s3.json'))
|
||||||
|
|
||||||
if data['virtualization'] == 'pvm' and data['system']['bootloader'] != 'pvgrub':
|
bootloader = data['system']['bootloader']
|
||||||
|
virtualization = data['virtualization']
|
||||||
|
partition_type = data['volume']['partitions']['type']
|
||||||
|
|
||||||
|
if virtualization == 'pvm' and bootloader != 'pvgrub':
|
||||||
error('Paravirtualized AMIs only support pvgrub as a bootloader', ['system', 'bootloader'])
|
error('Paravirtualized AMIs only support pvgrub as a bootloader', ['system', 'bootloader'])
|
||||||
if data['virtualization'] == 'hvm' and data['system']['bootloader'] != 'extlinux':
|
|
||||||
|
if virtualization == 'hvm':
|
||||||
|
if bootloader != 'extlinux':
|
||||||
error('HVM AMIs only support extlinux as a bootloader', ['system', 'bootloader'])
|
error('HVM AMIs only support extlinux as a bootloader', ['system', 'bootloader'])
|
||||||
|
if bootloader == 'extlinux' and partition_type not in ['none', 'msdos']:
|
||||||
|
error('HVM AMIs booted with extlinux currently only support the `none\' or `msdos\' partition type',
|
||||||
|
['system', 'bootloader'])
|
||||||
|
|
||||||
|
|
||||||
def resolve_tasks(taskset, manifest):
|
def resolve_tasks(taskset, manifest):
|
||||||
|
|
Loading…
Add table
Reference in a new issue