Setup uefi stubs with systemd-boot for laptop
Directly booting the stubs currently does not seem to work either due to a buggy UEFI implementation or the embedded cmdline being overwritten, see https://www.reddit.com/r/archlinux/comments/up8h6l/comment/i8jkuf7/
This commit is contained in:
parent
5d91c4196d
commit
fec111584c
9 changed files with 157 additions and 10 deletions
|
|
@ -1,18 +1,134 @@
|
|||
# TODO: set fan settings to `quiet` with smbios-thermal-ctl
|
||||
# TODO: provision mkinitcpio
|
||||
# TODO: provision modprobe
|
||||
# TODO: provision sysctl?
|
||||
#
|
||||
- name: create udev rule
|
||||
|
||||
- name: remove the sysctl.d directory
|
||||
become: true
|
||||
file:
|
||||
path: '/etc/udev/rules.d/00-remove-nvidia.rules'
|
||||
path: /etc/sysctl.d
|
||||
state: absent
|
||||
|
||||
- name: blacklist kernel module
|
||||
- name: recreate the sysctl.d directory
|
||||
become: true
|
||||
file:
|
||||
path: '/etc/modprobe.d/blacklist-nouveau.conf'
|
||||
path: /etc/sysctl.d
|
||||
state: directory
|
||||
mode: 755
|
||||
|
||||
- name: copy sysctl files
|
||||
become: true
|
||||
template:
|
||||
src: '{{ item.src }}'
|
||||
dest: '{{ item.dest }}'
|
||||
loop:
|
||||
- {
|
||||
src: 'templates/laptop/sysctl/99-sysrq.conf.j2',
|
||||
dest: '/etc/sysctl.d/99-sysrq.conf'
|
||||
}
|
||||
- {
|
||||
src: 'templates/laptop/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
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: recreate the modprobe.d directory
|
||||
become: true
|
||||
file:
|
||||
path: /etc/modprobe.d
|
||||
state: directory
|
||||
mode: 755
|
||||
|
||||
- name: copy kernel parameters template
|
||||
become: true
|
||||
template:
|
||||
src: 'templates/laptop/cmdline.j2'
|
||||
dest: '/etc/kernel/cmdline'
|
||||
|
||||
- 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/laptop/mkinitcpio/99-modules.conf.j2',
|
||||
dest: '/etc/mkinitcpio.conf.d/99-modules.conf'
|
||||
}
|
||||
- {
|
||||
src: 'templates/laptop/mkinitcpio/99-hooks.conf.j2',
|
||||
dest: '/etc/mkinitcpio.conf.d/99-hooks.conf'
|
||||
}
|
||||
- {
|
||||
src: 'templates/laptop/mkinitcpio/linux.preset.j2',
|
||||
dest: '/etc/mkinitcpio.d/linux.preset'
|
||||
}
|
||||
- {
|
||||
src: 'templates/laptop/mkinitcpio/linux-lts.preset.j2',
|
||||
dest: '/etc/mkinitcpio.d/linux-lts.preset'
|
||||
}
|
||||
|
||||
- name: regenerate initramfs images
|
||||
become: true
|
||||
command: 'mkinitcpio --allpresets'
|
||||
register: mkinitcpio_stats
|
||||
|
||||
- name: log mkinitcpio stdout
|
||||
debug:
|
||||
var: mkinitcpio_stats.stdout_lines
|
||||
|
||||
- name: create a Linux UEFI boot entry
|
||||
become: true
|
||||
command: efibootmgr \
|
||||
--create \
|
||||
--disk /dev/nvme0n1 \
|
||||
--part 1 \
|
||||
--label 'Arch Linux' \
|
||||
--loader '\EFI\Linux\linux.efi'\
|
||||
--unicode
|
||||
register: efi_linux_stats
|
||||
when: register_uefi_entry
|
||||
|
||||
- name: log efibootmgr stdout
|
||||
debug:
|
||||
var: efi_linux_stats.stdout_lines
|
||||
when: register_uefi_entry
|
||||
|
||||
- name: create a Linux LTS UEFI boot entry
|
||||
become: true
|
||||
command: efibootmgr \
|
||||
--create \
|
||||
--disk /dev/nvme0n1 \
|
||||
--part 1 \
|
||||
--label 'Arch Linux LTS' \
|
||||
--loader '\EFI\Linux\linux-lts.efi'\
|
||||
--unicode
|
||||
register: efi_linux_lts_stats
|
||||
when: register_uefi_entry
|
||||
|
||||
- name: log efibootmgr LTS stdout
|
||||
debug:
|
||||
var: efi_linux_lts_stats.stdout_lines
|
||||
when: register_uefi_entry
|
||||
|
|
|
|||
1
templates/laptop/cmdline.j2
Normal file
1
templates/laptop/cmdline.j2
Normal file
|
|
@ -0,0 +1 @@
|
|||
cryptdevice=UUID=4483183a-4881-4bf6-b20c-3ba918642cc4:cryptlvm root=/dev/VolumeGroup/root rw resume=/dev/VolumeGroup/swap pcie_aspm=nommconf i915.fastboot=1 enable_fbc=1 enable_psr=1 disable_power_well=0 acpi_rev_override=1 bgrt_disable
|
||||
3
templates/laptop/mkinitcpio/99-hooks.conf.j2
Normal file
3
templates/laptop/mkinitcpio/99-hooks.conf.j2
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block encrypt lvm2 resume filesystems fsck)
|
||||
3
templates/laptop/mkinitcpio/99-modules.conf.j2
Normal file
3
templates/laptop/mkinitcpio/99-modules.conf.j2
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
MODULES=(intel_agp i915 i8k)
|
||||
8
templates/laptop/mkinitcpio/linux-lts.preset.j2
Normal file
8
templates/laptop/mkinitcpio/linux-lts.preset.j2
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# {{ ansible_managed }}
|
||||
#
|
||||
# mkinitcpio preset file for the 'linux' package
|
||||
|
||||
PRESETS=('default')
|
||||
|
||||
default_uki="/boot/EFI/Linux/linux-lts.efi"
|
||||
default_kver="/boot/vmlinuz-linux-lts"
|
||||
8
templates/laptop/mkinitcpio/linux.preset.j2
Normal file
8
templates/laptop/mkinitcpio/linux.preset.j2
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# {{ ansible_managed }}
|
||||
#
|
||||
# mkinitcpio preset file for the 'linux' package
|
||||
|
||||
PRESETS=('default')
|
||||
|
||||
default_uki="/boot/EFI/Linux/linux.efi"
|
||||
default_kver="/boot/vmlinuz-linux"
|
||||
2
templates/laptop/sysctl/98-forward.conf.j2
Normal file
2
templates/laptop/sysctl/98-forward.conf.j2
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# {{ ansible_managed }}
|
||||
net.ipv4.ip_forward = 1
|
||||
2
templates/laptop/sysctl/99-sysrq.conf.j2
Normal file
2
templates/laptop/sysctl/99-sysrq.conf.j2
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# {{ ansible_managed }}
|
||||
kernel.sysrq = 1
|
||||
|
|
@ -4,6 +4,10 @@ platform_packages:
|
|||
- nvidia-prime
|
||||
- nvidia-utils
|
||||
- lib32-nvidia-utils
|
||||
- systemd-ukify
|
||||
- efibootmgr
|
||||
|
||||
register_uefi_entry: false
|
||||
|
||||
vpn_default:
|
||||
ip: '10.0.0.2'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue