Automatically mount binfmt_misc if necessary
Created by: ollieparanoid
When running pmbootstrap
on Alpine, you need to do:
sudo modprobe binfmt_misc
sudo mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
... or you will get:
sh: can't create /proc/sys/fs/binfmt_misc/register: nonexistent directory
We could check if /proc/sys/fs/binfmt_misc/register
exists, and if it does not, perform the two commands above.
See also https://wiki.postmarketos.org/wiki/Troubleshooting#sh:can.27t_create.2Fproc.2Fsys.2Ffs.2Fbinfmt_misc.2Fregister:_nonexistent_directory