From b939d370f2720f761ac7c6dfe0041ebfd64c1b79 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Fri, 27 Feb 2026 01:19:36 +0100 Subject: Add boot args that allow gpu and other mac locked features on linux --- host_vars/mac-archiso.local.yml | Bin 1048 -> 1040 bytes host_vars/mac-archiso.local.yml.example | 2 +- roles/bootstrap/defaults/main.yml | 3 ++- roles/bootstrap/meta/argument_specs.yml | 9 +++++++-- roles/bootstrap/tasks/install-archlinux.yml | 18 +++++++----------- roles/bootstrap/templates/refind.conf.j2 | 5 +++++ roles/bootstrap/templates/refind_linux.conf.j2 | 2 ++ 7 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 roles/bootstrap/templates/refind.conf.j2 create mode 100644 roles/bootstrap/templates/refind_linux.conf.j2 diff --git a/host_vars/mac-archiso.local.yml b/host_vars/mac-archiso.local.yml index 9634f1d..c0b5a59 100644 Binary files a/host_vars/mac-archiso.local.yml and b/host_vars/mac-archiso.local.yml differ diff --git a/host_vars/mac-archiso.local.yml.example b/host_vars/mac-archiso.local.yml.example index c2bfe53..749b6a8 100644 --- a/host_vars/mac-archiso.local.yml.example +++ b/host_vars/mac-archiso.local.yml.example @@ -43,5 +43,5 @@ partition_extras: part_end: "100%" fstype: "ext4" dev: "{{ partition_disk }}4" -bootstrap_broadcom_wl: true +bootstrap_mac: true configure_playbook_dir: "../ansible-distro-configure" diff --git a/roles/bootstrap/defaults/main.yml b/roles/bootstrap/defaults/main.yml index 552f54e..bf3753f 100644 --- a/roles/bootstrap/defaults/main.yml +++ b/roles/bootstrap/defaults/main.yml @@ -1,2 +1,3 @@ --- -bootstrap_broadcom_wl: false +bootstrap_mac: false +bootstrap_mac_boot_args: "acpi_osi=Darwin i915.modeset=1 acpi_mask_gpe=0x06" diff --git a/roles/bootstrap/meta/argument_specs.yml b/roles/bootstrap/meta/argument_specs.yml index 00c7b31..1744925 100644 --- a/roles/bootstrap/meta/argument_specs.yml +++ b/roles/bootstrap/meta/argument_specs.yml @@ -14,8 +14,13 @@ argument_specs: type: "dict" required: true description: "Check partition_root argument in role: partition, required options: mount_path" - bootstrap_broadcom_wl: + bootstrap_mac: type: "bool" required: false default: false - description: "Install broadcom-wl driver (required for BCM4360 on Intel 2012 Macs)" + description: "Install broadcom-wl driver/spoof_osx (required for Intel 2012 Macs)" + bootstrap_mac_boot_args: + type: "str" + required: false + default: "acpi_osi=Darwin i915.modeset=1 acpi_mask_gpe=0x06" + description: "Extra kernel boot arguments appended to rEFInd boot entries when bootstrap_mac is true" diff --git a/roles/bootstrap/tasks/install-archlinux.yml b/roles/bootstrap/tasks/install-archlinux.yml index 5affa1c..02ba1f3 100644 --- a/roles/bootstrap/tasks/install-archlinux.yml +++ b/roles/bootstrap/tasks/install-archlinux.yml @@ -46,20 +46,16 @@ changed_when: true - name: "Configure rEFInd boot options" - ansible.builtin.copy: + ansible.builtin.template: + src: "refind_linux.conf.j2" dest: "{{ mnt_root_path }}/boot/refind_linux.conf" mode: "0644" - content: | - "Boot with defaults" "root=PARTLABEL={{ partition_root.name }} rw console=tty1" - "Boot to terminal" "root=PARTLABEL={{ partition_root.name }} rw console=tty1 systemd.unit=multi-user.target" - name: "Configure rEFInd settings" - ansible.builtin.copy: + ansible.builtin.template: + src: "refind.conf.j2" dest: "{{ mnt_boot_path }}/EFI/refind/refind.conf" mode: "0644" - content: | - timeout 5 - textonly true # NOTE: this is skipped because the docker test doesn't have proper EFI/refind directory created tags: ["molecule-notest"] @@ -88,7 +84,7 @@ ansible.builtin.command: cmd: "arch-chroot {{ mnt_root_path }} pacman -S --noconfirm broadcom-wl" changed_when: true - when: bootstrap_broadcom_wl + when: bootstrap_mac - name: "Blacklist modules conflicting with broadcom-wl" ansible.builtin.copy: @@ -100,7 +96,7 @@ blacklist b43 blacklist ssb blacklist bcma - when: bootstrap_broadcom_wl + when: bootstrap_mac - name: "Load wl module at boot" ansible.builtin.copy: @@ -108,4 +104,4 @@ mode: "0644" content: | wl - when: bootstrap_broadcom_wl + when: bootstrap_mac diff --git a/roles/bootstrap/templates/refind.conf.j2 b/roles/bootstrap/templates/refind.conf.j2 new file mode 100644 index 0000000..995ae1e --- /dev/null +++ b/roles/bootstrap/templates/refind.conf.j2 @@ -0,0 +1,5 @@ +timeout 5 +textonly true +{% if bootstrap_mac %} +spoof_osx_version 12.7 +{% endif %} diff --git a/roles/bootstrap/templates/refind_linux.conf.j2 b/roles/bootstrap/templates/refind_linux.conf.j2 new file mode 100644 index 0000000..c5e9942 --- /dev/null +++ b/roles/bootstrap/templates/refind_linux.conf.j2 @@ -0,0 +1,2 @@ +"Boot with defaults" "root=PARTLABEL={{ partition_root.name }} rw console=tty1{% if bootstrap_mac %} {{ bootstrap_mac_boot_args }}{% endif %}" +"Boot to terminal" "root=PARTLABEL={{ partition_root.name }} rw console=tty1 systemd.unit=multi-user.target{% if bootstrap_mac %} {{ bootstrap_mac_boot_args }}{% endif %}" -- cgit v1.2.3