diff --git a/handbook/backups.sgml b/handbook/backups.sgml index ac6664824a..2372680b17 100644 --- a/handbook/backups.sgml +++ b/handbook/backups.sgml @@ -1,572 +1,572 @@ - + Backups

Issues of hardware compatibility are among the most troublesome in the computer industry today and FreeBSD is by no means immune to trouble. In this respect, FreeBSD's advantage of being able to run on inexpensive commodity PC hardware is also its liability when it comes to support for the amazing variety of components on the market. While it would be impossible to provide a exhaustive listing of hardware that FreeBSD supports, this section serves as a catalog of the device drivers included with FreeBSD and the hardware each drivers supports. Where possible and appropriate, notes about specific products are included. You may also want to refer to section in this handbook for a list of supported devices. As FreeBSD is a volunteer project without a funded testing department, we depend on you, the user, for much of the information contained in this catalog. If you have direct experience of hardware that does or does not work with FreeBSD, please let us know by sending e-mail to the &a.doc;. Questions about supported hardware should be directed to the &a.questions (see for more information). When submitting information or asking a question, please remember to specify exactly what version of FreeBSD you are using and include as many details of your hardware as possible. * What about backups to floppies? Tape Media

The major tape media are the 4mm, 8mm, QIC, mini-cartridge and DLT. 4mm (DDS: Digital Data Storage)

4mm tapes are replacing QIC as the workstation backup media of choice. This trend accelerated greatly when Conner purchased Archive, a leading manufacturer of QIC drives, and then stopped production of QIC drives. 4mm drives are small and quiet but do not have the reputation for reliability that is enjoyed by 8mm drives. The cartridges are less expensive and smaller (3 x 2 x 0.5 inches, 76 x 51 x 12 mm) than 8mm cartridges. 4mm, like 8mm, has comparatively short head life for the same reason, both use helical scan.

Data thruput on these drives starts ~150kB/s, peaking at ~500kB/s. Data capacity starts at 1.3 GB and ends at 2.0 GB. Hardware compression, available with most of these drives, approximately doubles the capacity. Multi-drive tape library units can have 6 drives in a single cabinet with automatic tape changing. Library capacities reach 240 GB.

4mm drives, like 8mm drives, use helical-scan. All the benefits and drawbacks of helical-scan apply to both 4mm and 8mm drives.

Tapes should be retired from use after 2,000 passes or 100 full backups. 8mm (Exabyte)

8mm tapes are the most common SCSI tape drives; they are the best choice of exchanging tapes. Nearly every site has an exabyte 2 GB 8mm tape drive. 8mm drives are reliable, convenient and quiet. Cartridges are inexpensive and small (4.8 x 3.3 x 0.6 inches; 122 x 84 x 15 mm). One downside of 8mm tape is relatively short head and tape life due to the high rate of relative motion of the tape across the heads.

Data thruput ranges from ~250kB/s to ~500kB/s. Data sizes start at 300 MB and go up to 7 GB. Hardware compression, available with most of these drives, approximately doubles the capacity. These drives are available as single units or multi-drive tape libraries with 6 drives and 120 tapes in a single cabinet. Tapes are changed automatically by the unit. Library capacities reach 840+ GB.

Data is recorded onto the tape using helical-scan, the heads are positioned at an angle to the media (approximately 6 degrees). The tape wraps around 270 degrees of the spool that holds the heads. The spool spins while the tape slides over the spool. The result is a high density of data and closely packed tracks that angle across the tape from one edge to the other. QIC

QIC-150 tapes and drives are, perhaps, the most common tape drive and media around. QIC tape drives are the least expensive "serious" backup drives. The downside is the cost of media. QIC tapes are expensive compared to 8mm or 4mm tapes, up to 5 times the price per GB data storage. But, if your needs can be satisfied with a half-dozen tapes, QIC may be the correct choice. QIC is the most common tape drive. Every site has a QIC drive of some density or another. Therein lies the rub, QIC has a large number of densities on physically similar (sometimes identical) tapes. QIC drives are not quiet. These drives audibly seek before they begin to record data and are clearly audible whenever reading, writing or seeking. QIC tapes measure (6 x 4 x 0.7 inches; 15.2 x 10.2 x 1.7 mm). , which also use 1/4" wide tape are discussed separately. Tape libraries and changers are not available.

Data thruput ranges from ~150kB/s to ~500kB/s. Data capacity ranges from 40 MB to 15 GB. Hardware compression is available on many of the newer QIC drives. QIC drives are less frequently installed; they are being supplanted by DAT drives.

Data is recorded onto the tape in tracks. The tracks run along the long axis of the tape media from one end to the other. The number of tracks, and therefore the width of a track, varies with the tape's capacity. Most if not all newer drives provide backward-compatibility at least for reading (but often also for writing). QIC has a good reputation regarding the safety of the data (the mechanics are simpler and more robust than for helical scan drives).

Tapes should be retired from use after 5,000 backups. * Mini-Cartridge DLT

DLT has the fastest data transfer rate of all the drive types listed here. The 1/2" (12.5mm) tape is contained in a single spool cartridge (4 x 4 x 1 inches; 100 x 100 x 25 mm). The cartridge has a swinging gate along one entire side of the cartridge. The drive mechanism opens this gate to extract the tape leader. The tape leader has an oval hole in it which the drive uses to "hook" the tape. The take-up spool is located inside the tape drive. All the other tape cartridges listed here (9 track tapes are the only exception) have both the supply and take-up spools located inside the tape cartridge itself. Data thruput is approximately 1.5MB/s, three times the thruput of 4mm, 8mm, or QIC tape drives. Data capacities range from 10GB to 20GB for a single drive. Drives are available in both multi-tape changers and multi-tape, multi-drive tape libraries containing from 5 to 900 tapes over 1 to 20 drives, providing from 50GB to 9TB of storage. Data is recorded onto the tape in tracks parallel to the direction of travel (just like QIC tapes). Two tracks are written at once. Read/write head lifetimes are relatively long; once the tape stops moving, there is no relative motion between the heads and the tape. Using a new tape for the first time

The first time that you try to read or write a new, completely blank tape, the operation will fail. The console messages should be similar to: st0(ncr1:4:0): NOT READY asc:4,1 st0(ncr1:4:0): Logical unit is in process of becoming ready The tape does not contain an Identifier Block (block number 0). All QIC tape drives since the adoption of QIC-525 standard write an Identifier Block to the tape. There are two solutions:

mt fsf 1 causes the tape drive to write an Identifier Block to the tape.

Use the front panel button to eject the tape.

Re-insert the tape and dump(8) data to the tape.

dump(8) will report DUMP: End of tape detected and the console will show: HARDWARE FAILURE info:280 asc:80,96

rewind the tape using: mt rewind

Subsequent tape operations are successful. Backup Programs

The three major programs are dump(8), tar(1), and cpio(1). Dump and Restore

dump(8) and restore(8) are the traditional Unix backup programs. They operate on the drive as a collection of disk blocks, below the abstractions of files, links and directories that are created by the filesystems. dump(8) backs up devices, entire filesystems, not parts of a filesystem and not directory trees that span more than one filesystem, using either soft links ln(1) or mounting one filesystem onto another. dump(8) does not write files and directories to tape, but rather writes the data blocks that are the building blocks of files and directories. dump(8) has quirks that remain from its early days in Version 6 of ATT Unix (circa 1975). The default parameters are suitable for 9-track tapes (6250 bpi), not the high-density media available today (up to 62,182 ftpi). These defaults must be overridden on the command line to utilize the capacity of current tape drives.

