none
[openafs-wiki.git] / AFSLore / BuildingAFSintotheDigitalUNIXKernel.mdwn
1 The sysconfig program is the dynamic kernel loader provided for Digital UNIX systems.
2
3 For AFS to function correctly, the sysconfig program must run each time the machine reboots, so the AFS initialization script (included on the AFS CD-ROM) invokes it automatically. In this section you copy the appropriate AFS library file to the location where the sysconfig program accesses it and then run the script.
4
5 ## <a name="Building AFS into the Digital UN"></a> Building AFS into the Digital UNIX Kernel
6
7 Use the following instructions to build AFS modifications into the kernel on a Digital UNIX system.
8
9 1. Create a copy called AFS of the basic kernel configuration file included in the Digital UNIX distribution as /usr/sys/conf/machine\_name, where machine\_name is the machine's hostname in all uppercase letters.
10
11        # cd /usr/sys/conf
12
13        # cp machine_name AFS
14
15 1. Add AFS to the list of options in the configuration file you created in the previous step, so that the result looks like the following:
16
17               .                   .
18               .                   .
19            options               UFS
20            options               NFS
21            options               AFS
22               .                   .
23               .                   .
24
25 1. Add an entry for AFS to two places in the file /usr/sys/conf/files.
26
27 \* Add a line for AFS to the list of OPTIONS, so that the result looks like the following:
28
29                  .                .      .
30                  .                .      .
31           OPTIONS/nfs          optional nfs
32           OPTIONS/afs          optional afs
33           OPTIONS/nfs_server   optional nfs_server
34                  .                .      .
35                  .                .      .
36
37 \* Add an entry for AFS to the list of MODULES, so that the result looks like the following:
38
39                  .                  .        .          .
40                  .                  .        .          .
41           #
42           MODULE/nfs_server       optional nfs_server Binary
43           nfs/nfs_server.c      module nfs_server optimize -g3
44           nfs/nfs3_server.c       module nfs_server optimize -g3
45           #
46           MODULE/afs            optional afs Binary
47           afs/libafs.c          module afs
48           #
49
50 1. Add an entry for AFS to two places in the file /usr/sys/vfs/vfs\_conf.c.
51
52 \* Add AFS to the list of defined file systems, so that the result looks like the following:
53
54             .       .
55             .       .
56          #include <afs.h>
57          #if defined(AFS) && AFS
58                 extern struct vfsops afs_vfsops;
59          #endif
60             .       .
61             .       .
62
63 \* Put a declaration for AFS in the vfssw[] table's MOUNT\_ADDON slot, so that the result looks like the following:
64
65             .                          .              .
66             .                          .              .
67           &fdfs_vfsops,         "fdfs",   /* 12 = MOUNT_FDFS */
68        #if   defined(AFS)
69           &afs_vfsops,          "afs",
70        #else
71           (struct vfsops *)0,   "",       /* 13 = MOUNT_ADDON */
72        #endif
73        #if NFS && INFS_DYNAMIC
74            &nfs3_vfsops,        "nfsv3",  /* 14 = MOUNT_NFS3 */
75
76 1. Mount the AFS CD-ROM for Digital UNIX on the local /cdrom directory. For instructions on mounting CD-ROMs (either locally or remotely via NFS), see your Digital UNIX documentation. Then change directory as indicated.
77
78        # cd /cdrom/alpha_dux40/root.client
79
80 1. Copy the AFS initialization script to the local directory for initialization files (by convention, /sbin/init.d on Digital UNIX machines). Note the removal of the .rc extension as you copy the script.
81
82        # cp usr/vice/etc/afs.rc  /sbin/init.d/afs
83
84 1. Copy the AFS kernel module to the local /usr/sys/BINARY directory.
85
86 If the machine's kernel supports NFS server functionality:
87
88        # cp bin/libafs.o /usr/sys/BINARY/afs.mod
89
90 If the machine's kernel does not support NFS server functionality:
91
92        # cp bin/libafs.nonfs.o /usr/sys/BINARY/afs.mod
93
94 1. Configure and build the kernel. Respond to any prompts by pressing . The resulting kernel resides in the file /sys/AFS/vmunix.
95
96        # doconfig -c AFS
97
98 1. Rename the existing kernel file and copy the new, AFS-modified file to the standard location.
99
100        # mv /vmunix /vmunix_noafs
101
102        # cp /sys/AFS/vmunix /vmunix
103
104 10. Reboot the machine to start using the new kernel, and login again as the superuser root.
105
106        # cd /
107
108        # shutdown -r now
109
110        login: root
111        Password: root_password