Having Trouble With systemd-binfmt

This forum is for discussion about general software issues.

Having Trouble With systemd-binfmt

Postby CuriousTommy » Thu Aug 02, 2018 2:31 am

Hello Everyone, I am having trouble setting up the config file for systemd-binfmt on my Arch Linux ARM device. I made a post about it on Reddit, but I thought I should ask for help here since you all probably have a better understanding of how Arch Linux works.

To summarize, the systemd-binfmt service fails to load whenever I add a config file. It complains about the file or directory not existing, despite terminal being able to run the application when I paste the location.

Since then, I make a few changes from my original Reddit post. I used the qemu-binfmt-conf.sh script to generate the config file, but I still got the same error (I did change the file location, but terminal is able to run the application just fine).

If anyone has any idea of what I should do, I greatly appreciate it.
Thomas A.

Here is some additional information (for the changes I made):
I have two config files located in /etc/binfmt.d (qemu-static-i386.conf and qemu-static-x86_64.conf). Here are the contents of the files:
$this->bbcode_second_pass_code('', '[root@alarm binfmt.d]# /usr/lib/systemd/systemd-binfmt --cat-config
# /etc/binfmt.d/qemu-static-i386.conf
:qemu-i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-i386-static:

# /etc/binfmt.d/qemu-static-x86_64.conf
:qemu-x86_64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00:\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-x86_64-static:
')
Checking the status now shows this:
$this->bbcode_second_pass_code('', '[root@alarm binfmt.d]# systemctl status systemd-binfmt
● systemd-binfmt.service - Set Up Additional Binary Formats
Loaded: loaded (/usr/lib/systemd/system/systemd-binfmt.service; static; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2018-08-01 21:28:32 EDT; 46min ago
Docs: man:systemd-binfmt.service(8)
man:binfmt.d(5)
https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html
https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
Process: 2592 ExecStart=/usr/lib/systemd/systemd-binfmt (code=exited, status=1/FAILURE)
Main PID: 2592 (code=exited, status=1/FAILURE)

Aug 01 21:28:32 alarm systemd[1]: Starting Set Up Additional Binary Formats...
Aug 01 21:28:32 alarm systemd-binfmt[2592]: Failed to add binary format: No such file or directory
Aug 01 21:28:32 alarm systemd-binfmt[2592]: Failed to add binary format: No such file or directory
Aug 01 21:28:32 alarm systemd[1]: systemd-binfmt.service: Main process exited, code=exited, status=1/FAILURE
Aug 01 21:28:32 alarm systemd[1]: systemd-binfmt.service: Failed with result 'exit-code'.
Aug 01 21:28:32 alarm systemd[1]: Failed to start Set Up Additional Binary Formats.
')
CuriousTommy
 
Posts: 2
Joined: Wed Aug 01, 2018 11:35 pm

Re: Having Trouble With systemd-binfmt

Postby CuriousTommy » Fri Aug 03, 2018 9:07 pm

I think I am starting to figure out what may be causing the issue. A while back, when I was testing the script, I got this error
$this->bbcode_second_pass_quote('', '#') ./qemu-binfmt-conf.sh
modprobe: FATAL: Module binfmt_misc not found in directory /lib/modules/4.16.5-g8efd0af-dirty

At first I thought this was normal. The arch wiki talks about how binfmt_misc is a part of the kernel rather than a module, so I wrongly assumed that the script didn't consider the way Arch Linux handled binfmt_misc.

I decided to test the script out on the x86_64 install of Arch Linux to make sure if this was an Arch Linux quirk or not. Once I found the script to work just fine on my x86_64 Arch Linux install, I realized that something may be misconfigured with the kernel I am using (it's a custom kernel) on my Arch Linux ARM install.

I am going to take a look at the kernel source code later and see if there is an option that is not enabled.
CuriousTommy
 
Posts: 2
Joined: Wed Aug 01, 2018 11:35 pm


Return to General

Who is online

Users browsing this forum: No registered users and 11 guests