Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / afsinstall / lib / InstallGuides / ALPHA_x / 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 kernel built libraries
9# For Alpha systems running Digital Unix 3.x
10#
11
12sub bldkernel {
13my($host);
14
15if ($Configuration{"NFSEXTENSIONS"}) {
16 &Copy("root.client/bin/libafs.o", "/usr/sys/BINARY"); }
17else {
18 &Copy("root.client/bin/libafs.nonfs.o", "/usr/sys/BINARY/libafs.o"); };
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
27if (!-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";
43options UFS
44options NFS
45xxENDxx
46$AFSNewInsert = <<"xxENDxx";
47options AFS
48xxENDxx
49
50$AFSSearchReplace = "ident\\s+.+";
51$AFSNewReplace = "ident\t\t\"AFS\"";
52
53if (!&Patch::Patch($AFS, [[0, "Insert", $AFSSearchInsert, $AFSNewInsert],
54 [1, "Replace", $AFSSearchReplace, $AFSNewReplace]])) {
55 &ErrorMsg("Did not succeed with patch", $AFS);
56}
57
58$FILESSearch1 = "OPTIONS/nfs\\s.*";
59$FILESNew1 = "OPTIONS/afs \t\t\toptional afs define_dynamic";
60
61#$FILESSearch2 = "nfs/nfs3_server.c\\s.*";
62#$FILESNew2 = << "xxENDxx";
63#MODULE/afs optional afs Binary
64#afs/libafs.c module afs
65#xxENDxx
66$FILESNew2 = "afs/libafs.c\t\t\toptional afs if_dynamic afs Binary";
67
68#if (!&Patch::Patch($FILES, [[1, "Insert", $FILESSearch1, $FILESNew1],
69# [1, "Insert", $FILESSearch2, $FILESNew2]])) {
70# &ErrorMsg("Did not succeed with patch", $FILES);
71#}
72if (!&Patch::Patch($FILES, [[1, "Insert", $FILESSearch1, $FILESNew1],
73 [0, "EOF", $FILESSearch2, $FILESNew2]])) {
74 &ErrorMsg("Did not succeed with patch", $FILES);
75}
76
77$VFSSearch1 = "#include <cdfs.h>";
78$VFSNew1 = << "xxENDxx";
79#include <afs.h>
80#if defined(AFS) && AFS
81extern struct vfsops afs_vfsops;
82#endif
83
84#include <cdfs.h>
85xxENDxx
86
87$VFSSearch2 = << "xxENDxx";
88 (struct vfsops *)0, "", /* 13 = MOUNT_ADDON */
89xxENDxx
90
91$VFSNew2 = << "xxENDxx";
92#if defined(AFS)
93 &afs_vfsops, "afs",
94#else
95 (struct vfsops *)0, "", /* 13 = MOUNT_ADDON */
96#endif
97xxENDxx
98
99
100
101if (!&Patch::Patch($VFSCONF, [[0, "Replace", $VFSSearch1, $VFSNew1],
102 [0, "Replace", $VFSSearch2, $VFSNew2]])) {
103 &ErrorMsg("Did not succeed with patch", $VFSCONF);
104}
105}