c6eefec0c9c674e849b6e5a0a2498669a1770ec6
[openafs.git] / src / afsinstall / lib / InstallGuides / SGI_5x / bldkernel
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 installing static AFS kernel libraries
9 # For SGI systems running IRIX 5.x
10 #
11
12 sub bldkernel {
13 my ($chip, $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[34][046]0*/;
19 $chip = $&;
20 &ErrorMsg("Could not determine chip type with", "hinv") unless ($chip =~ /^R/);
21
22 # Find out if there is more than one processor (eg "2 150 MHZ IP19 Processors")
23 $chipcount = `hinv -c processor`;
24 $chipcount =~ s/ .*//;
25 &ErrorMsg("Could not determine chip count with", "hinv") unless ($chipcount);
26
27 # NFS support
28 if ($Configuration{"NFSEXTENSIONS"}) {
29   $nfs = ""; }
30 else {
31   $nfs = ".nonfs"; };
32
33 # From the above, put together the name of the kernel library to use
34 $libafs = "libafs.SP.$chip$nfs.a" if ($chipcount == 1);
35 $libafs = "libafs.MP.$chip$nfs.a" if ($chipcount >  1);
36
37 &CreateDir("/usr/vice/etc/sgiload");
38 &ErrorsAreFatal(0);
39 &Copy("root.client/bin/$libafs", "/var/sysgen/boot/afs.a");
40 &Copy("root.client/usr/vice/etc/sgiload/afs",    "/usr/vice/etc/sgiload");
41 &Copy("root.client/usr/vice/etc/sgiload/afs.rc", "/usr/vice/etc/sgiload");
42 &Copy("root.client/usr/vice/etc/sgiload/afs.sm", "/usr/vice/etc/sgiload");
43
44 &Copy("root.client/usr/vice/etc/afsd", "/usr/vice/etc");
45 &Chmod(0744, "/usr/vice/etc/afsd");
46
47 system("/etc/chkconfig -f afsml off");
48 &Copy("bin/fs", "/usr/vice/etc/fs");
49 }