Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dev-embedded/rpi-eeprom Election for Pi4 or Pi5
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
jlpoole
Guru
Guru


Joined: 01 Nov 2005
Posts: 483
Location: Salem, OR

PostPosted: Wed Mar 13, 2024 4:41 pm    Post subject: dev-embedded/rpi-eeprom Election for Pi4 or Pi5 Reply with quote

I have a Gentoo image from September, 2013, built on the GenPi64 project. I returned to it and was going to update it when I learned of a recent introduction of making an election between Pi 4 and Pi 5 for the package dev-embedded/rpi-eeprom. If this image were just for a single unit, no problem: I select whatever is appropriate.

But here's the rub. I have a Raspberry Pi 5, and several Pi 4s and Zero Pi 2 Ws. What I am hoping to do is have the Pi5 serve as Funtoo-like server where I compile updates and then stage the compiled binaries which the lesser Pis can access and download to the respective platforms and would not have to compile. I have not set up such a system before, e.g. one server compiles everything and then acts as a binary server for the others, but believe Gentoo has a recipe on how to do such which I am about to learn. In the meantime, this update attempt has flagged the issue of making an election and I wonder how making an election would affect the unit as a binary server for other distinct Pis.

Am I going to be able to select "pi5" for my Pi5 unit and select "pi4" for my others (including the Pi Zero 2 W) and then point the non-Pi5s to the Pi5 and pull binaries from the Pi5?

Raspberry Pi Models Compared
Code:
Model      Processor     ARM Cortex Instruction Set
========   ============  ========== ===============
PiZero2W   BCM2710A1     A53        Armv8-A
Pi4B       BCM2711B0/C0  A72        Armv8-A
Pi5        BCM2712       A76        ARMv8.2-A


Since the instruction set for the PiZero2W and Pi4B are identical, I've been able to use the SD HC card on a Pi4, compile everything, and then change the SD HC Card to a PiZero2W and run it knowing that I have a 500 MB memory limit. I am banking on the fact that the Pi5 instructions set being a 2nd revision will, hopefully, for the most part compile byte code that can run on the lesser two models. Hence, I can use the Pi5 to be the laboring oar of compiling updates which are then pulled by the lesser two models.

Here is the session that brought to my attention the election for dev-embedded/rpi-eeprom. I'm hoping that each machine can have dev-embedded/rpi-eeprom set as appropriate and that code generated on one will not affect the other. I thought by posting this concern/question here, we would have documented the response should others consider this matter.

Code:

jlpoole@pizero2 ~ $ sudo emerge --update --newuse --deep @world -p

 * IMPORTANT: config file '/etc/portage/package.env/distcc' needs updating.
 * See the CONFIGURATION FILES and CONFIGURATION FILES UPDATE TOOLS
 * sections of the emerge man page to learn how to update config files.

These are the packages that would be merged:

Calculating dependencies  .

!!! Problem resolving dependencies for dev-embedded/rpi-eeprom from @profile
... done!
Dependency resolution took 10.24 s.


!!! The ebuild selected to satisfy "dev-embedded/rpi-eeprom" has unmet requirements.
- dev-embedded/rpi-eeprom-21.0_p1::gentoo USE="-pi4 -pi5" PYTHON_TARGETS="python3_11 -python3_10 -python3_12"

  The following REQUIRED_USE flag constraints are unsatisfied:
    exactly-one-of ( pi4 pi5 )

  The above constraints are a subset of the following complete expression:
    any-of ( python_targets_python3_10 python_targets_python3_11 python_targets_python3_12 ) exactly-one-of ( pi4 pi5 )

(dependency required by "@profile" [set])
(dependency required by "@world" [argument])

 * IMPORTANT: 3 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

jlpoole@pizero2 ~ $ exit
exit
Script done.
jlpoole@pizero2 ~ $ eix dev-embedded/rpi-eeprom
[U] dev-embedded/rpi-eeprom
     Available versions:  15.0_p1{gpkg} 21.0_p1 {pi4 pi5 PYTHON_TARGETS="python3_10 python3_11 python3_12"}
     Installed versions:  15.0_p1{gpkg}(05:01:30 PM 10/25/2023)(PYTHON_TARGETS="python3_11 -python3_10")
     Homepage:            https://github.com/raspberrypi/rpi-eeprom/
     Description:         Updater for Raspberry Pi 4/5 bootloader and the VL805 USB controller

jlpoole@pizero2 ~ $ date
Wed Mar 13 09:05:18 AM PDT 2024
jlpoole@pizero2 ~ $
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Wed Mar 13, 2024 5:16 pm    Post subject: Reply with quote

With the caveat that I have only read about the pieces in the documentation, and not attempted this, I think what you want is:
  1. Set FEATURES="binpkg-multi-instance" on the Pi5.
  2. Set package.use accordingly on both Pi4 and Pi5 systems.
  3. On the Pi5, build for Pi4 systems: USE=pi4-settings emerge --buildpkgonly dev-embedded/rpi-eeprom.
  4. On the Pi5, build for itself: emerge dev-embedded/rpi-eeprom.
  5. On the Pi4 systems, use emerge --binpkg-respect-use=y --usepkgonly dev-embedded/rpi-eeprom.
Explanation:
  1. This will preserve both the Pi4 build and Pi5 build in the binpkg directory.
  2. This will cause the systems to prefer their own type by default, if not overridden.
  3. This will build a Pi4-compatible package, despite being on the Pi5. It will not be installed, since you don't want to install a Pi4 build on a Pi5 system.
  4. This installs the default (and thus, per step 2, Pi5-compatible) settings on the Pi5 system.
  5. This fetches from the binpkg server, and --binpkg-respect-use=y forces it to grab the Pi4 build.
