prInstall.sh
5.69 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
#! /bin/csh -f
#
#**************************************************************************
#* *
#* Copyright (C) 1990, 1991 Silicon Graphics, Inc. *
#* *
#* These coded instructions, statements, and computer programs contain *
#* unpublished proprietary information of Silicon Graphics, Inc., and *
#* are protected by Federal copyright law. They may not be disclosed *
#* to third parties or copied or duplicated in any form, in whole or *
#* in part, without the prior written consent of Silicon Graphics, Inc. *
#* *
#**************************************************************************
#*
#* Module: prInstall
#*
#* $Revision: 1.1.1.1 $
#*
#* Description:
#* A C-Shell script that automatically munges the /var/sysgen/master.d/mem
#* file so that the Ultra64 development card may be mmap'd from user space.
#* The /dev/u64 device is also created (if it does not yet exist).
#*
#**************************************************************************/
#
# Check for running on IRIX 6.x
set version_6 = `/usr/bin/uname -r | grep "6."`
set cpu_board = `/usr/bin/uname -m`
set mem_sed = 'mem.sed' # sed script for mem file
set backup = '.O' # File backup name suffix
set gio_addr = 0xbf400000 # GIO address of u64 device
#
# CPU board が IP22(Indy) かどうかのチェック。
# IP22 でなければ正常終了する。IP22 でなければ system/u64.sm はインストール
# されないので、途中でエラー終了してしまう。
#
if ($cpu_board != "IP22") then
exit 0
endif
#
# Test to see if we are running from the mini-root:
if (-e "/var/inst/is_mr") then # run from mini-root
set rbase_src = $rbase
set rbase_dst = $rbase
else if ($version_6 != "") then # run on IRIX 6.x
set mem_sed = 'mem_6.2.sed' # sed script for mem file
set rbase_src = $rbase
set rbase_dst = ""
else # hopefully on IRIX 5.3
set rbase = ""
set rbase_src = $rbase
set rbase_dst = $rbase
endif
# File for GIO-bus mapping
set masterd_mem = "$rbase_dst/var/sysgen/master.d/mem"
set dev_u64 = "$rbase_dst/dev/u64" # Device special file for u64
set dev_u64_print = "$rbase_dst/dev/u64_print"
set dev_u64_debug = "$rbase_dst/dev/u64_debug"
set dev_u64_logging = "$rbase_dst/dev/u64_logging"
set dev_u64_data = "$rbase_dst/dev/u64_data"
set dev_u64_fault = "$rbase_dst/dev/u64_fault"
set dev_u64_kdebug = "$rbase_dst/dev/u64_kdebug"
set dev_u64_profile = "$rbase_dst/dev/u64_profile"
# Introduction
#
echo ""
echo "ULTRA-64 SYSTEM INSTALLATION PROGRAM"
echo ""
#
# Check for Super-User
#
if (! -w "/") then
echo "YOU MUST BE SUPER-USER TO RUN THIS PROGRAM"
exit 1
endif
#
# Check for existing mem File
#
if (! -e $masterd_mem) then
echo "ERROR: System configuration file $masterd_mem not found"
echo "Installation aborted."
exit 1
endif
#
# If we're installing on IRIX 6.x, most likely, we're installing the ultra
# image under a toolroot tree. If so, we need to copy the proper kernel
# files from the toolroot tree to the correct system locations.
#
set masterd_u64 = "/var/sysgen/master.d/u64"
set src_masterd_u64 = "$rbase_src$masterd_u64"
set dst_masterd_u64 = "$rbase_dst$masterd_u64"
set system_u64 = "/var/sysgen/system/u64.sm"
set src_system_u64 = "$rbase_src$system_u64"
set dst_system_u64 = "$rbase_dst$system_u64"
set u64driver = "$rbase_src/usr/lib/PR/install/u64_6.2.o"
set ip22bootarea = "$rbase_dst/usr/cpu/sysgen/IP22boot/u64.o"
# Check for installed master.d/u64 file
if (! -e $src_masterd_u64) then
echo "ERROR: System configuration file $src_masterd_u64 not found"
echo "Installation aborted."
exit 1
endif
# Check for installed system/u64.sm file
if (! -e $src_system_u64) then
echo "ERROR: System configuration file $src_system_u64 not found"
echo "Installation aborted."
exit 1
endif
if ($version_6 != "") then
echo "IRIX 6.X detected..."
echo "Copying $u64driver to $ip22bootarea"
cp $u64driver $ip22bootarea
echo "Copying $src_masterd_u64 to $dst_masterd_u64"
cp $src_masterd_u64 $dst_masterd_u64
echo "Copying $src_system_u64 to $dst_system_u64"
cp $src_system_u64 $dst_system_u64
endif
#
# Modify mem File
#
@ found = `/bin/grep -c $gio_addr $masterd_mem`
if ($found == 0) then
if ($1 == '-v') then
echo "Copying original $masterd_mem to $masterd_mem$backup"
endif
cp $masterd_mem $masterd_mem$backup
if ($1 == '-v') then
echo "Adding Ultra64 GIO-bus address $gio_addr to $masterd_mem"
endif
/bin/sed -f $mem_sed $masterd_mem$backup | \
/bin/sed s/-PUT-GIO-ADDR-HERE-/$gio_addr/g > $masterd_mem
set gio_addr = `echo $gio_addr`
echo "Installation completed (GIO-bus address $gio_addr added to $masterd_mem)"
else
echo "Installation completed (no change to $masterd_mem necessary)"
endif
if ( -e $dev_u64) then
rm $dev_u64
endif
/etc/mknod $dev_u64 c 255 0
chmod 666 $dev_u64
if ( -e $dev_u64_print) then
rm $dev_u64_print
endif
/etc/mknod $dev_u64_print c 255 1
chmod 666 $dev_u64_print
if ( -e $dev_u64_debug) then
rm $dev_u64_debug
endif
/etc/mknod $dev_u64_debug c 255 2
chmod 666 $dev_u64_debug
if ( -e $dev_u64_logging) then
rm $dev_u64_logging
endif
/etc/mknod $dev_u64_logging c 255 3
chmod 666 $dev_u64_logging
if ( -e $dev_u64_data) then
rm $dev_u64_data
endif
/etc/mknod $dev_u64_data c 255 4
chmod 666 $dev_u64_data
if ( -e $dev_u64_fault) then
rm $dev_u64_fault
endif
/etc/mknod $dev_u64_fault c 255 5
chmod 666 $dev_u64_fault
if ( -e $dev_u64_kdebug) then
rm $dev_u64_kdebug
endif
/etc/mknod $dev_u64_kdebug c 255 6
chmod 666 $dev_u64_kdebug
if ( -e $dev_u64_profile) then
rm $dev_u64_profile
endif
/etc/mknod $dev_u64_profile c 255 7
chmod 666 $dev_u64_profile
exit