Add PiShrink step to the workflow (#1)

* Add PiShrink step to the workflow

* Add environment variables for Raspberry Pi 64-bit builder

* Update Makefile command to include debug information

* Add source distribution target to Makefile

* Remove unnecessary provisioner command

* Add armhf architecture support

* Remove armhf architecture provisioning

* Refactor Makefile to remove unnecessary files

* Update Makefile command in publish.yml

* Update pwngrid URL in raspberrypi64.yml

* Add permissions to publish workflow

* Remove unnecessary permissions in publish.yml
This commit is contained in:
Chris Kerins
2024-02-06 12:53:45 -05:00
committed by GitHub
parent 3cc172a526
commit e1d8001fb4
3 changed files with 19 additions and 8 deletions

View File

@ -95,9 +95,13 @@ jobs:
run: make run: make
env: env:
PWN_VERSION: ${{ steps.tag-setter.outputs.TAG }} PWN_VERSION: ${{ steps.tag-setter.outputs.TAG }}
# - name: Create .img file
# run: | - name: PiShrink
# dd if=/dev/zero of=/home/runner/work/pwnagotchi-bookworm/pwnagotchi-bookworm/disk.img bs=1M count=1024 run: |
wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh
chmod +x pishrink.sh
sudo mv pishrink.sh /usr/local/bin
find /home/runner/work/ -type f -name "*.img" -exec sudo pishrink.sh {} \;
- name: Compress .img files - name: Compress .img files
run: | run: |

View File

@ -48,11 +48,15 @@ $(PACKER):
rm $(PACKER).zip rm $(PACKER).zip
chmod +x $@ 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. # Building the image requires packer, but don't rebuild the image just because packer updated.
pwnagotchi: | $(PACKER) pwnagotchi: | $(PACKER)
# If the packer or ansible files are updated, rebuild the image. # If the packer or ansible files are updated, rebuild the image.
pwnagotchi: builder/pwnagotchi.json.pkr.hcl builder/raspberrypi64.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 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
@ -60,5 +64,5 @@ pwnagotchi: builder/pwnagotchi.json.pkr.hcl builder/raspberrypi64.yml $(shell fi
image: pwnagotchi image: pwnagotchi
clean: clean:
- rm -rf pwnagotchi.egg-info - rm -rf dist pwnagotchi.egg-info
- rm -f $(PACKER) - rm -f $(PACKER)

View File

@ -44,7 +44,7 @@
ui: "https://github.com/bettercap/ui/releases/download/v1.3.0/ui.zip" ui: "https://github.com/bettercap/ui/releases/download/v1.3.0/ui.zip"
pwngrid: pwngrid:
source: "https://github.com/jayofelony/pwngrid.git" source: "https://github.com/jayofelony/pwngrid.git"
url: "https://github.com/jayofelony/pwngrid/releases/download/v1.10.5/pwngrid-1.11.1-aarch64.zip" url: "https://github.com/jayofelony/pwngrid/releases/download/v1.10.5/pwngrid-1.10.5-aarch64.zip"
apt: apt:
downgrade: downgrade:
- libpcap-dev_1.9.1-4_arm64.deb - libpcap-dev_1.9.1-4_arm64.deb
@ -174,7 +174,10 @@
- xxd - xxd
- zlib1g-dev - zlib1g-dev
- zram-tools - zram-tools
environment:
ARCHFLAGS: "-arch aarch64"
QEMU_UNAME: "{{ kernel.full }}"
tasks: tasks:
# First we install packages # First we install packages
- name: install packages - name: install packages