From a5cf11cd975da06257449bc23f51084ea02ad65a Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Sat, 4 Jul 2020 17:11:01 +0300 Subject: [PATCH] linux-gentoo: add few tty settings --- roles/linux-gentoo/tasks/main.yml | 15 +++++++----- roles/linux-gentoo/tasks/tty.yml | 45 ++++++++++++++++++++++++++++++++++ roles/linux-gentoo/templates/issue.j2 | 11 +++++++++ roles/linux-gentoo/templates/motd.j2 | 0 roles/linux-gentoo/templates/rgb.vt.j2 | 3 +++ roles/linux-gentoo/vars/system.yml | 1 + 6 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 roles/linux-gentoo/tasks/tty.yml create mode 100644 roles/linux-gentoo/templates/issue.j2 create mode 100644 roles/linux-gentoo/templates/motd.j2 create mode 100644 roles/linux-gentoo/templates/rgb.vt.j2 diff --git a/roles/linux-gentoo/tasks/main.yml b/roles/linux-gentoo/tasks/main.yml index 9ea2d57..666ad54 100644 --- a/roles/linux-gentoo/tasks/main.yml +++ b/roles/linux-gentoo/tasks/main.yml @@ -14,6 +14,13 @@ state: absent with_sequence: start={{ system.tty_consoles + 1 }} end=9 +- name: Disable clearing the boot console + lineinfile: + path: /etc/inittab + regexp: '^c1:' + line: 'c1:12345:respawn:/sbin/agetty --noclear 38400 tty1 linux' + state: present + - name: Configure tmpfs mount: path: "{{ item.path }}" @@ -33,6 +40,8 @@ - include: preload.yml when: optimisation.preload +- include: tty.yml + - name: Set sysctl options sysctl: name: "{{ item.name }}" @@ -51,12 +60,6 @@ src: xorg.touchpad.conf.j2 dest: "/etc/X11/xorg.conf.d/touchpad.conf.clt" -- name: Configure consolefont - template: - src: consolefont.j2 - dest: /etc/conf.d/consolefont.clt - register: consolefont_configured - - name: Update imagemagick policies lineinfile: path: /etc/ImageMagick-7/policy.xml diff --git a/roles/linux-gentoo/tasks/tty.yml b/roles/linux-gentoo/tasks/tty.yml new file mode 100644 index 0000000..7778d41 --- /dev/null +++ b/roles/linux-gentoo/tasks/tty.yml @@ -0,0 +1,45 @@ +--- + +# - name: Set up tty brightness + # copy: + # dest: /etc/local.d/brightness.start + # content: | + #!/bin/bash + # xbacklight -d :0 -set {{ system.display_brightness }} + # mode: "0755" + +# - name: Configure tty colours + # template: + # src: rgb.vt.j2 + # dest: /etc/rgb.vt + +# - name: Set up tty colours on system boot + # copy: + # dest: /etc/local.d/rgb.start + # content: | + #!/bin/bash + # setvtrgb /etc/rgb.vt + # mode: "0755" + +- name: Configure /etc/issue + template: + src: issue.j2 + dest: /etc/issue + +- name: Configure /etc/motd + template: + src: motd.j2 + dest: /etc/motd + +- name: Configure consolefont + lineinfile: + path: /etc/conf.d/consolefont + regexp: '^consolefont=' + line: "consolefont={{ system.console_font }}" + state: present + +- name: Configure consolefont template + template: + src: consolefont.j2 + dest: /etc/conf.d/consolefont.clt + diff --git a/roles/linux-gentoo/templates/issue.j2 b/roles/linux-gentoo/templates/issue.j2 new file mode 100644 index 0000000..d4f202e --- /dev/null +++ b/roles/linux-gentoo/templates/issue.j2 @@ -0,0 +1,11 @@ + . + .vir. d$b + .d$$$$$$b. .cd$$b. .d$$b. d$$$$$$$$$$$b .d$$b. .d$$b. + $$$$( )$$$b d$$$()$$$. d$$$$$$$b Q$$$$$$$P$$$P.$$$$$$$b. .$$$$$$$b. + Q$$$$$$$$$$B$$$$$$$$P" d$$$PQ$$$$b. $$$$. .$$$P' `$$$ .$$$P' `$$$ + "$$$$$$$P Q$$$$$$$b d$$$P Q$$$$b $$$$b $$$$b..d$$$ $$$$b..d$$$ + d$$$$$$P" "$$$$$$$$ Q$$$ Q$$$$ $$$$$ `Q$$$$$$$P `Q$$$$$$$P + $$$$$$$P `""""" "" "" Q$$$P "Q$$$P" "Q$$$P" + `Q$$P" """ + + diff --git a/roles/linux-gentoo/templates/motd.j2 b/roles/linux-gentoo/templates/motd.j2 new file mode 100644 index 0000000..e69de29 diff --git a/roles/linux-gentoo/templates/rgb.vt.j2 b/roles/linux-gentoo/templates/rgb.vt.j2 new file mode 100644 index 0000000..5886b18 --- /dev/null +++ b/roles/linux-gentoo/templates/rgb.vt.j2 @@ -0,0 +1,3 @@ +45,242,153,255,102,204,102,211,116,242,153,255,102,204,102,242 +45,119,204,204,153,153,204,208,115,119,204,204,153,153,204,240 +45,122,153,102,204,204,204,200,105,122,153,102,204,204,204,236 diff --git a/roles/linux-gentoo/vars/system.yml b/roles/linux-gentoo/vars/system.yml index 3e42f57..c67c240 100644 --- a/roles/linux-gentoo/vars/system.yml +++ b/roles/linux-gentoo/vars/system.yml @@ -2,6 +2,7 @@ system: tty_consoles: 4 console_font: cyr-sun16 + display_brightness: 30 optimisation: prelink: yes