support kernel parameters

Note that this is only supported for grub. That is the only bootloader I
use. Patches for other bootloaders will be accepted.

The default params:

    * quiet the boot process
    * cause all virtual terminals to blank (ie, screen power off) after 60 seconds
    * enable panel self refresh v2

Blanking the screen is useful with physlock. Physlock does not run in X,
so DPMS settings have no effect on it.

PSR can potentially improve battery life on some machines, but cause
screen flicker on others. I have happily been using v2 on a ThinkPad
X260 for 6 months, but users should experiment between 1/2/3/4 to find
the best setting for their machine, or disable it entirely with 0. See:

* https://hansdegoede.livejournal.com/18653.html
* https://patchwork.kernel.org/patch/8182841/
This commit is contained in:
Pig Monkey 2018-09-06 20:06:40 -07:00
parent 39959de82a
commit c2bcd10c53
2 changed files with 13 additions and 0 deletions

View file

@ -283,3 +283,5 @@ aur_fonts:
syncthing:
run_on: trusted
kernel_parameters: "quiet consoleblank=60 i915.enable_psr=2"

View file

@ -9,6 +9,17 @@
hostname: name={{ hostname }}
when: hostname is defined
- name: Set kernel parameters
lineinfile: "dest=/etc/default/grub
regexp=^GRUB_CMDLINE_LINUX_DEFAULT
state=present
line='GRUB_CMDLINE_LINUX_DEFAULT=\"{{ kernel_parameters }}\"'"
when: kernel_parameters is defined and bootloader == 'grub'
notify:
- rebuild grub
tags:
- kernelparams
- include: shell.yml
- include: user.yml
- include: sudo.yml