blob: 5db944863fd22de477cfb6034be3c7dc22e9c313 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
---
- name: "Find existing rEFInd NVRAM boot entries"
ansible.builtin.shell:
cmd: |
set -euo pipefail
efibootmgr | awk '/rEFInd Boot Manager/{print substr($1,5,4)}'
executable: /bin/bash
register: bootstrap_refind_boot_ids
changed_when: false
- name: "Remove existing rEFInd NVRAM boot entries"
# Rebuilt fresh below instead of updated in place, so this never accumulates
# duplicate entries across reruns (each disk wipe changes the partition GUID
# efibootmgr encodes, so an old entry can never just be "updated").
ansible.builtin.command:
cmd: "efibootmgr -b {{ item }} -B"
loop: "{{ bootstrap_refind_boot_ids.stdout_lines }}"
changed_when: true
- name: "Register rEFInd NVRAM boot entry"
# Explicit NVRAM entry instead of relying on Mac firmware's fallback scan of
# EFI/BOOT/bootx64.efi, which is slow and its timing/reliability is undocumented.
ansible.builtin.command:
cmd: >
efibootmgr --create
--disk {{ partition_disk }}
--part {{ partition_boot.num }}
--loader '\EFI\BOOT\bootx64.efi'
--label "rEFInd Boot Manager"
changed_when: true
- name: "Install broadcom-sta-dkms in chroot"
ansible.builtin.command:
cmd: "arch-chroot {{ mnt_root_path }} apt-get install -y broadcom-sta-dkms"
environment:
MAKEFLAGS: ""
changed_when: true
- name: "Blacklist modules conflicting with broadcom-wl"
ansible.builtin.copy:
dest: "{{ mnt_root_path }}/etc/modprobe.d/broadcom-wl.conf"
mode: "0644"
content: |
blacklist brcmfmac
blacklist brcmutil
blacklist b43
blacklist ssb
blacklist bcma
- name: "Load wl module at boot"
ansible.builtin.lineinfile:
path: "{{ mnt_root_path }}/etc/modules"
line: "wl"
create: true
mode: "0644"
- name: "Symlink resolv.conf to systemd-resolved stub"
# NOTE: "Ensure DNS works in chroot" in install-ubuntu.yml copies the macOS
# resolv.conf which breaks internet access (DNS resolving).
ansible.builtin.file:
src: "/run/systemd/resolve/stub-resolv.conf"
dest: "{{ mnt_root_path }}/etc/resolv.conf"
state: link
force: true
|