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

Building custom image fails with Pi-Gen #331

Open
LMartinez-Py opened this issue Feb 26, 2022 · 17 comments
Open

Building custom image fails with Pi-Gen #331

LMartinez-Py opened this issue Feb 26, 2022 · 17 comments

Comments

@LMartinez-Py
Copy link

LMartinez-Py commented Feb 26, 2022

I have an Ubuntu 20 system running on VM.

I ran the scripts as listed and I get a console error in Stage 2 when it is running the custom picobrew server setup.

Write after the echo for 'Making bluetooth accessible without being root...'
"unable to set CAP_SETFCAP effective capability: Operation not permitted"

Seems like this might be an issue with Pi-Gen and the suggestion there is to run it with QCow turned off on the Buster branch.
Commenting out the bluetooth code seems to work and create the image, but there is software missing. So I'm inclined to believe this is the offending block of code.

Can anyone recreate this?

@chiefwigms
Copy link
Owner

Did you run the script with sudo?

@LMartinez-Py
Copy link
Author

LMartinez-Py commented Feb 26, 2022 via email

@chiefwigms
Copy link
Owner

Tried a build and that happens in <checkoutdir>/pi-gen/stage2/01-sys-tweaks/ - all our stuff is in stage2/99-picobrewserver-setup, so its an issue of pi-gen. Is there a reason you're trying to make a custom image? The last one should have all the OS tweaks we do in it (i think)... if not, the last image was built Jan 27, 2021 - so you could try to checkout a hash in pi-gen's repo about the same time (although you wouldn't get whatever official tweaks raspberry pi has made)

@chiefwigms
Copy link
Owner

when i have more time, i'll try to debug and get pi-gen working (hopefully soon)

@LMartinez-Py
Copy link
Author

Main reason is to get the access point off the network and general "just want to make it work" nerd stuff.

I recall the build failing earlier on the default branch of pi-gen. I've got a couple of machines building the image right now. My investment in this point is just out of curiosity,

@LMartinez-Py
Copy link
Author

[19:48:08] End /home/pibuilder/pi-gen/stage2/03-set-timezone
[19:48:08] Begin /home/pibuilder/pi-gen/stage2/99-picobrewserver-setup
[19:48:08] Begin /home/pibuilder/pi-gen/stage2/99-picobrewserver-setup/00-run-chroot.sh
WARNING: libcap needs an update (cap=40 should have a name).
Making bluetooth accessible without being root...
unable to set CAP_SETFCAP effective capability: Operation not permitted

This is running off of pi-gen -b Buster

[19:47:16] End /home/pi/pi-gen/stage2/01-sys-tweaks/00-packages-nr
[19:47:16] Begin /home/pi/pi-gen/stage2/01-sys-tweaks/00-packages
WARNING: libcap needs an update (cap=40 should have a name).
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python-is-python3

This is pi-gen main branch.

No modification on either end for the stage2/99-picobrewserver-setup

@chiefwigms
Copy link
Owner

From RPi-Distro/pi-gen#565, I think latest is bullseye - there's a comment there that says anything not that will take some modifications. I'm gonna run a build w/ it now, but probably won't check until tomorrow morning

@chiefwigms
Copy link
Owner

chiefwigms commented Feb 27, 2022

Also - it looks like bullseye has python 3.9 - you'll probably have to pull changes from 3rd_party_updates_02-20-2022 to pull in newer 3rd party packages. And likely the whole AP+Repeater configuration I setup from (https://raspberrypi.stackexchange.com/questions/89803/access-point-as-wifi-router-repeater-optional-with-bridge) probably won't work, so 🤷‍♂️

@tmack8001
Copy link
Collaborator

I don't recall any changes we have made to the OS level that would require a new image. The only thing that could benefit from doing that the Bluetooth stuff now for Tilt support (used by subset of folks) and to prevent a year of git changes (not that we have a super large number of changes nowadays anyway) from being pulled and someone thinking the second boot takes 5+ minutes is "server is broken" type thing.

Benefits from within Raspbian are the best things we would get from a new image which would be similar to doing things like apt full-upgrade && apt dist-upgrade yourself (we don't do this in the update and restart).

You would likely get further by just making the systemd changes yourself @LMartinez-Py to disable the correct systemd process. This would then tell the OS not to start the process upon next login. There maybe other changes you need to make as mentioned in PMs about how the various systemd processes are linked together another might require the access point before running itself.

@LMartinez-Py
Copy link
Author

True. For my purposes it would be best to make the changes to an already running installation.

If for whatever reason a new build would needed we'd end up running into these problems so I figured it was good to share.

@tmack8001
Copy link
Collaborator

Agreed. Thanks for taking a look and documenting what you ran into. 👍

@tmack8001
Copy link
Collaborator

git rev-parse HEAD

225f69828fa05361d6028edf2d7a69db73fe2b45

Meantime you can simply check out the above sha. I verified today that our image can simply be built from that sha for verifying compatibility with the newer chips included in recently Pi 4 Model B boards. This was to fix another user's issue with starting up with a ~1yr old image... I call that success that we haven't had a need to release another software version in almost a year. #334

One of these days I'll get around to writing another 100,000 lines of code to force everyone to update again. 😜 ♾️

@LEFsher
Copy link

LEFsher commented Mar 15, 2022

The way I see it @tmack8001 is you guys have done a remarkable job in building and setting up this project thank you for all of your hard work, dedication, and time you have devoted to helping people like me continue to brew beer after we were let down by a screwed up company. Thank you 🍺🍻🍺👍🍻

@tmack8001
Copy link
Collaborator

@LEFsher I've been able to build from pi-gen master. There was one modification I needed to make given the fact we explicitly want to remove dhcpcd5 from the distro and that was to also remove raspberrypi-net-mods from the stage4/00-install-packages/00-packages file for when building a stage5 image (includes X11 and HDMI display support vs a headless stage2 "-lite" build).

I did however build a RELEASE=bullseye target image vs targeting a RELEASE=buster image so likely whatever issues you were facing were using the master pi-gen for building an older Raspbian release?

I have yet to test the image that I was able to build... as I don't have a spare SD card at the moment and thus would need to remove and re-image one of my existing ones, which isn't a big deal just didn't want to do with the short amount of time I had today.

@tmack8001
Copy link
Collaborator

There are some test images uploaded to https://github.com/chiefwigms/picobrew_pico/releases/tag/untagged-63abf5fbf92dd8711684 for those that might have access to a unreleased release (maybe just @chiefwigms and I as "owner/contributor" people). I can look to upload else where if someone wants to test bullseye with their local setup.

@LMartinez-Py
Copy link
Author

I used the recommended branch for the buster image.

I'll try bullseye sometime tomorrow morning

@tmack8001
Copy link
Collaborator

I've been able to get an image created, but did require a bit of fiddling around with dependencies... Will update this issue when identified what is the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants