From 02b2249ae5af5dda16e698d6c7bfe438cfe9aff6 Mon Sep 17 00:00:00 2001 From: XxKingsxX-Pinu Date: Thu, 21 Sep 2023 17:26:35 +1000 Subject: [PATCH 1/6] Create memtemp-plus.py --- pwnagotchi/plugins/default/memtemp-plus.py | 153 +++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 pwnagotchi/plugins/default/memtemp-plus.py diff --git a/pwnagotchi/plugins/default/memtemp-plus.py b/pwnagotchi/plugins/default/memtemp-plus.py new file mode 100644 index 00000000..293d153a --- /dev/null +++ b/pwnagotchi/plugins/default/memtemp-plus.py @@ -0,0 +1,153 @@ +# This is a customized version of the builtin Pwnagotchi Memtemp plugin which +# includes the changes from https://github.com/evilsocket/pwnagotchi/pull/918 +# but tweaked further to better fit my specific requirements. +# +# Author: https://github.com/xenDE +# Contributors: spees , crahan@n00.be + +#Edits by discord@rai68 - allows all 4 status - tested only on wave 2.13 v3 + +import logging +import pwnagotchi +import pwnagotchi.plugins as plugins +import pwnagotchi.ui.fonts as fonts +from pwnagotchi.ui.components import LabeledValue, Text +from pwnagotchi.ui.view import BLACK + + +class MemTempPlus(plugins.Plugin): + __author__ = 'https://github.com/xenDE' + __version__ = '1.0.2-1' + __license__ = 'GPL3' + __description__ = 'A plugin that will display memory/cpu usage and temperature' + + ALLOWED_FIELDS = { + 'mem': 'mem_usage', + 'cpu': 'cpu_load', + 'temp': 'cpu_temp', + 'freq': 'cpu_freq', + } + DEFAULT_FIELDS = ['mem', 'cpu', 'temp','freq'] #enables 4 by default + LINE_SPACING = 12 + LABEL_SPACING = 0 + FIELD_WIDTH = 4 + + def on_loaded(self): + logging.info('memtemp plugin loaded.') + + def mem_usage(self): + return f'{int(pwnagotchi.mem_usage() * 100)}%' + + def cpu_load(self): + return f'{int(pwnagotchi.cpu_load() * 100)}%' + + def cpu_temp(self): + if self.options['scale'].lower() == 'fahrenheit': + temp = (pwnagotchi.temperature() * 9 / 5) + 32 + symbol = 'F' + elif self.options['scale'].lower() == 'kelvin': + temp = pwnagotchi.temperature() + 273.15 + symbol = 'K' + else: + # default to celsius + temp = pwnagotchi.temperature() + symbol = 'C' + return f'{temp}{symbol}' + + def cpu_freq(self): + with open('/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq', 'rt') as fp: + return f'{round(float(fp.readline()) / 1000000, 1)}G' + + def pad_text(self, data): + return ' ' * (self.FIELD_WIDTH - len(data)) + data + + def on_ui_setup(self, ui): + try: + # Configure field list + self.fields = self.options['fields'].split(',') + self.fields = [x.strip() for x in self.fields if x.strip() in self.ALLOWED_FIELDS.keys()] + self.fields = self.fields[:4] # CHANGED to limit to the first 4 fields + except Exception: + # Set default value + self.fields = self.DEFAULT_FIELDS + + try: + # Configure line_spacing + line_spacing = int(self.options['linespacing']) + except Exception: + # Set default value + line_spacing = self.LINE_SPACING + + try: + # Configure position + pos = self.options['position'].split(',') + pos = [int(x.strip()) for x in pos] + v_pos = (pos[0], pos[1]) + h_pos = v_pos + except Exception: + # Set position based on screen type + if ui.is_waveshare_v2(): + v_pos = (197, 70) + h_pos = (178, 80) + else: + v_pos = (175, 50) + h_pos = (155, 60) + + if self.options['orientation'] == 'vertical': + # Dynamically create the required LabeledValue objects + for idx, field in enumerate(self.fields): + v_pos_x = v_pos[0] + v_pos_y = v_pos[1] + ((len(self.fields) - 3) * -1 * line_spacing) + ui.add_element( + f'memtemp_{field}', + LabeledValue( + color=BLACK, + label=f'{self.pad_text(field)}:', + value='-', + position=(v_pos_x, v_pos_y + (idx * line_spacing)), + label_font=fonts.Small, + text_font=fonts.Small, + label_spacing=self.LABEL_SPACING, + ) + ) + else: + # default to horizontal + h_pos_x = h_pos[0] + ((len(self.fields) - 3) * -1 * 25) + h_pos_y = h_pos[1] + ui.add_element( + 'memtemp_header', + Text( + color=BLACK, + value=' '.join([self.pad_text(x) for x in self.fields]), + position=(h_pos_x, h_pos_y), + font=fonts.Small, + ) + ) + ui.add_element( + 'memtemp_data', + Text( + color=BLACK, + value=' '.join([self.pad_text('-') for x in self.fields]), + position=(h_pos_x, h_pos_y + line_spacing), + font=fonts.Small, + ) + ) + + def on_unload(self, ui): + with ui._lock: + if self.options['orientation'] == 'vertical': + for idx, field in enumerate(self.fields): + ui.remove_element(f'memtemp_{field}') + else: + # default to horizontal + ui.remove_element('memtemp_header') + ui.remove_element('memtemp_data') + + def on_ui_update(self, ui): + if self.options['orientation'] == 'vertical': + for idx, field in enumerate(self.fields): + ui.set(f'memtemp_{field}', getattr(self, self.ALLOWED_FIELDS[field])()) + else: + # default to horizontal + data = ' '.join([self.pad_text(getattr(self, self.ALLOWED_FIELDS[x])()) for x in self.fields]) + ui.set('memtemp_data', data) From a26274f0796347d3acf4abdd10f85383cd872e3c Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Fri, 22 Sep 2023 07:48:02 +0200 Subject: [PATCH 2/6] Version 2.4.3 Signed-off-by: Jeroen Oudshoorn --- .../plugins/default/internet-connection.py | 55 ------- pwnagotchi/plugins/default/memtemp-plus.py | 153 ------------------ 2 files changed, 208 deletions(-) delete mode 100644 pwnagotchi/plugins/default/internet-connection.py delete mode 100644 pwnagotchi/plugins/default/memtemp-plus.py diff --git a/pwnagotchi/plugins/default/internet-connection.py b/pwnagotchi/plugins/default/internet-connection.py deleted file mode 100644 index 2678d27f..00000000 --- a/pwnagotchi/plugins/default/internet-connection.py +++ /dev/null @@ -1,55 +0,0 @@ -import logging -import pwnagotchi.ui.components as components -import pwnagotchi.ui.view as view -import pwnagotchi.ui.fonts as fonts -import pwnagotchi.plugins as plugins -import pwnagotchi -import subprocess -import socket - - -class InternetConnectionPlugin(plugins.Plugin): - __author__ = 'adi1708, edited by jayofelony' - __version__ = '1.1' - __license__ = 'GPL3' - __description__ = 'A plugin that displays the Internet connection status on the pwnagotchi display.' - __name__ = 'InternetConnectionPlugin' - __help__ = """ - A plugin that displays the Internet connection status on the pwnagotchi display. - """ - __dependencies__ = { - 'pip': ['scapy'] - } - __defaults__ = { - 'enabled': False, - } - - def on_loaded(self): - logging.info("[Internet-Connection] plugin loaded.") - - def on_ui_setup(self, ui): - with ui._lock: - # add a LabeledValue element to the UI with the given label and value - # the position and font can also be specified - ui.add_element('connection_status', components.LabeledValue(color=view.BLACK, label='WWW', value='-', - position=(ui.width() / 2 - 40, 0), - label_font=fonts.Bold, text_font=fonts.Medium)) - - def on_ui_update(self, ui): - # check if there is an active Internet connection - try: - # See if we can resolve the host name - tells us if there is - # A DNS listening - host = socket.gethostbyname("1.1.1.1") - # Connect to the host - tells us if the host is actually reachable - s = socket.create_connection((host, 80), 2) - s.close() - ui.set('connection_status', 'C') - except: - # if the command failed, it means there is no active Internet connection - ui.set('connection_status', 'D') - - def on_unload(self, ui): - with ui._lock: - logging.info("[Internet-Connection] plugin unloaded") - ui.remove_element('connection_status') diff --git a/pwnagotchi/plugins/default/memtemp-plus.py b/pwnagotchi/plugins/default/memtemp-plus.py deleted file mode 100644 index 293d153a..00000000 --- a/pwnagotchi/plugins/default/memtemp-plus.py +++ /dev/null @@ -1,153 +0,0 @@ -# This is a customized version of the builtin Pwnagotchi Memtemp plugin which -# includes the changes from https://github.com/evilsocket/pwnagotchi/pull/918 -# but tweaked further to better fit my specific requirements. -# -# Author: https://github.com/xenDE -# Contributors: spees , crahan@n00.be - -#Edits by discord@rai68 - allows all 4 status - tested only on wave 2.13 v3 - -import logging -import pwnagotchi -import pwnagotchi.plugins as plugins -import pwnagotchi.ui.fonts as fonts -from pwnagotchi.ui.components import LabeledValue, Text -from pwnagotchi.ui.view import BLACK - - -class MemTempPlus(plugins.Plugin): - __author__ = 'https://github.com/xenDE' - __version__ = '1.0.2-1' - __license__ = 'GPL3' - __description__ = 'A plugin that will display memory/cpu usage and temperature' - - ALLOWED_FIELDS = { - 'mem': 'mem_usage', - 'cpu': 'cpu_load', - 'temp': 'cpu_temp', - 'freq': 'cpu_freq', - } - DEFAULT_FIELDS = ['mem', 'cpu', 'temp','freq'] #enables 4 by default - LINE_SPACING = 12 - LABEL_SPACING = 0 - FIELD_WIDTH = 4 - - def on_loaded(self): - logging.info('memtemp plugin loaded.') - - def mem_usage(self): - return f'{int(pwnagotchi.mem_usage() * 100)}%' - - def cpu_load(self): - return f'{int(pwnagotchi.cpu_load() * 100)}%' - - def cpu_temp(self): - if self.options['scale'].lower() == 'fahrenheit': - temp = (pwnagotchi.temperature() * 9 / 5) + 32 - symbol = 'F' - elif self.options['scale'].lower() == 'kelvin': - temp = pwnagotchi.temperature() + 273.15 - symbol = 'K' - else: - # default to celsius - temp = pwnagotchi.temperature() - symbol = 'C' - return f'{temp}{symbol}' - - def cpu_freq(self): - with open('/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq', 'rt') as fp: - return f'{round(float(fp.readline()) / 1000000, 1)}G' - - def pad_text(self, data): - return ' ' * (self.FIELD_WIDTH - len(data)) + data - - def on_ui_setup(self, ui): - try: - # Configure field list - self.fields = self.options['fields'].split(',') - self.fields = [x.strip() for x in self.fields if x.strip() in self.ALLOWED_FIELDS.keys()] - self.fields = self.fields[:4] # CHANGED to limit to the first 4 fields - except Exception: - # Set default value - self.fields = self.DEFAULT_FIELDS - - try: - # Configure line_spacing - line_spacing = int(self.options['linespacing']) - except Exception: - # Set default value - line_spacing = self.LINE_SPACING - - try: - # Configure position - pos = self.options['position'].split(',') - pos = [int(x.strip()) for x in pos] - v_pos = (pos[0], pos[1]) - h_pos = v_pos - except Exception: - # Set position based on screen type - if ui.is_waveshare_v2(): - v_pos = (197, 70) - h_pos = (178, 80) - else: - v_pos = (175, 50) - h_pos = (155, 60) - - if self.options['orientation'] == 'vertical': - # Dynamically create the required LabeledValue objects - for idx, field in enumerate(self.fields): - v_pos_x = v_pos[0] - v_pos_y = v_pos[1] + ((len(self.fields) - 3) * -1 * line_spacing) - ui.add_element( - f'memtemp_{field}', - LabeledValue( - color=BLACK, - label=f'{self.pad_text(field)}:', - value='-', - position=(v_pos_x, v_pos_y + (idx * line_spacing)), - label_font=fonts.Small, - text_font=fonts.Small, - label_spacing=self.LABEL_SPACING, - ) - ) - else: - # default to horizontal - h_pos_x = h_pos[0] + ((len(self.fields) - 3) * -1 * 25) - h_pos_y = h_pos[1] - ui.add_element( - 'memtemp_header', - Text( - color=BLACK, - value=' '.join([self.pad_text(x) for x in self.fields]), - position=(h_pos_x, h_pos_y), - font=fonts.Small, - ) - ) - ui.add_element( - 'memtemp_data', - Text( - color=BLACK, - value=' '.join([self.pad_text('-') for x in self.fields]), - position=(h_pos_x, h_pos_y + line_spacing), - font=fonts.Small, - ) - ) - - def on_unload(self, ui): - with ui._lock: - if self.options['orientation'] == 'vertical': - for idx, field in enumerate(self.fields): - ui.remove_element(f'memtemp_{field}') - else: - # default to horizontal - ui.remove_element('memtemp_header') - ui.remove_element('memtemp_data') - - def on_ui_update(self, ui): - if self.options['orientation'] == 'vertical': - for idx, field in enumerate(self.fields): - ui.set(f'memtemp_{field}', getattr(self, self.ALLOWED_FIELDS[field])()) - else: - # default to horizontal - data = ' '.join([self.pad_text(getattr(self, self.ALLOWED_FIELDS[x])()) for x in self.fields]) - ui.set('memtemp_data', data) From faa6ca6e3b1980abe11ad1d7bb1bcc4688fe5ee0 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Sun, 24 Sep 2023 12:04:22 +0200 Subject: [PATCH 3/6] v2.4.3 Signed-off-by: Jeroen Oudshoorn --- builder/pwnagotchi.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builder/pwnagotchi.yml b/builder/pwnagotchi.yml index 70a91bbb..a8531867 100644 --- a/builder/pwnagotchi.yml +++ b/builder/pwnagotchi.yml @@ -416,7 +416,7 @@ register: pwngrid - name: install pwngrid 1.10.4 - shell: "export GOPATH=$HOME/go && export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin && sudo make && sudo make install" + shell: "export GOPATH=$HOME/go && export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin && make && make install" args: executable: /bin/bash chdir: /usr/local/src/pwngrid @@ -429,7 +429,7 @@ register: bettercap - name: Install bettercap v2.32.1 - shell: "export GOPATH=$HOME/go && export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin && sudo make && sudo make install" + shell: "export GOPATH=$HOME/go && export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin && make && make install" args: executable: /bin/bash chdir: /usr/local/src/bettercap @@ -570,7 +570,7 @@ line: "\nalias pwnlog='tail -f -n300 /var/log/pwn*.log | sed --unbuffered \"s/,[[:digit:]]\\{3\\}\\]//g\" | cut -d \" \" -f 2-'" insertafter: EOF - - name: Add pwnlog alias + - name: Add pwnver alias lineinfile: dest: /home/pi/.bashrc line: "\nalias pwnver='python3 -c \"import pwnagotchi as p; print(p.__version__)\"'" From fa27f2849ff0c7e37612a43db362dd688be0349f Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Sun, 24 Sep 2023 14:55:59 +0200 Subject: [PATCH 4/6] v2.4.3 Signed-off-by: Jeroen Oudshoorn --- builder/pwnagotchi.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/builder/pwnagotchi.yml b/builder/pwnagotchi.yml index 0ae08bf9..f2c3dcf0 100644 --- a/builder/pwnagotchi.yml +++ b/builder/pwnagotchi.yml @@ -41,7 +41,7 @@ # url: "https://github.com/evilsocket/pwngrid/releases/download/v1.10.3/pwngrid_linux_aarch64_v1.10.3.zip" apt: downgrade: - - libpcap0.8-dev_1.9.1-_arm64.deb + - libpcap0.8-dev_1.9.1-3_arm64.deb - libpcap0.8_1.9.1-3_arm64.deb - libpcap-dev_1.9.1-3_arm64.deb hold: @@ -537,31 +537,31 @@ echo echo "(◕‿‿◕) $_hostname" echo - echo "Hi! I'm a pwnagotchi $_version, please take good care of me!" - echo "Here are some basic things you need to know to raise me properly!" + echo " Hi! I'm a pwnagotchi $_version, please take good care of me!" + echo " Here are some basic things you need to know to raise me properly!" echo - echo "If you want to change my configuration, use /etc/pwnagotchi/config.toml" + echo " If you want to change my configuration, use /etc/pwnagotchi/config.toml" echo - echo "All the configuration options can be found on /etc/pwnagotchi/default.toml," - echo "but don't change this file because I will recreate it every time I'm restarted!" + echo " All the configuration options can be found on /etc/pwnagotchi/default.toml," + echo " but don't change this file because I will recreate it every time I'm restarted!" echo - echo "I use oPwnGrid as my main API, you can check stats at https://opwngrid.xyz" + echo " I use oPwnGrid as my main API, you can check stats at https://opwngrid.xyz" echo - echo "I'm managed by systemd. Here are some basic commands." + echo " I'm managed by systemd. Here are some basic commands." echo - echo "If you want to know what I'm doing, you can check my logs with the command" - echo "- pwnlog" - echo "- pwnver, to check the current version" - echo "- sudo pwnagotchi --donate, to see how you can donate to this project" - echo "- sudo pwnagotchi --check-update, to see if there is a new version available" + echo " If you want to know what I'm doing, you can check my logs with the command" + echo " - pwnlog" + echo " - sudo pwnagotchi --version, to check the current version" + echo " - sudo pwnagotchi --donate, to see how you can donate to this project" + echo " - sudo pwnagotchi --check-update, to see if there is a new version available" echo - echo "If you want to know if I'm running, you can use" - echo "sudo systemctl status pwnagotchi" + echo " If you want to know if I'm running, you can use" + echo " systemctl status pwnagotchi" echo - echo "You can restart me using" - echo "sudo systemctl restart pwnagotchi" + echo " You can restart me using" + echo " systemctl restart pwnagotchi" echo - echo "You learn more about me at https://pwnagotchi.ai/" + echo " You learn more about me at https://pwnagotchi.ai/" when: hostname.changed - name: Add pwnlog alias From 027edd7f294ce3d2797e2f4569c3be20cf36710c Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Sun, 24 Sep 2023 20:13:26 +0200 Subject: [PATCH 5/6] v2.4.3 Signed-off-by: Jeroen Oudshoorn --- Makefile | 4 ++-- builder/pwnagotchi.yml | 36 +++++++++++++++++++++++++++++++++--- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index c6679b65..6771779a 100644 --- a/Makefile +++ b/Makefile @@ -54,8 +54,8 @@ $(PWN_RELEASE).img: | $(PACKER) $(PWN_RELEASE).img: $(SDIST) builder/pwnagotchi.json builder/pwnagotchi.yml $(shell find builder/data -type f) sudo $(PACKER) plugins install github.com/solo-io/arm-image cd builder && sudo $(UNSHARE) $(PACKER) build -var "pwn_hostname=$(PWN_HOSTNAME)" -var "pwn_version=$(PWN_VERSION)" pwnagotchi.json - sudo chown -R $$USER:$$USER builder/output-pwnagotchi - mv builder/output-pwnagotchi/image $@ + sudo chown -R $USER:$USER builder/images + mv builder/images $@ # If any of these files are updated, rebuild the checksums. $(PWN_RELEASE).sha256: $(PWN_RELEASE).img diff --git a/builder/pwnagotchi.yml b/builder/pwnagotchi.yml index e0e320e7..6112bd3a 100644 --- a/builder/pwnagotchi.yml +++ b/builder/pwnagotchi.yml @@ -23,7 +23,6 @@ - pwnagotchi.service - bettercap.service - pwngrid-peer.service - - epd-fuse.service - fstrim.timer disable: - apt-daily.timer @@ -392,6 +391,11 @@ extra_args: "--no-cache-dir" when: (pwnagotchigit.changed) or (pip_packages['pwnagotchi'] is undefined) or (pip_packages['pwnagotchi'] != pwnagotchi_version) + - name: remove pwnagotchi folder + file: + state: absent + path: /usr/local/src/pwnagotchi + # Install go-1.20.6 - name: Install go-1.21 unarchive: @@ -422,6 +426,11 @@ chdir: /usr/local/src/pwngrid when: pwngrid.changed + - name: remove pwngrid folder + file: + state: absent + path: /usr/local/src/pwngrid + - name: download bettercap v2.32.1 git: repo: https://github.com/jayofelony/bettercap.git @@ -435,6 +444,11 @@ chdir: /usr/local/src/bettercap when: bettercap.changed + - name: remove bettercap folder + file: + state: absent + path: /usr/local/src/bettercap + - name: clone bettercap caplets git: repo: https://github.com/jayofelony/caplets.git @@ -591,6 +605,13 @@ with_items: "{{ packages.apt.downgrade }}" register: libpcap + - name: remove old libpcap files + become_user: root + file: + path: "/usr/local/src/{{ item }}" + state: absent + with_items: "{{ packages.apt.downgrade }}" + - name: add firmware packages to hold become_user: root dpkg_selections: @@ -602,13 +623,14 @@ - name: clean apt cache become_user: root apt: - autoclean: yes + autoclean: true - name: remove dependencies that are no longer required + become_user: root apt: autoremove: yes - - name: disable unecessary services + - name: disable unnecessary services become_user: root systemd: name: "{{ item }}" @@ -616,6 +638,14 @@ enabled: no with_items: "{{ services.disable }}" + - name: enable services + become_user: root + systemd: + name: "{{ item }}" + enabled: true + state: stopped + with_items: "{{ services.enable }}" + - name: remove ssh keys become_user: root file: From a52de85445e0a7955a95e18609ca0631ff4d5e40 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Sun, 24 Sep 2023 21:26:12 +0200 Subject: [PATCH 6/6] v2.4.3 Signed-off-by: Jeroen Oudshoorn --- builder/pwnagotchi.yml | 64 +++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 42 deletions(-) diff --git a/builder/pwnagotchi.yml b/builder/pwnagotchi.yml index 6112bd3a..990adb57 100644 --- a/builder/pwnagotchi.yml +++ b/builder/pwnagotchi.yml @@ -141,15 +141,12 @@ ARCHFLAGS: "-arch armv8" tasks: - - name: System details - debug: - msg="{{ item }}" - with_items: - - "{{ ansible_distribution }}" - - "{{ ansible_distribution_version }}" - - "{{ ansible_distribution_major_version }}" - - "{{ ansible_architecture }}" - - "{{ ansible_machine }}" + - name: Create pi user + user: + name: pi + password: "{{ 'raspberry' | password_hash('sha512') }}" + shell: /bin/bash + update_password: on_create - name: change hostname lineinfile: @@ -240,7 +237,7 @@ - name: install new firmware (bcm43436b0) copy: 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) @@ -272,22 +269,27 @@ - name: install new firmware (bcm43430a1) copy: 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 file: 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 file: 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 file: 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) replace: @@ -318,17 +320,17 @@ - name: install new firmware (bcm43455c0) copy: 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: - src: /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 + src: /usr/lib/modules/6.1.21-v8+/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko.xz + 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: 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) lineinfile: @@ -346,20 +348,6 @@ path: /usr/local/share/pwnagotchi/custom-plugins/ 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 git: repo: https://github.com/jayofelony/pwnagotchi.git @@ -371,14 +359,6 @@ path: /usr/local/share/pwnagotchi/ 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 command: "python3 setup.py sdist bdist_wheel" args: