aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/s390/config3270.sh
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /Documentation/s390/config3270.sh
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'Documentation/s390/config3270.sh')
-rw-r--r--Documentation/s390/config3270.sh76
1 files changed, 76 insertions, 0 deletions
diff --git a/Documentation/s390/config3270.sh b/Documentation/s390/config3270.sh
new file mode 100644
index 000000000000..515e2f431487
--- /dev/null
+++ b/Documentation/s390/config3270.sh
@@ -0,0 +1,76 @@
1#!/bin/sh
2#
3# config3270 -- Autoconfigure /dev/3270/* and /etc/inittab
4#
5# Usage:
6# config3270
7#
8# Output:
9# /tmp/mkdev3270
10#
11# Operation:
12# 1. Run this script
13# 2. Run the script it produces: /tmp/mkdev3270
14# 3. Issue "telinit q" or reboot, as appropriate.
15#
16P=/proc/tty/driver/tty3270
17ROOT=
18D=$ROOT/dev
19SUBD=3270
20TTY=$SUBD/tty
21TUB=$SUBD/tub
22SCR=$ROOT/tmp/mkdev3270
23SCRTMP=$SCR.a
24GETTYLINE=:2345:respawn:/sbin/mingetty
25INITTAB=$ROOT/etc/inittab
26NINITTAB=$ROOT/etc/NEWinittab
27OINITTAB=$ROOT/etc/OLDinittab
28ADDNOTE=\\"# Additional mingettys for the 3270/tty* driver, tub3270 ---\\"
29
30if ! ls $P > /dev/null 2>&1; then
31 modprobe tub3270 > /dev/null 2>&1
32fi
33ls $P > /dev/null 2>&1 || exit 1
34
35# Initialize two files, one for /dev/3270 commands and one
36# to replace the /etc/inittab file (old one saved in OLDinittab)
37echo "#!/bin/sh" > $SCR || exit 1
38echo " " >> $SCR
39echo "# Script built by /sbin/config3270" >> $SCR
40if [ ! -d /dev/dasd ]; then
41 echo rm -rf "$D/$SUBD/*" >> $SCR
42fi
43echo "grep -v $TTY $INITTAB > $NINITTAB" > $SCRTMP || exit 1
44echo "echo $ADDNOTE >> $NINITTAB" >> $SCRTMP
45if [ ! -d /dev/dasd ]; then
46 echo mkdir -p $D/$SUBD >> $SCR
47fi
48
49# Now query the tub3270 driver for 3270 device information
50# and add appropriate mknod and mingetty lines to our files
51echo what=config > $P
52while read devno maj min;do
53 if [ $min = 0 ]; then
54 fsmaj=$maj
55 if [ ! -d /dev/dasd ]; then
56 echo mknod $D/$TUB c $fsmaj 0 >> $SCR
57 echo chmod 666 $D/$TUB >> $SCR
58 fi
59 elif [ $maj = CONSOLE ]; then
60 if [ ! -d /dev/dasd ]; then
61 echo mknod $D/$TUB$devno c $fsmaj $min >> $SCR
62 fi
63 else
64 if [ ! -d /dev/dasd ]; then
65 echo mknod $D/$TTY$devno c $maj $min >>$SCR
66 echo mknod $D/$TUB$devno c $fsmaj $min >> $SCR
67 fi
68 echo "echo t$min$GETTYLINE $TTY$devno >> $NINITTAB" >> $SCRTMP
69 fi
70done < $P
71
72echo mv $INITTAB $OINITTAB >> $SCRTMP || exit 1
73echo mv $NINITTAB $INITTAB >> $SCRTMP
74cat $SCRTMP >> $SCR
75rm $SCRTMP
76exit 0