Line 0
Link Here
|
0 |
- |
1 |
#!@PREFIX@/sbin/runscript |
|
|
2 |
# Copyright (c) 2011 <mgorny@gentoo.org> |
3 |
# Released under the 2-clause BSD license. |
4 |
|
5 |
description='Associate binaries from binfmt.d using binfmt_misc' |
6 |
|
7 |
depend() |
8 |
{ |
9 |
need procfs |
10 |
use localmount |
11 |
} |
12 |
|
13 |
start() |
14 |
{ |
15 |
local f bn |
16 |
|
17 |
ebegin "Registering binfmt_misc executables" |
18 |
eindent |
19 |
for f in \ |
20 |
/run/binfmt.d/*.conf \ |
21 |
"@SYSCONFDIR@"/binfmt.d/*.conf \ |
22 |
"@PREFIX@"/usr/lib/binfmt.d/*.conf |
23 |
do |
24 |
# XXX: we should check for duplicates |
25 |
# right now, we just assume their names will collide and registrar |
26 |
# will ignore them |
27 |
|
28 |
if [ -r "${f}" ]; then |
29 |
ebegin "${f}" |
30 |
grep '^[;#]' "${f}" > /proc/sys/fs/binfmt_misc/register |
31 |
eend ${?} |
32 |
fi |
33 |
done |
34 |
eoutdent |
35 |
} |