Hermanverschooten

Hermanverschooten

Custom Nerves firmware for RPi5 issues

I am going out of the frying pan into the fire today…

I wanted to create a custom firmware for my RPi5, I need nftables.
So I cloned the repo at the latest tag (v0.3.1), set my MIX_TARGET, changed the mix.exs file, as I have done several times in the past.
I got my dependencies and compiled, so far so good.
Now I need to get to the make menuconfig, so I ran mix nerves.system.shell copied the docker command and ran it. Still good.

But when I do make menuconfig I just get a blank screen, with a single line on the bottom

/home/nerves/project/.config - Buildroot 2024.05.2 Configuration----------

That’s all. No menus, nothing and I have to ctrl-c to get out of it.

I assumed it has something to do with me being on an M2-Mac, so I ssh-d into my Ubuntu development machine and did the same dance.
But here I cannot even get the firmware to compile.

==> nerves
==> nerves_system_br
Generated nerves_system_br app
==> nerves_toolchain_ctng
Compiling 1 file (.ex)
Generated nerves_toolchain_ctng app
==> nerves_toolchain_aarch64_nerves_linux_gnu
Generated nerves_toolchain_aarch64_nerves_linux_gnu app
==> gratwifi_rpi5
Generated gratwifi_rpi5 app
Buildroot extracted to /home/herman/Projects/nerves/custom_rpi5/deps/nerves_system_br/buildroot.

Applying 0001-erlang-clean-up-target-installation.patch using patch:
patching file package/erlang/erlang.mk
Hunk #1 succeeded at 93 (offset -2 lines).

Applying 0002-mtools-Disable-iconv-use-on-target.patch using patch:
patching file package/mtools/mtools.mk

Applying 0003-NERVES_DEFCONFIG_DIR-support.patch using patch:
patching file Makefile
Hunk #2 succeeded at 995 (offset 6 lines).

Applying 0004-Add-customizable-linux-logo.patch using patch:
patching file linux/Config.ext.in
patching file linux/linux-ext-customlogo.mk
patching file package/Config.in
Hunk #1 succeeded at 282 (offset 2 lines).
patching file package/customlogo/Config.in
patching file package/customlogo/customlogo.mk

Applying 0005-kernel-wireless-regdb-install-regdb-in-kernel.patch using patch:
patching file linux/Config.ext.in
patching file linux/linux-ext-kernel-wireless-regdb.mk
patching file package/Config.in
Hunk #1 succeeded at 2459 (offset 101 lines).
patching file package/kernel-wireless-regdb/Config.in
patching symbolic link package/kernel-wireless-regdb/kernel-wireless-regdb.hash
patching file package/kernel-wireless-regdb/kernel-wireless-regdb.mk

Applying 0006-erlang-force-configure-options.patch using patch:
patching file package/erlang/erlang.mk
Hunk #1 succeeded at 39 (offset 8 lines).

Applying 0007-erlang-support-OTP-21-27.patch using patch:
patching file package/erlang/21.3.8.24/0001-erts-ethread-instruct-libatomic_ops-we-do-require-CA.patch
patching file package/erlang/21.3.8.24/0002-erts-emulator-reorder-inclued-headers-paths.patch
patching file package/erlang/21.3.8.24/0003-Link-with-LDLIBS-instead-of-LIBS-for-DED.patch
patching file package/erlang/21.3.8.24/0004-erlang-enable-deterministic-builds.patch
patching file package/erlang/22.3.4.26/0001-erts-ethread-instruct-libatomic_ops-we-do-require-CA.patch
patching file package/erlang/22.3.4.26/0002-erts-emulator-reorder-inclued-headers-paths.patch
patching file package/erlang/22.3.4.26/0003-erlang-enable-deterministic-builds.patch
patching file package/erlang/22.3.4.26/0004-disksup-update-df-call-to-work-with-Busybox.patch
patching file package/erlang/23.3.4.14/0001-erts-ethread-instruct-libatomic_ops-we-do-require-CA.patch
patching file package/erlang/23.3.4.14/0002-erts-emulator-reorder-inclued-headers-paths.patch
patching file package/erlang/23.3.4.14/0003-erlang-enable-deterministic-builds.patch
patching file package/erlang/23.3.4.14/0004-disksup-update-df-call-to-work-with-Busybox.patch
patching file package/erlang/24.3.2/0001-erts-ethread-instruct-libatomic_ops-we-do-require-CA.patch
patching file package/erlang/24.3.2/0002-erts-emulator-reorder-inclued-headers-paths.patch
patching file package/erlang/24.3.2/0003-erlang-enable-deterministic-builds.patch
patching file package/erlang/24.3.2/0004-disksup-update-df-call-to-work-with-Busybox.patch
patching file package/erlang/25.3.2/0001-erts-emulator-reorder-inclued-headers-paths.patch
patching file package/erlang/25.3.2/0003-disksup-update-df-call-to-work-with-Busybox.patch
patching file package/erlang/26.2.5/0001-disksup-update-df-call-to-work-with-Busybox.patch
patching file package/erlang/26.2.5/0002-erlang-libei-arch-compile.patch
patching file package/erlang/27.0.1/0001-disksup-update-df-call-to-work-with-Busybox.patch
patching file package/erlang/Config.in
patching file package/erlang/erlang.hash
patching file package/erlang/erlang.mk

Applying 0008-erlang-don-t-install-to-target.patch using patch:
patching file package/erlang/erlang.mk
Hunk #1 succeeded at 48 with fuzz 2 (offset 3 lines).

Applying 0009-rpi-firmware-support-custom-version-selection.patch using patch:
patching file package/rpi-firmware/Config.in
patching file package/rpi-firmware/rpi-firmware.mk

Applying 0010-Revert-package-libp11-bump-to-version-0.4.12.patch using patch:
patching file package/libp11/0001-Update-wp11_rsa.c.patch
patching file package/libp11/0001-src-p11_attr.c-fix-build-with-gcc-4.8.patch
patching file package/libp11/libp11.hash
patching file package/libp11/libp11.mk

Applying 0011-toolchain-external-refine-support-library-search-to-.patch using patch:
patching file toolchain/toolchain-external/pkg-toolchain-external.mk
Hunk #1 succeeded at 451 (offset 16 lines).

Applying 0012-fwup-bump-to-v1.10.1.patch using patch:
patching file package/fwup/fwup.hash
patching file package/fwup/fwup.mk

Applying 0013-uboot-support-alternative-TEE-filenames.patch using patch:
patching file boot/uboot/Config.in
patching file boot/uboot/uboot.mk

Applying 0014-Install-Linux-headers-to-staging.patch using patch:
patching file linux/linux.mk
Hunk #1 succeeded at 553 (offset 4 lines).
make: Entering directory '/home/herman/Projects/nerves/custom_rpi5/deps/nerves_system_br/buildroot-2024.05.2'
  GEN     /home/herman/Projects/nerves/custom_rpi5/.nerves/artifacts/gratwifi_rpi5-portable-0.3.1/Makefile
#
# configuration written to /home/herman/Projects/nerves/custom_rpi5/.nerves/artifacts/gratwifi_rpi5-portable-0.3.1/.config
#
make: Leaving directory '/home/herman/Projects/nerves/custom_rpi5/deps/nerves_system_br/buildroot-2024.05.2'
------------

Build directory successfully created.

Configuration: /home/herman/Projects/nerves/custom_rpi5/nerves_defconfig

Next, do the following:
   1. cd /home/herman/Projects/nerves/custom_rpi5/.nerves/artifacts/gratwifi_rpi5-portable-0.3.1
   2. make

For additional options, run 'make help' in the build directory.

IMPORTANT: If you update nerves_system_br, you should rerun this script.
.** (Mix) Nerves encountered an error while constructing the artifact
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
/bin/bash: line 1: ./bin/cat: cannot execute binary file: Exec format error
make[1]: *** [Makefile:750: target-finalize] Error 126
make: *** [Makefile:23: _all] Error 2

I traced the error back to the installation of the certificates, apparently it is trying to call the target cat command instead of the host’s.

So now I am stuck, on my Mac the firmware compiles, but make menuconfig is empty, on Ubuntu it doesn’t compile.

Help?

Marked As Solved

tomfarm

tomfarm

Are you using Kitty as your terminal? It sets TERM to xterm-kitty, which can lead to strange problems.

https://github.com/kovidgoyal/kitty/issues/713

Setting TERM to xterm in the nerves shell might solve the blank screen

mix nerves.system.shell
## wait a bit :) 
export TERM=xterm
make menuconfig

Also Liked

Hermanverschooten

Hermanverschooten

OMG, it’s not kiity, but iTerm2, but the issue was the same.

when I started the shell and echo $TERM it replied dumb.
So I set it to xterm and now it works.

Hermanverschooten

Hermanverschooten

I added it as an extra environment variable on the docker command.

gus

gus

Nerves Core Team

Thank you for this! I’ve been having the same problem on my recent custom systems using Elixir 1.17/Nerves Buildroot 1.28 (not sure which dependency changed to cause this issue), I just hadn’t got around to posting here or slack yet.

My TERM variable was also set to “dumb” on both Alacritty and iTerm2. Is there a way to persist this setting between calls to mix nerves.system.shell?

Where Next?

Popular in Questions Top

sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New

Other popular topics Top

malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36128 110
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 47930 226
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New

We're in Beta

About us Mission Statement