Diff for /wikisrc/guide/fetch.mdwn between versions 1.2 and 1.3

version 1.2, 2013/03/05 23:16:21 version 1.3, 2013/03/05 23:33:53
Line 1 Line 1
 # Obtaining the sources  # Obtaining the sources
   
 To read the NetBSD sources from your local disk or to build the system or parts   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   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   the NetBSD source using a number of different ways, although the preferred one
 is to get the tarballs and then update via   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).  [cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-5.0.1+i386).
   
 ## Preparing directories  ## Preparing directories
   
 Kernel and userland sources are usually placed in `/usr/src`. This directory is   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   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   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   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`.   demonstration purposes, it is assumed that the non-root login is `carlo`.
 Please replace it with a valid login name on your system:  Please replace it with a valid login name on your system:
   
     $ su      $ su
     Password:       Password:
     # mkdir /usr/src      # mkdir /usr/src
     # chown <carlo> /usr/src      # chown <carlo> /usr/src
   
Line 25  Also, if you want X11R6 sources, you can Line 25  Also, if you want X11R6 sources, you can
     # mkdir /usr/xsrc      # mkdir /usr/xsrc
     # chown <carlo> /usr/xsrc      # chown <carlo> /usr/xsrc
   
 *Note*: Please note that for the subsequent steps, root access is neither needed   *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   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   operations can (and should) be done as normal user and you don't need root
 privileges any more:  privileges any more:
   
     # exit      # exit
     $       $
   
 ## Terminology  ## Terminology
   
 **Before starting to fetch or download the required files, you may want to know   **Before starting to fetch or download the required files, you may want to know
 the definitions of *Formal releases*, *Maintenance branches* and other related   the definitions of *Formal releases*, *Maintenance branches* and other related
 terms**. That information is available under the [NetBSD release glossary and   terms**. That information is available under the [NetBSD release glossary and
 graphs](http://www.NetBSD.org/releases/release-map.html).  graphs](http://www.NetBSD.org/releases/release-map.html).
   
 ## Downloading tarballs  ## Downloading tarballs
   
 It is sometimes faster to download a tarball and then continue updating with   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   [cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-5.0.1+i386). You can
 download tarballs (see   download tarballs (see
 [tar(1)](http://netbsd.gw.com/cgi-bin/man-cgi?tar+1+NetBSD-5.0.1+i386)) from   [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.  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.  three days.
   
 Also, please note that these tarballs include the `CVS` directories, so you can   Also, please note that these tarballs include the `CVS` directories, so you can
 download them and then update your source tree using   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   [cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-5.0.1+i386), as
 explained in the CVS section.  explained in the CVS section.
   
 ### Downloading sources for a NetBSD release  ### 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-<RELEASE-NUMBER>/source/sets/`  `/pub/NetBSD/NetBSD-<RELEASE-NUMBER>/source/sets/`
 on ftp.NetBSD.org (or a mirror), where `<RELEASE-NUMBER>` is the release you   on ftp.NetBSD.org (or a mirror), where `<RELEASE-NUMBER>` is the release you
 want to fetch (for example, `4.0`).  want to fetch (for example, `4.0`).
   
 To fetch the sources of a NetBSD release using tarballs, simply do:  To fetch the sources of a NetBSD release using tarballs, simply do:
Line 137  You now must extract them all: Line 137  You now must extract them all:
   
 ### Downloading sources for a NetBSD-current development branch  ### Downloading sources for a NetBSD-current development branch
   
 To download the NetBSD-current tarballs, located under   To download the NetBSD-current tarballs, located under
 `/pub/NetBSD/NetBSD-current/tar_files/src`, just follow the same steps as in the   `/pub/NetBSD/NetBSD-current/tar_files/src`, just follow the same steps as in the
 previous section, but now on a different directory.  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`.  `/pub/NetBSD/NetBSD-current/tar_files/xsrc`.
   
 ## Fetching by CVS  ## Fetching by CVS
   
 CVS (Concurrent Versions System) can be used to fetch the NetBSD source tree or   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   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   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(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:  them or keep them up to date:
   
 The list of currently maintained branches is available under   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)   [`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).  (see the *Status* entry on *Release branches* section).
   
 Before you can do an initial (full) checkout of the NetBSD sources via   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   *anonymous CVS*, you first have to set some environment variables. For the
 C-Shell, type:  C-Shell, type:
   
     $ setenv CVS_RSH ssh      $ setenv CVS_RSH ssh
