Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
This commit is contained in:
Jeroen Oudshoorn
2023-11-03 18:21:55 +01:00
parent 537b39afdf
commit f67b15190c
6 changed files with 5 additions and 122 deletions

View File

@ -0,0 +1,63 @@
#
# expects to be called with
#
# 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: '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
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/"
- name: remove build folder
file:
state: absent
path: '/usr/local/src/{{ item.name }}'

40
builder/extras/nexmon.yml Normal file
View File

@ -0,0 +1,40 @@
# Install nexmon to fix wireless scanning (takes 2.5G of space)
- name: clone nexmon repository
git:
repo: https://github.com/DrSchottky/nexmon.git
dest: /usr/local/src/nexmon
- name: make firmware
shell: "source ./setup_env.sh && make"
args:
executable: /bin/bash
chdir: /usr/local/src/nexmon/
- name: make firmware patch
shell: "source ./setup_env.sh && cd /usr/local/src/nexmon/patches/{{ item.patch }}/nexmon/ && make"
args:
executable: /bin/bash
chdir: /usr/local/src/nexmon/
environment:
QEMU_UNAME: "{{ item.kernel }}"
ARCHFLAGS: "{{ item.arch_flags }}"
- name: install new firmware (bcm43455c0)
copy:
src: "/usr/local/src/nexmon/patches/{{ item.patch }}/nexmon/{{ item.firmware }}"
dest: "/usr/lib/firmware/brcm/{{ item.firmware }}"
follow: true
environment:
QEMU_UNAME: "{{ item.kernel }}"
ARCHFLAGS: "{{ item.arch_flags }}"
- name: backup original driver
command: "mv /usr/lib/modules/{{ item.kernel }}/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko.xz /usr/lib/modules/{{ item.kernel }}/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko.xz.orig"
- name: copy modified driver
copy:
src: "/usr/local/src/nexmon/patches/driver/brcmfmac_6.1.y-nexmon/brcmfmac.ko"
dest: "/usr/lib/modules/{{ item.kernel }}/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko"
- name : load brcmfmac drivers
command: "/sbin/depmod -a {{ item.kernel}}"