diff --git a/bootstrapvz/common/tasks/grub.py b/bootstrapvz/common/tasks/grub.py index 2cc04b3..3550e5b 100644 --- a/bootstrapvz/common/tasks/grub.py +++ b/bootstrapvz/common/tasks/grub.py @@ -234,6 +234,45 @@ class DisablePNIN(Task): info.grub_config['GRUB_CMDLINE_LINUX'].append('biosdevname=0') +class DisableConsoleBlanking(Task): + description = 'Disabling Console blanking' + phase = phases.system_modification + successors = [WriteGrubConfig] + + @classmethod + def run(cls, info): + info.grub_config['GRUB_CMDLINE_LINUX'].append('consoleblank=0') + + +class SetIoScheduler(Task): + description = 'Set VM optimized IO scheduler' + phase = phases.system_modification + successors = [WriteGrubConfig] + + @classmethod + def run(cls, info): + info.grub_config['GRUB_CMDLINE_LINUX'].append('elevator=noop') + + +class MakeLinuxFastAgain(Task): + description = 'make-linux-fast-again.com' + phase = phases.system_modification + successors = [WriteGrubConfig] + + @classmethod + def run(cls, info): + info.grub_config['GRUB_CMDLINE_LINUX'].append('noibrs') + info.grub_config['GRUB_CMDLINE_LINUX'].append('noibpb') + info.grub_config['GRUB_CMDLINE_LINUX'].append('nopti') + info.grub_config['GRUB_CMDLINE_LINUX'].append('nospectre_v2') + info.grub_config['GRUB_CMDLINE_LINUX'].append('nospectre_v1') + info.grub_config['GRUB_CMDLINE_LINUX'].append('l1tf=off') + info.grub_config['GRUB_CMDLINE_LINUX'].append('nospec_store_bypass_disable') + info.grub_config['GRUB_CMDLINE_LINUX'].append('no_stf_barrier') + info.grub_config['GRUB_CMDLINE_LINUX'].append('mds=off') + info.grub_config['GRUB_CMDLINE_LINUX'].append('mitigations=off') + + class SetGrubTerminalToConsole(Task): description = 'Setting the grub terminal to `console\'' phase = phases.system_modification diff --git a/bootstrapvz/providers/azure/tasks/boot.py b/bootstrapvz/providers/azure/tasks/boot.py index b967bef..1b0b3c2 100644 --- a/bootstrapvz/providers/azure/tasks/boot.py +++ b/bootstrapvz/providers/azure/tasks/boot.py @@ -32,15 +32,4 @@ class ConfigureGrub(Task): 'console=ttyS0,115200n8', 'earlyprintk=ttyS0,115200', 'rootdelay=300', - 'elevator=noop', - 'noibrs', - 'noibpb', - 'nopti', - 'nospectre_v2', - 'nospectre_v1', - 'l1tf=off', - 'nospec_store_bypass_disable', - 'no_stf_barrier', - 'mds=off', - 'mitigations=off', ]) diff --git a/bootstrapvz/providers/ec2/tasks/boot.py b/bootstrapvz/providers/ec2/tasks/boot.py index b0d392b..9ef6493 100644 --- a/bootstrapvz/providers/ec2/tasks/boot.py +++ b/bootstrapvz/providers/ec2/tasks/boot.py @@ -70,16 +70,6 @@ class ConfigurePVGrub(Task): info.grub_config['GRUB_CMDLINE_LINUX'].extend([ 'consoleblank=0', 'elevator=noop', - 'noibrs', - 'noibpb', - 'nopti', - 'nospectre_v2', - 'nospectre_v1', - 'l1tf=off', - 'nospec_store_bypass_disable', - 'no_stf_barrier', - 'mds=off', - 'mitigations=off', ]) diff --git a/bootstrapvz/providers/gce/tasks/boot.py b/bootstrapvz/providers/gce/tasks/boot.py index 9071f6c..d0f0e7b 100644 --- a/bootstrapvz/providers/gce/tasks/boot.py +++ b/bootstrapvz/providers/gce/tasks/boot.py @@ -10,22 +10,8 @@ class ConfigureGrub(Task): @classmethod def run(cls, info): - info.grub_config['GRUB_CMDLINE_LINUX'].extend([ - 'console=ttyS0,38400n8', - 'elevator=noop', - 'consoleblank=0', - 'elevator=noop', - 'noibrs', - 'noibpb', - 'nopti', - 'nospectre_v2', - 'nospectre_v1', - 'l1tf=off', - 'nospec_store_bypass_disable', - 'no_stf_barrier', - 'mds=off', - 'mitigations=off', - ]) + info.grub_config['GRUB_CMDLINE_LINUX'].append('console=ttyS0,38400n8') + info.grub_config['GRUB_CMDLINE_LINUX'].append('elevator=noop') # Enable SCSI block multiqueue on Stretch. from bootstrapvz.common.releases import stretch if info.manifest.release >= stretch: diff --git a/bootstrapvz/providers/kvm/tasks/boot.py b/bootstrapvz/providers/kvm/tasks/boot.py index 3c8d1a3..6064580 100644 --- a/bootstrapvz/providers/kvm/tasks/boot.py +++ b/bootstrapvz/providers/kvm/tasks/boot.py @@ -14,21 +14,7 @@ class SetGrubConsolOutputDeviceToVirtual(Task): @classmethod def run(cls, info): - info.grub_config['GRUB_CMDLINE_LINUX'].extend([ - 'console=tty0', - 'consoleblank=0', - 'elevator=noop', - 'noibrs', - 'noibpb', - 'nopti', - 'nospectre_v2', - 'nospectre_v1', - 'l1tf=off', - 'nospec_store_bypass_disable', - 'no_stf_barrier', - 'mds=off', - 'mitigations=off', - ]) + info.grub_config['GRUB_CMDLINE_LINUX'].append('console=tty0') class SetGrubSystemdShowStatus(Task): diff --git a/bootstrapvz/providers/virtualbox/tasks/boot.py b/bootstrapvz/providers/virtualbox/tasks/boot.py index cd752d0..51b1a15 100644 --- a/bootstrapvz/providers/virtualbox/tasks/boot.py +++ b/bootstrapvz/providers/virtualbox/tasks/boot.py @@ -11,18 +11,4 @@ class AddVirtualConsoleGrubOutputDevice(Task): @classmethod def run(cls, info): - info.grub_config['GRUB_CMDLINE_LINUX'].extend([ - 'console=tty0', - 'consoleblank=0', - 'elevator=noop', - 'noibrs', - 'noibpb', - 'nopti', - 'nospectre_v2', - 'nospectre_v1', - 'l1tf=off', - 'nospec_store_bypass_disable', - 'no_stf_barrier', - 'mds=off', - 'mitigations=off', - ]) + info.grub_config['GRUB_CMDLINE_LINUX_DEFAULT'].append('console=tty0')