chiefwigms / picobrew_pico

MIT License
149 stars 63 forks source link

Building custom image fails with Pi-Gen #331

Open LMartinez-Py opened 2 years ago

LMartinez-Py commented 2 years ago

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 commented 2 years ago

Did you run the script with sudo?

LMartinez-Py commented 2 years ago

Yes. All commands were run as sudo.

I don't have full logs because I shut down the VM for the day, but I can get them early tomorrow

On Sat, Feb 26, 2022, 12:42 PM Pete @.***> wrote:

Did you run the script with sudo?

β€” Reply to this email directly, view it on GitHub https://github.com/chiefwigms/picobrew_pico/issues/331#issuecomment-1052586806, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGKMVMFUX577S3L7DFYOXK3U5E3MLANCNFSM5PNRY7RA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

chiefwigms commented 2 years ago

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 commented 2 years ago

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

LMartinez-Py commented 2 years ago

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 commented 2 years ago
[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 commented 2 years ago

From https://github.com/RPi-Distro/pi-gen/issues/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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Agreed. Thanks for taking a look and documenting what you ran into. πŸ‘

tmack8001 commented 2 years ago
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. https://github.com/chiefwigms/picobrew_pico/issues/334

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

LEFsher commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

I used the recommended branch for the buster image.

I'll try bullseye sometime tomorrow morning

tmack8001 commented 2 years ago

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.