From fd1b383b1b93ae556387fb5a846eb6e6f1ac3404 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Sun, 21 Sep 2025 19:35:12 +0200 Subject: Replace systemd with rEFInd The systemd regression bug introduced in 258 version doesn't seem to be fixed or about to get fixed any time soon Ref: https://github.com/systemd/systemd/issues/36174 This replaces the systemd-boot with a simpler rEFInd approach --- roles/bootstrap/tasks/install-ubuntu.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'roles/bootstrap/tasks/install-ubuntu.yml') diff --git a/roles/bootstrap/tasks/install-ubuntu.yml b/roles/bootstrap/tasks/install-ubuntu.yml index 407da3c..c5b57ce 100644 --- a/roles/bootstrap/tasks/install-ubuntu.yml +++ b/roles/bootstrap/tasks/install-ubuntu.yml @@ -44,17 +44,20 @@ - "apt-get update" - "apt-get install -y {{ bootstrap_distro.packages | join(' ') }}" -- name: "Clean up old Linux Boot Manager entries" - ansible.builtin.shell: - cmd: | - for entry in $(efibootmgr | grep "Linux Boot Manager" | cut -d'*' -f1 | tr -d 'Boot'); do - efibootmgr -b $entry -B - done - changed_when: false - failed_when: false - -# NOTE: bootctl is not run in chroot to workaround https://github.com/systemd/systemd/issues/36174 -- name: "Run bootctl" +- name: "Ensure rEFInd bootloader installed" + ansible.builtin.command: + cmd: "arch-chroot {{ mnt_root_path }} apt-get install -y refind" + changed_when: true + +- name: "Install rEFInd" ansible.builtin.command: - cmd: "bootctl install --esp-path={{ mnt_boot_path }}" + cmd: "arch-chroot {{ mnt_root_path }} refind-install" changed_when: true + +- name: "Configure rEFInd" + ansible.builtin.copy: + dest: "{{ mnt_root_path }}/boot/refind_linux.conf" + mode: "0644" + content: | + "Boot with defaults" "root=PARTLABEL={{ partition_root.name }} rw" + "Boot to terminal" "root=PARTLABEL={{ partition_root.name }} rw systemd.unit=multi-user.target" -- cgit v1.2.3