Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / afsinstall / lib / InstallGuides / RS_AIX4x / 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 IBM RS/6000 systems running AIX 4.x
10 #
11
12 sub modkernel {
13 my($useiauth,$afsext,$export, $line, $a,$b,$c);
14 &ErrorsAreFatal(1);
15 &CreateDir("/usr/vice/etc/dkload");
16 &ErrorsAreFatal(0);
17
18 if ($Configuration{"NFSEXTENSIONS"}) {
19 # Determine if this AIX system uses the iauth system
20 # AIX 4.1.x for x>=5
21 # AIX 4.2.x for x>=1
22 # AIX 4.x for x>=3
23 $useiauth = 0;
24 open(LPP, "/bin/lslpp -L |");
25 while ($line = <LPP>) {
26 next unless ($line =~ /bos.rte\s/);
27 $line =~ /bos.rte\s+(\d)\.(\d)\.(\d)/;
28 ($a,$b,$c) = ($1,$2,$3);
29 $useiauth = 1 if ($a == 4 && $b == 1 && $c >= 5);
30 $useiauth = 1 if ($a == 4 && $b == 2 && $c >= 1);
31 $useiauth = 1 if ($a == 4 && $b >= 3);
32 last; };
33 close(LPP);
34
35 if ($useiauth) {
36 $export=".nonfs";
37 $afsext="iauth"; }
38 else {
39 $export="";
40 $afsext="trans"; }
41
42 # Copy NFS ready kernel extensions into place
43 &Copy("root.client/usr/vice/etc/dkload/cfgafs", "/usr/vice/etc/dkload");
44 &Copy("root.client/usr/vice/etc/dkload/cfgexport", "/usr/vice/etc/dkload");
45 &Copy("root.client/usr/vice/etc/dkload/afs.ext.$afsext",
46 "/usr/vice/etc/dkload");
47 &Copy("root.client/usr/vice/etc/dkload/export.ext$export",
48 "/usr/vice/etc/dkload"); }
49 else {
50 # Copy non NFS ready kernel extensions into place
51 &Copy("root.client/usr/vice/etc/dkload/afs.ext", "/usr/vice/etc/dkload");
52 &Copy("root.client/usr/vice/etc/dkload/cfgafs", "/usr/vice/etc/dkload");
53 &Copy("root.client/usr/vice/etc/dkload/cfgexport", "/usr/vice/etc/dkload");
54 &Copy("root.client/usr/vice/etc/dkload/export.ext.nonfs",
55 "/usr/vice/etc/dkload"); }
56
57 &Copy("root.client/usr/vice/etc/afsd", "/usr/vice/etc");
58 &Chmod(0744, "/usr/vice/etc/afsd");
59 &Copy("bin/fs", "/usr/vice/etc/fs");
60
61 $File="/etc/vfs";
62 $Patch::Verbose if ($InstallVerbose);
63
64 &Patch::FileOpen($File);
65
66 $Search = << "xxENDxx";
67 nfs 2 /sbin/helpers/nfsmnthelp none remote
68 xxENDxx
69
70 $New = << "xxENDxx";
71 afs 4 none none
72 xxENDxx
73
74 if (!&Patch::Patch($File, [[0, "Insert", $Search, $New]])) {
75 &ErrorMsg("Did not succeed in patching $File");
76 }
77 }