Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PiShrink step to the workflow (#1) #54

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,13 @@ jobs:
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: PiShrink
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
run: |
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,21 @@ $(PACKER):
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: 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

.PHONY: image
image: pwnagotchi

clean:
- rm -rf pwnagotchi.egg-info
- rm -f $(PACKER)
- rm -rf dist pwnagotchi.egg-info
- rm -f $(PACKER)
7 changes: 5 additions & 2 deletions builder/raspberrypi64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.11.1-aarch64.zip"
url: "https://github.com/jayofelony/pwngrid/releases/download/v1.10.5/pwngrid-1.10.5-aarch64.zip"
apt:
downgrade:
- libpcap-dev_1.9.1-4_arm64.deb
Expand Down Expand Up @@ -174,7 +174,10 @@
- xxd
- zlib1g-dev
- zram-tools

environment:
ARCHFLAGS: "-arch aarch64"
QEMU_UNAME: "{{ kernel.full }}"

tasks:
# First we install packages
- name: install packages
Expand Down