Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
This commit is contained in:
Jeroen Oudshoorn
2023-09-24 21:27:23 +02:00
parent e825c87efa
commit d820213ef8

View File

@ -141,15 +141,12 @@
ARCHFLAGS: "-arch armv8" ARCHFLAGS: "-arch armv8"
tasks: tasks:
- name: System details - name: Create pi user
debug: user:
msg="{{ item }}" name: pi
with_items: password: "{{ 'raspberry' | password_hash('sha512') }}"
- "{{ ansible_distribution }}" shell: /bin/bash
- "{{ ansible_distribution_version }}" update_password: on_create
- "{{ ansible_distribution_major_version }}"
- "{{ ansible_architecture }}"
- "{{ ansible_machine }}"
- name: change hostname - name: change hostname
lineinfile: lineinfile:
@ -240,7 +237,7 @@
- name: install new firmware (bcm43436b0) - name: install new firmware (bcm43436b0)
copy: copy:
src: /usr/local/src/nexmon/patches/bcm43436b0/9_88_4_65/nexmon/brcmfmac43436-sdio.bin src: /usr/local/src/nexmon/patches/bcm43436b0/9_88_4_65/nexmon/brcmfmac43436-sdio.bin
dest: /lib/firmware/brcm/brcmfmac43436-sdio.bin dest: /usr/lib/firmware/brcm/brcmfmac43436-sdio.bin
- name: choose the right kernel version (bcm43430a1) - name: choose the right kernel version (bcm43430a1)
@ -272,22 +269,27 @@
- name: install new firmware (bcm43430a1) - name: install new firmware (bcm43430a1)
copy: copy:
src: /usr/local/src/nexmon/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac43430-sdio.bin src: /usr/local/src/nexmon/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac43430-sdio.bin
dest: /lib/firmware/brcm/brcmfmac43430-sdio.bin dest: /usr/lib/firmware/brcm/brcmfmac43430-sdio.bin
- name: copy 43430-sdio as 43436s-sdio for the special 43430/1
copy:
src: /usr/lib/firmware/brcm/brcmfmac43430-sdio.bin
dest: /usr/lib/firmware/brcm/brcmfmac43436s-sdio.bin
- name: Delete the firmware blob to avoid it crashing - name: Delete the firmware blob to avoid it crashing
file: file:
state: absent state: absent
path: /lib/firmware/brcm/brcmfmac43430-sdio.clm_blob path: /usr/lib/firmware/brcm/brcmfmac43430-sdio.clm_blob
- name: Delete the RPiZW firmware blob to avoid it crashing - name: Delete the RPiZW firmware blob to avoid it crashing
file: file:
state: absent state: absent
path: /lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,model-zero-w.clm_blob path: /usr/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,model-zero-w.clm_blob
- name: Delete the RPi3 firmware blob to avoid it crashing - name: Delete the RPi3 firmware blob to avoid it crashing
file: file:
state: absent state: absent
path: /lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.clm_blob path: /usr/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.clm_blob
- name: choose the right kernel version (bcm43455c0) - name: choose the right kernel version (bcm43455c0)
replace: replace:
@ -318,17 +320,17 @@
- name: install new firmware (bcm43455c0) - name: install new firmware (bcm43455c0)
copy: copy:
src: /usr/local/src/nexmon/patches/bcm43455c0/7_45_206/nexmon/brcmfmac43455-sdio.bin src: /usr/local/src/nexmon/patches/bcm43455c0/7_45_206/nexmon/brcmfmac43455-sdio.bin
dest: /lib/firmware/brcm/brcmfmac43455-sdio.bin dest: /usr/lib/firmware/brcm/brcmfmac43455-sdio.bin
- name: copy modified driver (everyone but RPiZW) - name: backup original driver
copy: copy:
src: /lib/modules/6.1.21-v8+/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko.xz src: /usr/lib/modules/6.1.21-v8+/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko.xz
dest: /lib/modules/6.1.21-v8+/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko.xz.orig dest: /usr/lib/modules/6.1.21-v8+/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko.xz.orig
- name: copy modified driver (everyone but RPiZW) - name: copy modified driver
copy: copy:
src: /usr/local/src/nexmon/patches/driver/brcmfmac_6.1.y-nexmon/brcmfmac.ko src: /usr/local/src/nexmon/patches/driver/brcmfmac_6.1.y-nexmon/brcmfmac.ko
dest: /lib/modules/6.1.21-v8+/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko dest: /usr/lib/modules/6.1.21-v8+/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko
- name: ensure depmod runs on reboot to load modified driver (brcmfmac) - name: ensure depmod runs on reboot to load modified driver (brcmfmac)
lineinfile: lineinfile:
@ -346,20 +348,6 @@
path: /usr/local/share/pwnagotchi/custom-plugins/ path: /usr/local/share/pwnagotchi/custom-plugins/
state: directory state: directory
- name: collect python pip package list
command: "pip3 list"
register: pip_output
- name: set python pip package facts
set_fact:
pip_packages: >
{{ pip_packages | default({}) | combine( { item.split()[0]: item.split()[1] } ) }}
with_items: "{{ pip_output.stdout_lines }}"
- name: acquire python3 pip target
command: "python3 -c 'import sys;print(sys.path.pop())'"
register: pip_target
- name: clone pwnagotchi repository - name: clone pwnagotchi repository
git: git:
repo: https://github.com/jayofelony/pwnagotchi.git repo: https://github.com/jayofelony/pwnagotchi.git
@ -371,14 +359,6 @@
path: /usr/local/share/pwnagotchi/ path: /usr/local/share/pwnagotchi/
state: directory state: directory
- name: fetch pwnagotchi version
set_fact:
pwnagotchi_version: "{{ lookup('file', '/usr/local/src/pwnagotchi/pwnagotchi/_version.py') | regex_replace('.*__version__.*=.*''([0-9]+\\.[0-9]+\\.[0-9]+[A-Za-z0-9]*)''.*', '\\1') }}"
- name: pwnagotchi version found
debug:
msg: "{{ pwnagotchi_version }}"
- name: build pwnagotchi wheel - name: build pwnagotchi wheel
command: "python3 setup.py sdist bdist_wheel" command: "python3 setup.py sdist bdist_wheel"
args: args: