From fdd98bb37a299a33e195195e6f4b29430f38e30c Mon Sep 17 00:00:00 2001 From: Ravioli5 <157115073+Ravioli5@users.noreply.github.com> Date: Mon, 29 Jan 2024 13:33:47 +0530 Subject: [PATCH 01/26] Update 01-motd -fixed grammar (added a word) Signed-off-by: Ravioli5 <157115073+Ravioli5@users.noreply.github.com> --- builder/data/etc/update-motd.d/01-motd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/data/etc/update-motd.d/01-motd b/builder/data/etc/update-motd.d/01-motd index 08936d4d..37ad2880 100755 --- a/builder/data/etc/update-motd.d/01-motd +++ b/builder/data/etc/update-motd.d/01-motd @@ -30,4 +30,4 @@ echo echo " You can restart me using" echo " pwnkill" echo -echo " You learn more about me at https://pwnagotchi.ai/" +echo " You can learn more about me at https://pwnagotchi.ai/" From 78415b3137c9dbb81489d3d5ba8ffc745c6c90af Mon Sep 17 00:00:00 2001 From: wpa-2 <9049886+wpa-2@users.noreply.github.com> Date: Sat, 3 Feb 2024 15:13:44 +0000 Subject: [PATCH 02/26] Update 01-motd Maybe a good idea to point people to the new wiki instead. Signed-off-by: wpa-2 <9049886+wpa-2@users.noreply.github.com> --- builder/data/etc/update-motd.d/01-motd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/data/etc/update-motd.d/01-motd b/builder/data/etc/update-motd.d/01-motd index 37ad2880..31f6c6bd 100755 --- a/builder/data/etc/update-motd.d/01-motd +++ b/builder/data/etc/update-motd.d/01-motd @@ -30,4 +30,4 @@ echo echo " You can restart me using" echo " pwnkill" echo -echo " You can learn more about me at https://pwnagotchi.ai/" +echo " You can learn more about me at https://pwnagotchi.org/" From e7d8d632a009924f8a8c8159787c8a7f3bb96da3 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 09:30:49 -0500 Subject: [PATCH 03/26] Add publish workflow and update display layout --- .github/workflows/publish.yml | 188 +++++++++++++++++++++++++++++ pwnagotchi/ui/hw/waveshare3in52.py | 42 ++++--- 2 files changed, 211 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..ef7173de --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,188 @@ +name: Publish + +on: + workflow_dispatch: + inputs: + version: + description: 'Version number' + required: true + +jobs: + + publish: + runs-on: ubuntu-latest + steps: + + - name: Remove unnecessary directories + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf /usr/local/share/boost + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + + - name: Check disk space + run: df -BG + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Validate tag + id: tag-setter + run: | + TAG=${{ github.event.inputs.version }} + if [[ $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Tag $TAG is valid." + echo "TAG=$TAG" >> $GITHUB_OUTPUT + else + echo "Tag $TAG is not a valid semantic version. Aborting." + exit 1 + fi + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.9 + + - name: Install dependencies + run: | + sudo apt-get update && sudo apt-get install -y libdbus-1-dev curl unzip gettext qemu-utils qemu qemu-user-static binfmt-support + pip install -r requirements.txt + + - name: Update QEMU + run: | + sudo update-binfmts --enable qemu-arm + sudo update-binfmts --enable qemu-aarch64 + + - name: Restart binfmt-support + run: sudo service binfmt-support restart + + - name: Mount binfmt_misc + run: | + if ! grep -qs '/proc/sys/fs/binfmt_misc ' /proc/mounts; then + sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc + fi + + - name: Restart binfmt-support + run: sudo service binfmt-support restart + + - name: Update Languages + run: make update_langs + + - name: Compile Languages + run: make compile_langs + + - name: Check disk space + run: df -BG + + - name: Run Makefile + run: make + env: + PWN_VERSION: ${{ steps.tag-setter.outputs.TAG }} + + - name: Compress .img files + run: | + find /home/runner/work/ -type f -name "*.img" -exec xz --no-warn {} \; + + - name: Create tag + uses: actions/github-script@v7 + with: + script: | + const version = "${{ steps.tag-setter.outputs.TAG }}" + console.log(`Creating tag ${version}`) + await github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: `refs/tags/${version}`, + sha: context.sha + }) + + - name: Create Release + id: create_release + uses: actions/github-script@v7 + with: + script: | + const tag = "${{ steps.tag-setter.outputs.TAG }}" + console.log(`Creating release with tag: ${tag}`) + const release = await github.rest.repos.createRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + tag_name: tag, + name: tag, + draft: false, + prerelease: true, + generate_release_notes: true + }) + console.log(`Created release with id: ${release.data.id}`) + return release.data.id + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/github-script@v7 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + script: | + const fs = require('fs'); + const path = require('path'); + const release_id = "${{ steps.create_release.outputs.result }}"; + const asset_content_type = 'application/octet-stream'; + const distDir = '/home/runner/work/pwnagotchi/'; + + const uploadFile = async (filePath) => { + if (fs.lstatSync(filePath).isDirectory()) { + const files = fs.readdirSync(filePath); + for (const file of files) { + await uploadFile(path.join(filePath, file)); + } + } else { + // Check if the file has a .xz extension + if (path.extname(filePath) === '.xz') { + console.log(`Uploading ${filePath}...`); + + const asset_name = path.basename(filePath); + const asset_size = fs.statSync(filePath).size; + const asset = fs.createReadStream(filePath); + + const response = await github.rest.repos.uploadReleaseAsset({ + owner: context.repo.owner, + repo: context.repo.repo, + release_id: release_id, + name: asset_name, + data: asset, + headers: { + 'content-type': asset_content_type, + 'content-length': asset_size + } + }); + + console.log(`Uploaded ${filePath}: ${response.data.browser_download_url}`); + } + } + } + + await uploadFile(distDir); + + - name: Update Release + uses: actions/github-script@v7 + with: + script: | + const release_id = "${{ steps.create_release.outputs.result }}" + console.log(`Updating release with id: ${release_id}`) + github.rest.repos.updateRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + release_id: release_id, + tag_name: "${{ steps.tag-setter.outputs.TAG }}", + name: "${{ steps.tag-setter.outputs.TAG }}", + draft: false, + prerelease: false + }) + + - name: Save environment variable + run: echo "${{ steps.tag-setter.outputs.TAG }}" > env_var.txt + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: env-var + path: env_var.txt \ No newline at end of file diff --git a/pwnagotchi/ui/hw/waveshare3in52.py b/pwnagotchi/ui/hw/waveshare3in52.py index b2252a0b..95120fc6 100644 --- a/pwnagotchi/ui/hw/waveshare3in52.py +++ b/pwnagotchi/ui/hw/waveshare3in52.py @@ -9,36 +9,40 @@ class Waveshare3in52(DisplayImpl): super(Waveshare3in52, self).__init__(config, 'waveshare3in52') def layout(self): - fonts.setup(10, 8, 10, 18, 25, 9) - self._layout['width'] = 240 - self._layout['height'] = 360 - self._layout['face'] = (0, 43) - self._layout['name'] = (0, 14) - self._layout['channel'] = (0, 0) - self._layout['aps'] = (0, 71) - self._layout['uptime'] = (0, 25) - self._layout['line1'] = [0, 12, 240, 12] - self._layout['line2'] = [0, 116, 240, 116] - self._layout['friend_face'] = (12, 88) - self._layout['friend_name'] = (1, 103) - self._layout['shakes'] = (26, 117) - self._layout['mode'] = (0, 117) + fonts.setup(16, 14, 16, 100, 31, 15) + self._layout['width'] = 360 + self._layout['height'] = 240 + self._layout['face'] = (0, 40) + self._layout['name'] = (0, 0) + self._layout['channel'] = (300, 0) + self._layout['aps'] = (0, 220) + self._layout['uptime'] = (120, 0) + self._layout['line1'] = [0, 24, 360, 24] + self._layout['line2'] = [0, 220, 360, 220] + self._layout['friend_face'] = (0, 195) + self._layout['friend_name'] = (0, 185) + self._layout['shakes'] = (100, 220) + self._layout['mode'] = (0,200) self._layout['status'] = { - 'pos': (65, 26), + 'pos': (3, 170), 'font': fonts.status_font(fonts.Small), - 'max': 12 + 'max': 100 } return self._layout def initialize(self): - logging.info("initializing waveshare 3.52 inch lcd display") + logging.info("initializing waveshare 3.52 inch display") from pwnagotchi.ui.hw.libs.waveshare.v3in52.epd3in52 import EPD self._display = EPD() self._display.init() self._display.Clear() def render(self, canvas): - self._display.display(canvas) + self._display.Clear() + buf = self._display.getbuffer(canvas) + self._display.display(buf) + self._display.refresh() + def clear(self): - self._display.Clear() + self._display.Clear() \ No newline at end of file From e1be0f7674ed77b1910f3cbd12a90a28cc213451 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 10:01:12 -0500 Subject: [PATCH 04/26] Remove unnecessary clean-up step in Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3f10ad8d..4dfd756e 100644 --- a/Makefile +++ b/Makefile @@ -64,5 +64,5 @@ pwnagotchi: $(SDIST) builder/pwnagotchi.json.pkr.hcl builder/raspberrypi64.yml $ image: pwnagotchi clean: - - rm -rf build dist pwnagotchi.egg-info + - rm -rf dist pwnagotchi.egg-info - rm -f $(PACKER) From 12fd081ae06e9582a980df81ec21260f94c41580 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 10:09:57 -0500 Subject: [PATCH 05/26] Update required_plugins in pwnagotchi.json.pkr.hcl --- builder/pwnagotchi.json.pkr.hcl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builder/pwnagotchi.json.pkr.hcl b/builder/pwnagotchi.json.pkr.hcl index c08ff651..faa09ef2 100644 --- a/builder/pwnagotchi.json.pkr.hcl +++ b/builder/pwnagotchi.json.pkr.hcl @@ -2,10 +2,10 @@ # https://github.com/mkaczanowski/packer-builder-arm/pull/172 packer { required_plugins { - #arm = { - # version = "~> 1" - # source = "github.com/cdecoux/builder-arm" - #} + arm = { + version = "~> 1" + source = "github.com/cdecoux/builder-arm" + } ansible = { source = "github.com/hashicorp/ansible" version = "~> 1" From c882d0b67af3b71f4588f1146c72c1590d57b3c6 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 10:29:01 -0500 Subject: [PATCH 06/26] Update arm plugin source in pwnagotchi.json.pkr.hcl --- builder/pwnagotchi.json.pkr.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/pwnagotchi.json.pkr.hcl b/builder/pwnagotchi.json.pkr.hcl index faa09ef2..f2d6c098 100644 --- a/builder/pwnagotchi.json.pkr.hcl +++ b/builder/pwnagotchi.json.pkr.hcl @@ -4,7 +4,7 @@ packer { required_plugins { arm = { version = "~> 1" - source = "github.com/cdecoux/builder-arm" + source = "github.com/cdecoux/packer-plugin-builder-arm" } ansible = { source = "github.com/hashicorp/ansible" From 8724ca546daa9b1ae9bb6456d8e51601bdd162a9 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 10:51:18 -0500 Subject: [PATCH 07/26] Update packer builder-arm source URL --- builder/pwnagotchi.json.pkr.hcl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builder/pwnagotchi.json.pkr.hcl b/builder/pwnagotchi.json.pkr.hcl index f2d6c098..9c88bbb0 100644 --- a/builder/pwnagotchi.json.pkr.hcl +++ b/builder/pwnagotchi.json.pkr.hcl @@ -2,10 +2,10 @@ # https://github.com/mkaczanowski/packer-builder-arm/pull/172 packer { required_plugins { - arm = { - version = "~> 1" - source = "github.com/cdecoux/packer-plugin-builder-arm" - } + #arm = { + # version = "~> 1" + # source = "https://github.com/mkaczanowski/packer-builder-arm" + #} ansible = { source = "github.com/hashicorp/ansible" version = "~> 1" From 877b9fbba3d030898496fbe45487d0fff64cb8a5 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 10:57:33 -0500 Subject: [PATCH 08/26] Update Makefile and builder/pwnagotchi.json.pkr.hcl --- Makefile | 4 +- builder/pwnagotchi.json.pkr.hcl | 158 +++++++++++++++++++++++++++++--- 2 files changed, 147 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 4dfd756e..85e1f8df 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PACKER_VERSION := 1.10.0 PWN_HOSTNAME := pwnagotchi -PWN_VERSION := $(shell cut -d"'" -f2 < pwnagotchi/_version.py) +PWN_VERSION := ${PWN_VERSION} MACHINE_TYPE := $(shell uname -m) ifneq (,$(filter x86_64,$(MACHINE_TYPE))) @@ -56,7 +56,7 @@ $(SDIST): setup.py pwnagotchi pwnagotchi: | $(PACKER) # If the packer or ansible files are updated, rebuild the image. -pwnagotchi: $(SDIST) builder/pwnagotchi.json.pkr.hcl builder/raspberrypi64.yml $(shell find builder/data -type f) +pwnagotchi: $(SDIST) builder/pwnagotchi.json.pkr.hcl builder/raspberrypi64.yml builder/extras/nexmon.yml $(shell find builder/data -type f) 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 diff --git a/builder/pwnagotchi.json.pkr.hcl b/builder/pwnagotchi.json.pkr.hcl index 9c88bbb0..2ce17d68 100644 --- a/builder/pwnagotchi.json.pkr.hcl +++ b/builder/pwnagotchi.json.pkr.hcl @@ -2,10 +2,10 @@ # https://github.com/mkaczanowski/packer-builder-arm/pull/172 packer { required_plugins { - #arm = { - # version = "~> 1" - # source = "https://github.com/mkaczanowski/packer-builder-arm" - #} + arm = { + version = "1.0.0" + source = "github.com/cdecoux/builder-arm" + } ansible = { source = "github.com/hashicorp/ansible" version = "~> 1" @@ -51,6 +51,57 @@ source "arm" "rpi64-pwnagotchi" { } } +source "arm" "rpi32-pwnagotchi" { + file_checksum_url = "https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf-lite.img.xz.sha256" + file_urls = ["https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf-lite.img.xz"] + file_checksum_type = "sha256" + file_target_extension = "xz" + file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"] + image_path = "../../pwnagotchi-rpi-bullseye-${var.pwn_version}-armhf.img" + qemu_binary_source_path = "/usr/libexec/qemu-binfmt/arm-binfmt-P" + qemu_binary_destination_path = "/usr/libexec/qemu-binfmt/arm-binfmt-P" + image_build_method = "resize" + image_size = "9G" + image_type = "dos" + image_partitions { + name = "boot" + type = "c" + start_sector = "8192" + filesystem = "fat" + size = "256M" + mountpoint = "/boot" + } + image_partitions { + name = "root" + type = "83" + start_sector = "532480" + filesystem = "ext4" + size = "0" + mountpoint = "/" + } +} +source "arm" "opi-pwnagotchi" { + file_checksum_url = "https://github.com/jayofelony/orangepi/releases/download/v1.0/orangepi-raspios.img.xz.sha256" + file_urls = ["https://github.com/jayofelony/orangepi/releases/download/v1.0/orangepi-raspios.img.xz"] + file_checksum_type = "sha256" + file_target_extension = "xz" + file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"] + image_path = "../../pwnagotchi-opi-bullseye-${var.pwn_version}-arm64.img" + qemu_binary_source_path = "/usr/libexec/qemu-binfmt/aarch64-binfmt-P" + qemu_binary_destination_path = "/usr/libexec/qemu-binfmt/aarch64-binfmt-P" + image_build_method = "resize" + image_size = "9G" + image_type = "dos" + image_partitions { + name = "root" + type = "83" + start_sector = "8192" + filesystem = "ext4" + size = "0" + mountpoint = "/" + } +} + # a build block invokes sources and runs provisioning steps on them. The # documentation for build blocks can be found here: # https://www.packer.io/docs/from-1.5/blocks/build @@ -74,8 +125,48 @@ build { inline = ["chmod +x /usr/bin/*"] } + provisioner "file" { + destination = "/etc/systemd/system/" + sources = [ + "data/etc/systemd/system/bettercap.service", + "data/etc/systemd/system/pwnagotchi.service", + "data/etc/systemd/system/pwngrid-peer.service", + ] + } + provisioner "file" { + destination = "/etc/update-motd.d/01-motd" + source = "data/etc/update-motd.d/01-motd" + } provisioner "shell" { - inline = ["dpkg --add-architecture armhf"] + inline = ["chmod +x /etc/update-motd.d/*"] + } + provisioner "shell" { + inline = ["apt-get -y --allow-releaseinfo-change update", "apt-get -y dist-upgrade", "apt-get install -y --no-install-recommends ansible"] + } + provisioner "ansible-local" { + command = "ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 PWN_VERSION=${var.pwn_version} PWN_HOSTNAME=${var.pwn_hostname} ansible-playbook" + extra_arguments = ["--extra-vars \"ansible_python_interpreter=/usr/bin/python3\""] + playbook_file = "raspberrypi64.yml" + } +} + +build { + name = "Raspberry Pi 32 Pwnagotchi" + sources = ["source.arm.rpi32-pwnagotchi"] + provisioner "file" { + destination = "/usr/bin/" + sources = [ + "data/usr/bin/bettercap-launcher", + "data/usr/bin/hdmioff", + "data/usr/bin/hdmion", + "data/usr/bin/monstart", + "data/usr/bin/monstop", + "data/usr/bin/pwnagotchi-launcher", + "data/usr/bin/pwnlib", + ] + } + provisioner "shell" { + inline = ["chmod +x /usr/bin/*"] } provisioner "file" { @@ -86,7 +177,6 @@ build { "data/etc/systemd/system/pwngrid-peer.service", ] } - provisioner "file" { destination = "/etc/update-motd.d/01-motd" source = "data/etc/update-motd.d/01-motd" @@ -95,15 +185,57 @@ build { inline = ["chmod +x /etc/update-motd.d/*"] } provisioner "shell" { - inline = [ - "apt-get -y --allow-releaseinfo-change update", - "apt-get -y dist-upgrade", - "apt-get install -y --no-install-recommends ansible" - ] + inline = ["apt-get -y --allow-releaseinfo-change update", "apt-get -y dist-upgrade", "apt-get install -y --no-install-recommends ansible"] } provisioner "ansible-local" { command = "ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 PWN_VERSION=${var.pwn_version} PWN_HOSTNAME=${var.pwn_hostname} ansible-playbook" extra_arguments = ["--extra-vars \"ansible_python_interpreter=/usr/bin/python3\""] - playbook_file = "raspberrypi64.yml" + playbook_dir = "extras/" + playbook_file = "raspberrypi32.yml" } -} \ No newline at end of file +} + +#build { +# name = "Orange Pi Pwnagotchi" +# sources = ["source.arm.opi-pwnagotchi"] + +# provisioner "file" { +# destination = "/usr/bin/" +# sources = [ +# "data/usr/bin/bettercap-launcher", +# "data/usr/bin/hdmioff", +# "data/usr/bin/hdmion", +# "data/usr/bin/monstart", +# "data/usr/bin/monstop", +# "data/usr/bin/pwnagotchi-launcher", +# "data/usr/bin/pwnlib", +# ] +# } +# provisioner "shell" { +# inline = ["chmod +x /usr/bin/*"] +# } + +# provisioner "file" { +# destination = "/etc/systemd/system/" +# sources = [ +# "data/etc/systemd/system/bettercap.service", +# "data/etc/systemd/system/pwnagotchi.service", +# "data/etc/systemd/system/pwngrid-peer.service", +# ] +# } +# provisioner "file" { +# destination = "/etc/update-motd.d/01-motd" +# source = "data/etc/update-motd.d/01-motd" +# } +# provisioner "shell" { +# inline = ["chmod +x /etc/update-motd.d/*"] +# } +# provisioner "shell" { +# inline = ["apt-get -y --allow-releaseinfo-change update", "apt-get -y dist-upgrade", "apt-get install -y --no-install-recommends ansible"] +# } +# provisioner "ansible-local" { +# command = "ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 PWN_VERSION=${var.pwn_version} PWN_HOSTNAME=${var.pwn_hostname} ansible-playbook" +# extra_arguments = ["--extra-vars \"ansible_python_interpreter=/usr/bin/python3\""] +# playbook_file = "orangepi.yml" +# } +#} \ No newline at end of file From 50b1ceed81036d5ab46a85a47bb61107c9df60cc Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 11:01:49 -0500 Subject: [PATCH 09/26] Remove unnecessary file from pwnagotchi build process --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 85e1f8df..42783236 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,7 @@ $(SDIST): setup.py pwnagotchi pwnagotchi: | $(PACKER) # If the packer or ansible files are updated, rebuild the image. -pwnagotchi: $(SDIST) builder/pwnagotchi.json.pkr.hcl builder/raspberrypi64.yml builder/extras/nexmon.yml $(shell find builder/data -type f) +pwnagotchi: $(SDIST) builder/pwnagotchi.json.pkr.hcl builder/raspberrypi64.yml $(shell find builder/data -type f) 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 From 333804c3bb5efe93ce8114f62053992228e008c7 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 11:10:29 -0500 Subject: [PATCH 10/26] Remove unnecessary build configuration for Raspberry Pi 32 Pwnagotchi --- builder/pwnagotchi.json.pkr.hcl | 44 --------------------------------- 1 file changed, 44 deletions(-) diff --git a/builder/pwnagotchi.json.pkr.hcl b/builder/pwnagotchi.json.pkr.hcl index 2ce17d68..39d0a7a2 100644 --- a/builder/pwnagotchi.json.pkr.hcl +++ b/builder/pwnagotchi.json.pkr.hcl @@ -150,50 +150,6 @@ build { } } -build { - name = "Raspberry Pi 32 Pwnagotchi" - sources = ["source.arm.rpi32-pwnagotchi"] - provisioner "file" { - destination = "/usr/bin/" - sources = [ - "data/usr/bin/bettercap-launcher", - "data/usr/bin/hdmioff", - "data/usr/bin/hdmion", - "data/usr/bin/monstart", - "data/usr/bin/monstop", - "data/usr/bin/pwnagotchi-launcher", - "data/usr/bin/pwnlib", - ] - } - provisioner "shell" { - inline = ["chmod +x /usr/bin/*"] - } - - provisioner "file" { - destination = "/etc/systemd/system/" - sources = [ - "data/etc/systemd/system/bettercap.service", - "data/etc/systemd/system/pwnagotchi.service", - "data/etc/systemd/system/pwngrid-peer.service", - ] - } - provisioner "file" { - destination = "/etc/update-motd.d/01-motd" - source = "data/etc/update-motd.d/01-motd" - } - provisioner "shell" { - inline = ["chmod +x /etc/update-motd.d/*"] - } - provisioner "shell" { - inline = ["apt-get -y --allow-releaseinfo-change update", "apt-get -y dist-upgrade", "apt-get install -y --no-install-recommends ansible"] - } - provisioner "ansible-local" { - command = "ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 PWN_VERSION=${var.pwn_version} PWN_HOSTNAME=${var.pwn_hostname} ansible-playbook" - extra_arguments = ["--extra-vars \"ansible_python_interpreter=/usr/bin/python3\""] - playbook_dir = "extras/" - playbook_file = "raspberrypi32.yml" - } -} #build { # name = "Orange Pi Pwnagotchi" From 502e85693489b4b23e1ad024f6fd899c8365657f Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 11:22:39 -0500 Subject: [PATCH 11/26] Update QEMU and restart binfmt-support --- .github/workflows/publish.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ef7173de..2d605e19 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -48,22 +48,23 @@ jobs: sudo apt-get update && sudo apt-get install -y libdbus-1-dev curl unzip gettext qemu-utils qemu qemu-user-static binfmt-support pip install -r requirements.txt - - name: Update QEMU - run: | - sudo update-binfmts --enable qemu-arm - sudo update-binfmts --enable qemu-aarch64 + # - name: Update QEMU + # run: | + # sudo update-binfmts --enable qemu-arm + # sudo update-binfmts --enable qemu-aarch64 - - name: Restart binfmt-support - run: sudo service binfmt-support restart + # - name: Restart binfmt-support + # run: sudo service binfmt-support restart - name: Mount binfmt_misc run: | if ! grep -qs '/proc/sys/fs/binfmt_misc ' /proc/mounts; then + echo "Mounting binfmt_misc" sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc fi - - name: Restart binfmt-support - run: sudo service binfmt-support restart + # - name: Restart binfmt-support + # run: sudo service binfmt-support restart - name: Update Languages run: make update_langs From 6a2703cc27599e13629c0df2ae22f1eee2a732b4 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 11:34:03 -0500 Subject: [PATCH 12/26] Update QEMU in publish.yml --- .github/workflows/publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2d605e19..3491d57c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -48,10 +48,10 @@ jobs: sudo apt-get update && sudo apt-get install -y libdbus-1-dev curl unzip gettext qemu-utils qemu qemu-user-static binfmt-support pip install -r requirements.txt - # - name: Update QEMU - # run: | - # sudo update-binfmts --enable qemu-arm - # sudo update-binfmts --enable qemu-aarch64 + - name: Update QEMU + run: | + sudo update-binfmts --enable qemu-aarch64 + echo $(ls /usr/bin/qemu-aarch64-static) # - name: Restart binfmt-support # run: sudo service binfmt-support restart From ce1315b85f7892f3f78f7b7986a6ac91f689b38f Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 12:08:07 -0500 Subject: [PATCH 13/26] Add binfmt_misc registration for qemu-aarch64 --- .github/workflows/publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3491d57c..c3f64561 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -52,6 +52,7 @@ jobs: run: | sudo update-binfmts --enable qemu-aarch64 echo $(ls /usr/bin/qemu-aarch64-static) + echo ':qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-aarch64-static:' | sudo tee /proc/sys/fs/binfmt_misc/register # - name: Restart binfmt-support # run: sudo service binfmt-support restart From 829a6962d6fc3201e576456649c86d38a22264d5 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 12:17:41 -0500 Subject: [PATCH 14/26] Update binfmt-support and add checks for qemu-user-static package, binfmt-support service, and binfmt_misc filesystem --- .github/workflows/publish.yml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c3f64561..0af55246 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -54,8 +54,8 @@ jobs: echo $(ls /usr/bin/qemu-aarch64-static) echo ':qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-aarch64-static:' | sudo tee /proc/sys/fs/binfmt_misc/register - # - name: Restart binfmt-support - # run: sudo service binfmt-support restart + - name: Restart binfmt-support + run: sudo service binfmt-support restart - name: Mount binfmt_misc run: | @@ -64,8 +64,8 @@ jobs: sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc fi - # - name: Restart binfmt-support - # run: sudo service binfmt-support restart + - name: Restart binfmt-support + run: sudo service binfmt-support restart - name: Update Languages run: make update_langs @@ -75,7 +75,22 @@ jobs: - name: Check disk space run: df -BG - + + - name: Check qemu-user-static package + run: | + echo "Checking qemu-user-static package..." + dpkg -s qemu-user-static && echo "qemu-user-static is installed." || echo "qemu-user-static is NOT installed." + + - name: Check binfmt-support service + run: | + echo "Checking binfmt-support service..." + service binfmt-support status && echo "binfmt-support service is running." || echo "binfmt-support service is NOT running." + + - name: Check binfmt_misc filesystem + run: | + echo "Checking binfmt_misc filesystem..." + mount | grep binfmt_misc && echo "binfmt_misc is mounted." || echo "binfmt_misc is NOT mounted." + - name: Run Makefile run: make env: From a50695aef29d9bb64b62b052c4fa405764f44fa7 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 12:18:04 -0500 Subject: [PATCH 15/26] Update publish workflow and add Makefile2 --- .github/workflows/publish.yml | 1 - Makefile2 | 68 ++++++++++ builder/config.kcl | 241 ++++++++++++++++++++++++++++++++++ 3 files changed, 309 insertions(+), 1 deletion(-) create mode 100644 Makefile2 create mode 100644 builder/config.kcl diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0af55246..3e889dcc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -52,7 +52,6 @@ jobs: run: | sudo update-binfmts --enable qemu-aarch64 echo $(ls /usr/bin/qemu-aarch64-static) - echo ':qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-aarch64-static:' | sudo tee /proc/sys/fs/binfmt_misc/register - name: Restart binfmt-support run: sudo service binfmt-support restart diff --git a/Makefile2 b/Makefile2 new file mode 100644 index 00000000..88424859 --- /dev/null +++ b/Makefile2 @@ -0,0 +1,68 @@ +PACKER_VERSION := 1.10.0 +PWN_HOSTNAME := pwnagotchi +PWN_VERSION := ${PWN_VERSION} + +MACHINE_TYPE := $(shell uname -m) +ifneq (,$(filter x86_64,$(MACHINE_TYPE))) +GOARCH := amd64 +else ifneq (,$(filter i686,$(MACHINE_TYPE))) +GOARCH := 386 +else ifneq (,$(filter arm64% aarch64%,$(MACHINE_TYPE))) +GOARCH := arm64 +else ifneq (,$(filter arm%,$(MACHINE_TYPE))) +GOARCH := arm +else +GOARCH := amd64 +$(warning Unable to detect CPU arch from machine type $(MACHINE_TYPE), assuming $(GOARCH)) +endif + +# The Ansible part of the build can inadvertently change the active hostname of +# the build machine while updating the permanent hostname of the build image. +# If the unshare command is available, use it to create a separate namespace +# so hostname changes won't affect the build machine. +UNSHARE := $(shell command -v unshare) +ifneq (,$(UNSHARE)) +UNSHARE := $(UNSHARE) --uts +endif + +all: clean image clean + +update_langs: + @for lang in pwnagotchi/locale/*/; do\ + echo "updating language: $$lang ..."; \ + ./scripts/language.sh update $$(basename $$lang); \ + done + +compile_langs: + @for lang in pwnagotchi/locale/*/; do\ + echo "compiling language: $$lang ..."; \ + ./scripts/language.sh compile $$(basename $$lang); \ + done + +PACKER := ~/pwnagotchi/packer +PACKER_URL := https://releases.hashicorp.com/packer/$(PACKER_VERSION)/packer_$(PACKER_VERSION)_linux_$(GOARCH).zip +$(PACKER): + mkdir -p $(@D) + curl -L "$(PACKER_URL)" -o $(PACKER).zip + unzip $(PACKER).zip -d $(@D) + rm $(PACKER).zip + chmod +x $@ + +SDIST := dist/pwnagotchi-$(PWN_VERSION).tar.gz +$(SDIST): setup.py pwnagotchi + python3 setup.py sdist + +# Building the image requires packer, but don't rebuild the image just because packer updated. +pwnagotchi: | $(PACKER) + +# If the packer or ansible files are updated, rebuild the image. +pwnagotchi: $(SDIST) builder/pwnagotchi.json.pkr.hcl builder/raspberrypi32.yml builder/raspberrypi64.yml builder/orangepi.yml builder/extras/nexmon.yml $(shell find builder/data -type f) + + 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 + +.PHONY: image +image: pwnagotchi + +clean: + - rm -rf dist pwnagotchi.egg-info + - rm -f $(PACKER) diff --git a/builder/config.kcl b/builder/config.kcl new file mode 100644 index 00000000..2ce17d68 --- /dev/null +++ b/builder/config.kcl @@ -0,0 +1,241 @@ +# This is not working quite yet +# https://github.com/mkaczanowski/packer-builder-arm/pull/172 +packer { + required_plugins { + arm = { + version = "1.0.0" + source = "github.com/cdecoux/builder-arm" + } + ansible = { + source = "github.com/hashicorp/ansible" + version = "~> 1" + } + } +} + +variable "pwn_hostname" { + type = string +} + +variable "pwn_version" { + type = string +} + +source "arm" "rpi64-pwnagotchi" { + file_checksum_url = "https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz.sha256" + file_urls = ["https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz"] + file_checksum_type = "sha256" + file_target_extension = "xz" + file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"] + image_path = "../../../pwnagotchi-rpi-bookworm-${var.pwn_version}-arm64.img" + qemu_binary_source_path = "/usr/bin/qemu-aarch64-static" + qemu_binary_destination_path = "/usr/bin/qemu-aarch64-static" + image_build_method = "resize" + image_size = "9G" + image_type = "dos" + image_partitions { + name = "boot" + type = "c" + start_sector = "8192" + filesystem = "fat" + size = "256M" + mountpoint = "/boot/firmware" + } + image_partitions { + name = "root" + type = "83" + start_sector = "532480" + filesystem = "ext4" + size = "0" + mountpoint = "/" + } +} + +source "arm" "rpi32-pwnagotchi" { + file_checksum_url = "https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf-lite.img.xz.sha256" + file_urls = ["https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf-lite.img.xz"] + file_checksum_type = "sha256" + file_target_extension = "xz" + file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"] + image_path = "../../pwnagotchi-rpi-bullseye-${var.pwn_version}-armhf.img" + qemu_binary_source_path = "/usr/libexec/qemu-binfmt/arm-binfmt-P" + qemu_binary_destination_path = "/usr/libexec/qemu-binfmt/arm-binfmt-P" + image_build_method = "resize" + image_size = "9G" + image_type = "dos" + image_partitions { + name = "boot" + type = "c" + start_sector = "8192" + filesystem = "fat" + size = "256M" + mountpoint = "/boot" + } + image_partitions { + name = "root" + type = "83" + start_sector = "532480" + filesystem = "ext4" + size = "0" + mountpoint = "/" + } +} +source "arm" "opi-pwnagotchi" { + file_checksum_url = "https://github.com/jayofelony/orangepi/releases/download/v1.0/orangepi-raspios.img.xz.sha256" + file_urls = ["https://github.com/jayofelony/orangepi/releases/download/v1.0/orangepi-raspios.img.xz"] + file_checksum_type = "sha256" + file_target_extension = "xz" + file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"] + image_path = "../../pwnagotchi-opi-bullseye-${var.pwn_version}-arm64.img" + qemu_binary_source_path = "/usr/libexec/qemu-binfmt/aarch64-binfmt-P" + qemu_binary_destination_path = "/usr/libexec/qemu-binfmt/aarch64-binfmt-P" + image_build_method = "resize" + image_size = "9G" + image_type = "dos" + image_partitions { + name = "root" + type = "83" + start_sector = "8192" + filesystem = "ext4" + size = "0" + mountpoint = "/" + } +} + +# a build block invokes sources and runs provisioning steps on them. The +# documentation for build blocks can be found here: +# https://www.packer.io/docs/from-1.5/blocks/build +build { + name = "Raspberry Pi 64 Pwnagotchi" + sources = ["source.arm.rpi64-pwnagotchi"] + + provisioner "file" { + destination = "/usr/bin/" + sources = [ + "data/usr/bin/bettercap-launcher", + "data/usr/bin/hdmioff", + "data/usr/bin/hdmion", + "data/usr/bin/monstart", + "data/usr/bin/monstop", + "data/usr/bin/pwnagotchi-launcher", + "data/usr/bin/pwnlib", + ] + } + provisioner "shell" { + inline = ["chmod +x /usr/bin/*"] + } + + provisioner "file" { + destination = "/etc/systemd/system/" + sources = [ + "data/etc/systemd/system/bettercap.service", + "data/etc/systemd/system/pwnagotchi.service", + "data/etc/systemd/system/pwngrid-peer.service", + ] + } + provisioner "file" { + destination = "/etc/update-motd.d/01-motd" + source = "data/etc/update-motd.d/01-motd" + } + provisioner "shell" { + inline = ["chmod +x /etc/update-motd.d/*"] + } + provisioner "shell" { + inline = ["apt-get -y --allow-releaseinfo-change update", "apt-get -y dist-upgrade", "apt-get install -y --no-install-recommends ansible"] + } + provisioner "ansible-local" { + command = "ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 PWN_VERSION=${var.pwn_version} PWN_HOSTNAME=${var.pwn_hostname} ansible-playbook" + extra_arguments = ["--extra-vars \"ansible_python_interpreter=/usr/bin/python3\""] + playbook_file = "raspberrypi64.yml" + } +} + +build { + name = "Raspberry Pi 32 Pwnagotchi" + sources = ["source.arm.rpi32-pwnagotchi"] + provisioner "file" { + destination = "/usr/bin/" + sources = [ + "data/usr/bin/bettercap-launcher", + "data/usr/bin/hdmioff", + "data/usr/bin/hdmion", + "data/usr/bin/monstart", + "data/usr/bin/monstop", + "data/usr/bin/pwnagotchi-launcher", + "data/usr/bin/pwnlib", + ] + } + provisioner "shell" { + inline = ["chmod +x /usr/bin/*"] + } + + provisioner "file" { + destination = "/etc/systemd/system/" + sources = [ + "data/etc/systemd/system/bettercap.service", + "data/etc/systemd/system/pwnagotchi.service", + "data/etc/systemd/system/pwngrid-peer.service", + ] + } + provisioner "file" { + destination = "/etc/update-motd.d/01-motd" + source = "data/etc/update-motd.d/01-motd" + } + provisioner "shell" { + inline = ["chmod +x /etc/update-motd.d/*"] + } + provisioner "shell" { + inline = ["apt-get -y --allow-releaseinfo-change update", "apt-get -y dist-upgrade", "apt-get install -y --no-install-recommends ansible"] + } + provisioner "ansible-local" { + command = "ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 PWN_VERSION=${var.pwn_version} PWN_HOSTNAME=${var.pwn_hostname} ansible-playbook" + extra_arguments = ["--extra-vars \"ansible_python_interpreter=/usr/bin/python3\""] + playbook_dir = "extras/" + playbook_file = "raspberrypi32.yml" + } +} + +#build { +# name = "Orange Pi Pwnagotchi" +# sources = ["source.arm.opi-pwnagotchi"] + +# provisioner "file" { +# destination = "/usr/bin/" +# sources = [ +# "data/usr/bin/bettercap-launcher", +# "data/usr/bin/hdmioff", +# "data/usr/bin/hdmion", +# "data/usr/bin/monstart", +# "data/usr/bin/monstop", +# "data/usr/bin/pwnagotchi-launcher", +# "data/usr/bin/pwnlib", +# ] +# } +# provisioner "shell" { +# inline = ["chmod +x /usr/bin/*"] +# } + +# provisioner "file" { +# destination = "/etc/systemd/system/" +# sources = [ +# "data/etc/systemd/system/bettercap.service", +# "data/etc/systemd/system/pwnagotchi.service", +# "data/etc/systemd/system/pwngrid-peer.service", +# ] +# } +# provisioner "file" { +# destination = "/etc/update-motd.d/01-motd" +# source = "data/etc/update-motd.d/01-motd" +# } +# provisioner "shell" { +# inline = ["chmod +x /etc/update-motd.d/*"] +# } +# provisioner "shell" { +# inline = ["apt-get -y --allow-releaseinfo-change update", "apt-get -y dist-upgrade", "apt-get install -y --no-install-recommends ansible"] +# } +# provisioner "ansible-local" { +# command = "ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 PWN_VERSION=${var.pwn_version} PWN_HOSTNAME=${var.pwn_hostname} ansible-playbook" +# extra_arguments = ["--extra-vars \"ansible_python_interpreter=/usr/bin/python3\""] +# playbook_file = "orangepi.yml" +# } +#} \ No newline at end of file From dfbfd7f891629fa262cd52fafc074fe6900afefe Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 12:34:09 -0500 Subject: [PATCH 16/26] Update pwngrid to version 1.11.1 --- builder/pwnagotchi.json.pkr.hcl | 99 +-------------------------------- builder/raspberrypi64.yml | 2 +- 2 files changed, 3 insertions(+), 98 deletions(-) diff --git a/builder/pwnagotchi.json.pkr.hcl b/builder/pwnagotchi.json.pkr.hcl index 39d0a7a2..3e5181e7 100644 --- a/builder/pwnagotchi.json.pkr.hcl +++ b/builder/pwnagotchi.json.pkr.hcl @@ -51,56 +51,7 @@ source "arm" "rpi64-pwnagotchi" { } } -source "arm" "rpi32-pwnagotchi" { - file_checksum_url = "https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf-lite.img.xz.sha256" - file_urls = ["https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf-lite.img.xz"] - file_checksum_type = "sha256" - file_target_extension = "xz" - file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"] - image_path = "../../pwnagotchi-rpi-bullseye-${var.pwn_version}-armhf.img" - qemu_binary_source_path = "/usr/libexec/qemu-binfmt/arm-binfmt-P" - qemu_binary_destination_path = "/usr/libexec/qemu-binfmt/arm-binfmt-P" - image_build_method = "resize" - image_size = "9G" - image_type = "dos" - image_partitions { - name = "boot" - type = "c" - start_sector = "8192" - filesystem = "fat" - size = "256M" - mountpoint = "/boot" - } - image_partitions { - name = "root" - type = "83" - start_sector = "532480" - filesystem = "ext4" - size = "0" - mountpoint = "/" - } -} -source "arm" "opi-pwnagotchi" { - file_checksum_url = "https://github.com/jayofelony/orangepi/releases/download/v1.0/orangepi-raspios.img.xz.sha256" - file_urls = ["https://github.com/jayofelony/orangepi/releases/download/v1.0/orangepi-raspios.img.xz"] - file_checksum_type = "sha256" - file_target_extension = "xz" - file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"] - image_path = "../../pwnagotchi-opi-bullseye-${var.pwn_version}-arm64.img" - qemu_binary_source_path = "/usr/libexec/qemu-binfmt/aarch64-binfmt-P" - qemu_binary_destination_path = "/usr/libexec/qemu-binfmt/aarch64-binfmt-P" - image_build_method = "resize" - image_size = "9G" - image_type = "dos" - image_partitions { - name = "root" - type = "83" - start_sector = "8192" - filesystem = "ext4" - size = "0" - mountpoint = "/" - } -} + # a build block invokes sources and runs provisioning steps on them. The # documentation for build blocks can be found here: @@ -148,50 +99,4 @@ build { extra_arguments = ["--extra-vars \"ansible_python_interpreter=/usr/bin/python3\""] playbook_file = "raspberrypi64.yml" } -} - - -#build { -# name = "Orange Pi Pwnagotchi" -# sources = ["source.arm.opi-pwnagotchi"] - -# provisioner "file" { -# destination = "/usr/bin/" -# sources = [ -# "data/usr/bin/bettercap-launcher", -# "data/usr/bin/hdmioff", -# "data/usr/bin/hdmion", -# "data/usr/bin/monstart", -# "data/usr/bin/monstop", -# "data/usr/bin/pwnagotchi-launcher", -# "data/usr/bin/pwnlib", -# ] -# } -# provisioner "shell" { -# inline = ["chmod +x /usr/bin/*"] -# } - -# provisioner "file" { -# destination = "/etc/systemd/system/" -# sources = [ -# "data/etc/systemd/system/bettercap.service", -# "data/etc/systemd/system/pwnagotchi.service", -# "data/etc/systemd/system/pwngrid-peer.service", -# ] -# } -# provisioner "file" { -# destination = "/etc/update-motd.d/01-motd" -# source = "data/etc/update-motd.d/01-motd" -# } -# provisioner "shell" { -# inline = ["chmod +x /etc/update-motd.d/*"] -# } -# provisioner "shell" { -# inline = ["apt-get -y --allow-releaseinfo-change update", "apt-get -y dist-upgrade", "apt-get install -y --no-install-recommends ansible"] -# } -# provisioner "ansible-local" { -# command = "ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 PWN_VERSION=${var.pwn_version} PWN_HOSTNAME=${var.pwn_hostname} ansible-playbook" -# extra_arguments = ["--extra-vars \"ansible_python_interpreter=/usr/bin/python3\""] -# playbook_file = "orangepi.yml" -# } -#} \ No newline at end of file +} \ No newline at end of file diff --git a/builder/raspberrypi64.yml b/builder/raspberrypi64.yml index ec2115b6..985aacd3 100644 --- a/builder/raspberrypi64.yml +++ b/builder/raspberrypi64.yml @@ -44,7 +44,7 @@ ui: "https://github.com/bettercap/ui/releases/download/v1.3.0/ui.zip" pwngrid: source: "https://github.com/jayofelony/pwngrid.git" - url: "https://github.com/jayofelony/pwngrid/releases/download/v1.10.5/pwngrid-1.10.5-aarch64.zip" + url: "https://github.com/jayofelony/pwngrid/releases/download/v1.10.5/pwngrid-1.11.1-aarch64.zip" apt: downgrade: - libpcap-dev_1.9.1-4_arm64.deb From 1ffe6c4e3df40fdac3ac527020ae28213f2e08cd Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 12:34:34 -0500 Subject: [PATCH 17/26] Remove Makefile2 and update build process --- Makefile2 | 68 ------------- builder/config.kcl | 241 --------------------------------------------- 2 files changed, 309 deletions(-) delete mode 100644 Makefile2 delete mode 100644 builder/config.kcl diff --git a/Makefile2 b/Makefile2 deleted file mode 100644 index 88424859..00000000 --- a/Makefile2 +++ /dev/null @@ -1,68 +0,0 @@ -PACKER_VERSION := 1.10.0 -PWN_HOSTNAME := pwnagotchi -PWN_VERSION := ${PWN_VERSION} - -MACHINE_TYPE := $(shell uname -m) -ifneq (,$(filter x86_64,$(MACHINE_TYPE))) -GOARCH := amd64 -else ifneq (,$(filter i686,$(MACHINE_TYPE))) -GOARCH := 386 -else ifneq (,$(filter arm64% aarch64%,$(MACHINE_TYPE))) -GOARCH := arm64 -else ifneq (,$(filter arm%,$(MACHINE_TYPE))) -GOARCH := arm -else -GOARCH := amd64 -$(warning Unable to detect CPU arch from machine type $(MACHINE_TYPE), assuming $(GOARCH)) -endif - -# The Ansible part of the build can inadvertently change the active hostname of -# the build machine while updating the permanent hostname of the build image. -# If the unshare command is available, use it to create a separate namespace -# so hostname changes won't affect the build machine. -UNSHARE := $(shell command -v unshare) -ifneq (,$(UNSHARE)) -UNSHARE := $(UNSHARE) --uts -endif - -all: clean image clean - -update_langs: - @for lang in pwnagotchi/locale/*/; do\ - echo "updating language: $$lang ..."; \ - ./scripts/language.sh update $$(basename $$lang); \ - done - -compile_langs: - @for lang in pwnagotchi/locale/*/; do\ - echo "compiling language: $$lang ..."; \ - ./scripts/language.sh compile $$(basename $$lang); \ - done - -PACKER := ~/pwnagotchi/packer -PACKER_URL := https://releases.hashicorp.com/packer/$(PACKER_VERSION)/packer_$(PACKER_VERSION)_linux_$(GOARCH).zip -$(PACKER): - mkdir -p $(@D) - curl -L "$(PACKER_URL)" -o $(PACKER).zip - unzip $(PACKER).zip -d $(@D) - rm $(PACKER).zip - chmod +x $@ - -SDIST := dist/pwnagotchi-$(PWN_VERSION).tar.gz -$(SDIST): setup.py pwnagotchi - python3 setup.py sdist - -# Building the image requires packer, but don't rebuild the image just because packer updated. -pwnagotchi: | $(PACKER) - -# If the packer or ansible files are updated, rebuild the image. -pwnagotchi: $(SDIST) builder/pwnagotchi.json.pkr.hcl builder/raspberrypi32.yml builder/raspberrypi64.yml builder/orangepi.yml builder/extras/nexmon.yml $(shell find builder/data -type f) - - 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 - -.PHONY: image -image: pwnagotchi - -clean: - - rm -rf dist pwnagotchi.egg-info - - rm -f $(PACKER) diff --git a/builder/config.kcl b/builder/config.kcl deleted file mode 100644 index 2ce17d68..00000000 --- a/builder/config.kcl +++ /dev/null @@ -1,241 +0,0 @@ -# This is not working quite yet -# https://github.com/mkaczanowski/packer-builder-arm/pull/172 -packer { - required_plugins { - arm = { - version = "1.0.0" - source = "github.com/cdecoux/builder-arm" - } - ansible = { - source = "github.com/hashicorp/ansible" - version = "~> 1" - } - } -} - -variable "pwn_hostname" { - type = string -} - -variable "pwn_version" { - type = string -} - -source "arm" "rpi64-pwnagotchi" { - file_checksum_url = "https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz.sha256" - file_urls = ["https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz"] - file_checksum_type = "sha256" - file_target_extension = "xz" - file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"] - image_path = "../../../pwnagotchi-rpi-bookworm-${var.pwn_version}-arm64.img" - qemu_binary_source_path = "/usr/bin/qemu-aarch64-static" - qemu_binary_destination_path = "/usr/bin/qemu-aarch64-static" - image_build_method = "resize" - image_size = "9G" - image_type = "dos" - image_partitions { - name = "boot" - type = "c" - start_sector = "8192" - filesystem = "fat" - size = "256M" - mountpoint = "/boot/firmware" - } - image_partitions { - name = "root" - type = "83" - start_sector = "532480" - filesystem = "ext4" - size = "0" - mountpoint = "/" - } -} - -source "arm" "rpi32-pwnagotchi" { - file_checksum_url = "https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf-lite.img.xz.sha256" - file_urls = ["https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf-lite.img.xz"] - file_checksum_type = "sha256" - file_target_extension = "xz" - file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"] - image_path = "../../pwnagotchi-rpi-bullseye-${var.pwn_version}-armhf.img" - qemu_binary_source_path = "/usr/libexec/qemu-binfmt/arm-binfmt-P" - qemu_binary_destination_path = "/usr/libexec/qemu-binfmt/arm-binfmt-P" - image_build_method = "resize" - image_size = "9G" - image_type = "dos" - image_partitions { - name = "boot" - type = "c" - start_sector = "8192" - filesystem = "fat" - size = "256M" - mountpoint = "/boot" - } - image_partitions { - name = "root" - type = "83" - start_sector = "532480" - filesystem = "ext4" - size = "0" - mountpoint = "/" - } -} -source "arm" "opi-pwnagotchi" { - file_checksum_url = "https://github.com/jayofelony/orangepi/releases/download/v1.0/orangepi-raspios.img.xz.sha256" - file_urls = ["https://github.com/jayofelony/orangepi/releases/download/v1.0/orangepi-raspios.img.xz"] - file_checksum_type = "sha256" - file_target_extension = "xz" - file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"] - image_path = "../../pwnagotchi-opi-bullseye-${var.pwn_version}-arm64.img" - qemu_binary_source_path = "/usr/libexec/qemu-binfmt/aarch64-binfmt-P" - qemu_binary_destination_path = "/usr/libexec/qemu-binfmt/aarch64-binfmt-P" - image_build_method = "resize" - image_size = "9G" - image_type = "dos" - image_partitions { - name = "root" - type = "83" - start_sector = "8192" - filesystem = "ext4" - size = "0" - mountpoint = "/" - } -} - -# a build block invokes sources and runs provisioning steps on them. The -# documentation for build blocks can be found here: -# https://www.packer.io/docs/from-1.5/blocks/build -build { - name = "Raspberry Pi 64 Pwnagotchi" - sources = ["source.arm.rpi64-pwnagotchi"] - - provisioner "file" { - destination = "/usr/bin/" - sources = [ - "data/usr/bin/bettercap-launcher", - "data/usr/bin/hdmioff", - "data/usr/bin/hdmion", - "data/usr/bin/monstart", - "data/usr/bin/monstop", - "data/usr/bin/pwnagotchi-launcher", - "data/usr/bin/pwnlib", - ] - } - provisioner "shell" { - inline = ["chmod +x /usr/bin/*"] - } - - provisioner "file" { - destination = "/etc/systemd/system/" - sources = [ - "data/etc/systemd/system/bettercap.service", - "data/etc/systemd/system/pwnagotchi.service", - "data/etc/systemd/system/pwngrid-peer.service", - ] - } - provisioner "file" { - destination = "/etc/update-motd.d/01-motd" - source = "data/etc/update-motd.d/01-motd" - } - provisioner "shell" { - inline = ["chmod +x /etc/update-motd.d/*"] - } - provisioner "shell" { - inline = ["apt-get -y --allow-releaseinfo-change update", "apt-get -y dist-upgrade", "apt-get install -y --no-install-recommends ansible"] - } - provisioner "ansible-local" { - command = "ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 PWN_VERSION=${var.pwn_version} PWN_HOSTNAME=${var.pwn_hostname} ansible-playbook" - extra_arguments = ["--extra-vars \"ansible_python_interpreter=/usr/bin/python3\""] - playbook_file = "raspberrypi64.yml" - } -} - -build { - name = "Raspberry Pi 32 Pwnagotchi" - sources = ["source.arm.rpi32-pwnagotchi"] - provisioner "file" { - destination = "/usr/bin/" - sources = [ - "data/usr/bin/bettercap-launcher", - "data/usr/bin/hdmioff", - "data/usr/bin/hdmion", - "data/usr/bin/monstart", - "data/usr/bin/monstop", - "data/usr/bin/pwnagotchi-launcher", - "data/usr/bin/pwnlib", - ] - } - provisioner "shell" { - inline = ["chmod +x /usr/bin/*"] - } - - provisioner "file" { - destination = "/etc/systemd/system/" - sources = [ - "data/etc/systemd/system/bettercap.service", - "data/etc/systemd/system/pwnagotchi.service", - "data/etc/systemd/system/pwngrid-peer.service", - ] - } - provisioner "file" { - destination = "/etc/update-motd.d/01-motd" - source = "data/etc/update-motd.d/01-motd" - } - provisioner "shell" { - inline = ["chmod +x /etc/update-motd.d/*"] - } - provisioner "shell" { - inline = ["apt-get -y --allow-releaseinfo-change update", "apt-get -y dist-upgrade", "apt-get install -y --no-install-recommends ansible"] - } - provisioner "ansible-local" { - command = "ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 PWN_VERSION=${var.pwn_version} PWN_HOSTNAME=${var.pwn_hostname} ansible-playbook" - extra_arguments = ["--extra-vars \"ansible_python_interpreter=/usr/bin/python3\""] - playbook_dir = "extras/" - playbook_file = "raspberrypi32.yml" - } -} - -#build { -# name = "Orange Pi Pwnagotchi" -# sources = ["source.arm.opi-pwnagotchi"] - -# provisioner "file" { -# destination = "/usr/bin/" -# sources = [ -# "data/usr/bin/bettercap-launcher", -# "data/usr/bin/hdmioff", -# "data/usr/bin/hdmion", -# "data/usr/bin/monstart", -# "data/usr/bin/monstop", -# "data/usr/bin/pwnagotchi-launcher", -# "data/usr/bin/pwnlib", -# ] -# } -# provisioner "shell" { -# inline = ["chmod +x /usr/bin/*"] -# } - -# provisioner "file" { -# destination = "/etc/systemd/system/" -# sources = [ -# "data/etc/systemd/system/bettercap.service", -# "data/etc/systemd/system/pwnagotchi.service", -# "data/etc/systemd/system/pwngrid-peer.service", -# ] -# } -# provisioner "file" { -# destination = "/etc/update-motd.d/01-motd" -# source = "data/etc/update-motd.d/01-motd" -# } -# provisioner "shell" { -# inline = ["chmod +x /etc/update-motd.d/*"] -# } -# provisioner "shell" { -# inline = ["apt-get -y --allow-releaseinfo-change update", "apt-get -y dist-upgrade", "apt-get install -y --no-install-recommends ansible"] -# } -# provisioner "ansible-local" { -# command = "ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 PWN_VERSION=${var.pwn_version} PWN_HOSTNAME=${var.pwn_hostname} ansible-playbook" -# extra_arguments = ["--extra-vars \"ansible_python_interpreter=/usr/bin/python3\""] -# playbook_file = "orangepi.yml" -# } -#} \ No newline at end of file From f410feb2bbdc356ba5d587629a91ca0f0c9765f2 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 13:09:36 -0500 Subject: [PATCH 18/26] Add check for qemu-aarch64 in binfmt_misc --- .github/workflows/publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3e889dcc..17b23bf4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -89,6 +89,7 @@ jobs: run: | echo "Checking binfmt_misc filesystem..." mount | grep binfmt_misc && echo "binfmt_misc is mounted." || echo "binfmt_misc is NOT mounted." + echo $(ls /proc/sys/fs/binfmt_misc | grep qemu-aarch64) - name: Run Makefile run: make From f895b0697800a3993351d61ccd61cb86e1382b6b Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 13:19:56 -0500 Subject: [PATCH 19/26] Update qemu binary paths for arm64 --- builder/pwnagotchi.json.pkr.hcl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builder/pwnagotchi.json.pkr.hcl b/builder/pwnagotchi.json.pkr.hcl index 3e5181e7..e707724d 100644 --- a/builder/pwnagotchi.json.pkr.hcl +++ b/builder/pwnagotchi.json.pkr.hcl @@ -28,8 +28,8 @@ source "arm" "rpi64-pwnagotchi" { file_target_extension = "xz" file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"] image_path = "../../../pwnagotchi-rpi-bookworm-${var.pwn_version}-arm64.img" - qemu_binary_source_path = "/usr/bin/qemu-aarch64-static" - qemu_binary_destination_path = "/usr/bin/qemu-aarch64-static" + qemu_binary_source_path = "/usr/libexec/qemu-binfmt/aarch64-binfmt-P" + qemu_binary_destination_path = "/usr/libexec/qemu-binfmt/aarch64-binfmt-P" image_build_method = "resize" image_size = "9G" image_type = "dos" @@ -39,7 +39,7 @@ source "arm" "rpi64-pwnagotchi" { start_sector = "8192" filesystem = "fat" size = "256M" - mountpoint = "/boot/firmware" + mountpoint = "/boot" } image_partitions { name = "root" From 0638832532ee3a2832549b7813df5325363d3ccd Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 13:42:59 -0500 Subject: [PATCH 20/26] Update mountpoint for boot partition --- builder/pwnagotchi.json.pkr.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/pwnagotchi.json.pkr.hcl b/builder/pwnagotchi.json.pkr.hcl index e707724d..dfc1ba8e 100644 --- a/builder/pwnagotchi.json.pkr.hcl +++ b/builder/pwnagotchi.json.pkr.hcl @@ -39,7 +39,7 @@ source "arm" "rpi64-pwnagotchi" { start_sector = "8192" filesystem = "fat" size = "256M" - mountpoint = "/boot" + mountpoint = "/boot/firmware" } image_partitions { name = "root" From 4ffad03c91edcb9e6db30de1d632c61824a2c6e6 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 15:44:50 -0500 Subject: [PATCH 21/26] Update distDir path in publish.yml --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 17b23bf4..3dca7f96 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -143,7 +143,7 @@ jobs: const path = require('path'); const release_id = "${{ steps.create_release.outputs.result }}"; const asset_content_type = 'application/octet-stream'; - const distDir = '/home/runner/work/pwnagotchi/'; + const distDir = '/home/runner/work/pwnagotchi-bookworm/'; const uploadFile = async (filePath) => { if (fs.lstatSync(filePath).isDirectory()) { From 1ef3a8867977e49b2d140986f69f84db75bcfc46 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 17:34:23 -0500 Subject: [PATCH 22/26] Update distDir path in publish.yml --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3dca7f96..e168b1fb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -143,7 +143,7 @@ jobs: const path = require('path'); const release_id = "${{ steps.create_release.outputs.result }}"; const asset_content_type = 'application/octet-stream'; - const distDir = '/home/runner/work/pwnagotchi-bookworm/'; + const distDir = '/home/runner/work/'; const uploadFile = async (filePath) => { if (fs.lstatSync(filePath).isDirectory()) { From d7fefa78f0922965240a236142f564384196e708 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 17:40:38 -0500 Subject: [PATCH 23/26] Commented out make step and added code to create .img file --- .github/workflows/publish.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e168b1fb..9538a897 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -91,10 +91,13 @@ jobs: mount | grep binfmt_misc && echo "binfmt_misc is mounted." || echo "binfmt_misc is NOT mounted." echo $(ls /proc/sys/fs/binfmt_misc | grep qemu-aarch64) - - name: Run Makefile - run: make - env: - PWN_VERSION: ${{ steps.tag-setter.outputs.TAG }} + # - name: Run Makefile + # run: make + # env: + # PWN_VERSION: ${{ steps.tag-setter.outputs.TAG }} + - name: Create .img file + run: | + dd if=/dev/zero of=/home/runner/work/pwnagotchi/pwnagotchi/disk.img bs=1M count=1024 - name: Compress .img files run: | From 7587f38c28b7de5af0b34ad14298a144542a62a2 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 17:46:20 -0500 Subject: [PATCH 24/26] Update disk.img path in publish.yml --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9538a897..951a91f5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -97,7 +97,7 @@ jobs: # PWN_VERSION: ${{ steps.tag-setter.outputs.TAG }} - name: Create .img file run: | - dd if=/dev/zero of=/home/runner/work/pwnagotchi/pwnagotchi/disk.img bs=1M count=1024 + dd if=/dev/zero of=/home/runner/work/pwnagotchi-bookworm/pwnagotchi-bookworm/disk.img bs=1M count=1024 - name: Compress .img files run: | From 3fb91498cd9648f882980ba2967250d586f20985 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 5 Feb 2024 17:52:51 -0500 Subject: [PATCH 25/26] Enable Makefile execution and remove disk image creation --- .github/workflows/publish.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 951a91f5..2ef78a5e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -91,13 +91,13 @@ jobs: mount | grep binfmt_misc && echo "binfmt_misc is mounted." || echo "binfmt_misc is NOT mounted." echo $(ls /proc/sys/fs/binfmt_misc | grep qemu-aarch64) - # - name: Run Makefile - # run: make - # env: - # PWN_VERSION: ${{ steps.tag-setter.outputs.TAG }} - - name: Create .img file - run: | - dd if=/dev/zero of=/home/runner/work/pwnagotchi-bookworm/pwnagotchi-bookworm/disk.img bs=1M count=1024 + - name: Run Makefile + run: make + env: + PWN_VERSION: ${{ steps.tag-setter.outputs.TAG }} + # - name: Create .img file + # run: | + # dd if=/dev/zero of=/home/runner/work/pwnagotchi-bookworm/pwnagotchi-bookworm/disk.img bs=1M count=1024 - name: Compress .img files run: | From b3d8a4420885b8079c4d43101626b7642fd4c2ec Mon Sep 17 00:00:00 2001 From: Chris Kerins Date: Mon, 5 Feb 2024 20:14:18 -0500 Subject: [PATCH 26/26] Update waveshare3in52.py Signed-off-by: Chris Kerins --- pwnagotchi/ui/hw/waveshare3in52.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pwnagotchi/ui/hw/waveshare3in52.py b/pwnagotchi/ui/hw/waveshare3in52.py index 95120fc6..3489728a 100644 --- a/pwnagotchi/ui/hw/waveshare3in52.py +++ b/pwnagotchi/ui/hw/waveshare3in52.py @@ -38,11 +38,10 @@ class Waveshare3in52(DisplayImpl): self._display.Clear() def render(self, canvas): - self._display.Clear() buf = self._display.getbuffer(canvas) self._display.display(buf) self._display.refresh() def clear(self): - self._display.Clear() \ No newline at end of file + self._display.Clear()