File: 12_rc_serial_m68k.patch

package info (click to toggle)
setserial 2.17-47
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 744 kB
  • sloc: sh: 2,119; ansic: 1,008; makefile: 131; csh: 2
file content (71 lines) | stat: -rw-r--r-- 1,889 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From: Jonas Genannt <jonas.genannt@capi2name.de>
Subject: setserial rc.serial.mk68 patch


diff -Naurp setserial-2.17.orig/rc.serial.m68k setserial-2.17/rc.serial.m68k
--- setserial-2.17.orig/rc.serial.m68k	1970-01-01 00:00:00.000000000 +0000
+++ setserial-2.17/rc.serial.m68k	2008-09-26 21:59:26.000000000 +0000
@@ -0,0 +1,63 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:		setserial
+# Required-Start:	$remote_fs
+# Required-Stop:	$remote_fs
+# Default-Start:	S
+# Default-Stop:		0 6
+# Short-Description:    controls configuration of serial ports
+# Description:          Set and/or report the configuration information
+#                       associated with a serial port. This information
+#                       includes what I/O port and which IRQ a particular
+#                       serial port is using.
+### END INIT INFO
+#
+# This version of the configuration file is only suitable for
+# the m680x0 series of machines. In these cases, the configuration
+# process is unnecessary, but it may still be useful to output
+# information about the serial configuration
+#    Gordon Russell <g.russell@dcs.napier.ac.uk>
+#
+SETSERIAL=/bin/setserial
+
+# if the setserial executable is unavailable then abort the configuration
+[ -x ${SETSERIAL} ] || exit 0
+
+#
+# Handle System V init conventions...
+#
+case $1 in
+start | restart | force-reload )
+	action="start";
+	;;
+stop | modload | modsave )
+	action="stop";
+	;;
+*)
+	action="start";
+esac
+
+if test $action  = stop ; then
+	exit 0
+fi
+
+#
+# If not stop, it must be a start....
+#
+
+insmod -k serial 2>/dev/null
+
+ALLDEVS="/dev/ttyS?"
+if /bin/ls /dev/ttyS?? 2> /dev/null ; then
+	ALLDEVS="$ALLDEVS /dev/ttyS??"
+fi
+
+rtn=`${SETSERIAL} -bg ${ALLDEVS} >/dev/null 2>&1`
+if [ $? -gt 0 ]
+then
+  echo "Aborting serial port reporting. Check the serial modules..."
+  exit 1
+fi
+
+${SETSERIAL} -bg ${ALLDEVS}
+#