ULTRIX-11 Version 3.1 Source Kit The ULTRIX-11 Version 3.1 source kit contains the directories and files from which the ULTRIX-11 Version 3.1 binary system was built. These source directories and files are intended for reference only. To build an ULTRIX-11 Version 3.1 system from these sources, you already must be running an ULTRIX-11 Version 3.1 binary system. Then, you can install this source kit on top of your ULTRIX-11 Version 3.1 binary system. The next four subsections discuss: o Source kit contents o Extracting sources o Building commands o Building an ULTRIX-11 kernel _1._1 _S_o_u_r_c_e _K_i_t _C_o_n_t_e_n_t_s The ULTRIX-11 Version 3.1 source kit consists of a single, 1600 bpi magnetic tape in _t_a_r format. This source kit tape contains: o System administrative (data) files o Local Header files o Local commands o Command and library sources o Kernel and stand-alone program sources For further information, read _t_a_r(1) and _t_a_r(5) in the _U_L_T_R_I_X-_1_1 _P_r_o_g_r_a_m_m_e_r'_s _M_a_n_u_a_l. 9 _1._1._1 _S_y_s_t_e_m _A_d_m_i_n_i_s_t_r_a_t_i_v_e _F_i_l_e_s The following system administrative (data) files are included on the source kit tape: o /etc/group.KIT o /etc/motd.KIT o /etc/passwd.KIT o /etc/rc.KIT o /etc/remote.KIT o /usr/games/lib/fortunes.KIT o /usr/lib/aliases.KIT o /usr/lib/crontab.KIT o /usr/lib/sendmail.cfKIT o /usr/lib/uucp/USERFILE.KIT These .KIT files are the default system data files distributed with the ULTRIX-11 Version 3.1 binary system. For example, the /_e_t_c/_p_a_s_s_w_d._K_I_T file is a duplicate of the /_e_t_c/_p_a_s_s_w_d file that is distributed with the ULTRIX-11 Version 3.1 binary system. Because most of these .KIT files are tailored to the needs of each system, they are included with the source tape distribution for reference only. To ensure that each .KIT file is extracted and placed in its appropriate directory, each is archived, using its full path name, in the directory where it normally would be found. _1._1._2 _L_o_c_a_l _H_e_a_d_e_r _F_i_l_e_s The following header files are included on the source kit tape: o /usr/include/local/uparm.h o /usr/include/protocols/rwhod.h o /usr/include/sys/eflg.h These are the additional header files required to build the ULTRIX-11 Version 3.1 binary system. The remaining header files required to build the ULTRIX-11 Version 3.1 system already are distributed with the binary system. To ensure that each header file is extracted and placed in its appropriate directory, each is 9 2 Version 3.1 Source Kit archived, using its full path name, in the directory where it normally would be found. _1._1._3 _L_o_c_a_l _C_o_m_m_a_n_d_s The following local commands are included on the source kit tape: o /usr/local/calcov o /usr/local/install To ensure that each local command is extracted and placed in its appropriate directory, each is archived, using its full path name, in the directory where it normally would be found. For example, because the location of the _c_a_l_c_o_v command is hardwired into several makefiles, it is archived and extracted using its full path name, /_u_s_r/_l_o_c_a_l/_c_a_l_c_o_v. _W_a_r_n_i_n_g If your system contains any files with the same name as those mentioned in the System Administrative Files, Local Header Files, or Local Commands subsections, then extracting these files from the source kit tape will overwrite your local version. The ULTRIX-11 Version 3.1 binary system, however, does not contain files with these names. Therefore, you will overwrite data only if you have added files with any of these names. Therefore, first check this list carefully, then, if necessary, preserve on your system those files which potentially conflict. _1._1._4 _C_o_m_m_a_n_d _a_n_d _L_i_b_r_a_r_y _S_o_u_r_c_e_s The ./src directory, containing all sources for the ULTRIX-11 Version 3.1 commands and libraries, is included on the source kit tape. _1._1._5 _K_e_r_n_e_l _a_n_d _S_t_a_n_d-_a_l_o_n_e _P_r_o_g_r_a_m _S_o_u_r_c_e_s The ./sys directory, containing all sources for the ULTRIX-11 Version 3.1 kernel, is included on the source kit tape. _1._2 _E_x_t_r_a_c_t_i_n_g _S_o_u_r_c_e_s Before you begin extracting sources, you should check the amount of disk free space on your /_u_s_r file system. To check the amount of 9 Version 3.1 Source Kit 3 free space available, use the _d_f command. For further information, read _d_f(8) in the _U_L_T_R_I_X-_1_1 _P_r_o_g_r_a_m_m_e_r'_s _M_a_n_u_a_l. The entire source kit tape requires, for sources only, approximately 17,500 K-bytes of free disk space on the /_u_s_r file system. If you have insufficient space on your /_u_s_r file system but have space available on another file system, you can use symbolic links to link the ./src and ./sys directories to the larger file system. For example, if you have a /_u_s_e_r_1 file system with sufficient free space, you can symbolically link the /_u_s_r/_s_r_c directory to /_u_s_e_r_1/_s_r_c. To do so, type: mv /usr/src /usr/src.old mkdir /user1/src ln -s /user1/src /usr/src Once these directories are symbolically linked, any files extracted and placed in /_u_s_r/_s_r_c actually reside in the /_u_s_e_r_1/_s_r_c directory on the larger file system. Each source directory requires: ./src 15,000 K-bytes ./sys 2,500 K-bytes ----------------------- Total 17,500 K-bytes In addition, you need sufficient disk space to build the commands or libraries in each of the respective source directories. Building the entire ULTRIX-11 Version 3.1 binary system requires an additional: ./src 21,700 K-bytes ./sys 1,300 K-bytes ----------------------- Total 23,000 K-bytes Therefore, if you intend to build the entire system at once, you will need about 40,000 Kbytes of free disk space on your /_u_s_r file system. To extract the contents of the source kit tape, you use the _t_a_r command with the x, p, and f keys specified. x Extracts each file from the tape. p Preserves the original owner IDs, permissions, and modification times. f Uses the next argument as the name of the special file on which the source kit tape is mounted. 9 4 Version 3.1 Source Kit To extract the contents of entire source kit tape, log in to the _r_o_o_t account and type: cd /usr tar xpf /dev/rht0 The /_d_e_v/_r_h_t_0 is the special file name of the tape drive on which the source tape is mounted. If you only want to extract the command sources in the /_u_s_r/_s_r_c directory, type: cd /usr tar xpf /dev/rht0 ./src The /_d_e_v/_r_h_t_0 is the special file name of the tape drive on which the source tape is mounted. If you only want to extract the kernel sources in the /_u_s_r/_s_y_s directory, type: cd /usr tar xpf /dev/rht0 ./sys The /_d_e_v/_r_h_t_0 is the special file name of the tape drive on which the source tape is mounted. _1._3 _B_u_i_l_d_i_n_g _U_L_T_R_I_X-_1_1 _C_o_m_m_a_n_d_s _f_r_o_m _S_o_u_r_c_e To build an ULTRIX-11 command from source, you first are to change directory to where the sources for that command reside. Therefore, read the listing provided and use the _c_d command to change to the appropriate directory. Essentially, the sources for the ULTRIX-11 commands reside in either two types of directories. One type contains the sources for a number of different commands (for example, /_u_s_r/_s_r_c/_c_m_d, /_u_s_r/_s_r_c/_u_c_b, and /_u_s_r/_s_r_c/_e_t_c). The other type contains only the source files required to build a single command or library. For example, the /_u_s_r/_s_r_c/_c_m_d/_a_d_b directory contains the source files needed to build the _a_d_b command, and the /_u_s_r/_s_r_c/_u_c_b/_M_a_i_l directory contains the source files needed to build the Berkeley _m_a_i_l command. Once in the appropriate directory, use the supplied makefile to build an ULTRIX-11 command from source. To build all commands in that directory, type: 9 Version 3.1 Source Kit 5 make all To build a specific command in that directory, however, type: make _c_m_d _c_m_d Specifies the command that is to be built. If no command name is specified, builds all commands in that directory as well as those in all subdirectories. For example, to build the _w_h_o command from source, type: cd /usr/src/cmd make who Once a command is built, use the _i_n_s_t_a_l_l script to install the new version in its appropriate directory. For example, to install the new version of the _w_h_o command, type: cd /usr/src/cmd install who If the -n option is specified, _i_n_s_t_a_l_l displays all actions but does not install the new version of the command. For example, to display all actions but not install the new version of the _w_h_o command, type: install -n who From a command subdirectory (for example, /_u_s_r/_s_r_c/_c_m_d/_a_d_b), however, the _i_n_s_t_a_l_l script cannot be used. To build and install from a command subdirectory (for example, /_u_s_r/_s_r_c/_c_m_d/_a_d_b), type: cd /usr/src/cmd/adb make install For further information about _m_a_k_e and _i_n_s_t_a_l_l procedures, see /_u_s_r/_s_r_c/_m_a_k_e._s_k_e_l (prototype makefile). _1._4 _B_u_i_l_d_i_n_g _a_n _U_L_T_R_I_X-_1_1 _K_e_r_n_e_l _f_r_o_m _S_o_u_r_c_e To build an ULTRIX-11 kernel from source, you need to build the appropriate libraries or object files for your processor. There are two types of directories for kernel object files. One is for processors having separate instruction and data space (split I & D), and the other is for processors having nonseparate instruction and data space (nonsplit I & D). The _d_e_v, _n_e_t, and _s_y_s subdirectories in /_u_s_r/_s_y_s contain the kernel object libraries for split I & D processors. The _o_v_d_e_v, _o_v_n_e_t, and _o_v_s_y_s subdirectories in /_u_s_r/_s_l_y_s contain the object files for nonsplit I & D Processors. Each set of objects and libraries, whether split I & D 9 6 Version 3.1 Source Kit or nonsplit I & D, depends on a common set of source files. The kernel source files reside in /_u_s_r/_s_y_s in the directories _d_e_v, _s_y_s, and _n_e_t. To build an ULTRIX-11 kernel for your processor, change directory to where the objects for your processor type reside and type: make This rebuilds the kernel object files from the source files and then, for split I & D processors, automatically rearchives the new objects into the appropriate library. If the archive library does not exist, however, _m_a_k_e displays the following error message: make: cannot open LIB?_id. Stop. If you receive this message, you can force the archive to be built by typing: make archive For example, to rebuild the split I & D version of the device driver library, /_u_s_r/_s_y_s/_d_e_v/_L_I_B_2__i_d, change directory to /_u_s_r/_s_y_s/_d_e_v and type: make archive In another example, to rebuild the nonsplit I & D networking object files, change directory to /_u_s_r/_s_y_s/_o_v_n_e_t, and type: make This rebuilds the networking object files from the networking source files residing in /_u_s_r/_s_y_s/_n_e_t. Finally, use the _s_y_s_g_e_n program to build a new kernel using the libraries or object files that were just built. For further information, see the _U_L_T_R_I_X-_1_1 _S_y_s_t_e_m _M_a_n_a_g_e_m_e_n_t _G_u_i_d_e. _1._4._1 _B_o_o_t_i_n_g _Y_o_u_r _N_e_w _K_e_r_n_e_l To boot an ULTRIX-11 kernel that has been built from sources, you need to install a new copy of the /_b_o_o_t program. If you do not install a new version of _b_o_o_t, the new kernel will not boot. The boot program sources are located in the /_u_s_r/_s_y_s/_s_a_s directory. To build and install a new version of the _b_o_o_t program, type: cp /boot /boot.save cd /usr/sys/sas make boot (continued on next page) 9 Version 3.1 Source Kit 7 cp boot /boot chmod 644 /boot You only need to build a new version of _b_o_o_t once. The new version of the _b_o_o_t program knows how to boot all different types of ULTRIX-11 kernels. After having verified that the new version of _b_o_o_t works, create a backup copy named /_b_o_o_t._b_u: cp /boot /boot.bu Then, in the event that /_b_o_o_t fails or cannot be accessed, the system will automatically try /_b_o_o_t._b_u and attempt to boot the system from this backup file. 9 8 Version 3.1 Source Kit