Browse Source

binfmt script

2.3.1
Nathan Owens 1 year ago
parent
commit
a5c4036e39
  1. 15
      module/boot@/configure/binfmt.sh
  2. 3
      package/targets.mak

15
module/boot@/configure/binfmt.sh

@ -0,0 +1,15 @@
#!/bin/sh
mountpoint -q /proc/sys/fs/binfmt_misc || \
mount -t binfmt_misc binfmt /proc/sys/fs/binfmt_misc
for path in /usr/lib/binfmt.d /etc/binfmt.d /run/binfmt.d; do
[ ! -d $path ] && continue
[ -z "$(ls $path)" ] && continue
grep -h "^:" $path/* | \
while read -r line; do
reg=${line#*:}
[ -e /proc/sys/fs/binfmt_misc/${reg%%:*} ] && echo -1 > /proc/sys/fs/binfmt_misc/${reg%%:*}
printf "%s" "$line" > /proc/sys/fs/binfmt_misc/register
done
done

3
package/targets.mak

@ -1,6 +1,7 @@
SCRIPT_TARGET := \
module/boot@/configure/crypt.awk \
module/boot@/configure/modules.sh
module/boot@/configure/modules.sh \
module/boot@/configure/binfmt.sh
SERVICE_TARGET := service/boot@
MODULE_TARGET := $(shell find module/boot@/service -type f)

Loading…
Cancel
Save