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

[BUG] pwnagotchi image can't be built #1115

Open
llamasoft opened this issue Sep 16, 2022 · 7 comments · May be fixed by #1120
Open

[BUG] pwnagotchi image can't be built #1115

llamasoft opened this issue Sep 16, 2022 · 7 comments · May be fixed by #1120
Labels
bug Something isn't working

Comments

@llamasoft
Copy link

Describe the bug
It's currently impossible to build a pwnagotchi image due to a number of reasons:

  • The image's main apt repo changed from "stable" to "oldstable" which causes the initial apt-get update to fail.
  • The re4son kernel apt repository keys are expired.
  • The arm-image packer plugin repo has been renamed.

To Reproduce
Steps to reproduce the behavior:

  1. Run make image

Additional context
I recently started working on building a pwnagotchi but got a Waveshare v3 display. I saw that support for the display had been merged but that no pwnagotchi images have been released in over a year. I tried to build the image myself but kept running into issues.

I'm currently working on a fix for most of these. 👍

@llamasoft llamasoft added the bug Something isn't working label Sep 16, 2022
@TQMatvey
Copy link

TQMatvey commented Sep 19, 2022

just tried to build using your fork and makefix branch,
`cd builder && sudo /usr/bin/unshare --uts /tmp/packer build -var "pwn_hostname=pwnagotchi" -var "pwn_version=1.5.5" pwnagotchi.json
Error loading configuration:

fork/exec /tmp/packer-plugin-3560001340.zip: permission denied
make: *** [Makefile:56: pwnagotchi-raspios-lite-1.5.5.img] Error 1`

Are you also stuck on that?

@llamasoft
Copy link
Author

I haven't quite worked out what causes that issue yet, but if you rerun the makefile with sudo (i.e. sudo make image) it'll fix it.
Ideally, the fix would be upgrading builder/pwnagotchi.json to HCL so it can use the required_plugins directive instead of installing plugins manually. That said, I was trying to keep my changes minimal and the JSON -> HCL conversion felt out of scope for just getting the builds working again.

@TQMatvey
Copy link

anyways i seemingly fixed everything.. building now, going without any issues, fixed re4son keys also, will push my work to github a bit later

@TQMatvey
Copy link

anyways i can confirm, i fully fixed builds and kernel keys, you can check my fork

@Allstreamer
Copy link

Tryed Building with your fork, i get a warning and it fails:

Warning: Warning when preparing build: "pwnagotchi"

last_partition_extra_size is deprecated, use target_image_size to grow your
image

here is the failure:

==> pwnagotchi: losetup --show -f -P output-pwnagotchi/image
==> pwnagotchi: error losetup --show -f -P exit status 1: losetup: output-pwnagotchi/image: failed to set up loop device: No such device or address
==> pwnagotchi:
Build 'pwnagotchi' errored after 1 minute 8 seconds: step canceled or halted

@llamasoft
Copy link
Author

llamasoft commented Sep 23, 2022

Two things:

  1. This is an issue to track the image not being buildable, not a troubleshooting thread for the development branch I'm still working on. Please reserve any build issue troubleshooting for the PR once I submit it.

  2. The losetup issue is because packer-plugin-arm-image requires that you use an actual Linux system that supports loop devices. Windows Subsystem for Linux (WSL) and MacOS don't support loop devices. Unfortunately, that also means that building under Docker on either of those systems won't work either. You will need to use an honest to goodness Debian/Ubuntu system or VM. https://github.com/solo-io/packer-plugin-arm-image/issues?q=is%3Aissue+losetup

@llamasoft llamasoft linked a pull request Oct 4, 2022 that will close this issue
9 tasks
@D337z
Copy link

D337z commented Apr 15, 2023

The issues are mainly that the versions of programs like Go, Packer and the like are so outdated that the newer programs that depend on them can't be built using them. You have to manually download newer versions from the websites via wget and install them in order to use them. On top of that, it seems that Packer was deliberately sabotaged as it includes scripts in the JSON that require sudo to run but won't work unless a separate bash script is used to run the commands.
It's also trying to pull an older 2019 version of Raspbian instead of trying to always pull the most recent version to create the image file with.
Oh, and good luck trying to compile a 32-bit version because you'll have to track down a specific version of a program (that I can't recall the name of at the moment) that works in 32-bit. You'll also have to change the Makefile to download the correct items or just do it manually and erase those horrible bits of code. And then there's the json file...just don't. If you can take the bin files that you compiled and toss them into a working image, just do it and run far far away. The JSON file will be a reference for you that Packer would otherwise require.
So, have fun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants