imagebuilder icon indicating copy to clipboard operation
imagebuilder copied to clipboard

misc: Enable support for binfmt_misc to support box86

Open libf-de opened this issue 3 years ago • 5 comments

It seems like binfmt_misc isn't supported in the Odroid U3 image, as there is no binfmt_misc module loaded and no /proc/sys/fs/binfmt_misc directory. Compiling the kernel with that option enabled makes the kernel module loadable, however the directory /proc/sys/fs/binfmt_misc is still missing. It would be nice to have support for that to use box86 properly.

libf-de avatar Oct 12 '21 19:10 libf-de

i added it to my todo list, but it can take quite a while until i'll get there. do i understand it right that it still does not work well if binfmt-misc is compiled as a module?

hexdump0815 avatar Oct 12 '21 20:10 hexdump0815

Yes, I've selected it as a module in menuconfig, and only copied over the module to my U3. Something seems to be missing as that directory isn't created, and I cannot create it manually. Didn't try mounting binfmt_misc somewhere else however, I might try that.

Unfortunately, I can't find much documentation about enabling binfmt, as it seems to be standard in most distros.

libf-de avatar Oct 12 '21 21:10 libf-de

Tried some things again..

binfmt_misc loads fine:

linux@buggster-linux:~$ LANG=C lsmod|grep binfmt
binfmt_misc            20480  1

mkdir obviously fails:

linux@buggster-linux:~$ LANG=C sudo mkdir -p /proc/sys/fs/binfmt_misc
mkdir: cannot create directory '/proc/sys/fs/binfmt_misc': No such file or directory

Mounting binfmt_misc somewhere else works...

linux@buggster-linux:~$ LANG=C mount|grep binfmt
binfmt_misc on /tmp/binfmt_misc type binfmt_misc (rw,relatime)

however all utils seem to expect it to be mounted in /proc/sys/fs/binfmt_misc:

linux@buggster-linux:~$ LANG=C sudo update-binfmts --enable box86
mount: /proc/sys/fs/binfmt_misc: mount point does not exist.
update-binfmts: warning: Couldn't mount the binfmt_misc filesystem on /proc/sys/fs/binfmt_misc.
linux@buggster-linux:~$ LANG=C sudo /lib/systemd/systemd-binfmt
Failed to add binary format: No such file or directory

libf-de avatar Oct 12 '21 21:10 libf-de