summaryrefslogtreecommitdiffstats
path: root/roles/bootstrap/tasks
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2026-06-30 17:42:32 +0200
committerAhmed Abdelhalim <[email protected]>2026-06-30 17:42:32 +0200
commitb9bfb43360e588e008e1f3279b99b2523665d422 (patch)
treec7a49a74c62426eada98dbc200f8358953cd3303 /roles/bootstrap/tasks
parentf77cd8a569c8e06c0d5e391a495e5d89d7375be6 (diff)
Fix booting nightmares on Mac (dualboot)
Co-authored-by: Claude.ai
Diffstat (limited to 'roles/bootstrap/tasks')
-rw-r--r--roles/bootstrap/tasks/install-archlinux-mac.yml24
-rw-r--r--roles/bootstrap/tasks/install-ubuntu-mac.yml24
-rw-r--r--roles/bootstrap/tasks/install-ubuntu.yml5
3 files changed, 49 insertions, 4 deletions
diff --git a/roles/bootstrap/tasks/install-archlinux-mac.yml b/roles/bootstrap/tasks/install-archlinux-mac.yml
index 26ae9ee..9184207 100644
--- a/roles/bootstrap/tasks/install-archlinux-mac.yml
+++ b/roles/bootstrap/tasks/install-archlinux-mac.yml
@@ -1,4 +1,28 @@
---
+- name: "Ensure EFI/refind directory exists for Mac NVRAM compatibility"
+ ansible.builtin.file:
+ path: "{{ mnt_boot_path }}/EFI/refind"
+ state: directory
+ mode: "0755"
+ # Mac NVRAM entries persist across disk wipes (stored in firmware) and point to EFI/refind/
+ # refind-install --usedefault only creates EFI/BOOT/ so we must create this explicitly
+ tags: ["molecule-notest"]
+
+- name: "Copy rEFInd binary to EFI/refind for Mac NVRAM entries"
+ ansible.builtin.copy:
+ src: "{{ mnt_boot_path }}/EFI/BOOT/bootx64.efi"
+ dest: "{{ mnt_boot_path }}/EFI/refind/refind_x64.efi"
+ remote_src: true
+ mode: "0644"
+ tags: ["molecule-notest"]
+
+- name: "Configure rEFInd base settings in EFI/refind for Mac NVRAM entries"
+ ansible.builtin.template:
+ src: "refind.conf.j2"
+ dest: "{{ mnt_boot_path }}/EFI/refind/refind.conf"
+ mode: "0644"
+ tags: ["molecule-notest"]
+
- name: "Install broadcom-wl driver"
ansible.builtin.command:
cmd: "arch-chroot {{ mnt_root_path }} pacman -S --noconfirm broadcom-wl"
diff --git a/roles/bootstrap/tasks/install-ubuntu-mac.yml b/roles/bootstrap/tasks/install-ubuntu-mac.yml
index 23ead61..69b9a88 100644
--- a/roles/bootstrap/tasks/install-ubuntu-mac.yml
+++ b/roles/bootstrap/tasks/install-ubuntu-mac.yml
@@ -1,4 +1,28 @@
---
+- name: "Ensure EFI/refind directory exists for Mac NVRAM compatibility"
+ ansible.builtin.file:
+ path: "{{ mnt_boot_path }}/EFI/refind"
+ state: directory
+ mode: "0755"
+ # Mac NVRAM entries persist across disk wipes (stored in firmware) and point to EFI/refind/
+ # refind-install --usedefault only creates EFI/BOOT/ so we must create this explicitly
+ tags: ["molecule-notest"]
+
+- name: "Copy rEFInd binary to EFI/refind for Mac NVRAM entries"
+ ansible.builtin.copy:
+ src: "{{ mnt_boot_path }}/EFI/BOOT/bootx64.efi"
+ dest: "{{ mnt_boot_path }}/EFI/refind/refind_x64.efi"
+ remote_src: true
+ mode: "0644"
+ tags: ["molecule-notest"]
+
+- name: "Configure rEFInd base settings in EFI/refind for Mac NVRAM entries"
+ ansible.builtin.template:
+ src: "refind.conf.j2"
+ dest: "{{ mnt_boot_path }}/EFI/refind/refind.conf"
+ mode: "0644"
+ tags: ["molecule-notest"]
+
- name: "Install broadcom-sta-dkms in chroot"
ansible.builtin.command:
cmd: "arch-chroot {{ mnt_root_path }} apt-get install -y broadcom-sta-dkms"
diff --git a/roles/bootstrap/tasks/install-ubuntu.yml b/roles/bootstrap/tasks/install-ubuntu.yml
index 9d32543..89f351f 100644
--- a/roles/bootstrap/tasks/install-ubuntu.yml
+++ b/roles/bootstrap/tasks/install-ubuntu.yml
@@ -75,11 +75,8 @@
- name: "Configure rEFInd base settings"
ansible.builtin.template:
src: "refind.conf.j2"
- dest: "{{ item }}"
+ dest: "{{ mnt_boot_path }}/EFI/BOOT/refind.conf"
mode: "0644"
- loop:
- - "{{ mnt_boot_path }}/EFI/BOOT/refind.conf"
- - "{{ mnt_boot_path }}/EFI/refind/refind.conf"
# NOTE: this is skipped because the docker test doesn't have proper EFI/BOOT directory created
tags: ["molecule-notest"]