Make sure we can override grub.ConfigureGrub for Azure images.

This commit is contained in:
Stephen A. Zarkos 2015-08-05 22:16:24 +00:00
parent b5a0c7df21
commit 7cb4453fe4

View file

@ -23,11 +23,13 @@ class PatchUdev(Task):
class ConfigureGrub(Task):
description = 'Change grub configuration to allow for ttyS0 output'
phase = phases.system_modification
predecessors = [grub.ConfigureGrub]
successors = [grub.InstallGrub_1_99, grub.InstallGrub_2]
@classmethod
def run(cls, info):
from bootstrapvz.common.tools import sed_i
grub_config = os.path.join(info.root, 'etc/default/grub')
sed_i(grub_config, r'^(GRUB_CMDLINE_LINUX_DEFAULT=.*)', r'GRUB_CMDLINE_LINUX_DEFAULT=""')
sed_i(grub_config, r'^(GRUB_CMDLINE_LINUX*=".*)"\s*$', r'\1console=tty0 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 rootdelay=300"')
sed_i(grub_config, r'^.*(GRUB_TIMEOUT=).*$', r'GRUB_TIMEOUT=5')