All this assumes that a Pi5 system can USE=pi4 emerge --buildpkgonly dev-embedded/rpi-eeprom successfully. If building it requires running operations a Pi5 cannot do, then you are stuck.
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 474
Location: San Diego, California USA

PostPosted: Wed Mar 13, 2024 5:17 pm    Post subject: Reply with quote

I know one major reason why the rpri-eeprom package is different for Pi5 and Pi4: the 'vcgencmd' utility. This utility is used to set and get low-level information in the RPI including the boot loader configs, clock measurements, mode configuration, etc. Different Pi models support different functionality. So it's not just the instruction set differences, it's that the functionality is different on the different devices because the boot loaders on RPI have evolved over time.

I don't have a good answer for you, but realize those utilities (and associated libraries) are different. And, unfortunately, they are all installed in /usr with the same names so they conflict.
Back to top
View user's profile Send private message
Phoenix591
Guru
Guru


Joined: 17 Sep 2007
Posts: 487

PostPosted: Wed Mar 13, 2024 5:39 pm    Post subject: Reply with quote

Hmm, these could actually be dropped here. I've been using my own ebuild for rpi-eeprom that installs all the files and the script is already smart enough to look in the correct directory based on the running system.
Back to top
View user's profile Send private message
jlpoole
Guru
Guru


Joined: 01 Nov 2005
Posts: 483
Location: Salem, OR

PostPosted: Wed Mar 13, 2024 10:37 pm    Post subject: Reply with quote

Phoenix591 wrote:
Hmm, these could actually be dropped here. I've been using my own ebuild for rpi-eeprom that installs all the files and the script is already smart enough to look in the correct directory based on the running system.


Clarification: the script that Phoenix591 references as "is already smart enough" is the official Raspberry Pi Foundation's code, the link is to the Foundation's Github account.

If I'm understanding Phoenix591 correctly, he is suggesting that the election of "rpi4" or "rpi5" may be unnecessary given that the Raspberry Pi Foundation's script, rpi-eeprom-update, will handle both situations. If my understanding is correct, then I think the maintainers of dev-embedded/rpi-eeprom should comment here.

(Interesting, the Raspberry Pi Foundation's script, rpi-eeprom-update, has no copyright or license information within it. I thought Github requires every file to have such.)
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 474
Location: San Diego, California USA

PostPosted: Wed Mar 13, 2024 10:52 pm    Post subject: Reply with quote

jlpoole wrote:
If I'm understanding Phoenix591 correctly, he is suggesting that the election of "rpi4" or "rpi5" may be unnecessary given that the Raspberry Pi Foundation's script, rpi-eeprom-update, will handle both situations. If my understanding is correct, then I think the maintainers of dev-embedded/rpi-eeprom should comment here.


That particular script may do 'the right thing' but I pointed out another utility in that package that is definitely different between Pi4 and Pi5. There may be others.

-Ryan
Back to top
View user's profile Send private message
Phoenix591
Guru
Guru


Joined: 17 Sep 2007
Posts: 487

PostPosted: Thu Mar 14, 2024 1:05 am    Post subject: Reply with quote

gentoo_ram wrote:
jlpoole wrote:
If I'm understanding Phoenix591 correctly, he is suggesting that the election of "rpi4" or "rpi5" may be unnecessary given that the Raspberry Pi Foundation's script, rpi-eeprom-update, will handle both situations. If my understanding is correct, then I think the maintainers of dev-embedded/rpi-eeprom should comment here.


That particular script may do 'the right thing' but I pointed out another utility in that package that is definitely different between Pi4 and Pi5. There may be others.

-Ryan


Vcgencmd isn't even in that package. It's part of the mothballed raspberrypi-userland package, and the replacement raspberrypi-utils package.

And yes the same command works just fine on pi 4 and 5 it just has different capabilities depending on where it's running.
Back to top
View user's profile Send private message
jlpoole
Guru
Guru


Joined: 01 Nov 2005
Posts: 483
Location: Salem, OR

PostPosted: Fri Mar 29, 2024 12:50 am    Post subject: Reply with quote

Hu wrote:
With the caveat that I have only read about the pieces in the documentation, and not attempted this, I think what you want is:
  1. Set FEATURES="binpkg-multi-instance" on the Pi5.
  2. Set package.use accordingly on both Pi4 and Pi5 systems.
  3. On the Pi5, build for Pi4 systems: USE=pi4-settings emerge --buildpkgonly dev-embedded/rpi-eeprom.
  4. On the Pi5, build for itself: emerge dev-embedded/rpi-eeprom.
  5. On the Pi4 systems, use emerge --binpkg-respect-use=y --usepkgonly dev-embedded/rpi-eeprom.
Explanation:
  1. This will preserve both the Pi4 build and Pi5 build in the binpkg directory.
  2. This will cause the systems to prefer their own type by default, if not overridden.
  3. This will build a Pi4-compatible package, despite being on the Pi5. It will not be installed, since you don't want to install a Pi4 build on a Pi5 system.
  4. This installs the default (and thus, per step 2, Pi5-compatible) settings on the Pi5 system.
  5. This fetches from the binpkg server, and --binpkg-respect-use=y forces it to grab the Pi4 build.
All this assumes that a Pi5 system can USE=pi4 emerge --buildpkgonly dev-embedded/rpi-eeprom successfully. If building it requires running operations a Pi5 cannot do, then you are stuck.

Thank you, Hu. I'm now getting to the stage of configuring my machines for binary distributions and your suggestions will be helpful.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum