Some doc path fixes from Anders
[pkg-k5-afs_openafs.git] / src / afsinstall / lib / InstallGuides / RS_AIX3x / rc
blob8fdfd8491f56a33e8939fbd06f5648c49e3a6bf8
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
8 # An InstallGuide for installing the initialization script
9 # For IBM RS/6000 systems running AIX 3.x
12 sub AIXrc {
14 # Defaults
15 $rcfile   = "/etc/rc.afs";
16 $initfile = "/etc/inittab";
18 &ErrorsAreFatal(1);
20 # Add AFS kernel loader to RC file
21 &VPrint("Creating $rcfile file");
22 &DisplaceFile($rcfile);
23 $rc = open(RC, "> $rcfile");
24 &ErrorMsg("Could not overwrite", $rcfile) if (!$rc);
26 print RC <<"EORC";
27 #!/bin/sh
29 USENFS=\"$Configuration{"NFSEXTENSIONS"}\"
31 if [ \"\$NFS\" = 1 ]; then
32   ExportExt=\"\"
33   AFSExt=\".trans\"
34 else
35   ExportExt=\".nonfs\"
36   AFSExt=\"\"
39 # Load AFS into the kernel
40 /usr/vice/etc/dkload/cfgexport -a /usr/vice/etc/dkload/export.ext\${ExportExt}
41 /usr/vice/etc/dkload/cfgafs -a /usr/vice/etc/dkload/afs.ext\${AFSExt}
43 EORC
44 close(RC);
46 # Append the generic RC file
47 &ReadInstallGuide("$InstallGuideDir/GENERIC/rc");
48 &Appendrc;
50 # Add AFS entry to the inittab file
51 &VPrint("Adding AFS entry to $initfile");
53 &Patch::Verbose if ($InstallVerbose);
54 &Patch::FileOpen($initfile);
55 $SearchString = <<"xxENDxx";
56 rcnfs:2:wait:/etc/rc.nfs > /dev/console 2>&1 # Start NFS Daemons
57 xxENDxx
59 $NewString = <<"xxENDxx";
60 rcafs:2:wait:/etc/rc.afs > /dev/console 2>&1 # Start AFS daemons
61 xxENDxx
63 if (!&Patch::Patch($initfile, [[0, "Insert", $SearchString, $NewString]])) {
64   &ErrorMsg("Did not succeed with patch", $initfile);  }
70 sub rc {
71 goto &AIXrc;