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

binfmt errors (and mitigation) #48

Open
seanboyce opened this issue Jan 4, 2025 · 1 comment
Open

binfmt errors (and mitigation) #48

seanboyce opened this issue Jan 4, 2025 · 1 comment

Comments

@seanboyce
Copy link

seanboyce commented Jan 4, 2025

Hello!

When I ran the default podman command for licheerv nano, I encountered a few problems. I'm using the 'fix' branch (although the problem exists in master too, I think). I've managed to mitigate them, by entering the container image and modifying it.

  1. Issue: binfmt is not mounted. This one is easy, I just entered the container and ran:
    mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc

echo 1 > /proc/sys/fs/binfmt_misc/status

  1. binfmt doesn't have binaries for the architecture riscv64. This one was tougher.

First, I installed the binaries via:
apt-install qemu-system-misc

Then, the system still could not find them, so I registered them manually with:

echo ':qemu-riscv64:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf3\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/libexec/qemu-binfmt/riscv64-binfmt-P:OCPF' > /proc/sys/fs/binfmt_misc/register

After this, it would try and build.

  1. OpenSBI patch fails to apply correctly and the build halts.

This may have been caused by my mildly ham-fisted attempt to fix things. I resolved it by deleting the OpenSBI directory, re-cloning it into that directory, entering it, and executing:

git checkout 216793f

Then I re-ran the makefile from within the container, and it eventually spat out an image, which seems to boot. I'm having some problems with RNDIS DHCP not working, but that seems unrelated to the above, and I bet it will work fine when I switch to serial.

@seanboyce
Copy link
Author

Soldered in a serial port and logged in, core problem seems to be I ran make without specifying a config file. So it didn't build with any packages.

Installed with the pre-built image instead, this works fine :)

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

1 participant