Since the new binfmt_misc registration script in OpenRC 0.14, any configuration requiring a magic string containing a backslash will fail. The problem is that the line-by-line parsing method is mangling these lines, since the `read` builtin interprets backslashes as escape sequence delimiter. From dash(1): read [-p prompt] [-r] variable [...] ... By default, unless the -r option is specified, the backslash “\” acts as an escape character, causing the following character to be treated literally. If a backslash is fol‐ lowed by a newline, the backslash and the newline will be deleted. Reproducible: Always Steps to Reproduce: 1. Add a binfmt configuration file to /etc/binfmt.d (e.g. http://pkgs.fedoraproject.org/cgit/rpms/qemu.git/plain/qemu.binfmt) 2. Restart the binfmt service Actual Results: * Loading custom binary format handlers ... sh: echo: I/O error binfmt: invalid entry on line 1 of `/etc/binfmt.d//qemu-arm.conf'
Created attachment 425870 [details, diff] 0001-binfmt.sh-apply_file-Use-read-in-raw-mode.patch The attached patch fixes this issue. Tested with dash, bash, and zsh as /bin/sh
https://github.com/openrc/openrc/commit/beaa71d This will be in openrc-0.21. Thanks for the report and patch.