/[baselayout]/trunk/init.d/serial
Gentoo

Contents of /trunk/init.d/serial

Parent Directory Parent Directory | Revision Log Revision Log


Revision 484 - (show annotations) (download)
Wed Apr 21 17:09:18 2004 UTC (15 years, 2 months ago) by vapier
File size: 1014 byte(s)
update copyright years

1 #!/sbin/runscript
2 # Copyright 1999-2004 Gentoo Technologies, Inc.
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header$
5
6 moduleinserted() {
7 local res="$(grep 'serial' /proc/modules | cut -f1 -d" ")"
8 if [ "${res}" ]
9 then
10 if [ "${res}" = "serial" ]
11 then
12 return 1
13 fi
14 fi
15 }
16
17 setport() {
18 # arguments: device, irq, port, args
19
20 #if serial module exists, and it's not inserted, insert it permanently
21 if [ -f /lib/modules/$(uname -r)/misc/serial.o ]
22 then
23 moduleinserted;
24 if [ "$?" -eq 0 ]
25 then
26 /sbin/insmod serial 1>&2
27 fi
28 fi
29
30 ebegin "Setting /dev/$1"
31 ${SETSERIAL} -b /dev/$1 irq $2 port $3 $4 1>&2
32 if [ "$?" -gt 0 ]
33 then
34 eend 1 "Error setting serial port $1 to irq $2 port $3 (args: $4)"
35 no_errs=0
36 else
37 eend 0
38 done="${done} /dev/$1"
39 fi
40 }
41
42 depend() {
43 need localmount
44 }
45
46 start() {
47 if [ -e /etc/rc.d/config/serial ]
48 then
49 source /etc/rc.d/config/serial
50 else
51 return
52 fi
53
54 SETSERIAL="/sbin/setserial"
55
56 no_errs=1
57 done=""
58 setports
59 return
60 }
61
62
63 # vim:ts=4

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20