From dab1dfa93031a43d183878b92caff6a7e6d68dc3 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Mon, 31 Mar 2014 14:16:16 +0200 Subject: [PATCH] Add console output to serial when using grub --- common/task_sets.py | 2 +- common/tasks/boot.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/common/task_sets.py b/common/task_sets.py index 8af0ae7..e499e34 100644 --- a/common/task_sets.py +++ b/common/task_sets.py @@ -74,7 +74,7 @@ locale_set = [locale.LocaleBootstrapPackage, ] -bootloader_set = {'grub': [boot.AddGrubPackage, boot.InstallGrub], +bootloader_set = {'grub': [boot.AddGrubPackage, boot.ConfigureGrub, boot.InstallGrub], 'extlinux': [boot.AddExtlinuxPackage, boot.InstallExtLinux], } diff --git a/common/tasks/boot.py b/common/tasks/boot.py index 271598f..6149ace 100644 --- a/common/tasks/boot.py +++ b/common/tasks/boot.py @@ -44,6 +44,20 @@ class AddGrubPackage(Task): info.packages.add('grub-pc') +class ConfigureGrub(Task): + description = 'Configuring grub' + phase = phases.system_modification + predecessors = [filesystem.FStab] + + @classmethod + def run(cls, info): + from common.tools import sed_i + grub_def = os.path.join(info.root, 'etc/default/grub') + sed_i(grub_def, '^#GRUB_TERMINAL=console', 'GRUB_TERMINAL=console') + sed_i(grub_def, '^GRUB_CMDLINE_LINUX_DEFAULT="quiet"', + 'GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0"') + + class InstallGrub(Task): description = 'Installing grub' phase = phases.system_modification