Open christianhujer opened 1 year ago
Nice one! I like the approach... Unfortunately, I don't see a way on how to support this automatically on the myriad of Linux variants out there...
However, a readme keeping this information would be really helpful... I'll extend the manual...
I just set this up myself in Gentoo, where both OpenRC and systemd init-systems use the same format[2] for configuring new binary formats.
/etc/binfmt.d/amiga_hunk.conf
:AmigaHUNK:M::\x00\x00\x03\xf3::/path/to/amitools/bin/vamos:
The config file will be picked up by /etc/init.d/binfmt
or systemd's systemd-binfmt.service
if you (re)start the service. You can also manually add it by issuing[2] the following command - this only works, if the binfmt_misc pseudo-filesystem has already been mounted.
cat /etc/binfmt.d/amiga_hunk.conf >/proc/sys/fs/binfmt_misc/register
[1] https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html [2] https://manpages.debian.org/testing/systemd/binfmt.d.5.en.html
It would be great to see packaged support for Linux binfmt. Using Linux binfmt, Amiga OS binaries could be directly run from a Linux shell using their name.
I managed to quickly get this running on Ubuntu 22.04 using these files:
File
/usr/share/binfms/amiga-vamos
:(The path in the file obviously would have to be set correctly by
make install-binfmt
or whatever would be used.)Then I ran
sudo update-binfmts --import amiga-vamos
andsudo service binfmt-support force-reload
. And voilà, I could run an Amiga-OS binary by making it executablechmod +x hello
and then running it using./hello
.