Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-dotnet/pe-format/files: pe-format.init-1
Date: Tue, 28 Jul 2009 10:43:56
Message-Id: E1MVk9y-0004Y3-FQ@stork.gentoo.org
1 flameeyes 09/07/28 10:43:54
2
3 Added: pe-format.init-1
4 Log:
5 Add new version that properly executes after procfs have been mounted.
6 (Portage version: 2.2_rc33/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 dev-dotnet/pe-format/files/pe-format.init-1
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-dotnet/pe-format/files/pe-format.init-1?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-dotnet/pe-format/files/pe-format.init-1?rev=1.1&content-type=text/plain
13
14 Index: pe-format.init-1
15 ===================================================================
16 #!/sbin/runscript
17 # Copyright 1999-2006 Gentoo Foundation
18 # Distributed under the terms of the GNU General Public License v2
19 # $Header: /var/cvsroot/gentoo-x86/dev-dotnet/pe-format/files/pe-format.init-1,v 1.1 2009/07/28 10:43:54 flameeyes Exp $
20
21 depend() {
22 after procfs
23 }
24
25 start() {
26 ebegin "Registering PE binaries with ${CLR}"
27
28 if [[ ! -d /proc/sys/fs/binfmt_misc ]] ; then
29 eerror "You need support for \"misc binaries\" in your kernel!"
30 eend 1
31 fi
32
33 if [[ $(mount | grep -c binfmt_misc) -eq 0 ]] ; then
34 mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc &> /dev/null
35 local result=$?
36
37 if [[ $result -ne 0 ]] ; then
38 eend $result
39 fi
40 fi
41
42 case "${CLR}" in
43 mono)
44 echo ':PE:M::MZ::/usr/bin/mono:' > /proc/sys/fs/binfmt_misc/register
45 eend 0
46 ;;
47 ilrun)
48 echo ':PE:M::MZ::/usr/bin/ilrun:' > /proc/sys/fs/binfmt_misc/register
49 eend 0
50 ;;
51 *)
52 eerror 'Please enter a valid option in /etc/conf.d/pe-format'
53 eend 1
54 ;;
55 esac
56 }
57
58 stop() {
59 ebegin "Unregistering PE binaries"
60
61 if [[ -f /proc/sys/fs/binfmt_misc/PE ]] ; then
62 echo '-1' > /proc/sys/fs/binfmt_misc/PE
63 fi
64
65 eend $?
66 }
67
68 # vim: ts=4 :