rdump(8) and rrestore(8) backup data across the network to a tape drive attached to another computer. Both programs rely upon rcmd(3) and ruserok(3) to access the remote tape drive. Therefore, the user performing the backup must have rhosts access to the remote computer. The arguments to rdump(8) and rrestore(8) must suitable to use on the remote computer. (e.g. When rdump'ing from a FreeBSD computer to an Exabyte tape drive connected to a Sun called komodo, use: /sbin/rdump 0dsbfu 54000 13000 126 komodo:/dev/nrst8 /dev/rsd0a 2>&1) Beware: there are security implications to allowing rhosts commands. Evaluate your situation carefully. Tar

tar(1) also dates back to Version 6 of ATT Unix (circa 1975). tar(1) operates in cooperation with the filesystem; tar(1) writes files and directories to tape. tar(1) does not support the full range of options that are available from cpio(1), but tar(1) does not require the unusual command pipeline that cpio(1) uses.

Most versions of tar(1) do not support backups across the network. The GNU version of tar(1), which FreeBSD utilizes, supports remote devices using the same syntax as rdump. To tar(1) to an Exabyte tape drive connected to a Sun called komodo, use: /usr/bin/tar cf komodo:/dev/nrst8 . 2>&1. For versions without remote device support, you can use a pipeline and rsh(1) to send the data to a remote tape drive. (XXX add an example command) Cpio

cpio(1) is the original Unix file interchange tape program for magnetic media. cpio(1) has options (among many others) to perform byte-swapping, write a number of different archives format, and pipe the data to other programs. This last feature makes cpio(1) and excellent choice for installation media. cpio(1) does not know how to walk the directory tree and a list of files must be provided thru STDIN.

cpio(1) does not support backups across the network. You can use a pipeline and rsh(1) to send the data to a remote tape drive. (XXX add an example command) Pax

pax(1) is IEEE/POSIX's answer to tar and cpio. Over the years the various versions of tar and cpio have gotten slightly incompatible. So rather than fight it out to fully standardize them, POSIX created a new archive utility. pax attempts to read and write many of the various cpio and tar formats, plus new formats of its own. Its command set more resembles cpio than tar. Amanda -

(Advanced Maryland Network Disk Archiver) is a client/server backup system, rather than a single program. An Amanda server will backup to a single tape drive any number of computers that have Amanda clients and network communications with the Amanda server. A common problem at locations with a number of large disks is the length of time required to backup to data directly to tape exceeds the amount of time available for the task. Amanda solves this problem. Amanda can use a "holding disk" to backup several filesystems at the same time. Amanda creates "archive sets": a group of tapes used over a period of time to create full backups of all the filesystems listed in Amanda's configuration file. The "archive set" also contains nightly incremental (or differential) backups of all the filesystems. Restoring a damaged filesystem requires the most recent full backup and the incremental backups.

The configuration file provides fine control backups and the network traffic that Amanda generates. Amanda will use any of the above backup programs to write the data to tape. Amanda is available as either a port or a package, it is not installed by default. Do nothing

"Do nothing" is not a computer program, but it is the most widely used backup strategy. There are no initial costs. There is no backup schedule to follow. Just say no. If something happens to your data, grin and bear it!

If your time and your data is worth little to nothing, then "Do nothing" is the most suitable backup program for your computer. But beware, Unix is a useful tool, you may find that within six months you have a collection of files that are valuable to you.

"Do nothing" is the correct backup method for /usr/obj and other directory trees that can be exactly recreated by your computer. An example is the files that comprise these handbook pages-they have been generated from SGML input files. Creating backups of these HTML files is not necessary. The SGML source files are backed up regularly. Which Backup Program is Best?

dump(8) Period. Elizabeth D. Zwicky torture tested all the backup programs discussed here. The clear choice for preserving all your data and all the peculiarities of Unix filesystems is dump(8). Elizabeth created filesystems containing a large variety of unusual conditions (and some not so unusual ones) and tested each program by do a backup and restore of that filesystems. The peculiarities included: files with holes, files with holes and a block of nulls, files with funny characters in their names, unreadable and unwritable files, devices, files that change size during the backup, files that are created/deleted during the backup and more. She presented the results at LISA V in Oct. 1991. See . Emergency Restore Procedure Before the Disaster

There are only four steps that you need to perform in preparation for any disaster that may occur.

First, print the disklabel from each of your disks (e.g. disklabel sd0 | lpr), your filesystem table (/etc/fstab) and all boot messages, two copies of each.

Second, determine that the boot and fixit floppies (boot.flp and fixit.flp) have all your devices. The easiest way to check is to reboot your machine with the boot floppy in the floppy drive and check the boot messages. If all your devices are listed and functional, skip on to step three.

Otherwise, you have to create two custom bootable floppies which has a kernel that can mount your all of your disks and access your tape drive. These floppies must contain: fdisk(8), disklabel(8), newfs(8), mount(8), and whichever backup program you use. These programs must be statically linked. If you use dump(8), the floppy must contain restore(8).

Third, create backup tapes regularly. Any changes that you make after your last backup may be irretrievably lost. Write-protect the backup tapes.

Fourth, test the floppies (either boot.flp and fixit.flp or the two custom bootable floppies you made in step two.) and backup tapes. Make notes of the procedure. Store these notes with the bootable floppy, the printouts and the backup tapes. You will be so distraught when restoring that the notes may prevent you from destroying your backup tapes (How? In place of tar xvf /dev/rst0, you might accidently type tar cvf /dev/rst0 and over-write your backup tape).

For an added measure of security, make bootable floppies and two backup tapes each time. Store one of each at a remote location. A remote location is NOT the basement of the same office building. A number of firms in the World Trade Center learned this lesson the hard way. A remote location should be physically separated from your computers and disk drives by a significant distance.

An example script for creating a bootable floppy: #!/bin/sh # # create a restore floppy # # format the floppy # PATH=/bin:/sbin:/usr/sbin:/usr/bin fdformat -q fd0 if [ $? -ne 0 ] then echo "Bad floppy, please use a new one" exit 1 fi # place boot blocks on the floppy # disklabel -w -B -b /usr/mdec/fdboot -s /usr/mdec/bootfd /dev/rfd0c fd1440 # # newfs the one and only partition # newfs -t 2 -u 18 -l 1 -c 40 -i 5120 -m 5 -o space /dev/rfd0a # # mount the new floppy # mount /dev/fd0a /mnt # # create required directories # mkdir /mnt/dev mkdir /mnt/bin mkdir /mnt/sbin mkdir /mnt/etc mkdir /mnt/root mkdir /mnt/mnt # for the root partition mkdir /mnt/tmp mkdir /mnt/var # # populate the directories # if [ ! -x /sys/compile/MINI/kernel ] then cat << EOM The MINI kernel does not exist, please create one. Here is an example config file: # # MINI -- A kernel to get FreeBSD on onto a disk. # machine "i386" cpu "I486_CPU" ident MINI maxusers 5 options INET # needed for _tcp _icmpstat _ipstat # _udpstat _tcpstat _udb options FFS #Berkeley Fast File System options FAT_CURSOR #block cursor in syscons or pccons options SCSI_DELAY=15 #Be pessimistic about Joe SCSI device options NCONS=2 #1 virtual consoles options USERCONFIG #Allow user configuration with -c XXX config kernel root on sd0 swap on sd0 and sd1 dumps on sd0 controller isa0 controller pci0 controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr disk fd0 at fdc0 drive 0 controller ncr0 controller scbus0 device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr device npx0 at isa? port "IO_NPX" irq 13 vector npxintr device sd0 device sd1 device sd2 device st0 pseudo-device loop # required by INET pseudo-device gzip # Exec gzipped a.out's EOM exit 1 fi cp -f /sys/compile/MINI/kernel /mnt gzip -c -best /sbin/init > /mnt/sbin/init gzip -c -best /sbin/fsck > /mnt/sbin/fsck gzip -c -best /sbin/mount > /mnt/sbin/mount gzip -c -best /sbin/halt > /mnt/sbin/halt gzip -c -best /sbin/restore > /mnt/sbin/restore gzip -c -best /bin/sh > /mnt/bin/sh gzip -c -best /bin/sync > /mnt/bin/sync cp /root/.profile /mnt/root cp -f /dev/MAKEDEV /mnt/dev chmod 755 /mnt/dev/MAKEDEV chmod 500 /mnt/sbin/init chmod 555 /mnt/sbin/fsck /mnt/sbin/mount /mnt/sbin/halt chmod 555 /mnt/bin/sh /mnt/bin/sync chmod 6555 /mnt/sbin/restore # # create the devices nodes # cd /mnt/dev ./MAKEDEV std ./MAKEDEV sd0 ./MAKEDEV sd1 ./MAKEDEV sd2 ./MAKEDEV st0 ./MAKEDEV pty0 cd / # # create minimum filesystem table # cat > /mnt/etc/fstab < /mnt/etc/passwd < /mnt/etc/master.passwd < After the Disaster

The key question is: did your hardware survive? You have been doing regular backups so there is no need to worry about the software.

If the hardware has been damaged. First, replace those parts that have been damaged.

If your hardware is okay, check your floppies. If you are using a custom boot floppy, boot single-user (type "-s" at the "boot:" prompt). Skip the following paragraph.

If you are using the boot.flp and fixit.flp floppies, keep reading. Insert the boot.flp floppy in the first floppy drive and boot the computer. The original install menu will be displayed on the screen. Select the "Fixit--Repair mode with CDROM or floppy." option. Insert the fixit.flp when prompted. restore and the other programs that you need are located in /mnt2/stand.

Recover each filesystem separately.

Try to mount(8) (e.g. mount /dev/sd0a /mnt) the root partition of your first disk. If the disklabel was damaged, use disklabel(8) to re-partition and label the disk to match the label that your printed and saved. Use newfs(8) to re-create the filesystems. Re-mount the root partition of the floppy read-write ("mount -u -o rw /mnt"). Use your backup program and backup tapes to recover the data for this filesystem (e.g. restore vrf /dev/st0). Unmount the filesystem (e.g. umount /mnt) Repeat for each filesystem that was damaged.

Once your system is running, backup your data onto new tapes. Whatever caused the crash or data loss may strike again. An another hour spent now, may save you from further distress later. * I did not prepare for the Disaster, What Now? diff --git a/handbook/contrib.sgml b/handbook/contrib.sgml index c85dbf9d3b..c5f675f7e5 100644 --- a/handbook/contrib.sgml +++ b/handbook/contrib.sgml @@ -1,188 +1,188 @@ - + FreeBSD Project Staff

The FreeBSD Project is managed and operated by the following groups of people: The FreeBSD Core Team

The FreeBSD core team constitutes the project's ``Board of Directors'', responsible for deciding the project's overall goals and direction as well as managing of the FreeBSD project landscape.

(in alphabetical order by last name): &a.asami; &a.jmb; &a.ache; &a.bde; &a.gibbs; &a.davidg; &a.jkh; &a.phk; &a.rich; &a.gpalmer; &a.jdp; &a.guido; &a.sos; &a.peter; &a.wollman; &a.joerg; The FreeBSD Developers

These are the people who have commit privileges and do the engineering work on the FreeBSD source tree. All core team members and most FreeBSD Documentation project personnel are also developers. &a.ugen; &a.mbarkah; &a.stb; &a.pb; &a.jb; &a.torstenb; &a.dburr; &a.danny; &a.thepish; &a.charnier; &a.ejc; &a.kjc; &a.gclarkii; &a.cracauer; &a.adam; &a.dufault; &a.uhclem; &a.tegge; &a.eivind; &a.julian; &a.rse; &a.se; &a.sef; &a.fenner; &a.jfieber; &a.jfitz; &a.lars; &a.scrappy; &a.tg; &a.brandon; &a.graichen; &a.jgreco; &a.rgrimes; &a.jmg; &a.hanai; &a.jhay; &a.ghelmer; &a.helbig; &a.erich; &a.hosokawa; &a.hsu; &a.mph; &a.itojun; &a.gj; &a.nsj; &a.kato; &a.andreas; &a.jkoshy; &a.kuriyama; &a.imp; &a.smace; &a.mckay; &a.jlemon; &a.tedm; &a.amurai; &a.markm; &a.max; &a.alex; &a.rnordier; &a.davidn; &a.obrien; &a.ljo; &a.fsmp; &a.smpatel; &a.wpaul; &a.jmacd; &a.steve; &a.mpp; &a.dfr; &a.jraynard; &a.darrenr; &a.csgr; &a.martin; &a.paul; &a.roberto; &a.chuckr; &a.dima; &a.wosch; &a.ats; &a.jseger; &a.vanilla; &a.msmith; &a.des; &a.brian; &a.stark; &a.karl; &a.dt; &a.cwt; &a.pst; &a.hoek; &a.nectar; &a.swallace; &a.nate; &a.yokota; &a.jmz; &a.dwhite; The FreeBSD Documentation Project -

The The is responsible for a number of different services, each service being run by an individual and his deputies (if any):

currently vacant Deputy: &a.john; Deputy: &a.cawimm Deputy: &a.cracauer Deputy: &a.stb Who Is Responsible for What

currently vacant Assistant: &a.jdp International (Crypto): &a.markm diff --git a/handbook/porting.sgml b/handbook/porting.sgml index 6d0d957ddb..940d196bfc 100644 --- a/handbook/porting.sgml +++ b/handbook/porting.sgml @@ -1,1799 +1,1799 @@ - + Porting an existing piece of free software

Contributed by &a.jkh;, &a.gpalmer;, &a.asami; and &a.obrien;.28 August 1996.

The porting of freely available software, while perhaps not as gratifying as developing your own from scratch, is still a vital part of FreeBSD's growth and of great usefulness to those who would not otherwise know where to turn for it. All ported software is organized into a carefully organized hierarchy known as ``the ports collection''. The collection enables a new user to get a quick and complete overview of what is available for FreeBSD in an easy-to-compile form. It also saves considerable space by not actually containing the majority of the sources being ported, but merely those differences required for running under FreeBSD.

What follows are some guidelines for creating a new port for FreeBSD 3.x. The bulk of the work is done by /usr/share/mk/bsd.port.mk, which all port Makefiles include. Please refer to that file for more details on the inner workings of the ports collection. Even if you don't hack Makefiles daily, it is well commented, and you will still gain much knowledge from it. Before Starting the Port

Note: Only a fraction of the overridable variables (${..}) are mentioned in this document. Most (if not all) are documented at the start of bsd.port.mk. This file uses a non-standard tab setting. Emacs and Vim should recognize the setting on loading the file. vi or ex can be set to using the correct value by typing `:set tabstop=4' once the file has been loaded.

You may come across code that needs modifications or conditional compilation based upon what version of UNIX it is running under. If you need to make such changes to the code for conditional compilation, make sure you make the changes as general as possible so that we can back-port code to FreeBSD 1.x systems and cross-port to other BSD systems such as 4.4BSD from CSRG, BSD/386, 386BSD, NetBSD, and OpenBSD.

The preferred way to tell 4.3BSD/Reno (1990) and newer versions of the BSD code apart is by using the `BSD' macro defined in <sys/param.h>. Hopefully that file is already included; if not, add the code: #if (defined(__unix__) || defined(unix)) && !defined(USG) #include #endif

to the proper place in the .c file. We believe that every system that defines these to symbols has sys/param.h. If you find a system that doesn't, we would like to know. Please send mail to &a.ports;.

Another way is to use the GNU Autoconf style of doing this: #ifdef HAVE_SYS_PARAM_H #include #endif Don't forget to add -DHAVE_SYS_PARAM_H to the CFLAGS in the Makefile for this method. Once you have <sys/param.h> included, you may use: #if (defined(BSD) && (BSD >= 199103)) to detect if the code is being compiled on a 4.3 Net2 code base or newer (e.g. FreeBSD 1.x, 4.3/Reno, NetBSD 0.9, 386BSD, BSD/386 1.1 and below). Use: #if (defined(BSD) && (BSD >= 199306)) to detect if the code is being compiled on a 4.4 code base or newer (e.g. FreeBSD 2.x, 4.4, NetBSD 1.0, BSD/386 2.0 or above). The value of the BSD macro is 199506 for the 4.4BSD-Lite2 code base. This is stated for informational purposes only. It should not be used to distinguish between version of FreeBSD based only on 4.4-Lite vs. versions that have merged in changes from 4.4-Lite2. The __FreeBSD__ macro should be used instead.

Use sparingly: __FreeBSD__ is defined in all versions of FreeBSD. Use it if the change you are making ONLY affects FreeBSD. Porting gotchas like the use of sys_errlist[] vs strerror() are Berkeleyisms, not FreeBSD changes. In FreeBSD 2.x, __FreeBSD__ is defined to be 2. In earlier versions, it is 1. Later versions will bump it to match their major version number. If you need to tell the difference between a FreeBSD 1.x system and a FreeBSD 2.x or 3.x system, usually the right answer is to use the BSD macros described above. If there actually is a FreeBSD specific change (such as special shared library options when using `ld') then it is OK to use __FreeBSD__ and `#if __FreeBSD__ > 1' to detect a FreeBSD 2.x and later system. If you need more granularity in detecting FreeBSD systems since 2.0-RELEASE you can use the following: #if __FreeBSD__ >= 2 #include # if __FreeBSD_version >= 199504 /* 2.0.5+ release specific code here */ # endif #endif __FreeBSD_version values: 2.0-RELEASE: 199411 2.1-current's: 199501, 199503 2.0.5-RELEASE: 199504 2.2-current before 2.1: 199508 2.1.0-RELEASE: 199511 2.2-current before 2.1.5: 199512 2.1.5-RELEASE: 199607 2.2-current before 2.1.6: 199608 2.1.6-RELEASE: 199612 2.1.7-RELEASE: 199612 2.2-RELEASE: 220000 2.2.1-RELEASE: 220000 (yes, no change) 2.2-STABLE after 2.2.1-RELEASE: 220000 (yes, still no change) 2.2-STABLE after texinfo-3.9: 221001 2.2-STABLE after top: 221002 2.2.2-RELEASE: 222000 2.2-STABLE after 2.2.2-RELEASE: 222001 2.2.5-RELEASE: 225000 2.2-STABLE after 2.2.5-RELEASE: 225001 2.2-STABLE after ldconfig -R merge: 225002 2.2.6-RELEASE: 226000 2.2.7-RELEASE: 227000 2.2-STABLE after 2.2.7-RELEASE: 227001 3.0-current before mount(2) change: 300000 3.0-current as of Nov 1997: 300001 (Note that 2.2-STABLE sometimes identifies itself as "2.2.5-STABLE" after the 2.2.5-RELEASE.) The pattern used to be year followed by the month, but we decided to change it to a more straightforward major/minor system starting from 2.2. This is because the parallel development on several branches made it infeasible to classify the releases simply by their real release dates. (Note that if you are making a port now, you don't have to worry about old -current's; they are listed here just for your reference.)

In the hundreds of ports that have been done, there have only been one or two cases where __FreeBSD__ should have been used. Just because an earlier port screwed up and used it in the wrong place does not mean you should do so too. Quick Porting

This section tells you how to do a quick port. In many cases, it is not enough, but we will see.

First, get the original tarball and put it into ${DISTDIR}, which defaults to /usr/ports/distfiles.

Note: The following assumes that the software compiled out-of-the-box, i.e., there was absolutely no change required for the port to work on your FreeBSD box. If you needed to change something, you will have to refer to the next section too. Writing the Makefile

The minimal Makefile would look something like this: # New ports collection makefile for: oneko # Version required: 1.1b # Date created: 5 December 1994 # Whom: asami # # $Id$ # DISTNAME= oneko-1.1b CATEGORIES= games MASTER_SITES= ftp://ftp.cs.columbia.edu/archives/X11R5/contrib/ MAINTAINER= asami@FreeBSD.ORG USE_IMAKE= yes .include

See if you can figure it out. Do not worry about the contents of the $Id$ line, it will be filled in automatically by CVS when the port is imported to our main ports tree. You can find a more detailed example in the section. Writing the description files

There are three required description files that are required for any port, whether they actually package or not. They are COMMENT, DESCR, and PLIST, and reside in the pkg subdirectory. COMMENT

This is the one-line description of the port. PLEASE do not include the package name (or version number of the software) in the comment. Here is an example: A cat chasing a mouse all over the screen. DESCR

This is a longer description of the port. One to a few paragraphs concisely explaining what the port does is sufficient. This is not a manual or an in-depth description on how to use or compile the port! Please be careful if you are copying from the README or manpage; too often they are not a concise description of the port or are in an awkward format (e.g. manpages have justified spacing). If the ported software has an official WWW homepage, you should list in here.

It is recommended that you sign the name at the end of this file, as in: This is a port of oneko, in which a cat chases a poor mouse all over the screen. : (etc.) http://www.oneko.org/ - Satoshi asami@cs.berkeley.edu PLIST

This file lists all the files installed by the port. It is also called the `packing list' because the package is generated by packing the files listed here. The pathnames are relative to the installation prefix (usually /usr/local or /usr/X11R6). Also it is assumed the manpages will be compressed.

Here is a small example: bin/oneko man/man1/oneko.1.gz lib/X11/app-defaults/Oneko lib/X11/oneko/cat1.xpm lib/X11/oneko/cat2.xpm lib/X11/oneko/mouse.xpm

Refer to the pkg_create(1) man page for details on the packing list. Creating the checksum file

Just type `make makesum'. The ports make rules will automatically generate the file files/md5. Testing the port

You should make sure that the port rules do exactly what you want it to do, including packaging up the port. Try doing `make install', `make package' and then `make deinstall' and see if all the files and directories are correctly deleted. Then do a `pkg_add `make package-name`.tgz' and see if everything re-appears and works correctly. Then do another `make deinstall' and then `make reinstall; make package' to make sure you haven't included in the packing list any files that are not installed by your port. Submitting the port

First, make sure you have read the section.

Now that you are happy with your port, the only thing remaining is to put it in the main FreeBSD ports tree and make everybody else happy about it too. We do not need your work/ directory or the pkgname.tgz package, so delete them now. Next, simply include the output of `shar `find port_dir`' in a bug report and send it with the send-pr(1) program. If the uncompressed port is larger than 20KB, you should compress it into a tarfile and use uuencode(1) before including it in the bug report (uuencoded tarfiles are acceptable even if the report is smaller than 20KB but are not preferred). Be sure to classify the bug report as category `ports' and class `change-request'.

One more time, do not include the original source distfile, the work/ directory, or the package you built with `make package'!

See for more information.

We will look at your port, get back to you if necessary, and put it in the tree. Your name will also appear in the list of `Additional FreeBSD contributors' on the FreeBSD Handbook and other files. Isn't that great?!? :) Slow Porting

Ok, so it was not that simple, and the port required some modifications to get it to work. In this section, we will explain, step by step, how to modify it to get it to work with the ports paradigm. How things work

First, this is the sequence of events which occurs when the user first types `make' in your port's directory, and you may find that having bsd.port.mk in another window while you read this really helps to understand it.

But do not worry if you do not really understand what bsd.port.mk is doing, not many people do... :> The fetch target is run. The fetch target is responsible for making sure that the tarball exists locally in ${DISTDIR}. If fetch cannot find the required files in ${DISTDIR} it will look up the URL ${MASTER_SITES}, which is set in the Makefile, as well as our main ftp site at where we put sanctioned distfiles as backup. It will then attempt to fetch the named distribution file with ${FETCH}, assuming that the requesting site has direct access to the Internet. If that succeeds, it will save the file in ${DISTDIR} for future use and proceed. The extract target is run. It looks for your port's distribution file in ${DISTDIR} (typically a gzip'd tarball) and unpacks it into a temporary subdirectory specified by ${WRKDIR} (defaults to work). The patch target is run. First, any patches defined in ${PATCHFILES} are applied. Second, if any patches are found in ${PATCHDIR} (defaults to the patches subdirectory), they are applied at this time in alphabetical order. The configure target is run. This can do any one of many different things. If it exists, scripts/configure is run. If ${HAS_CONFIGURE} or ${GNU_CONFIGURE} is set, ${WRKSRC}/configure is run. If ${USE_IMAKE} is set, ${XMKMF} (default: `xmkmf -a') is run. The build target is run. This is responsible for descending into the ports' private working directory (${WRKSRC}) and building it. If ${USE_GMAKE} is set, GNU make will be used, otherwise the system make will be used.

The above are the default actions. In addition, you can define targets `pre-<something>' or `post-<something>', or put scripts with those names, in the scripts subdirectory, and they will be run before or after the default actions are done.

For example, if you have a post-extract target defined in your Makefile, and a file pre-build in the scripts subdirectory, the post-extract target will be called after the regular extraction actions, and the pre-build script will be executed before the default build rules are done. It is recommended that you use Makefile targets if the actions are simple enough, because it will be easier for someone to figure out what kind of non-default action the port requires.

The default actions are done by the bsd.port.mk targets `do-<something>'. For example, the commands to extract a port are in the target `do-extract'. If you are not happy with the default target, you can fix it by redefining the `do-<something>' target in your Makefile.

Note that the `main' targets (e.g., extract, configure, etc.) do nothing more than make sure all the stages up to that one is completed and call the real targets or scripts, and they are not intended to be changed. If you want to fix the extraction, fix do-extract, but never ever touch extract!

Now that you understand what goes on when the user types `make', let us go through the recommended steps to create the perfect port. Getting the original sources

Get the original sources (normally) as a compressed tarball (<foo>.tar.gz or <foo>.tar.Z) and copy it into ${DISTDIR}. Always use mainstream sources when and where you can.

If you cannot find a ftp/http site that is well-connected to the net, or can only find sites that have irritatingly non-standard formats, you might want to put a copy on a reliable http or ftp server that you control. If you are a FreeBSD committer, your public_html directory on freefall is ideal. Make sure you set MASTER_SITE to reflect your choice! If you cannot find somewhere convenient and reliable to put the distfile, we can `house' it ourselves by putting it on ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/LOCAL_PORTS/ as the last resort. Please refer to this location as ${MASTER_SITE_LOCAL}. Send mail to the &a.ports if you are not sure what to do.

If your port requires some additional `patches' that are available on the Internet, fetch them too and put them in ${DISTDIR}. Do not worry if they come from site other than where you got the main source tarball, we have a way to handle these situations (see the description of below). Modifying the port

Unpack a copy of the tarball in a private directory and make whatever changes are necessary to get the port to compile properly under the current version of FreeBSD. Keep careful track of everything you do, as you will be automating the process shortly. Everything, including the deletion, addition or modification of files should be doable using an automated script or patch file when your port is finished.

If your port requires significant user interaction/customization to compile or install, you should take a look at one of Larry Wall's classic Configure scripts and perhaps do something similar yourself. The goal of the new ports collection is to make each port as `plug-and-play' as possible for the end-user while using a minimum of disk space.

Note: Unless explicitly stated, patch files, scripts, and other files you have created and contributed to the FreeBSD ports collection are assumed to be covered by the standard BSD copyright conditions. Patching

In the preparation of the port, files that have been added or changed can be picked up with a recursive diff for later feeding to patch. Each set of patches you wish to apply should be collected into a file named `patch-<xx>' where <xx> denotes the sequence in which the patches will be applied -- these are done in alphabetical order, thus `aa' first, `ab' second and so on. These files should be stored in ${PATCHDIR}, from where they will be automatically applied. All patches should be relative to ${WRKSRC} (generally the directory your port's tarball unpacks itself into, that being where the build is done). To make fixes and upgrades easier you should avoid having more than one patch fix the same file (e.g., patch-aa and patch-ab both changing ${WRKSRC}/foobar.c). Configuring

Include any additional customization commands to your configure script and save it in the `scripts' subdirectory. As mentioned above, you can also do this as Makefile targets and/or scripts with the name pre-configure or post-configure. Handling user input

If your port requires user input to build, configure or install, then set IS_INTERACTIVE in your Makefile. This will allow `overnight builds' to skip your port if the user sets the variable BATCH in his environment (and if the user sets the variable INTERACTIVE, then only those ports requiring interaction are built). Configuring the Makefile

Configuring the Makefile is pretty simple, and again we suggest that you look at existing examples before starting. Also, there is a in this handbook, so take a look and please follow the ordering of variables and sections in that template to make your port easier for others to read.

Now, consider the following problems in sequence as you design your new Makefile: The original source

Does it live in ${DISTDIR} as a standard gzip'd tarball? If so, you can go on to the next step. If not, you should look at overriding any of the ${EXTRACT_CMD}, ${EXTRACT_BEFORE_ARGS}, ${EXTRACT_AFTER_ARGS}, ${EXTRACT_SUFX}, or ${DISTFILES} variables, depending on how alien a format your port's distribution file is. (The most common case is `EXTRACT_SUFX=.tar.Z', when the tarball is condensed by regular compress, not gzip.)

In the worst case, you can simply create your own `do-extract' target to override the default, though this should be rarely, if ever, necessary. DISTNAME

You should set ${DISTNAME} to be the base name of your port. The default rules expect the distribution file list (${DISTFILES}) to be named ${DISTNAME}${EXTRACT_SUFX} by default which, if it is a normal tarball, is going to be something like: foozolix-1.0.tar.gz for a setting of `DISTNAME=foozolix-1.0'. The default rules also expect the tarball(s) to extract into a subdirectory called work/${DISTNAME}, e.g. work/foozolix-1.0/ All this behavior can be overridden, of course; it simply represents the most common time-saving defaults. For a port requiring multiple distribution files, simply set ${DISTFILES} explicitly. If only a subset of ${DISTFILES} are actual extractable archives, then set them up in ${EXTRACT_ONLY}, which will override the ${DISTFILES} list when it comes to extraction, and the rest will be just left in ${DISTDIR} for later use. CATEGORIES

When a package is created, it is put under /usr/ports/packages/All and links are made from one or more subdirectories of /usr/ports/packages. The names of these subdirectories are specified by the variable ${CATEGORIES}. It is intended to make life easier for the user when he is wading through the pile of packages on the ftp site or the CD-ROM. Please take a look at the existing categories (you can find them in ) and pick the ones that are suitable for your port. If your port truly belongs to something that is different from all the existing ones, you can even create a new category name. MASTER_SITES

Record the directory part of the ftp/http-URL pointing at the original tarball in ${MASTER_SITES}. Do not forget the trailing slash (/)!

The make macros will try to use this specification for grabbing the distribution file with ${FETCH} if they cannot find it already on the system.

It is recommended that you put multiple sites on this list, preferably from different continents. This will safeguard against wide-area network problems, and we are even planning to add support for automatically determining the closest master site and fetching from there!

If the original tarball is part of one of the following popular archives: X-contrib, GNU, Perl CPAN, TeX CTAN, or Linux Sunsite, you refer to those sites in an easy compact form using MASTER_SITE_XCONTRIB, MASTER_SITE_GNU, MASTER_SITE_PERL_CPAN, MASTER_SITE_TEX_CTAN, and MASTER_SITE_SUNSITE. Simply set MASTER_SITE_SUBDIR to the path with in the archive. Here is an example: MASTER_SITES= ${MASTER_SITE_XCONTRIB} MASTER_SITE_SUBDIR= applications

The user can also set the MASTER_SITE_* variables in /etc/make.conf to override our choices, and use their favorite mirrors of these popular archives instead. PATCHFILES

If your port requires some additional patches that are available by ftp or http, set ${PATCHFILES} to the names of the files and ${PATCH_SITES} to the URL of the directory that contains them (the format is the same as ${MASTER_SITES}).

If the patch is not relative to the top of the source tree (i.e., ${WKRSRC}) because it contains some extra pathnames, set ${PATCH_DIST_STRIP} accordingly. For instance, if all the pathnames in the patch has an extra `foozolix-1.0/' in front of the filenames, then set `PATCH_DIST_STRIP=-p1'.

Do not worry if the patches are compressed, they will be decompressed automatically if the filenames end with `.gz' or `.Z'.

If the patch is distributed with some other files, such as documentation, in a gzip'd tarball, you can't just use ${PATCHFILES}. If that is the case, add the name and the location of the patch tarball to ${DISTFILES} and ${MASTER_SITES}. Then, from the pre-patch target, apply the patch either by running the patch command from there, or copying the patch file into the ${PATCHDIR} directory and calling it patch-<xx>. (Note the tarball will have been extracted alongside the regular source by then, so there is no need to explicitly extract it if it is a regular gzip'd or compress'd tarball.) If you do the latter, take extra care not to overwrite something that already exists in that directory. Also do not forget to add a command to remove the copied patch in the pre-clean target. MAINTAINER

Set your mail-address here. Please. :)

For detailed description of the responsibility of maintainers, refer to section. Dependencies

Many ports depend on other ports. There are five variables that you can use to ensure that all the required bits will be on the user's machine. LIB_DEPENDS

This variable specifies the shared libraries this port depends on. It is a list of `lib:dir' pairs where lib is the name of the shared library, and dir is the directory in which to find it in case it is not available. For example, LIB_DEPENDS= jpeg\\.6\\.:${PORTSDIR}/graphics/jpeg will check for a shared jpeg library with major version 6, and descend into the graphics/jpeg subdirectory of your ports tree to build and install it if it is not found. Note that the lib part is just an argument given to `ldconfig -r | grep', so periods should be escaped by two backslashes like in the example above. The dependency is checked from within the extract target. Also, the name of the dependency is put in to the package so that pkg_add will automatically install it if it is not on the user's system. RUN_DEPENDS

This variable specifies executables or files this port depends on during run-time. It is a list of `path:dir' pairs where path is the name of the executable or file, and dir is the directory in which to find it in case it is not available. If path starts with a slash (/), it is treated as a file and its existence is tested with `test -e'; otherwise, it is assumed to be an executable, and `which -s' is used to determine if the program exists in the user's search path.

For example, RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \ wish:${PORTSDIR}/x11/tk will check if the file `/usr/local/etc/innd' exists, and build and install it from the news/inn subdirectory of the ports tree if it is not found. It will also see if an executable called `wish' is in your search path, and descend into the x11/tk subdirectory of your ports tree to build and install it if it is not found. (Note that in this case, `innd' is actually an executable; if an executable is in a place that is not expected to be in a normal user's search path, you should use the full pathname.) The dependency is checked from within the install target. Also, the name of the dependency is put in to the package so that pkg_add will automatically install it if it is not on the user's system. BUILD_DEPENDS

This variable specifies executables or files this port requires to build. Like RUN_DEPENDS, it is a list of `path:dir' pairs. For example, BUILD_DEPENDS= unzip:${PORTSDIR}/archivers/unzip will check for an executable called `unzip', and descend into the archivers/unzip subdirectory of your ports tree to build and install it if it is not found. Note that `build' here means everything from extracting to compilation. The dependency is checked from within the extract target. FETCH_DEPENDS

This variable specifies executables or files this port requires to fetch. Like the previous two, it is a list of `path:dir' pairs. For example, FETCH_DEPENDS= ncftp2:${PORTSDIR}/net/ncftp2 will check for an executable called `ncftp2', and descend into the net/ncftp2 subdirectory of your ports tree to build and install it if it is not found. The dependency is checked from within the fetch target. DEPENDS

If there is a dependency that does not fall into either of the above four categories, or your port requires to have the source of the other port extracted (i.e., having them installed is not enough), then use this variable. This is just a list of directories, as there is nothing to check, unlike the previous four. Building mechanisms

If your package uses GNU make, set `USE_GMAKE=yes'. If your package uses GNU configure, set `GNU_CONFIGURE=yes'. If you want to give some extra arguments to GNU configure (other than the default `--prefix=${PREFIX}'), set those extra arguments in ${CONFIGURE_ARGS}.

If your package is an X application that creates Makefiles from Imakefiles using imake, then set `USE_IMAKE=yes'. This will cause the configure stage to automatically do an xmkmf -a. If the `-a' flag is a problem for your port, set `XMKMF=xmkmf'.

If your port's source Makefile has something else than `all' as the main build target, set ${ALL_TARGET} accordingly. Same goes for `install' and ${INSTALL_TARGET}. NO_INSTALL_MANPAGES

If the port uses imake but does not understand the `install.man' target, `NO_INSTALL_MANPAGES=yes' should be set. In addition, the author of the original port should be shot. :> Ports that require Motif

There are many programs that require a Motif library (available from several commercial vendors, while there is (at least) one effort to create a free clone) to compile. Since it is a popular toolkit and their licenses usually permit redistribution of statically linked binaries, we have made special provisions for handling ports that require Motif in a way that we can easily compile binaries linked either dynamically or statically. REQUIRES_MOTIF

If your port requires Motif, define this variable in the Makefile. This will prevent people who don't own a copy of Motif from even attempting to build it. ${MOTIFLIB}

This variable will be set by bsd.port.mk to be the appropriate reference to the Motif library. Please patch the source to use this wherever the Motif library is referenced in the Makefile or Imakefile.

There are two common cases: If the port refers to the Motif library as `-lXm' in its Makefile or Imakefile, simply substitute `${MOTIFLIB}' for it. If the port uses `XmClientLibs' in its Imakefile, change it to `${MOTIFLIB} ${XTOOLLIB} ${XLIB}'.

Note that ${MOTIFLIB} (usually) expands to `-L/usr/X11R6/lib -lXm' or `/usr/X11R6/lib/libXm.a', so there is no need to add `-L' or `-l' in front. Info files

The new version of texinfo (included in 2.2.2-RELEASE and onwards) contains a utility called `&dollar{PREFIX}/info/dir file. (Sorry for the length of this section, but it is imperative to weave all the info files together. If done correctly, it will produce a beautiful listing, so please bear with me! First, this is what you (as a porter) need to know: % install-info --help install-info [OPTION]... [INFO-FILE [DIR-FILE]] Install INFO-FILE in the Info directory file DIR-FILE. Options: --delete Delete existing entries in INFO-FILE; don't insert any new entries. : --entry=TEXT Insert TEXT as an Info directory entry. : --section=SEC Put this file's entries in section SEC of the directory. :

Note that this program will not actually Here's a seven-step procedure to convert ports to use editors/emacs as an example. Look at the texinfo sources and make a patch to insert --- ./man/vip.texi.org Fri Jun 16 15:31:11 1995 +++ ./man/vip.texi Tue May 20 01:28:33 1997 @@ -2,6 +2,10 @@ @setfilename ../info/vip @settitle VIP +@dircategory The Emacs editor and associated tools +@direntry +* VIP: (vip). A VI-emulation for Emacs. +@end direntry @iftex @finalout :

The format should be self-explanatory. Many authors leave a Note that you can put only one info entry per file because of a bug in `install-info --delete' that deletes only the first entry if you specify multiple entries in the You can give the three places (japanese/skk for examples on how to do this). Go back to the port directory and do a `make clean; make' and verify that the info files are regenerated from the texinfo sources. Since the texinfo sources are newer than the info files, they should be rebuilt when you type --- ./Makefile.in.org Mon Aug 19 21:12:19 1996 +++ ./Makefile.in Tue Apr 15 00:15:28 1997 @@ -184,7 +184,7 @@ # Subdirectories to make recursively. `lisp' is not included # because the compiled lisp files are part of the distribution # and you cannot remake them without installing Emacs first. -SUBDIR = lib-src src +SUBDIR = lib-src src man # The makefiles of the directories in $SUBDIR. SUBDIR_MAKEFILES = lib-src/Makefile man/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile --- ./man/Makefile.in.org Thu Jun 27 15:27:19 1996 +++ ./man/Makefile.in Tue Apr 15 00:29:52 1997 @@ -66,6 +66,7 @@ ${srcdir}/gnu1.texi \ ${srcdir}/glossary.texi +all: info info: $(INFO_TARGETS) dvi: $(DVI_TARGETS)

The second hunk was necessary because the default target in the /usr/share/info (that patch is not shown here). If there is a place in the --- ./Makefile.in.org Mon Aug 19 21:12:19 1996 +++ ./Makefile.in Mon Apr 14 23:38:07 1997 @@ -368,14 +368,8 @@ if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \ then \ (cd ${infodir}; \ - if [ -f dir ]; then \ - if [ ! -f dir.old ]; then mv -f dir dir.old; \ - else mv -f dir dir.bak; fi; \ - fi; \ cd ${srcdir}/info ; \ - (cd $${thisdir}; ${INSTALL_DATA} ${srcdir}/info/dir ${infodir}/dir); \ - (cd $${thisdir}; chmod a+r ${infodir}/dir); \ for f in ccmode* cl* dired-x* ediff* emacs* forms* gnus* info* message* mh-e* sc* vip*; do \ (cd $${thisdir}; \ ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \ chmod a+r ${infodir}/$$f); \ (This step is only necessary if you are modifying an existing port.) Take a look at pkg/PLIST and delete anything that is trying to patch up info/dir. They may be in pkg/INSTALL or some other file, so search extensively. Index: pkg/PLIST =================================================================== RCS file: /usr/cvs/ports/editors/emacs/pkg/PLIST,v retrieving revision 1.15 diff -u -r1.15 PLIST --- PLIST 1997/03/04 08:04:00 1.15 +++ PLIST 1997/04/15 06:32:12 @@ -15,9 +15,6 @@ man/man1/emacs.1.gz man/man1/etags.1.gz man/man1/ctags.1.gz -@unexec cp %D/info/dir %D/info/dir.bak -info/dir -@unexec cp %D/info/dir.bak %D/info/dir info/cl info/cl-1 info/cl-2 Add a Index: Makefile =================================================================== RCS file: /usr/cvs/ports/editors/emacs/Makefile,v retrieving revision 1.26 diff -u -r1.26 Makefile --- Makefile 1996/11/19 13:14:40 1.26 +++ Makefile 1997/05/20 10:25:09 1.28 @@ -20,5 +20,11 @@ post-install: .for file in emacs-19.34 emacsclient etags ctags b2m strip ${PREFIX}/bin/${file} .endfor + if [ ! -f ${PREFIX}/info/dir ]; then \ + ${SED} -ne '1,/Menu:/p' /usr/share/info/dir > ${PREFIX}/info/dir; \ + fi +.for info in emacs vip viper forms gnus mh-e cl sc dired-x ediff ccmode + install-info ${PREFIX}/info/${info} ${PREFIX}/info/dir +.endfor .include

Do not use anything other than /usr/share/info/dir and the above command to create a new info file. In fact, I'd add the first three lines of the above patch to Edit info/dir with Index: pkg/PLIST =================================================================== RCS file: /usr/cvs/ports/editors/emacs/pkg/PLIST,v retrieving revision 1.15 diff -u -r1.15 PLIST --- PLIST 1997/03/04 08:04:00 1.15 +++ PLIST 1997/05/20 10:25:12 1.17 @@ -16,7 +14,15 @@ man/man1/etags.1.gz man/man1/ctags.1.gz +@unexec install-info --delete %D/info/emacs %D/info/dir : +@unexec install-info --delete %D/info/ccmode %D/info/dir info/cl info/cl-1 @@ -87,6 +94,18 @@ info/viper-3 info/viper-4 +@exec [ -f %D/info/dir ] || sed -ne '1,/Menu:/p' /usr/share/info/dir > %D/info/dir +@exec install-info %D/info/emacs %D/info/dir : +@exec install-info %D/info/ccmode %D/info/dir libexec/emacs/19.34/i386--freebsd/cvtmail libexec/emacs/19.34/i386--freebsd/digest-doc

Note that the `@unexec install-info --delete' commands have to be listed before the info files themselves so they can read the files. Also, the `@exec install-info' commands have to be after the info files and the Test and admire your work. Licensing Problems

Some software packages have restrictive licenses or can be in violation to the law (PKP's patent on public key crypto, ITAR (export of crypto software) to name just two of them). What we can do with them vary a lot, depending on the exact wordings of the respective licenses.

Note that it is your responsibility as a porter to read the licensing terms of the software and make sure that the FreeBSD project will not be held accountable of violating them by redistributing the source or compiled binaries either via ftp or CD-ROM. If in doubt, please contact the &a.ports;.

There are two variables you can set in the Makefile to handle the situations that arise frequently: If the port has a `do not sell for profit' type of license, set the variable NO_CDROM. We will make sure such ports won't go into the CD-ROM come release time. The distfile and package will still be available via ftp. If the resulting package needs to be built uniquely for each site, or the resulting binary package can't be distributed due to licensing; set the variable NO_PACKAGE. We will make sure such packages won't go on the ftp site, nor into the CD-ROM come release time. The distfile will still be included on both however. If the port has legal restrictions on who can use it (e.g., crypto stuff) or has a `no commercial use' license, set the variable RESTRICTED to be the string describing the reason why. For such ports, the distfiles/packages will not be available even from our ftp sites.

Note: The GNU General Public License (GPL), both version 1 and 2, should not be a problem for ports.

Note: If you are a committer, make sure you update the ports/LEGAL file too. Upgrading

When you notice that a port is out of date compared to the latest version from the original authors, first make sure you have the latest port. You can find them in the ports-current directory of the ftp mirror sites.

The next step is to send a mail to the maintainer, if one is listed in the port's Makefile. That person may already be working on an upgrade, or have a reason to not upgrade the port right now (because of, for example, stability problems of the new version).

If the maintainer asks you to do the upgrade or there isn't any such person to begin with, please make the upgrade and send the recursive diff (either unified or context diff is fine, but port committers appear to prefer unified diff more) of the new and old ports directories to us (e.g., if your modified port directory is called `superedit' and the original as in our tree is `superedit.bak', then send us the result of `diff -ruN superedit.bak superedit'). Please examine the output to make sure all the changes make sense. The best way to send us the diff is by including it to send-pr(1) (category `ports'). Please mention any added or deleted files in the message, as they have to be explicitly specified to CVS when doing a commit. If the diff is more than about 20KB, please compress and uuencode it; otherwise, just include it in as is in the PR. Do's and Dont's

Here is a list of common do's and dont's that you encounter during the porting process. You should check your own port against this list, but you can also check ports in the PR database that others have submitted. Submit any comments on ports you check as described in . Checking ports in the PR database will both make it faster for us to commit them, and prove that you know what you are doing. WRKDIR

Do not leave anything valuable lying around in the work subdirectory, `make clean' will nuke it completely! If you need auxiliary files that are not scripts or patches, put them in the ${FILESDIR} subdirectory (files by default) and use the post-extract target to copy them to the work subdirectory. Portlint Clean

Do use portlint! The program is part of the ports collection. Compress manpages, strip binaries

Do compress manpages and strip binaries. If the original source already strips the binary, fine; otherwise, you can add a post-install rule to do it yourself. Here is an example: post-install: strip ${PREFIX}/bin/xdl

Use the file command on the installed executable to check whether the binary is stripped or not. If it does not say `not stripped', it is stripped.

To automagically compress the manpages, use the MAN[1-9LN] variables. They will check the variable NOMANCOMPRESS that the user can set in /etc/make.conf to disable man page compression. Place them last in the section below the MAINTAINER variable. Here is an example: MAN1= foo.1 bar.1 MAN5= foo.conf.5 MAN8= baz.8

Note that this is not usually necessary with ports that are X applications and use Imake to build.

If your port anchors its man tree somewhere other than PREFIX, you can use the MANPREFIX to set it. Also, if only manpages in certain section go in a non-standard place, such as many Perl modules ports, you can set individual man paths using MANsectPREFIX (where sect is one of 1-9, L or N). INSTALL_* macros

Do use the macros provided in bsd.port.mk to ensure correct modes and ownership of files in your own *-install targets. They are: ${INSTALL_PROGRAM} is a command to install binary executables. ${INSTALL_SCRIPT} is a command to install executable scripts. ${INSTALL_DATA} is a command to install sharable data. ${INSTALL_MAN} is a command to install manpages and other documentation (it doesn't compress anything).

These are basically the install command with all the appropriate flags. See below for an example on how to use them. INSTALL package script

If your port needs execute commands when the binary package is installed with pkg_add you can do with via the pkg/INSTALL script. This script will automatically be added to the package, and will be run twice by pkg_add. The first time will as `INSTALL ${PKGNAME} PRE-INSTALL' and the second time as `INSTALL ${PKGNAME} POST-INSTALL'. `$2' can be tested to determine which mode the script is being run in. The `PKG_PREFIX' environmental variable will be set to the package installation directory. See man pkg_add(1) for additional information. Note, that this script is not run automatically if you install the port with `make install'. If you are depending on it being run, you will have to explicitly call it on your port's Makefile. REQ package script

If your port needs to determine if it should install or not, you can create a pkg/REQ ``requirements'' script. It will be invoked automatically at installation/deinstallation time to determine whether or not installation/deinstallation should proceed. See man pkg_create(1) and man pkg_add(1) for more information. Install additional documentation

If your software has some documentation other than the standard man and info pages that you think is useful for the user, install it under ${PREFIX}/share/doc. This can be done, like the previous item, in the post-install target.

Create a new directory for your port. The directory name should reflect what the port is. This usually means ${PKGNAME} minus the version part. However, if you think the user might want different versions of the port to be installed at the same time, you can use the whole ${PKGNAME}.

Make the installation dependent to the variable NOPORTDOCS so that users can disable it in /etc/make.conf, like this: post-install: .if !defined(NOPORTDOCS) ${MKDIR} ${PREFIX}/share/doc/xv ${INSTALL_MAN} ${WRKSRC}/docs/xvdocs.ps ${PREFIX}/share/doc/xv .endif

Do not forget to add them to pkg/PLIST too! (Do not worry about NOPORTDOCS here; there is currently no way for the packages to read variables from /etc/make.conf.)

If you need to display a message to the installer, you may place the message in pkg/MESSAGE. This capability is often useful to display additional installation steps to be taken after a pkg_add, or to display licensing information. (note: the MESSAGE file does not need to be added to pkg/PLIST). DIST_SUBDIR

Do not let your port clutter /usr/ports/distfiles. If your port requires a lot of files to be fetched, or contains a file that has a name that might conflict with other ports (e.g., `Makefile'), set ${DIST_SUBDIR} to the name of the port (${PKGNAME} without the version part should work fine). This will change ${DISTDIR} from the default /usr/ports/distfiles to /usr/ports/distfiles/${DIST_SUBDIR}, and in effect puts everything that is required for your port into that subdirectory.

It will also look at the subdirectory with the same name on the backup master site at ftp.freebsd.org. (Setting ${DISTDIR} explicitly in your Makefile will not accomplish this, so please use ${DIST_SUBDIR}.)

Note this does not affect the ${MASTER_SITES} you define in your Makefile. Feedback

Do send applicable changes/patches to the original author/maintainer for inclusion in next release of the code. This will only make your job that much easier for the next release. RCS strings

Do not put RCS strings in patches. CVS will mangle them when we put the files into the ports tree, and when we check them out again, they will come out different and the patch will fail. RCS strings are surrounded by dollar (`$') signs, and typically start with `$Id' or `$RCS'. Recursive diff

Using the recurse (`-r') option to diff to generate patches is fine, but please take a look at the resulting patches to make sure you don't have any unnecessary junk in there. In particular, diffs between two backup files, Makefiles when the port uses Imake or GNU configure, etc., are unnecessary and should be deleted. Also, if you had to delete a file, then you can do it in the post-extract target rather than as part of the patch. Once you are happy with the resulting diff, please split it up into one source file per patch file. PREFIX

Do try to make your port install relative to ${PREFIX}. (The value of this variable will be set to ${LOCALBASE} (default /usr/local), unless ${USE_IMAKE} or ${USE_X11} is set, in which case it will be ${X11BASE} (default /usr/X11R6).)

Not hard-coding `/usr/local' or `/usr/X11R6' anywhere in the source will make the port much more flexible and able to cater to the needs of other sites. For X ports that use imake, this is automatic; otherwise, this can often be done by simply replacing the occurrences of `/usr/local' (or `/usr/X11R6' for X ports that do not use imake) in the various scripts/Makefiles in the port to read `${PREFIX}', as this variable is automatically passed down to every stage of the build and install processes.

The variable ${PREFIX} can be reassigned in your Makefile or in the user's environment. However, it is strongly discouraged for individual ports to set this variable explicitly in the Makefiles. (If your port is an X port but does not use imake, set USE_X11=yes; this is quite different from setting PREFIX=/usr/X11R6.)

Also, refer to programs/files from other ports with the variables mentioned above, not explicit pathnames. For instance, if your port requires a macro PAGER to be the full pathname of less, use the compiler flag: -DPAGER=\"${PREFIX}/bin/less\" or -DPAGER=\"${LOCALBASE}/bin/less\" if this is an X port, instead of -DPAGER=\"/usr/local/bin/less\". This way it will have a better chance of working if the system administrator has moved the whole `/usr/local' tree somewhere else. Subdirectories

Try to let the port put things in the right subdirectories of ${PREFIX}. Some ports lump everything and put it in the subdirectory with the port's name, which is incorrect. Also, many ports put everything except binaries, header files and manual pages in the a subdirectory of `lib', which does not bode well with the BSD paradigm. Many of the files should be moved to one of the following: `etc' (setup/configuration files), `libexec' (executables started internally), `sbin' (executables for superusers/managers), `info' (documentation for info browser) or `share' (architecture independent files). See man hier(7) for details, the rule governing /usr pretty much applies to /usr/local too. The exception are ports dealing with USENET `news'. They may use ${PREFIX}/news as a destination for their files. ldconfig

If your port installs a shared library, add a post-install target to your Makefile that runs `/sbin/ldconfig -m' on the directory where the new library is installed (usually ${PREFIX}/lib) to register it into the shared library cache.

Also, add an @exec line to your pkg/PLIST file so that a user who installed the package can start using the shared library immediately. This line should immediately follow the line for the shared library itself, as in: lib/libtcl80.so.1.0 @exec /sbin/ldconfig -m %D/lib

Never, ever, ever add a line that says `ldconfig' without any arguments to your Makefile or pkg/PLIST. This will reset the shared library cache to the contents of /usr/lib only, and will royally screw up the user's machine ("Help, xinit does not run anymore after I install this port!"). Anybody who does this will be shot and cut into 65,536 pieces by a rusty knife and have his liver chopped out by a bunch of crows and will eternally rot to death in the deepest bowels of hell (not necessarily in that order).... UIDs

If your port requires a certain user to be on the installed system, let the pkg/INSTALL script call pw to create it automatically. Look at net/cvsup-mirror for an example.

If your port must use the same user/group ID number when it is installed as a binary package as when it was compiled, then you must choose a free UID from 50 to 99 and register it below. Look at japanese/Wnn for an example.

Make sure you don't use a UID already used by the system or other ports. This is the current list of UIDs between 50 and 99. majordom:*:54:54:Majordomo Pseudo User:/usr/local/majordomo:/nonexistent cyrus:*:60:60:the cyrus mail server:/nonexistent:/nonexistent gnats:*:61:1:GNATS database owner:/usr/local/share/gnats/gnats-db:/bin/sh uucp:*:66:66:UUCP pseudo-user:/var/spool/uucppublic:/usr/libexec/uucp/uucico xten:*:67:67:X-10 daemon:/usr/local/xten:/nonexistent pop:*:68:6:Post Office Owner (popper):/nonexistent:/nonexistent wnn:*:69:7:Wnn:/nonexistent:/nonexistent ifmail:*:70:66:Ifmail user:/nonexistent:/nonexistent pgsql:*:70:70:PostgreSQL pseudo-user:/usr/local/pgsql:/bin/sh ircd:*:72:72:IRCd hybrid:/nonexistent:/nonexistent alias:*:81:81:QMail user:/var/qmail/alias:/nonexistent qmaill:*:83:81:QMail user:/var/qmail:/nonexistent qmaild:*:82:81:QMail user:/var/qmail:/nonexistent qmailq:*:85:82:QMail user:/var/qmail:/nonexistent qmails:*:87:82:QMail user:/var/qmail:/nonexistent qmailp:*:84:81:QMail user:/var/qmail:/nonexistent qmailr:*:86:82:QMail user:/var/qmail:/nonexistent msql:*:87:87:mSQL-2 pseudo-user:/var/db/msqldb:/bin/sh

Please include a notice when you submit a port (or an upgrade) that reserves a new UID or GID in this range. This allows us to keep the list of reserved IDs up to date. Do things rationally

The Makefile should do things simply and reasonably. If you can make it a couple of lines shorter or more readable, then do so. Examples include using a make `.if' construct instead of a shell `if' construct, not redefining do-extract if you can redefine ${EXTRACT*} instead, and using $GNU_CONFIGURE instead of `CONFIGURE_ARGS += --prefix=${PREFIX}'. Respect CFLAGS

The port should respect the ${CFLAGS} variable. If it doesn't, please add `NO_PACKAGE=ignores cflags' to the Makefile. Miscellanea

The files pkg/DESCR, pkg/COMMENT, and pkg/PLIST should each be double-checked. If you are reviewing a port and feel they can be worded better, do so.

Don't copy more copies of the GNU General Public License into our system, please.

Please be careful to note any legal issues! Don't let us illegally distribute software! If you are stuck....

Do look at existing examples and the bsd.port.mk file before asking us questions! ;)

Do ask us questions if you have any trouble! Do not just beat your head against a wall! :) A Sample Makefile

Here is a sample Makefile that you can use to create a new port. Make sure you remove all the extra comments (ones between brackets)!

It is recommended that you follow this format (ordering of variables, empty lines between sections, etc.). Not all of the existing Makefiles are in this format (mostly old ones), but we are trying to uniformize how they look. This format is designed so that the most important information is easy to locate. [the header...just to make it easier for us to identify the ports.] # New ports collection makefile for: xdvi [the version required header should updated when upgrading a port.] # Version required: pl18 [things like "1.5alpha" are fine here too] [this is the date when the first version of this Makefile was created. Never change this when doing an update of the port.] # Date created: 26 May 1995 [this is the person who did the original port to FreeBSD, in particular, the person who wrote the first version of this Makefile. Remember, this should not be changed when upgrading the port later.] # Whom: Satoshi Asami # # $Id$ [ ^^^^ This will be automatically replaced with RCS ID string by CVS when it is committed to our repository.] # [section to describe the port itself and the master site - DISTNAME is always first, followed by PKGNAME (if necessary), CATEGORIES, and then MASTER_SITES, which can be followed by MASTER_SITE_SUBDIR. After those, one of EXTRACT_SUFX or DISTFILES can be specified too.] DISTNAME= xdvi PKGNAME= xdvi-pl18 CATEGORIES= print [do not forget the trailing slash ("/")! if you aren't using MASTER_SITE_* macros] MASTER_SITES= ${MASTER_SITE_XCONTRIB} MASTER_SITE_SUBDIR= applications [set this if the source is not in the standard ".tar.gz" form] EXTRACT_SUFX= .tar.Z [section for distributed patches -- can be empty] PATCH_SITES= ftp://ftp.sra.co.jp/pub/X11/japanese/ PATCHFILES= xdvi-18.patch1.gz xdvi-18.patch2.gz [maintainer; *mandatory*! This is the person (preferably with commit privileges) who a user can contact for questions and bug reports - this person should be the porter or someone who can forward questions to the original porter reasonably promptly. If you really do not want to have your address here, set it to "ports@FreeBSD.ORG".] MAINTAINER= asami@FreeBSD.ORG [dependencies -- can be empty] RUN_DEPENDS= gs:${PORTSDIR}/print/ghostscript LIB_DEPENDS= Xpm\\.4\\.:${PORTSDIR}/graphics/xpm [this section is for other standard bsd.port.mk variables that do not belong to any of the above] [If it asks questions during configure, build, install...] IS_INTERACTIVE= yes [If it extracts to a directory other than ${DISTNAME}...] WRKSRC= ${WRKDIR}/xdvi-new [If the distributed patches were not made relative to ${WRKSRC}, you may need to tweak this] PATCH_DIST_STRIP= -p1 [If it requires a "configure" script generated by GNU autoconf to be run] GNU_CONFIGURE= yes [If it requires GNU make, not /usr/bin/make, to build...] USE_GMAKE= yes [If it is an X application and requires "xmkmf -a" to be run...] USE_IMAKE= yes [et cetera.] [non-standard variables to be used in the rules below] MY_FAVORITE_RESPONSE= "yeah, right" [then the special rules, in the order they are called] pre-fetch: i go fetch something, yeah post-patch: i need to do something after patch, great pre-install: and then some more stuff before installing, wow [and then the epilogue] .include Package Names

The following are the conventions you should follow in naming your packages. This is to have our package directory easy to scan, as there are already lots and lots of packages and users are going to turn away if they hurt their eyes!

The package name should look like [-][[-]]-; If your ${DISTNAME} doesn't look like that, set ${PKGNAME} to something in that format. FreeBSD strives to support the native language of its users. The `<language>' part should be a two letter abbreviation of the natural language defined by ISO-639 if the port is specific to a certain language. Examples are `ja' for Japanese, `ru' for Russian, `vi' for Vietnamese, `zh' for Chinese, `ko' for Korean and `de' for German. The `<name>' part should be all lowercases, except for a really large package (with lots of programs in it). Things like XFree86 (yes there really is a package of it, check it out) and ImageMagick fall into this category. Otherwise, convert the name (or at least the first letter) to lowercase. If the capital letters are important to the name (for example, with one-letter names like R or V) you may use capital letters at your discretion. There is a tradition of naming Perl 5 modules by prepending `p5-' and converting the double-colon separator to a hyphen; for example, the `Data::Dumper' module becomes `p5-Data-Dumper'. If the software in question has numbers, hyphens, or underscores in its name, you may include them as well (like `kinput2'). If the port can be built with different hardcoded defaults (usually specified as environment variables or on the make command line), the `<compiled.specifics>' part should state the compiled-in defaults (the hyphen is optional). Examples are papersize and font units. The version string should be a period-separated list of integers and single lowercase alphabetics. The only exception is the string `pl' (meaning `patchlevel'), which can be used only when there are no major and minor version numbers in the software.

Here are some (real) examples on how to convert a ${DISTNAME} into a suitable ${PKGNAME}: DISTNAME PKGNAME Reason mule-2.2.2 mule-2.2.2 no prob at all XFree86-3.1.2 XFree86-3.1.2 ditto EmiClock-1.0.2 emiclock-1.0.2 no uppercase names for single programs gmod1.4 gmod-1.4 need hyphen after `' xmris.4.02 xmris-4.02 ditto rdist-1.3alpha rdist-1.3a no strings like `alpha' allowed es-0.9-beta1 es-0.9b1 ditto v3.3beta021.src tiff-3.3 what the heck was that anyway? ;) tvtwm tvtwm-pl11 version string always required piewm piewm-1.0 ditto xvgr-2.10pl1 xvgr-2.10.1 `pl' allowed only when no maj/minor numbers gawk-2.15.6 ja-gawk-2.15.6 Japanese language version psutils-1.13 psutils-letter-1.13 papersize hardcoded at package build time pkfonts pkfonts300-1.0 package for 300dpi fonts

If there is absolutely no trace of version information in the original source and it is unlikely that the original author will ever release another version, just set the version string to `1.0' (like the piewm example above). Otherwise, ask the original author or use the date string (`yy.mm.dd') as the version. That is It, Folks!

Boy, this sure was a long tutorial, wasn't it? Thanks for following us to here, really.

Well, now that you know how to do a port, let us go at it and convert everything in the world into ports! That is the easiest way to start contributing to the FreeBSD Project! :) diff --git a/handbook/relnotes.sgml b/handbook/relnotes.sgml index b5e0bd2cf4..22b91fbf95 100644 --- a/handbook/relnotes.sgml +++ b/handbook/relnotes.sgml @@ -1,587 +1,587 @@ - + About the Current Release

FreeBSD is a freely available, full source 4.4BSD-Lite based release for Intel i386/i486/Pentium/PentiumPro/Pentium II (or compatible) based PC's. It is based primarily on software from U.C. Berkeley's CSRG group, with some enhancements from NetBSD, OpenBSD, 386BSD, and the Free Software Foundation. Since our release of FreeBSD 2.0 in January of 95, the performance, feature set, and stability of FreeBSD has improved dramatically. The largest change is a revamped virtual memory system with a merged VM/file buffer cache that not only increases performance, but reduces FreeBSD's memory footprint, making a 5MB configuration a more acceptable minimum. Other enhancements include full NIS client and server support, transaction TCP support, dial-on-demand PPP, an improved SCSI subsystem, early ISDN support, support for FDDI and Fast Ethernet (100Mbit) adapters, improved support for the Adaptec 2940 (WIDE and narrow) and many hundreds of bug fixes. We have also taken the comments and suggestions of many of our users to heart and have attempted to provide what we hope is a more sane and easily understood installation process. Your feedback on this (constantly evolving) process is especially welcome! In addition to the base distributions, FreeBSD offers a new ported software collection with hundreds of commonly sought-after programs. At the end of March 1998 there were more than 1300 ports! The list of ports ranges from http (WWW) servers, to games, languages, editors and almost everything in between. The entire ports collection requires approximately 26MB of storage, all ports being expressed as ``deltas'' to their original sources. This makes it much easier for us to update ports, and greatly reduces the disk space demands made by the older 1.0 ports collection. To compile a port, you simply change to the directory of the program you wish to install, type ``make all'' followed by ``make install'' after successful compilation and let the system do the rest. The full original distribution for each port you build is retrieved dynamically off the CDROM or a local ftp site, so you need only enough disk space to build the ports you want. (Almost) every port is also provided as a pre-compiled "package" which can be installed with a simple command (pkg_add) by those who do not wish to compile their own ports from source. A number of additional documents which you may find very helpful in the process of installing and using FreeBSD may now also be found in the /usr/share/doc directory on any machine running FreeBSD 2.1 or later. You may view the locally installed manuals with any HTML capable browser using the following URLs: The FreeBSD handbook The FreeBSD FAQ You can also visit the master (and most frequently updated) copies at . The core of FreeBSD does not contain DES code which would inhibit its being exported outside the United States. There is an add-on package to the core distribution, for use only in the United States, that contains the programs that normally use DES. The auxiliary packages provided separately can be used by anyone. A freely (from outside the U.S.) exportable European distribution of DES for our non-U.S. users also exists and is described in the . If password security for FreeBSD is all you need, and you have no requirement for copying encrypted passwords from different hosts (Suns, DEC machines, etc) into FreeBSD password entries, then FreeBSD's MD5 based security may be all you require! We feel that our default security model is more than a match for DES, and without any messy export issues to deal with. If you are outside (or even inside) the U.S., give it a try! Since our first release of FreeBSD 1.0 nearly two years ago, FreeBSD has changed dramatically. Since release 2.0, FreeBSD has been based on the Berkeley 4.4BSD-Lite code rather than the Net2 code used for previous versions. In addition to clearing the legal issues that surrounded the Net2 code, the port to 4.4 has also brought in numerous new features, filesystems and enhanced driver support. Since our release of FreeBSD 2.0 in November of 1994, the performance, feature set, and stability of FreeBSD has improved dramatically. The largest change is a revamped Virtual Memory (VM) system with a merged virtual memory and file buffer cache. This increases performance while reducing FreeBSD's memory footprint, making a system with 4 megabytes of RAM a more acceptable minimum. Other enhancements include full NIS client and server support, transaction TCP support, dial on demand PPP, an improved SCSI subsystem, early support for ISDN, support for FDDI and 100Mbit Fast Ethernet adapters, improved support for the Adaptec 2940 and hundreds of bug fixes. We have also taken the comments and suggestions of many of our users to heart and have attempted to provide what we hope is a more sane and easily understood installation process. Your feedback on this constantly evolving process is especially welcome! In addition to the base distributions, FreeBSD offers a new ported software collection with some 270 commonly sought-after programs. The list of ports ranges from World Wide Web (http) servers, to games, languages, editors and almost everything in between. The entire ports collection requires only 10MB of storage because each port contains only the changes required for the source code to compile on FreeBSD and the information necessary to automatically retrieve the original sources. The original distribution for each port you build is automatically retrieved off of CD-ROM or a via anonymous ftp, so you need only enough disk space to build the ports you want. Each port is also provided as a pre-compiled package which can be installed with the pkg_add(1) command for those who do not wish to compile their own ports from source. See for a more complete description. The core of FreeBSD does not contain DES code which would inhibit its being exported outside the United States. An add-on package, for use only in the United States, contains the programs that normally use DES. The auxiliary packages provided separately can be used by anyone. A freely exportable European distribution of DES for our non-U.S. users also exists and is described in the . If password security for FreeBSD is all you need, and you have no requirement for copying encrypted passwords from other hosts using DES into FreeBSD password entries, then FreeBSD's MD5 based security may be all you require. We feel that our default security model is more than a match for DES, and without any messy export issues to deal with. FreeBSD 2.0.5 represents the culmination of 2 years of work and many thousands of man hours put in by an international development team. We hope you enjoy it! New feature highlights

The following features were added or substantially improved between the release of 2.0 and this 2.0.5 release. In order to facilitate better communication, the person, or persons, responsible for each enhancement is noted. Any questions regarding the new functionality should be directed to them first. Kernel

Merged VM-File Buffer Cache A merged VM/buffer cache design greatly enhances overall system performance and makes it possible to do a number of more optimal memory allocation strategies that were not possible before. Owner: &a.davidg; Network PCB hash optimization For systems with a great number of active TCP connections (WEB and ftp servers, for example), this greatly speeds up the lookup time required to match an incoming packet up to its associated connection. Owner: &a.davidg; Name cache optimization The name-cache would cache all files of the same name to the same bucket, which would put for instance all ".." entries in the same bucket. We added the parent directory version to frustrate the hash, and improved the management of the cache in various other ways while we were at it. Owner: &a.phk; and &a.davidg; Less restrictive swap-spaces The need to compile the names of the swap devices into the kernel has been removed. Now swapon(8) will accept any block devices, up to the maximum number of swap devices configured in the kernel. Owner: &a.phk; and &a.davidg; Hard Wired SCSI Devices Prior to 2.0.5, FreeBSD performed dynamic assignment of unit numbers to SCSI devices as they were probed, allowing a SCSI device failure to possibly change unit number assignment. This could cause filesystems other disks in the system to be incorrectly mounted, or not mounted at all. Hard wiring allows static allocation of unit numbers (and hence device names) to scsi devices based on SCSI ID and bus. SCSI configuration occurs in the kernel config file. Samples of the configuration syntax can be found in the scsi(4) man page or the LINT kernel config file. Owner: &a.dufault; Sources involved: sys/scsi/* usr.sbin/config/* Slice Support FreeBSD now supports a slice abstraction which enhances FreeBSD's ability to share disks with other operating systems. This support will allow FreeBSD to inhabit DOS extended partitions. Owner: &a.bde; Sources involved: sys/disklabel.h sys/diskslice.h sys/dkbad.h kern/subr_diskslice.c kern/subr_dkbad.c i386/isa/diskslice_machdep.c i386/isa/wd.c scsi/sd.c dev/vn/vn.c Support for Ontrack Disk Manager Version 6.0 Support has been added for disks which use Ontrack Disk Manager. The fdisk program does not know about it however, so make all changes using the install program on the boot.flp or the Ontrack Disk Manager tool under MS-DOS. Owner: &a.phk; Bad144 is back and working Bad144 works again, though the semantics are slightly different than before in that the bad-spots are kept relative to the slice rather than absolute on the disk. Owner: &a.bde; and &a.phk; New device support SCSI and CDROM devices

Matsushita/Panasonic (Creative) CD-ROM driver The Matsushita/Panasonic CR-562 and CR-563 drives are now supported when connected to a Sound Blaster or 100% compatible host adapter. Up to four host adapters are supported for a total of 16 CD-ROM drives. The audio functions are supported with the Karoke variable speed playback. Owner: &a.uhclem; Sources involved: isa/matcd Adaptec 2742/2842/2940 SCSI driver The original 274x/284x driver has evolved considerably since the 2.0 release of FreeBSD. We now offer full support for the 2940 series as well as the Wide models of these cards. The arbitration bug that caused problems with fast devices has been corrected and experimental tagged queuing support has been added (kernel option AHC_TAGENABLE). John Aycock has also released the sequencer code under a Berkeley style copyright making the driver entirely clean of the GPL. Owner: &a.gibbs; Sources involved: isa/aic7770.c pci/aic7870.c i386/scsi/* sys/dev/aic7xxx/* NCR5380/NCR53400 SCSI (ProAudio Spectrum) driver Owner: &a.core; Submitted by: Serge Vakulenko (vak@cronyx.ru) Sources involved: isa/ncr5380.c Sony CDROM driver Owner: &a.core; Submitted by: Mikael Hybsch (micke@dynas.se) Sources involved: isa/scd.c Serial devices

SDL Communications Riscom/8 Serial Board Driver Owner: &a.ache; Sources involved: isa/rc.c isa/rcreg.h Cyclades Cyclom-y Serial Board Driver Owner: &a.bde; Submitted by: Andrew Werple (andrew@werple.apana.org.au) and Heikki Suonsivu (hsu@cs.hut.fi) Obtained from: NetBSD Sources involved: isa/cy.c Cronyx/Sigma sync/async serial driver Owner: &a.core; Submitted by: Serge Vakulenko Sources involved: isa/cronyx.c Networking

Diskless booting Diskless booting in 2.0.5 is much improved over previous releases. The boot program is in src/sys/i386/boot/netboot, and can be run from an MS-DOS system or burned into an EPROM. WD, SMC, 3COM and Novell ethernet cards are currently supported. Local swapping is also supported. DEC DC21140 Fast Ethernet driver This driver supports any of the numerous NICs using the DC21140 chipset including the 100Mb DEC DE-500-XA and SMC 9332. Owner: &a.core; Submitted by: Matt Thomas (thomas@lkg.dec.com) Sources involved: pci/if_de.c pci/dc21040.h DEC FDDI (DEFPA/DEFEA) driver Owner: &a.core; Submitted by: Matt Thomas (thomas@lkg.dec.com) Sources involved: pci/if_pdq.c pci/pdq.c pci/pdq_os.h pci/pdqreg.h 3Com 3c505 (Etherlink/+) NIC driver Owner: &a.core; Submitted by: Dean Huxley (dean@fsa.ca) Obtained from: NetBSD Sources involved: isa/if_eg.c Fujitsu MB86960A family of NICs driver Owner: &a.core; Submitted by: M.S. (seki@sysrap.cs.fujitsu.co.jp) Sources involved: isa/if_fe.c Intel EtherExpress driver Owner: Rodney W. Grimes (rgrimes@FreeBSD.org) Sources involved: isa/if_ix.c isa/if_ixreg.h 3Com 3c589 driver Owner: &a.core; Submitted by: "HOSOKAWA Tatsumi" (hosokawa@mt.cs.keio.ac.jp), Seiji Murata (seiji@mt.cs.keio.ac.jp) and Noriyuki Takahashi (hor@aecl.ntt.jp) Sources involved: isa/if_zp.c IBM Credit Card Adapter driver Owner: &a.core; Submitted by: "HOSOKAWA Tatsumi" (hosokawa@mt.cs.keio.ac.jp), Sources involved: isa/pcic.c isa/pcic.h EDSS1 and 1TR6 ISDN interface driver Owner: &a.core; Submitted by: Dietmar Friede (dfriede@drnhh.neuhaus.de) and Juergen Krause (jkr@saarlink.de) Sources involved: gnu/isdn/* Miscellaneous drivers

Joystick driver Owner: &a.jmz; Sources involved: isa/joy.c National Instruments ``LabPC'' driver Owner: &a.dufault; Sources involved: isa/labpc.c WD7000 driver Owner: Olof Johansson (offe@ludd.luth.se) Pcvt Console driver Owner: &a.joerg; Submitted by: &a.hm; Sources involved: isa/pcvt/* BSD-audio emulator for VAT driver Owner: Amancio Hasty (ahasty@FreeBSD.org) and &a.pst; Sources involved: isa/sound/vat_audio.c isa/sound/vat_audioio.h National Instruments AT-GPIB and AT-GPIB/TNT GPIB driver Owner: &a.core; Submitted by: Fred Cawthorne (fcawth@delphi.umd.edu) Sources involved: isa/gpib.c isa/gpib.h isa/gpibreg.h Genius GS-4500 hand scanner driver Owner: &a.core; Submitted by: Gunther Schadow (gusw@fub46.zedat.fu-berlin.de) Sources involved: isa/gsc.c isa/gscreg.h CORTEX-I Frame Grabber Owner: &a.core; Submitted by: Paul S. LaFollette, Jr. ( Sources involved: isa/ctx.c isa/ctxreg.h Video Spigot video capture card Owner: Jim Lowe Experimental features

UNIONFS and LFS The unionfs and LFS file systems are known to be severely broken in FreeBSD 2.0.5. This is in part due to old bugs that we have not had time to resolve yet and the need to update these file systems to deal with the new VM system. We hope to address these issues in a later release of FreeBSD. iBCS2 Support FreeBSD now supports running iBCS2 compatible binaries. Currently SCO UNIX 3.2.2 and 3.2.4, and ISC 2.2 COFF are supported. The iBCS2 emulator is in its early stages and has not been extensively tested, but it is functional. Most of SCO's 3.2.2 binaries work, as does an old INFORMIX-2.10 for SCO. Further testing is necessary to complete this project. There is also work under way for ELF and XOUT loaders, and most of the svr4 syscall wrappers are written. Owner: &a.sos; and &a.sef; Sources involved: sys/i386/ibcs2/* and misc kernel changes. ]]>