| 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 | |
| 12 | sub bldkernel { |
| 13 | my($host); |
| 14 | |
| 15 | if ($Configuration{"NFSEXTENSIONS"}) { |
| 16 | &Copy("root.client/bin/libafs.o", "/usr/sys/BINARY"); } |
| 17 | else { |
| 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 |
| 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 | |
| 50 | $AFSSearchReplace = "ident\\s+.+"; |
| 51 | $AFSNewReplace = "ident\t\t\"AFS\""; |
| 52 | |
| 53 | if (!&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 | #} |
| 72 | if (!&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 |
| 81 | extern struct vfsops afs_vfsops; |
| 82 | #endif |
| 83 | |
| 84 | #include <cdfs.h> |
| 85 | xxENDxx |
| 86 | |
| 87 | $VFSSearch2 = << "xxENDxx"; |
| 88 | (struct vfsops *)0, "", /* 13 = MOUNT_ADDON */ |
| 89 | xxENDxx |
| 90 | |
| 91 | $VFSNew2 = << "xxENDxx"; |
| 92 | #if defined(AFS) |
| 93 | &afs_vfsops, "afs", |
| 94 | #else |
| 95 | (struct vfsops *)0, "", /* 13 = MOUNT_ADDON */ |
| 96 | #endif |
| 97 | xxENDxx |
| 98 | |
| 99 | |
| 100 | |
| 101 | if (!&Patch::Patch($VFSCONF, [[0, "Replace", $VFSSearch1, $VFSNew1], |
| 102 | [0, "Replace", $VFSSearch2, $VFSNew2]])) { |
| 103 | &ErrorMsg("Did not succeed with patch", $VFSCONF); |
| 104 | } |
| 105 | } |