Setup desktop initramfs configuration
This commit is contained in:
parent
a5ed57f910
commit
5d91c4196d
7 changed files with 154 additions and 69 deletions
|
|
@ -15,6 +15,10 @@
|
||||||
- common
|
- common
|
||||||
tasks:
|
tasks:
|
||||||
- import_tasks: 'tasks/setup.yml'
|
- import_tasks: 'tasks/setup.yml'
|
||||||
|
- import_tasks: 'tasks/setup-desktop.yml'
|
||||||
|
when: platform == 'desktop'
|
||||||
|
- import_tasks: 'tasks/setup-laptop.yml'
|
||||||
|
when: platform == 'laptop'
|
||||||
- import_tasks: 'tasks/network.yml'
|
- import_tasks: 'tasks/network.yml'
|
||||||
- import_tasks: 'tasks/systemd.yml'
|
- import_tasks: 'tasks/systemd.yml'
|
||||||
- import_tasks: 'tasks/git.yml'
|
- import_tasks: 'tasks/git.yml'
|
||||||
|
|
|
||||||
111
tasks/setup-desktop.yml
Normal file
111
tasks/setup-desktop.yml
Normal file
|
|
@ -0,0 +1,111 @@
|
||||||
|
- name: remove the sysctl.d directory
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
path: /etc/sysctl.d
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: recreate the sysctl.d directory
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
path: /etc/sysctl.d
|
||||||
|
state: directory
|
||||||
|
mode: 755
|
||||||
|
|
||||||
|
- name: copy sysctl files
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
src: '{{ item.src }}'
|
||||||
|
dest: '{{ item.dest }}'
|
||||||
|
loop:
|
||||||
|
- {
|
||||||
|
src: 'templates/desktop/sysctl/99-sysrq.conf.j2',
|
||||||
|
dest: '/etc/sysctl.d/99-sysrq.conf'
|
||||||
|
}
|
||||||
|
- {
|
||||||
|
src: 'templates/desktop/sysctl/98-forward.conf.j2',
|
||||||
|
dest: '/etc/sysctl.d/98-foward.conf'
|
||||||
|
}
|
||||||
|
notify: reload sysctl configuration
|
||||||
|
|
||||||
|
- name: remove the modprobe.d directory
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
path: /etc/modprobe.d
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: recreate the modprobe.d directory
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
path: /etc/modprobe.d
|
||||||
|
state: directory
|
||||||
|
mode: 755
|
||||||
|
|
||||||
|
- name: copy modprobe files
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
src: '{{ item.src }}'
|
||||||
|
dest: '{{ item.dest }}'
|
||||||
|
loop:
|
||||||
|
- {
|
||||||
|
src: 'templates/desktop/modprobe/99-amdgpu.conf.j2',
|
||||||
|
dest: '/etc/modprobe.d/99-amdgpu.conf'
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: remove the mkinitcpio directories
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
path: '{{ item }}'
|
||||||
|
state: absent
|
||||||
|
loop:
|
||||||
|
- /etc/mkinitcpio.conf.d
|
||||||
|
- /etc/mkinitcpio.d
|
||||||
|
|
||||||
|
- name: recreate the mkinitcpio directories
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
path: '{{ item }}'
|
||||||
|
state: directory
|
||||||
|
mode: 755
|
||||||
|
loop:
|
||||||
|
- /etc/mkinitcpio.conf.d
|
||||||
|
- /etc/mkinitcpio.d
|
||||||
|
|
||||||
|
- name: copy mkinitcpio configuration files
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
src: '{{ item.src }}'
|
||||||
|
dest: '{{ item.dest }}'
|
||||||
|
loop:
|
||||||
|
- {
|
||||||
|
src: 'templates/desktop/mkinitcpio/99-modules.conf.j2',
|
||||||
|
dest: '/etc/mkinitcpio.conf.d/99-amdgpu.conf'
|
||||||
|
}
|
||||||
|
- {
|
||||||
|
src: 'templates/desktop/mkinitcpio/linux.preset.j2',
|
||||||
|
dest: '/etc/mkinitcpio.d/linux.preset'
|
||||||
|
}
|
||||||
|
- {
|
||||||
|
src: 'templates/desktop/mkinitcpio/linux-lts.preset.j2',
|
||||||
|
dest: '/etc/mkinitcpio.d/linux-lts.preset'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- name: remove old initramfs files
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
path: '{{ item }}'
|
||||||
|
state: absent
|
||||||
|
loop:
|
||||||
|
- /boot/initramfs-linux-lts-fallback.img
|
||||||
|
- /boot/initramfs-linux-fallback.img
|
||||||
|
|
||||||
|
- name: regenerate initramfs images
|
||||||
|
become: true
|
||||||
|
command: 'mkinitcpio --allpresets'
|
||||||
|
register: mkinitcpio_stats
|
||||||
|
|
||||||
|
- name: log mkinitcpio stdout
|
||||||
|
debug:
|
||||||
|
var: mkinitcpio_stats.stdout_lines
|
||||||
|
|
||||||
|
# TODO: provision systemd-boot
|
||||||
18
tasks/setup-laptop.yml
Normal file
18
tasks/setup-laptop.yml
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
# TODO: set fan settings to `quiet` with smbios-thermal-ctl
|
||||||
|
# TODO: provision mkinitcpio
|
||||||
|
# TODO: provision modprobe
|
||||||
|
# TODO: provision sysctl?
|
||||||
|
#
|
||||||
|
- name: create udev rule
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
path: '/etc/udev/rules.d/00-remove-nvidia.rules'
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: blacklist kernel module
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
path: '/etc/modprobe.d/blacklist-nouveau.conf'
|
||||||
|
state: absent
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
|
@ -65,72 +65,3 @@
|
||||||
systemd:
|
systemd:
|
||||||
name: fstrim.timer
|
name: fstrim.timer
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
- block:
|
|
||||||
- name: remove the sysctl.d directory
|
|
||||||
become: true
|
|
||||||
file:
|
|
||||||
path: /etc/sysctl.d
|
|
||||||
state: absent
|
|
||||||
- name: recreate the sysctl.d directory
|
|
||||||
become: true
|
|
||||||
file:
|
|
||||||
path: /etc/sysctl.d
|
|
||||||
state: directory
|
|
||||||
mode: 755
|
|
||||||
- name: copy sysctl files
|
|
||||||
become: true
|
|
||||||
template:
|
|
||||||
src: '{{ item.src }}'
|
|
||||||
dest: '{{ item.dest }}'
|
|
||||||
loop:
|
|
||||||
- {
|
|
||||||
src: 'templates/desktop/sysctl/99-sysrq.conf.j2',
|
|
||||||
dest: '/etc/sysctl.d/99-sysrq.conf'
|
|
||||||
}
|
|
||||||
- {
|
|
||||||
src: 'templates/desktop/sysctl/98-forward.conf.j2',
|
|
||||||
dest: '/etc/sysctl.d/98-foward.conf'
|
|
||||||
}
|
|
||||||
notify: reload sysctl configuration
|
|
||||||
|
|
||||||
- name: remove the modprobe.d directory
|
|
||||||
become: true
|
|
||||||
file:
|
|
||||||
path: /etc/modprobe.d
|
|
||||||
state: absent
|
|
||||||
- name: recreate the modprobe.d directory
|
|
||||||
become: true
|
|
||||||
file:
|
|
||||||
path: /etc/modprobe.d
|
|
||||||
state: directory
|
|
||||||
mode: 755
|
|
||||||
- name: copy modprobe files
|
|
||||||
become: true
|
|
||||||
template:
|
|
||||||
src: '{{ item.src }}'
|
|
||||||
dest: '{{ item.dest }}'
|
|
||||||
loop:
|
|
||||||
- {
|
|
||||||
src: 'templates/desktop/modprobe/99-amdgpu.conf.j2',
|
|
||||||
dest: '/etc/modprobe.d/99-amdgpu.conf'
|
|
||||||
}
|
|
||||||
when: platform == 'desktop'
|
|
||||||
|
|
||||||
# TODO: set fan settings to `quiet` with smbios-thermal-ctl
|
|
||||||
|
|
||||||
- name: remove old configuration files
|
|
||||||
block:
|
|
||||||
- name: create udev rule
|
|
||||||
become: true
|
|
||||||
file:
|
|
||||||
path: '/etc/udev/rules.d/00-remove-nvidia.rules'
|
|
||||||
state: absent
|
|
||||||
- name: blacklist kernel module
|
|
||||||
become: true
|
|
||||||
file:
|
|
||||||
path: '/etc/modprobe.d/blacklist-nouveau.conf'
|
|
||||||
state: absent
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
when: platform == 'laptop'
|
|
||||||
|
|
|
||||||
3
templates/desktop/mkinitcpio/99-modules.conf.j2
Normal file
3
templates/desktop/mkinitcpio/99-modules.conf.j2
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
|
MODULES=(amdgpu)
|
||||||
9
templates/desktop/mkinitcpio/linux-lts.preset.j2
Normal file
9
templates/desktop/mkinitcpio/linux-lts.preset.j2
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
# {{ ansible_managed }}
|
||||||
|
#
|
||||||
|
# mkinitcpio preset file for the 'linux' package
|
||||||
|
|
||||||
|
PRESETS=('default')
|
||||||
|
|
||||||
|
default_config="/etc/mkinitcpio.conf"
|
||||||
|
default_image="/boot/initramfs-linux-lts.img"
|
||||||
|
default_kver="/boot/vmlinuz-linux-lts"
|
||||||
9
templates/desktop/mkinitcpio/linux.preset.j2
Normal file
9
templates/desktop/mkinitcpio/linux.preset.j2
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
# {{ ansible_managed }}
|
||||||
|
#
|
||||||
|
# mkinitcpio preset file for the 'linux' package
|
||||||
|
|
||||||
|
PRESETS=('default')
|
||||||
|
|
||||||
|
default_config="/etc/mkinitcpio.conf"
|
||||||
|
default_image="/boot/initramfs-linux.img"
|
||||||
|
default_kver="/boot/vmlinuz-linux"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue