Standardize License information
[openafs.git] / src / afsinstall / lib / InstallGuides / SGI_6x / modkernel
1 # Copyright 2000, International Business Machines Corporation and others.
2 # All Rights Reserved.
3
4 # This software has been released under the terms of the IBM Public
5 # License.  For details, see the LICENSE file in the top-level source
6 # directory or online at http://www.openafs.org/dl/license10.html
7
8 # An InstallGuide for dynamic kernel loaded libraries
9 # For SGI systems running IRIX 6.x
10 #
11
12 sub modkernel {
13 my($chip, $ip_type, $os_vers, $chipcount, $nfs, $libafs);
14 &ErrorsAreFatal(1);
15
16 # Find out what kind of chip the machine has (Rx000)
17 $chip = `hinv -t cpu`;
18 $chip =~ /R[4581][046]0*/;
19 $chip = $&;
20 &ErrorMsg("Could not determine chip type with", "hinv") unless ($chip =~ /^R/);
21 substr($chip, -3,3) = "000";
22 $ip_type = `uname -m`;
23 $os_vers = `uname -r`;
24 if ($chip =~ /R5/) { $chip = "R4000_32";  }
25 elsif ($chip =~ /R4/ && $os_vers =~ /6.2/ && $ip_type =~ /17|20|22/) {
26   $chip = "R4000_32"; }
27
28 # Find out if there is more than one processor (eg "2 150 MHZ IP19 Processors")
29 $chipcount = `hinv -c processor`;
30 $chipcount =~ s/ .*//;
31 &ErrorMsg("Could not determine chip count with", "hinv") unless ($chipcount);
32
33 # NFS support
34 if ($Configuration{"NFSEXTENSIONS"}) {
35   $nfs = ""; }
36 else {
37   $nfs = ".nonfs"; };
38
39 # From the above, put together the name of the kernel library to use
40 $libafs = "libafs.SP.$chip$nfs.o" if ($chipcount == 1);
41 $libafs = "libafs.MP.$chip$nfs.o" if ($chipcount >  1);
42
43 &CreateDir("/usr/vice/etc/sgiload");
44 &ErrorsAreFatal(0);
45
46 &Copy("root.client/usr/vice/etc/sgiload/$libafs", "/usr/vice/etc/sgiload");
47 &Copy("root.client/usr/vice/etc/afsd", "/usr/vice/etc");
48 &Chmod(0744, "/usr/vice/etc/afsd");
49 system("/etc/chkconfig -f afsml on");
50 system("/etc/chkconfig -f afsclient on");
51 &Copy("bin/fs", "/usr/vice/etc/fs");
52 }