Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / afsinstall / lib / InstallGuides / alpha_dux40 / 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 static kernel built libraries
9 # For Alpha systems running Digital Unix 4.0
10 #
11
12 sub bldkernel {
13 my($host);
14
15 if ($Configuration{"NFSEXTENSIONS"}) {
16 &Copy("root.client/bin/libafs.o", "/usr/sys/BINARY/afs.mod"); }
17 else {
18 &Copy("root.client/bin/libafs.nonfs.o", "/usr/sys/BINARY/afs.mod"); };
19
20 &CreateDir("/usr/vice/etc");
21 &Copy("root.client/usr/vice/etc/afsd", "/usr/vice/etc");
22 &Chmod(0744, "/usr/vice/etc/afsd");
23 &Copy("bin/fs", "/usr/vice/etc/fs");
24
25 &ErrorsAreFatal(1);
26 # Patch the files
27 if (!-f "/usr/sys/conf/AFS") {
28 $host = $ENV{HOST};
29 $host =~ tr/a-z/A-Z/;
30 &Copy("/usr/sys/conf/$host", "/usr/sys/conf/AFS"); };
31
32 $AFS="/sys/conf/AFS";
33 $FILES="/sys/conf/files";
34 $VFSCONF="/sys/vfs/vfs_conf.c";
35
36 &Patch::Verbose if ($InstallVerbose);
37
38 &Patch::FileOpen($AFS);
39 &Patch::FileOpen($FILES);
40 &Patch::FileOpen($VFSCONF);
41
42 $AFSSearchInsert = <<"xxENDxx";
43 options UFS
44 options NFS
45 xxENDxx
46 $AFSNewInsert = <<"xxENDxx";
47 options AFS
48 xxENDxx
49 $AFSSearchReplace = "ident\\s+.+";
50 $AFSNewReplace = "ident\t\t\"AFS\"";
51
52 if (!&Patch::Patch($AFS, [[0, "Insert", $AFSSearchInsert, $AFSNewInsert],
53 [1, "Replace", $AFSSearchReplace, $AFSNewReplace]])) {
54 &ErrorMsg("Did not succeed with patch", $AFS);
55 }
56
57 $FILESSearch1 = << "xxENDxx";
58 OPTIONS/nfs optional nfs
59 xxENDxx
60 $FILESNew1 = << "xxENDxx";
61 OPTIONS/afs optional afs
62 xxENDxx
63
64 $FILESSearch2 = << "xxENDxx";
65 nfs/nfs3_server.c module nfs_server optimize -g3
66 #
67 xxENDxx
68 $FILESNew2 = << "xxENDxx";
69 MODULE/afs optional afs Binary
70 afs/libafs.c module afs
71 #
72 xxENDxx
73
74 if (!&Patch::Patch($FILES, [[0, "Insert", $FILESSearch1, $FILESNew1],
75 [0, "Insert", $FILESSearch2, $FILESNew2]])) {
76 &ErrorMsg("Did not succeed with patch", $FILES);
77 }
78
79 $VFSSearch1 = "#include <cdfs.h>";
80 $VFSNew1 = << "xxENDxx";
81 #include <afs.h>
82 #if defined(AFS) && AFS
83 extern struct vfsops afs_vfsops;
84 #endif
85
86 #include <cdfs.h>
87 xxENDxx
88
89 $VFSSearch2 = << "xxENDxx";
90 (struct vfsops *)0, "", /* 13 = MOUNT_ADDON */
91 xxENDxx
92
93 $VFSNew2 = << "xxENDxx";
94 #if defined(AFS)
95 &afs_vfsops, "afs",
96 #else
97 (struct vfsops *)0, "", /* 13 = MOUNT_ADDON */
98 #endif
99 xxENDxx
100
101
102
103 if (!&Patch::Patch($VFSCONF, [[0, "Replace", $VFSSearch1, $VFSNew1],
104 [0, "Replace", $VFSSearch2, $VFSNew2]])) {
105 &ErrorMsg("Did not succeed with patch", $VFSCONF);
106 }
107 }