--- wikisrc/guide/fetch.mdwn 2013/03/05 23:16:21 1.2 +++ wikisrc/guide/fetch.mdwn 2013/03/05 23:33:53 1.3 @@ -1,22 +1,22 @@ # Obtaining the sources -To read the NetBSD sources from your local disk or to build the system or parts -of it, you need to download the NetBSD sources. This chapter explains how to get -the NetBSD source using a number of different ways, although the preferred one -is to get the tarballs and then update via +To read the NetBSD sources from your local disk or to build the system or parts +of it, you need to download the NetBSD sources. This chapter explains how to get +the NetBSD source using a number of different ways, although the preferred one +is to get the tarballs and then update via [cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-5.0.1+i386). ## Preparing directories -Kernel and userland sources are usually placed in `/usr/src`. This directory is -not present by default in the NetBSD installation and you will need to create it -first. As it is in a system directory, you will need root access to create the -directory and make sure your normal user account can write to it. For -demonstration purposes, it is assumed that the non-root login is `carlo`. +Kernel and userland sources are usually placed in `/usr/src`. This directory is +not present by default in the NetBSD installation and you will need to create it +first. As it is in a system directory, you will need root access to create the +directory and make sure your normal user account can write to it. For +demonstration purposes, it is assumed that the non-root login is `carlo`. Please replace it with a valid login name on your system: $ su - Password: + Password: # mkdir /usr/src # chown /usr/src @@ -25,42 +25,42 @@ Also, if you want X11R6 sources, you can # mkdir /usr/xsrc # chown /usr/xsrc -*Note*: Please note that for the subsequent steps, root access is neither needed -nor recommended, so this preparation step should be done first. All CVS -operations can (and should) be done as normal user and you don't need root +*Note*: Please note that for the subsequent steps, root access is neither needed +nor recommended, so this preparation step should be done first. All CVS +operations can (and should) be done as normal user and you don't need root privileges any more: # exit - $ + $ ## Terminology -**Before starting to fetch or download the required files, you may want to know -the definitions of *Formal releases*, *Maintenance branches* and other related -terms**. That information is available under the [NetBSD release glossary and +**Before starting to fetch or download the required files, you may want to know +the definitions of *Formal releases*, *Maintenance branches* and other related +terms**. That information is available under the [NetBSD release glossary and graphs](http://www.NetBSD.org/releases/release-map.html). ## Downloading tarballs -It is sometimes faster to download a tarball and then continue updating with -[cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-5.0.1+i386). You can -download tarballs (see -[tar(1)](http://netbsd.gw.com/cgi-bin/man-cgi?tar+1+NetBSD-5.0.1+i386)) from +It is sometimes faster to download a tarball and then continue updating with +[cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-5.0.1+i386). You can +download tarballs (see +[tar(1)](http://netbsd.gw.com/cgi-bin/man-cgi?tar+1+NetBSD-5.0.1+i386)) from ftp.NetBSD.org (or any other mirror) for a number of releases or branches. -The only drawback is that the tarballs are updated less often. Normally, every +The only drawback is that the tarballs are updated less often. Normally, every three days. -Also, please note that these tarballs include the `CVS` directories, so you can -download them and then update your source tree using -[cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-5.0.1+i386), as +Also, please note that these tarballs include the `CVS` directories, so you can +download them and then update your source tree using +[cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-5.0.1+i386), as explained in the CVS section. ### Downloading sources for a NetBSD release -The tarball files for the sources of a specific release are available under +The tarball files for the sources of a specific release are available under `/pub/NetBSD/NetBSD-/source/sets/` -on ftp.NetBSD.org (or a mirror), where `` is the release you +on ftp.NetBSD.org (or a mirror), where `` is the release you want to fetch (for example, `4.0`). To fetch the sources of a NetBSD release using tarballs, simply do: @@ -137,27 +137,27 @@ You now must extract them all: ### Downloading sources for a NetBSD-current development branch -To download the NetBSD-current tarballs, located under -`/pub/NetBSD/NetBSD-current/tar_files/src`, just follow the same steps as in the +To download the NetBSD-current tarballs, located under +`/pub/NetBSD/NetBSD-current/tar_files/src`, just follow the same steps as in the previous section, but now on a different directory. -You may also want to fetch the X11 source, available under: +You may also want to fetch the X11 source, available under: `/pub/NetBSD/NetBSD-current/tar_files/xsrc`. ## Fetching by CVS -CVS (Concurrent Versions System) can be used to fetch the NetBSD source tree or -to keep the NetBSD source tree up to date with respect to changes made to the -NetBSD sources. There are three trees maintained for which you can use -[cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-5.0.1+i386) to obtain +CVS (Concurrent Versions System) can be used to fetch the NetBSD source tree or +to keep the NetBSD source tree up to date with respect to changes made to the +NetBSD sources. There are three trees maintained for which you can use +[cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-5.0.1+i386) to obtain them or keep them up to date: -The list of currently maintained branches is available under -[`src/doc/BRANCHES`](http://cvsweb.NetBSD.org/bsdweb.cgi/src/doc/BRANCHES?rev=HEAD&content-type=text/x-cvsweb-markup) +The list of currently maintained branches is available under +[`src/doc/BRANCHES`](http://cvsweb.NetBSD.org/bsdweb.cgi/src/doc/BRANCHES?rev=HEAD&content-type=text/x-cvsweb-markup) (see the *Status* entry on *Release branches* section). -Before you can do an initial (full) checkout of the NetBSD sources via -*anonymous CVS*, you first have to set some environment variables. For the +Before you can do an initial (full) checkout of the NetBSD sources via +*anonymous CVS*, you first have to set some environment variables. For the C-Shell, type: $ setenv CVS_RSH ssh @@ -168,22 +168,22 @@ Or, the same for the bourne shell: $ export CVS_RSH="ssh" $ export CVSROOT="anoncvs@anoncvs.NetBSD.org:/cvsroot" -We will also use the `-P` option in the examples below since it is used to prune +We will also use the `-P` option in the examples below since it is used to prune empty directories. ### Fetching a NetBSD release -A release is a set of particular versions of source files, and once released +A release is a set of particular versions of source files, and once released does not change over time. -To get the NetBSD (kernel and userland) sources from a specific release, run the +To get the NetBSD (kernel and userland) sources from a specific release, run the following command after the preparations done above: $ cd /usr $ cvs checkout -r -P src -Where `` is the release branch to be checked out, for example, -`netbsd-3-1-RELEASE` or `netbsd-4-0-RELEASE`. If you want to fetch a different +Where `` is the release branch to be checked out, for example, +`netbsd-3-1-RELEASE` or `netbsd-4-0-RELEASE`. If you want to fetch a different patchlevel, you would use `netbsd-3-0-1-RELEASE` or `netbsd-3-0-2-RELEASE`. For example, in order to fetch `netbsd-4-0-RELEASE` you would use: @@ -196,14 +196,14 @@ To fetch the X11R6 source, just `checkou ### Fetching a NetBSD stable branch -NetBSD stable branches are also called *Maintenance branches*. Please consult +NetBSD stable branches are also called *Maintenance branches*. Please consult the [[Terminology|guide/fetch#term]]. -If you want to follow a stable branch, just pass the branch name to the -[cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-5.0.1+i386) `-r` +If you want to follow a stable branch, just pass the branch name to the +[cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-5.0.1+i386) `-r` option. -For example, if you want to fetch the most recent version of `netbsd-4`, you +For example, if you want to fetch the most recent version of `netbsd-4`, you just need to use that tag: $ cd /usr @@ -213,21 +213,21 @@ And for the `xsrc` module: $ cvs checkout -r netbsd-4 -P xsrc -If you have checked out sources from a stable branch in `/usr/src` and want to +If you have checked out sources from a stable branch in `/usr/src` and want to update them to get the latest security-fixes and bug-fixes, run: $ cd /usr/src $ cvs update -Pd -The same applies to the `xsrc` module, but in that case you will have to change +The same applies to the `xsrc` module, but in that case you will have to change your working directory to `/usr/xsrc` first. -*Caution!* Be sure to take care in selecting the correct and desired branch tag +*Caution!* Be sure to take care in selecting the correct and desired branch tag so you don't accidentally *downgrade* your source tree. ### Fetching the NetBSD-current development branch -To obtain the NetBSD-current source just omit `-r` *``* and replace it +To obtain the NetBSD-current source just omit `-r` *``* and replace it by `-A`: $ cd /usr @@ -245,11 +245,11 @@ To update your NetBSD-current source tre ### Saving some cvs options -If you find yourself typing some options to cvs over and over again, you can as -well put them into a file `.cvsrc` in your home directory. It is useful for just -typing `cvs update` on a directory with a branch checked out to update it -(adding `-A` would revert the branch to the -current branch, which is not what -one usually wants!), For unified diffs, transfers should be compressed and `cvs +If you find yourself typing some options to cvs over and over again, you can as +well put them into a file `.cvsrc` in your home directory. It is useful for just +typing `cvs update` on a directory with a branch checked out to update it +(adding `-A` would revert the branch to the -current branch, which is not what +one usually wants!), For unified diffs, transfers should be compressed and `cvs update` should be mostly quiet: **Example `.cvsrc`**: @@ -262,34 +262,34 @@ update` should be mostly quiet: ## Sources on CD (ISO) -If you prefer to download (and maybe burn) a CD-ROM image with the NetBSD -source, just fetch `sourcecd-.iso` from ftp.NetBSD.org or any +If you prefer to download (and maybe burn) a CD-ROM image with the NetBSD +source, just fetch `sourcecd-.iso` from ftp.NetBSD.org or any other mirror. -The `sourcecd-.iso` file is located under -`/pub/NetBSD/iso/`, where `` is a release of NetBSD, +The `sourcecd-.iso` file is located under +`/pub/NetBSD/iso/`, where `` is a release of NetBSD, for example, `5.1`: ftp://ftp.NetBSD.org/pub/NetBSD/iso/5.1/sourcecd-5.1.iso -The next step is to burn the ISO image or mount it with the help of -[vnconfig(8)](http://netbsd.gw.com/cgi-bin/man-cgi?vnconfig+8+NetBSD-5.0.1+i386). -Please see [[Using removable media|guide/rmmedia]], as it explains in detail how +The next step is to burn the ISO image or mount it with the help of +[vnconfig(8)](http://netbsd.gw.com/cgi-bin/man-cgi?vnconfig+8+NetBSD-5.0.1+i386). +Please see [[Using removable media|guide/rmmedia]], as it explains in detail how to do it. -Assuming you have mounted the CD under `/mnt`, `/mnt/source/sets` should have +Assuming you have mounted the CD under `/mnt`, `/mnt/source/sets` should have everything you need to extract: $ ls /mnt/source/sets BSDSUM MD5 gnusrc.tgz src.tgz xsrc.tgz CKSUM SYSVSUM sharesrc.tgz syssrc.tgz -All tarballs should be extracted to the root file system (`/`). The following +All tarballs should be extracted to the root file system (`/`). The following command will do it: $ foreach file (*.tgz) ? tar -xzf $file -C / ? end -After that, you should have `/usr/src` and `/usr/xsrc` populated with the NetBSD +After that, you should have `/usr/src` and `/usr/xsrc` populated with the NetBSD sources.