We may want to add the binary formats in one of the shell scripts that are executed at system boot time. For example, on a Slackware Linux system we can use /etc/rc.d/rc.local.
To do it we can add to the shell script a chunk of code like the following, which activates the mechanism for Scheme programs compiled with Vicare:
if test -f /proc/sys/fs/binfmt_misc/register
then
if test -f /proc/sys/fs/binfmt_misc/VICARE
then echo -1 >/proc/sys/fs/binfmt_misc/VICARE
fi
echo \
':VICARE:M:0:;;;!vicare::/usr/local/bin/vicare:' \
>/proc/sys/fs/binfmt_misc/register
fi
which does the following:
binfmt_misc kernel module has been loaded by
testing the existence of the register file; if the module is not
there, nothing happens.
/proc/sys/fs/binfmt_misc/VICARE
echoing -1 in it removes the Vicare record.
VICAREM0;;;!vicare/usr/local/bin/vicareWe see that the mask field is set to the empty string, that is:
no mask is applied and #!vicare is matched literally.
We have to care about the order of added entries: entries added later are matched first.