aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/source/system/vfs/mount-binfmt_misc/up
diff options
context:
space:
mode:
authorPS <p@0x53.net>2026-02-01 12:06:46 +0100
committerPS <p@0x53.net>2026-02-01 12:06:46 +0100
commiteaf0ecff18ee063286ad423469241ca0eb2e4c6c (patch)
tree692ca6a0fea576b21d988cb2459f492c6284648b /src/lib/source/system/vfs/mount-binfmt_misc/up
downloadgoetia-linux-eaf0ecff18ee063286ad423469241ca0eb2e4c6c.tar.gz
goetia-linux-eaf0ecff18ee063286ad423469241ca0eb2e4c6c.tar.bz2
goetia-linux-eaf0ecff18ee063286ad423469241ca0eb2e4c6c.zip
version 0.2.0.0
Diffstat (limited to 'src/lib/source/system/vfs/mount-binfmt_misc/up')
-rw-r--r--src/lib/source/system/vfs/mount-binfmt_misc/up39
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}