From b582bac853a7c9f45634b5ec3ebd71be6f35305b Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Wed, 8 Apr 2015 21:37:29 +0200 Subject: [PATCH] Generally deny installing grub on squeeze --- bootstrapvz/base/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bootstrapvz/base/__init__.py b/bootstrapvz/base/__init__.py index be224ce..39d88a1 100644 --- a/bootstrapvz/base/__init__.py +++ b/bootstrapvz/base/__init__.py @@ -16,7 +16,15 @@ def validate_manifest(data, validator, error): schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml')) validator(data, schema_path) + from bootstrapvz.common.tools import get_codename + codename = get_codename(data['system']['release']) + # Check the bootloader/partitioning configuration. # Doing this via the schema is a pain and does not output a useful error message. - if data['system']['bootloader'] == 'grub' and data['volume']['partitions']['type'] == 'none': + if data['system']['bootloader'] == 'grub': + + if data['volume']['partitions']['type'] == 'none': error('Grub cannot boot from unpartitioned disks', ['system', 'bootloader']) + + if codename == 'squeeze': + error('Grub installation on squeeze is not supported', ['system', 'bootloader'])