Commit | Line | Data |
---|---|---|
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 | # afs.rc | |
9 | # | |
10 | # An InstallGuide for AFS startup scripts | |
11 | # For Sun systems running SunOS 4.x | |
12 | # | |
13 | ||
14 | sub SUNrc { | |
15 | my($nfsext, $othernfsext, $rcfile); | |
16 | $rcfile = "/etc/rc.afs"; | |
17 | &ErrorsAreFatal(1); | |
18 | ||
19 | # Start an AFS RC file | |
20 | if ($Configuration{"NFSEXTENSIONS"}) { | |
21 | $nfsext=""; | |
22 | $othernfsext=".nonfs"; } | |
23 | else { | |
24 | $nfsext=".nonfs"; | |
25 | $othernfsext=""; | |
26 | }; | |
27 | ||
28 | &VPrint("Creating AFS startup script"); | |
29 | &DisplaceFile($rcfile); | |
30 | $rc = open(RC, "> $rcfile"); | |
31 | &ErrorMsg("Could not write to file", $rcfile) if (!$rc); | |
32 | print RC <<"EORC"; | |
33 | #!/bin/sh | |
34 | # | |
35 | ||
36 | # Choose one of the following depending on how to load AFS into the kernel | |
37 | loader="modload" | |
38 | #loader="dkload" | |
39 | ||
40 | # Choose one of the following depending on whether or not system uses NFS | |
41 | NFS="$nfsext" | |
42 | #NFS="$othernfsext" | |
43 | ||
44 | if [ "\$loader" -eq "modload" ]; then | |
45 | library="libafs${NFS}.o" | |
46 | program="/usr/etc/modload" | |
47 | options="" | |
48 | else | |
49 | library="libafs${NFS}.a" | |
50 | program="./dkload" | |
51 | options="-quiet" | |
52 | fi | |
53 | ||
54 | if [ -d /usr/vice/etc/\$loader ]; then | |
55 | echo 'Invoking \$loader kernel loader...'>/dev/console | |
56 | cd /usr/vice/etc/\$loader | |
57 | if [ -f "\$library" ]; then | |
58 | echo "Loading AFS" > /dev/console | |
59 | \$program \$options \$library 1> /dev/console 2>&1 | |
60 | if [ $? != 0 ]; then | |
61 | echo "Error loading AFS" > /dev/console | |
62 | fi | |
63 | else | |
64 | echo "Cannot load AFS - no kernel library object" > /dev/console | |
65 | fi | |
66 | cd / | |
67 | fi | |
68 | ||
69 | EORC | |
70 | close(RC); | |
71 | &Chmod(0744, $rcfile); | |
72 | ||
73 | # Append the generic RC file | |
74 | &ReadInstallGuide("$InstallGuideDir/GENERIC/rc"); | |
75 | &Appendrc; | |
76 | ||
77 | &Print("AFS startup script created as $rcfile"); | |
78 | } | |
79 | ||
80 | ||
81 | ||
82 | sub rc { | |
83 | goto &SUNrc; | |
84 | } |