Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / afsinstall / lib / InstallGuides / SGI_6x / bldkernel
CommitLineData
805e021f
CE
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 static AFS kernel libraries
9# For SGI systems running IRIX 6.x
10#
11
12sub bldkernel {
13my($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/);
21substr($chip, -3,3) = "000";
22$ip_type = `uname -m`;
23$os_vers = `uname -r`;
24if ($chip =~ /R5/) { $chip = "R4000_32"; }
25elsif ($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
34if ($Configuration{"NFSEXTENSIONS"}) {
35 $nfs = ""; }
36else {
37 $nfs = ".nonfs"; };
38
39# From the above, put together the name of the kernel library to use
40$libafs = "libafs.SP.$chip$nfs.a" if ($chipcount == 1);
41$libafs = "libafs.MP.$chip$nfs.a" if ($chipcount > 1);
42
43&CreateDir("/usr/vice/etc/sgiload");
44&ErrorsAreFatal(0);
45
46if (-f "root.client/bin/afs") {
47 &Copy("root.client/bin/afs", "/usr/vice/etc/sgiload");
48 &Copy("root.client/bin/afs.sm", "/usr/vice/etc/sgiload"); }
49elsif ( -f "root.client/usr/vice/etc/sgiload/afs") {
50 &Copy("root.client/usr/vice/etc/sgiload/afs", "/usr/vice/etc/sgiload");
51 &Copy("root.client/usr/vice/etc/sgiload/afs.sm", "/usr/vice/etc/sgiload"); };
52&Symlink("/usr/vice/etc/sgiload/afs", "/var/sysgen/master.d/afs");
53&Symlink("/usr/vice/etc/sgiload/afs.sm", "/var/sysgen/system/afs.sm");
54
55&Copy("root.client/bin/$libafs", "/var/sysgen/boot/afs.a");
56&Copy("root.client/usr/vice/etc/afsd", "/usr/vice/etc");
57&Chmod(0744, "/usr/vice/etc/afsd");
58&Copy("bin/fs", "/usr/vice/etc/fs");
59system("/etc/chkconfig -f afsml off");
60system("/etc/chkconfig -f afsclient on");
61}