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

raspberrypifw binaries do not work on raspberrypi3 #30026

Closed
makefu opened this issue Oct 2, 2017 · 5 comments
Closed

raspberrypifw binaries do not work on raspberrypi3 #30026

makefu opened this issue Oct 2, 2017 · 5 comments

Comments

@makefu
Copy link
Contributor

makefu commented Oct 2, 2017

Issue description

When trying to run any of the binaries packaged in raspberrypifw (more specifically i was looking for vcgencmd) on my raspberrypi3 i get:

[nix-shell:/var/src/nixpkgs]$ vcgencmd 
bash: /nix/store/75kzz46fpnb37jv6r2pd8y7zdjg4l5mg-raspberrypi-firmware-1.20170811/bin/vcgencmd: Accessing a corrupted shared library

Steps to reproduce

nix-shell -p raspberrypifw --run vcgencmd

Technical details

  • System: 18.03pre-git (Impala)
  • Nix version: nix-env (Nix) 1.11.14
  • Nixpkgs version: 18.03pre-git, rev: 799435b
  • Sandboxing enabled: true
@Mic92
Copy link
Member

Mic92 commented Oct 2, 2017

The package does patchelf on 32-bit arm executable and set a 64-bit link-loader (on aarch64):

$ file vcgencmd
vcgencmd: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, not stripped

Do we have 32-bit infrastructure for arm like we have on x86?

@dezgeg
Copy link
Contributor

dezgeg commented Oct 2, 2017

No, we don't. AFAIK it's more difficult than the equivalent on x86 since there's no equivalent multilib support for that in GCC (i.e. no gcc -m32) so an AArch64 -> ARM cross compiler is needed, I believe.

@dezgeg
Copy link
Contributor

dezgeg commented Apr 2, 2018

I changed the raspberrypifw package to only contain the firmware blobs and added a separate package raspberrypi-tools which builds the userland tools from the BSD3 source.

I tested that it compiles on AArch64, but don't have the hardware on hand right now (only RPi 1) so please test and close if it works now.

@dezgeg
Copy link
Contributor

dezgeg commented Apr 3, 2018

On IRC I got a test report that the vchiq module isn't working out-of-the-box on mainline, but there are kernel patches floating/merged that will make it work on either 4.17 or 4.18.

@florianjacob
Copy link
Contributor

This seems to work now as of 18.09 and kernel 4.18.16:

$ sudo vcgencmd measure_temp
temp=37.6'C

Sidenote: Requires root access. Without, this fails with a misleading error message:

$ vcgencmd
VCHI initialization failed

@Mic92 Mic92 closed this as completed Oct 30, 2018
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