mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
2
Makefile
2
Makefile
@ -53,8 +53,6 @@ $(PWN_RELEASE).img: | $(PACKER)
|
||||
# If the packer or ansible files are updated, rebuild the image.
|
||||
$(PWN_RELEASE).img: $(SDIST) builder/pwnagotchi.json.pkr.hcl builder/raspberrypi32.yml builder/raspberrypi64.yml builder/orangepi.yml builder/extras/build_install_gopkg.yml builder/extras/nexmon.yml $(shell find builder/data -type f)
|
||||
|
||||
# sudo $(PACKER) plugins install github.com/solo-io/arm-image
|
||||
# sudo $(PACKER) plugins install github.com/hashicorp/ansible
|
||||
cd builder && packer init pwnagotchi.json.pkr.hcl && sudo $(UNSHARE) $(PACKER) build -var "pwn_hostname=$(PWN_HOSTNAME)" -var "pwn_version=$(PWN_VERSION)" pwnagotchi.json.pkr.hcl
|
||||
|
||||
# If any of these files are updated, rebuild the checksums.
|
||||
|
@ -4,58 +4,31 @@
|
||||
# item = { name: 'resulting_binary', url: 'https://github.com/foo/bar.git' }
|
||||
#
|
||||
|
||||
- name: Check for existance of Golang in /usr/local/go
|
||||
stat: path=/usr/local/go
|
||||
register: big_golang
|
||||
|
||||
- name: Download and install golang
|
||||
when: not big_golang.stat.exists
|
||||
unarchive:
|
||||
src: https://go.dev/dl/go1.21.1.linux-armv6l.tar.gz
|
||||
dest: /usr/local
|
||||
remote_src: yes
|
||||
register: big_golang
|
||||
|
||||
- name: Update .bashrc for go-1.21
|
||||
blockinfile:
|
||||
dest: /home/pi/.bashrc
|
||||
state: present
|
||||
block: |
|
||||
export GOPATH=$HOME/go
|
||||
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
|
||||
|
||||
- name: 'download target {{ item.name }} from github'
|
||||
git:
|
||||
repo: "{{ item.url }}"
|
||||
dest: '/usr/local/src/{{ item.name }}'
|
||||
register: big_download
|
||||
|
||||
- name: go mod tidy
|
||||
shell: "go mod tidy -x -v"
|
||||
register: result
|
||||
retries: 7
|
||||
delay: 60
|
||||
args:
|
||||
executable: /bin/bash
|
||||
chdir: '/usr/local/src/{{ item.name }}'
|
||||
until: result is not failed
|
||||
ignore_errors: true
|
||||
|
||||
- name: build package
|
||||
shell: "make"
|
||||
register: result
|
||||
args:
|
||||
executable: /bin/bash
|
||||
chdir: '/usr/local/src/{{ item.name }}'
|
||||
|
||||
- name: install pwngrid 1.10.4
|
||||
shell: "make install"
|
||||
register: result
|
||||
shell: "export GOPATH=$HOME/go && export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin && go mod tidy && make && make install"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
chdir: '/usr/local/src/{{ item.name }}'
|
||||
|
||||
- name: make bin staging dir
|
||||
file:
|
||||
state: directory
|
||||
path: "/root/staging/bin"
|
||||
|
||||
- name: copy built binary to staging directory
|
||||
copy:
|
||||
src: '/usr/local/bin/{{ item.name }}'
|
||||
dest: "/root/staging/bin/"
|
||||
chdir: /usr/local/src/pwngrid
|
||||
|
||||
- name: remove build folder
|
||||
file:
|
||||
|
@ -247,40 +247,19 @@
|
||||
dest: /usr/lib/firmware/brcm/brcmfmac43436s-sdio.bin
|
||||
follow: true
|
||||
|
||||
- name: Delete the firmware blob to avoid it crashing
|
||||
# delete blob files that make nexmon sad
|
||||
- name: Delete the firmware blob files to avoid some nexmon crashing
|
||||
file:
|
||||
state: absent
|
||||
path: /usr/lib/firmware/brcm/brcmfmac43430-sdio.clm_blob
|
||||
|
||||
- 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
|
||||
|
||||
- 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
|
||||
|
||||
- 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
|
||||
|
||||
- name: Delete the RPi02w firmware blob to avoid it crashing
|
||||
file:
|
||||
state: absent
|
||||
path: /usr/lib/firmware/brcm/brcmfmac43436-sdio.clm_blob
|
||||
|
||||
- name: Delete the RPi02w firmware blob to avoid it crashing
|
||||
file:
|
||||
state: absent
|
||||
path: /usr/lib/firmware/brcm/brcmfmac43436-sdio.raspberrypi,model-zero-2-w.clm_blob
|
||||
|
||||
- name: Delete the RPi02w firmware blob to avoid it crashing
|
||||
file:
|
||||
state: absent
|
||||
path: /usr/lib/firmware/brcm/brcmfmac43455-sdio.clm_blo
|
||||
path: '{{ item }}'
|
||||
loop:
|
||||
- /usr/lib/firmware/brcm/brcmfmac43430-sdio.clm_blob
|
||||
- /usr/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,model-zero-w.clm_blob
|
||||
- /usr/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.clm_blob
|
||||
- /usr/lib/firmware/brcm/brcmfmac43430b0-sdio.raspberrypi,model-zero-2-w.clm_blob
|
||||
- /usr/lib/firmware/brcm/brcmfmac43436-sdio.clm_blob
|
||||
- /usr/lib/firmware/brcm/brcmfmac43436-sdio.raspberrypi,model-zero-2-w.clm_blob
|
||||
- /usr/lib/firmware/brcm/brcmfmac43455-sdio.clm_blo
|
||||
|
||||
- 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"
|
||||
|
Reference in New Issue
Block a user