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