Line 168  Or, the same for the bourne shell: Line 168  Or, the same for the bourne shell:
     $ export CVS_RSH="ssh"      $ export CVS_RSH="ssh"
     $ export CVSROOT="anoncvs@anoncvs.NetBSD.org:/cvsroot"      $ 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.  empty directories.
   
 ### Fetching a NetBSD release  ### 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.  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:  following command after the preparations done above:
   
     $ cd /usr      $ cd /usr
     $ cvs checkout -r <BRANCH> -P src      $ cvs checkout -r <BRANCH> -P src
   
 Where `<BRANCH>` is the release branch to be checked out, for example,   Where `<BRANCH>` 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   `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`.  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:  For example, in order to fetch `netbsd-4-0-RELEASE` you would use:
Line 196  To fetch the X11R6 source, just `checkou Line 196  To fetch the X11R6 source, just `checkou
   
 ### Fetching a NetBSD stable branch  ### 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]].  the [[Terminology|guide/fetch#term]].
   
 If you want to follow a stable branch, just pass the branch name to the   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`   [cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-5.0.1+i386) `-r`
 option.  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:  just need to use that tag:
   
     $ cd /usr      $ cd /usr
Line 213  And for the `xsrc` module: Line 213  And for the `xsrc` module:
   
     $ cvs checkout -r netbsd-4 -P xsrc      $ 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:  update them to get the latest security-fixes and bug-fixes, run:
   
     $ cd /usr/src      $ cd /usr/src
     $ cvs update -Pd      $ 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.  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.  so you don't accidentally *downgrade* your source tree.
   
 ### Fetching the NetBSD-current development branch  ### Fetching the NetBSD-current development branch
   
 To obtain the NetBSD-current source just omit `-r` *`<BRANCH>`* and replace it   To obtain the NetBSD-current source just omit `-r` *`<BRANCH>`* and replace it
 by `-A`:  by `-A`:
   
     $ cd /usr      $ cd /usr
Line 245  To update your NetBSD-current source tre Line 245  To update your NetBSD-current source tre
   
 ### Saving some cvs options  ### Saving some cvs options
   
 If you find yourself typing some options to cvs over and over again, you can as   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   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   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   (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   one usually wants!), For unified diffs, transfers should be compressed and `cvs
 update` should be mostly quiet:  update` should be mostly quiet:
   
 **Example `.cvsrc`**:  **Example `.cvsrc`**:
Line 262  update` should be mostly quiet: Line 262  update` should be mostly quiet:
   
 ## Sources on CD (ISO)  ## Sources on CD (ISO)
   
 If you prefer to download (and maybe burn) a CD-ROM image with the NetBSD   If you prefer to download (and maybe burn) a CD-ROM image with the NetBSD
 source, just fetch `sourcecd-<RELEASE-NUMBER>.iso` from ftp.NetBSD.org or any   source, just fetch `sourcecd-<RELEASE-NUMBER>.iso` from ftp.NetBSD.org or any
 other mirror.  other mirror.
   
 The `sourcecd-<RELEASE-NUMBER>.iso` file is located under   The `sourcecd-<RELEASE-NUMBER>.iso` file is located under
 `/pub/NetBSD/iso/<RELEASE>`, where `<RELEASE>` is a release of NetBSD,   `/pub/NetBSD/iso/<RELEASE>`, where `<RELEASE>` is a release of NetBSD,
 for example, `5.1`:  for example, `5.1`:
   
     ftp://ftp.NetBSD.org/pub/NetBSD/iso/5.1/sourcecd-5.1.iso      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   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).   [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   Please see [[Using removable media|guide/rmmedia]], as it explains in detail how
 to do it.  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:  everything you need to extract:
   
     $ ls /mnt/source/sets      $ ls /mnt/source/sets
     BSDSUM          MD5             gnusrc.tgz      src.tgz         xsrc.tgz      BSDSUM          MD5             gnusrc.tgz      src.tgz         xsrc.tgz
     CKSUM           SYSVSUM         sharesrc.tgz    syssrc.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:  command will do it:
   
     $ foreach file (*.tgz)      $ foreach file (*.tgz)
     ?   tar -xzf $file -C /      ?   tar -xzf $file -C /
     ? end      ? 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.  sources.

Removed from v.1.2  
changed lines
  Added in v.1.3


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb