3 # config3270 -- Autoconfigure /dev/3270/* and /etc/inittab
13 # 2. Run the script it produces: /tmp/mkdev3270
14 # 3. Issue "telinit q" or reboot, as appropriate.
16 P
=/proc
/tty
/driver
/tty3270
22 SCR
=$ROOT/tmp
/mkdev3270
24 GETTYLINE
=:2345:respawn
:/sbin
/mingetty
25 INITTAB
=$ROOT/etc
/inittab
26 NINITTAB
=$ROOT/etc
/NEWinittab
27 OINITTAB
=$ROOT/etc
/OLDinittab
28 ADDNOTE
=\\"# Additional mingettys for the 3270/tty* driver, tub3270 ---\\"
30 if ! ls $P > /dev
/null
2>&1; then
31 modprobe tub3270
> /dev
/null
2>&1
33 ls $P > /dev
/null
2>&1 ||
exit 1
35 # Initialize two files, one for /dev/3270 commands and one
36 # to replace the /etc/inittab file (old one saved in OLDinittab)
37 echo "#!/bin/sh" > $SCR ||
exit 1
39 echo "# Script built by /sbin/config3270" >> $SCR
40 if [ ! -d /dev
/dasd
]; then
41 echo rm -rf "$D/$SUBD/*" >> $SCR
43 echo "grep -v $TTY $INITTAB > $NINITTAB" > $SCRTMP ||
exit 1
44 echo "echo $ADDNOTE >> $NINITTAB" >> $SCRTMP
45 if [ ! -d /dev
/dasd
]; then
46 echo mkdir
-p $D/$SUBD >> $SCR
49 # Now query the tub3270 driver for 3270 device information
50 # and add appropriate mknod and mingetty lines to our files
52 while read devno maj min
;do
55 if [ ! -d /dev
/dasd
]; then
56 echo mknod
$D/$TUB c
$fsmaj 0 >> $SCR
57 echo chmod 666 $D/$TUB >> $SCR
59 elif [ $maj = CONSOLE
]; then
60 if [ ! -d /dev
/dasd
]; then
61 echo mknod
$D/$TUB$devno c
$fsmaj $min >> $SCR
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
68 echo "echo t$min$GETTYLINE $TTY$devno >> $NINITTAB" >> $SCRTMP
72 echo mv $INITTAB $OINITTAB >> $SCRTMP ||
exit 1
73 echo mv $NINITTAB $INITTAB >> $SCRTMP
This page took 0.031189 seconds and 5 git commands to generate.