diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2009-07-28 10:43:54 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2009-07-28 10:43:54 +0000 |
commit | 0561bd11c90a7fdbda61f2fadf2d499a72dd9293 (patch) | |
tree | 71a99e4587711a6ec195369e13af77a4086bda90 /dev-dotnet/pe-format/files | |
parent | Rdepend on krosspython. Per bug #244649. Force due to notfully updated cvs (diff) | |
download | gentoo-2-0561bd11c90a7fdbda61f2fadf2d499a72dd9293.tar.gz gentoo-2-0561bd11c90a7fdbda61f2fadf2d499a72dd9293.tar.bz2 gentoo-2-0561bd11c90a7fdbda61f2fadf2d499a72dd9293.zip |
Add new version that properly executes after procfs have been mounted.
(Portage version: 2.2_rc33/cvs/Linux x86_64)
Diffstat (limited to 'dev-dotnet/pe-format/files')
-rw-r--r-- | dev-dotnet/pe-format/files/pe-format.init-1 | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/dev-dotnet/pe-format/files/pe-format.init-1 b/dev-dotnet/pe-format/files/pe-format.init-1 new file mode 100644 index 000000000000..0816edacde52 --- /dev/null +++ b/dev-dotnet/pe-format/files/pe-format.init-1 @@ -0,0 +1,53 @@ +#!/sbin/runscript +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $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 $ + +depend() { + after procfs +} + +start() { + ebegin "Registering PE binaries with ${CLR}" + + if [[ ! -d /proc/sys/fs/binfmt_misc ]] ; then + eerror "You need support for \"misc binaries\" in your kernel!" + eend 1 + fi + + if [[ $(mount | grep -c binfmt_misc) -eq 0 ]] ; then + mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc &> /dev/null + local result=$? + + if [[ $result -ne 0 ]] ; then + eend $result + fi + fi + + case "${CLR}" in + mono) + echo ':PE:M::MZ::/usr/bin/mono:' > /proc/sys/fs/binfmt_misc/register + eend 0 + ;; + ilrun) + echo ':PE:M::MZ::/usr/bin/ilrun:' > /proc/sys/fs/binfmt_misc/register + eend 0 + ;; + *) + eerror 'Please enter a valid option in /etc/conf.d/pe-format' + eend 1 + ;; + esac +} + +stop() { + ebegin "Unregistering PE binaries" + + if [[ -f /proc/sys/fs/binfmt_misc/PE ]] ; then + echo '-1' > /proc/sys/fs/binfmt_misc/PE + fi + + eend $? +} + +# vim: ts=4 : |