From c170141cfb2a59b5057c37ee0a8b4b3f8384ec3f Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Mon, 11 Aug 2025 00:33:31 +0200 Subject: Safe dualboot /efi folder structure --- roles/bootstrap/tasks/install-archlinux.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'roles/bootstrap/tasks') diff --git a/roles/bootstrap/tasks/install-archlinux.yml b/roles/bootstrap/tasks/install-archlinux.yml index 5c746a8..c467be8 100644 --- a/roles/bootstrap/tasks/install-archlinux.yml +++ b/roles/bootstrap/tasks/install-archlinux.yml @@ -36,12 +36,18 @@ - src: "archlinux.conf.j2" dest: "{{ mnt_boot_path }}/loader/entries/archlinux.conf" +- name: "Create distro kernel directory" + ansible.builtin.file: + path: "{{ mnt_boot_path }}/archlinux" + state: "directory" + mode: "0700" + - name: "Copy kernel to efi partition" ansible.builtin.copy: src: "{{ item }}" - dest: "{{ mnt_boot_path }}" + dest: "{{ mnt_boot_path }}/archlinux/" remote_src: true - mode: "0644" + mode: "0700" with_items: - "{{ mnt_root_path }}/boot/vmlinuz-linux" - "{{ mnt_root_path }}/boot/initramfs-linux.img" @@ -60,9 +66,9 @@ [Action] Description = Updating systemd-boot When = PostTransaction - Exec = /usr/bin/cp /boot/vmlinuz-linux /boot/efi/vmlinuz-linux - Exec = /usr/bin/cp /boot/initramfs-linux.img /boot/efi/initramfs-linux.img - Exec = /usr/bin/cp /boot/initramfs-linux-fallback.img /boot/efi/initramfs-linux-fallback.img + Exec = /usr/bin/cp /boot/vmlinuz-linux /boot/efi/archlinux/vmlinuz-linux + Exec = /usr/bin/cp /boot/initramfs-linux.img /boot/efi/archlinux/initramfs-linux.img + Exec = /usr/bin/cp /boot/initramfs-linux-fallback.img /boot/efi/archlinux/initramfs-linux-fallback.img - name: "Configure hostname in chroot" ansible.builtin.copy: -- cgit v1.2.3