diff options
| author | Ahmed Abdelhalim <[email protected]> | 2025-09-21 17:17:08 +0200 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2025-09-21 17:17:08 +0200 |
| commit | a82425b10738c9119075c2347e258d5048530f1d (patch) | |
| tree | 9a7b1ca65528ab19e8faa1d6ffbfd5e4091899c8 /roles/bootstrap/tasks/install-archlinux.yml | |
| parent | cf24e81b55c1e038f17d795ac103c58b7bd9b12c (diff) | |
Clean up bootmgr and fix systemd-boot regression issue
Also update the syntax to use the new loop syntax instead of with_items
Diffstat (limited to 'roles/bootstrap/tasks/install-archlinux.yml')
| -rw-r--r-- | roles/bootstrap/tasks/install-archlinux.yml | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/roles/bootstrap/tasks/install-archlinux.yml b/roles/bootstrap/tasks/install-archlinux.yml index aa7d183..9e36e70 100644 --- a/roles/bootstrap/tasks/install-archlinux.yml +++ b/roles/bootstrap/tasks/install-archlinux.yml @@ -9,9 +9,19 @@ cmd: "genfstab -t PARTLABEL {{ mnt_root_path }} > {{ mnt_root_path }}/etc/fstab" changed_when: true -- name: "Run bootclt" +- 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" ansible.builtin.command: - cmd: "arch-chroot {{ mnt_root_path }} bootctl install" + cmd: "bootctl install --esp-path={{ mnt_boot_path }}" changed_when: true - name: "Enable systemd-boot-update" @@ -24,7 +34,7 @@ src: "{{ item.src }}" dest: "{{ item.dest }}" mode: "0644" - with_items: + loop: - src: "loader.conf.j2" dest: "{{ mnt_boot_path }}/loader/loader.conf" - src: "archlinux.conf.j2" @@ -34,15 +44,15 @@ ansible.builtin.file: path: "{{ mnt_boot_path }}/archlinux" state: "directory" - mode: "0700" + mode: "0755" - name: "Copy kernel to efi partition" ansible.builtin.copy: src: "{{ item }}" dest: "{{ mnt_boot_path }}/archlinux/" remote_src: true - mode: "0700" - with_items: + mode: "0644" + loop: - "{{ mnt_root_path }}/boot/vmlinuz-linux" - "{{ mnt_root_path }}/boot/initramfs-linux.img" - "{{ mnt_root_path }}/boot/initramfs-linux-fallback.img" @@ -76,7 +86,7 @@ ansible.builtin.command: cmd: "arch-chroot {{ mnt_root_path }} {{ item }}" changed_when: true - with_items: + loop: - "pacman-key --init" - "pacman-key --populate" - "pacman -Syyu --noconfirm" |
