/[baselayout]/trunk/sh/rc-functions.sh
Gentoo

Contents of /trunk/sh/rc-functions.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2612 - (show annotations) (download) (as text)
Tue Apr 17 00:07:09 2007 UTC (7 years, 4 months ago) by vapier
File MIME type: text/x-sh
File size: 949 byte(s)
Allow addons to pass up their exit status in import_addon.  Simplify /dev handling in init.sh and add mdev as an option.
1 # Copyright 2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 has_addon() {
5 [ -e "${RC_LIBDIR}/addons/$1.sh" ]
6 }
7
8 import_addon() {
9 has_addon "$1" || return 1
10 . "${RC_LIBDIR}/addons/$1.sh"
11 }
12
13 start_addon() {
14 ( import_addon "$1-start" )
15 }
16
17 stop_addon() {
18 ( import_addon "$1-stop" )
19 }
20
21 is_net_fs() {
22 [ -z "$1" ] && return 1
23
24 local t=$(mountinfo --fstype "$1" )
25 for x in ${RC_NET_FS_LIST} ; do
26 [ "${x}" = "${t}" ] && return 0
27 done
28 return 1
29 }
30
31 is_union_fs() {
32 [ ! -x /sbin/unionctl ] && return 1
33 unionctl "$1" --list >/dev/null 2>/dev/null
34 }
35
36 get_bootparam() {
37 local match="$1"
38 [ -z "${match}" -o ! -r /proc/cmdline ] && return 1
39
40 set -- $(cat /proc/cmdline)
41 while [ -n "$1" ] ; do
42 case "$1" in
43 gentoo=*)
44 local params="${1##*=}"
45 local IFS=, x=
46 for x in ${params} ; do
47 [ "${x}" = "${match}" ] && return 0
48 done
49 ;;
50 esac
51 shift
52 done
53
54 return 1
55 }
56
57 # vim: set ts=4 :

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20