diff options
Diffstat (limited to 'src/lib/source/system/vfs/mount-binfmt_misc/up')
| -rw-r--r-- | src/lib/source/system/vfs/mount-binfmt_misc/up | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/lib/source/system/vfs/mount-binfmt_misc/up b/src/lib/source/system/vfs/mount-binfmt_misc/up new file mode 100644 index 0000000..39a1ae2 --- /dev/null +++ b/src/lib/source/system/vfs/mount-binfmt_misc/up @@ -0,0 +1,39 @@ +#!@shebangdir@/execlineb -P + +# ISC license. +# https://docs.kernel.org/admin-guide/binfmt-misc.html + +fdmove -c 2 1 + +multisubstitute { + define BINFMT_FS "/proc/sys/fs/binfmt_misc" + define BINFMT_CONF "/etc/binfmt.d" +} + +if { eltest -d ${BINFMT_FS} } +if { mount -t binfmt_misc binfmt_misc ${BINFMT_FS} } + +pipeline { + elglob -0sd '' FILES ${BINFMT_CONF}/* + if -x0 { eltest ${FILES} } + define -sd '' SPLITFILES ${FILES} + cat ${SPLITFILES} +} +pipeline { + sed + -e "/^#/d" + -e "s/^[[:blank:]]*//g" + -e "s/[[:blank:]]*$//g" + -e "/^$/d" +} +forstdin -pE LINE + if -x0 -n { redirfd -w 1 ${BINFMT_FS}/register echo ${LINE} } + pipeline { echo ${LINE} } + pipeline { + sed + -e s/:// + -e s/:.*// + } + withstdinas -E TORESET + if { redirfd -w 1 ${BINFMT_FS}/${TORESET} echo -1 } + redirfd -w 1 ${BINFMT_FS}/register echo ${LINE} |
