From a419c8fd1a2f33f9b2697b2200b99fc2bb81e156 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Sun, 29 Oct 2023 23:12:37 +0100 Subject: [PATCH] v2.5.1 Signed-off-by: Jeroen Oudshoorn --- builder/pwnagotchi.json.pkr.hcl | 18 +++++++++--------- builder/pwnagotchi.yml | 21 ++++++++++++++++++++- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/builder/pwnagotchi.json.pkr.hcl b/builder/pwnagotchi.json.pkr.hcl index a0fa4ebf..67c99a27 100644 --- a/builder/pwnagotchi.json.pkr.hcl +++ b/builder/pwnagotchi.json.pkr.hcl @@ -27,14 +27,14 @@ source "arm-image" "rpi-pwnagotchi" { target_image_size = 9368709120 qemu_args = ["-r", "6.1.21-v8+"] } -# "arm-image" "opi-pwnagotchi" { -# iso_checksum = "" -# iso_url = "https://drive.usercontent.google.com/download?id=12DgsOXXgpDTQLRBsh8cKqVGD2FUUMZDk&export=download&authuser=0&confirm=t&uuid=d97afcec-3979-44e2-838a-f17c576a87fb&at=APZUnTWoYAa6oVoxrZWwPP7o8Hn9:1698613336721" -# output_file ="../../../pwnagotchi-orangepi-jammy-${var.pwn_version}-arm64.img" -# qemu_binary = "qemu-aarch64-static" -# target_image_size = 9368709120 -# qemu_args = ["-r", "6.1.21-v8+"] -#} +source "arm-image" "opi-pwnagotchi" { + iso_checksum = "" + iso_url = "https://drive.usercontent.google.com/download?id=1AJ_rrLAtCwurEB61VevSRKQwDOBF9GHN&export=download&authuser=0&confirm=t&uuid=ae4b66d9-adca-4fe1-9c4c-bf54bfc9d2ce&at=APZUnTV50dgaDoFFE0NnKqszShSm:1698614532340" + output_file ="../../../pwnagotchi-orangepi-jammy-${var.pwn_version}-arm64.img" + qemu_binary = "qemu-aarch64-static" + target_image_size = 9368709120 + qemu_args = ["-r", "6.1.31-sun50iw9"] +} # a build block invokes sources and runs provisioning steps on them. The # documentation for build blocks can be found here: @@ -43,7 +43,7 @@ build { name = "Pwnagotchi Torch 64bit" sources = [ "source.arm-image.rpi-pwnagotchi", - # "source.arm-image.opi-pwnagotchi", + "source.arm-image.opi-pwnagotchi", ] provisioner "file" { diff --git a/builder/pwnagotchi.yml b/builder/pwnagotchi.yml index fe1c5acb..4f0a273e 100644 --- a/builder/pwnagotchi.yml +++ b/builder/pwnagotchi.yml @@ -199,107 +199,126 @@ git: repo: https://github.com/DrSchottky/nexmon.git dest: /usr/local/src/nexmon - register: nexmongit + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: make firmware shell: "source ./setup_env.sh && make" args: executable: /bin/bash chdir: /usr/local/src/nexmon/ + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: make firmware patch (bcm43455c0) shell: "source ./setup_env.sh && cd /usr/local/src/nexmon/patches/bcm43455c0/7_45_206/nexmon/ && make" args: executable: /bin/bash chdir: /usr/local/src/nexmon/ + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: install new firmware (bcm43455c0) copy: src: /usr/local/src/nexmon/patches/bcm43455c0/7_45_206/nexmon/brcmfmac43455-sdio.bin dest: /usr/lib/firmware/brcm/brcmfmac43455-sdio.bin follow: true + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: make firmware patch (bcm43436b0) shell: "source ./setup_env.sh && cd /usr/local/src/nexmon/patches/bcm43436b0/9_88_4_65/nexmon/ && make" args: executable: /bin/bash chdir: /usr/local/src/nexmon/ + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: install new firmware (bcm43436b0) copy: src: /usr/local/src/nexmon/patches/bcm43436b0/9_88_4_65/nexmon/brcmfmac43436-sdio.bin dest: /usr/lib/firmware/brcm/brcmfmac43436-sdio.bin follow: true + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: make firmware patch (bcm43430a1) shell: "source ./setup_env.sh && cd /usr/local/src/nexmon/patches/bcm43430a1/7_45_41_46/nexmon/ && make" args: executable: /bin/bash chdir: /usr/local/src/nexmon/ + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: install new firmware (bcm43430a1) copy: src: /usr/local/src/nexmon/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac43430-sdio.bin dest: /usr/lib/firmware/brcm/brcmfmac43430-sdio.bin follow: true + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: copy 43430-sdio as 43436s-sdio for the special 43430/1 /2 copy: src: /usr/lib/firmware/brcm/brcmfmac43430-sdio.bin dest: /usr/lib/firmware/brcm/brcmfmac43436s-sdio.bin follow: true + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: Delete the firmware blob to avoid it crashing file: state: absent path: /usr/lib/firmware/brcm/brcmfmac43430-sdio.clm_blob + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: Delete the RPiZW firmware blob to avoid it crashing file: state: absent path: /usr/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,model-zero-w.clm_blob + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: Delete the RPi3 firmware blob to avoid it crashing file: state: absent path: /usr/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.clm_blob + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: Delete the RPi02w firmware blob to avoid it crashing file: state: absent path: /usr/lib/firmware/brcm/brcmfmac43430b0-sdio.raspberrypi,model-zero-2-w.clm_blob + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: Delete the RPi02w firmware blob to avoid it crashing file: state: absent path: /usr/lib/firmware/brcm/brcmfmac43436-sdio.clm_blob + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: Delete the RPi302w firmware blob to avoid it crashing file: state: absent path: /usr/lib/firmware/brcm/brcmfmac43436-sdio.raspberrypi,model-zero-2-w.clm_blob + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: Delete the RPi02w firmware blob to avoid it crashing file: state: absent path: /usr/lib/firmware/brcm/brcmfmac43455-sdio.clm_blob + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: backup original driver command: "mv /usr/lib/modules/{{ kernel.full }}/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko.xz /usr/lib/modules/{{ kernel.full }}/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko.xz.orig" + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: copy modified driver copy: src: "/usr/local/src/nexmon/patches/driver/brcmfmac_{{ kernel.min }}.y-nexmon/brcmfmac.ko" dest: "/usr/lib/modules/{{ kernel.full }}/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko" + when: ansible_facts['kernel'] == "6.1.21-v8+" - name : load brcmfmac drivers command: "/sbin/depmod -a" + when: ansible_facts['kernel'] == "6.1.21-v8+" # To shrink the final image, remove the nexmon directory (takes 2.5G of space) post build and installation - name: Delete nexmon content & directory file: state: absent path: /usr/local/src/nexmon/ + when: ansible_facts['kernel'] == "6.1.21-v8+" - name: Create custom plugin directory file: