[BACK]Return to updating.html CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / htdocs / docs

File: [cvs.NetBSD.org] / htdocs / docs / updating.html (download) (as text)

Revision 1.22, Thu Aug 2 22:40:21 2012 UTC (11 years, 8 months ago) by jym
Branch: MAIN
Changes since 1.21: +9 -9 lines

Regen. netbsd.org => NetBSD.org

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="generator" content="Website XSL Stylesheet V2.6.0">
<link rel="home" href="../." title="Welcome to The NetBSD Project: Of course it runs NetBSD.">
<link rel="up" href="../docs/." title="NetBSD Documentation">
<link rel="previous" href="../docs/software/." title="Application Software for NetBSD">
<link rel="next" href="../docs/vmware.html" title="NetBSD Documentation: Running VMWare on NetBSD">
<link rel="first" href="../docs/Hardware/." title="Hardware Documentation">
<link rel="last" href="../docs/x/." title="NetBSD Documentation: The X Window System">
<link rel="stylesheet" href="../global.css" type="text/css">
    
    <title>Updating a stable NetBSD release</title>
  </head>
<body class="website"><div class="webpage">
<a name="docs-updating"></a><div id="top"><a href="#mainContent" class="doNotDisplay doNotPrint">Skip to main content.</a></div>
<div id="centralHeader">
<a href="../"><img alt="[NetBSD Logo]" src="../images/NetBSD-headerlogo.png"></a><div id="headerTools">
<div id="header-cse-search-form">Google custom search</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script><script type="text/javascript"> 
		  google.load('search', '1', {language : 'en'});
		  google.setOnLoadCallback(function() {
		    var header_customSearchControl = new google.search.CustomSearchControl('006277936787196004968:mbdhrauy1wm');
		    header_customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
		    var header_options = new google.search.DrawOptions();
		    header_options.enableSearchboxOnly("http://google.com/cse?cx=006277936787196004968:mbdhrauy1wm");    
		    header_customSearchControl.draw('header-cse-search-form', header_options);
		  }, true);
		</script>
</div>
</div>
<div id="navBar" role="navigation">
<span class="doNotDisplay">
	  Navigation:
	</span><ul>
<li><a href="../">
	  Home</a></li>
<li>
<a href="../">
	  New &amp; Media</a><ul>
<li><a href="../changes/">
	    Recent changes</a></li>
<li><a href="http://blog.NetBSD.org/">
	    NetBSD blog</a></li>
<li><a href="../gallery/events.html">
	    Events</a></li>
<li><a href="../changes/rss.html">
	    Feeds</a></li>
</ul>
</li>
<li>
<a href="../about/">
	  About</a><ul>
<li><a href="../about/">
	    NetBSD</a></li>
<li><a href="../foundation/">
	    The NetBSD Foundation</a></li>
<li><a href="../gallery/">
	    Advocacy</a></li>
</ul>
</li>
<li>
<a href="../docs/">
	  Documentation</a><ul>
<li><a href="../docs/misc/index.html">
	    FAQ &amp; HOWTOs</a></li>
<li><a href="../docs/guide/en/">
	    The Guide</a></li>
<li><a href="http://man.NetBSD.org/">
	    Manual pages</a></li>
<li><a href="http://wiki.NetBSD.org/">
	    Wiki</a></li>
</ul>
</li>
<li>
<a href="../support/">
	  Support</a><ul>
<li><a href="../support/send-pr.html">
	    Problem report guide</a></li>
<li><a href="../cgi-bin/sendpr.cgi?gndb=netbsd">
	    Report a bug</a></li>
<li><a href="../support/query-pr.html">
	    Query bug database</a></li>
<li><a href="../support/security/">
	    Security</a></li>
</ul>
</li>
<li>
<a href="../community/">
	  Community</a><ul>
<li><a href="http://onetbsd.org/">
	    Blogs</a></li>
<li><a href="../mailinglists/">
	    Mailing lists</a></li>
<li><a href="http://mail-index.NetBSD.org/">
	    List archives</a></li>
</ul>
</li>
<li>
<a href="../developers/">
	  Developers</a><ul>
<li><a href="http://cvsweb.NetBSD.org/">
	    Browse source</a></li>
<li><a href="http://nxr.NetBSD.org/">
	    Cross-reference</a></li>
<li><a href="http://releng.NetBSD.org/">
	    Release engineering</a></li>
<li><a href="http://wiki.NetBSD.org/projects/">
	    Projects list</a></li>
</ul>
</li>
<li>
<a href="../ports/">
	  Ports</a><ul>
<li><a href="../ports/history.html">
	    History</a></li>
<li><a href="../ports/emulators.html">
	    Emulators</a></li>
</ul>
</li>
<li>
<a href="http://www.pkgsrc.org/">
	  Packages</a><ul>
<li><a href="http://www.pkgsrc.se/">
	    Browse packages</a></li>
<li><a href="http://releng.NetBSD.org/index-pkgsrc.html">
	    Release engineering</a></li>
</ul>
</li>
</ul>
</div>
<div id="content"><div class="fullWidth"><div class="rowOfBoxes">
<h1>Updating a stable NetBSD release</h1>
<h3 class="title"><a name="top"></a></h3>
<ul>
<li><a href="#current">Tracking -current</a></li>
<li><a href="#update-src">Updating the sources</a></li>
<li><a href="#tools">Building the tools</a></li>
<li><a href="#kernel">Building a new kernel</a></li>
<li><a href="#userland">Building a new  userland</a></li>
<li><a href="#installing">Installing the kernel and userland</a></li>
<li><a href="#parts">Updating only parts of the source tree</a></li>
<li><a href="#summary">Terse summary of an updating procedure</a></li>
</ul>
<hr>
<h3 class="title"></h3>
        <h4 class="title">
<a name="current"></a>Tracking -current (<a href="#top">top</a>)
  </h4>
        <p>
          See 
          <a class="ulink" href="current/" target="_top">this document</a>
          for our documentation on how to track NetBSD-current.
        </p>
      
        <h4 class="title">
<a name="update-src"></a>Updating the sources (<a href="#top">top</a>)
  </h4>
        <p>
          If you are running a stable NetBSD release (such as 
          <a class="ulink" href="../releases/formal-3/" target="_top">NetBSD 3.1</a>),
          in a production environment, you should occasionally
          update your sources and rebuild the system or the kernel,
          in order to incorporate any security fixes that have been
          applied to the branch since its release.
       </p>

       <p>Most of the following steps can be done as ordinary user. 
       Only the installation of a new kernel and the userland will require 
       root privileges.
       Although <code class="filename">/usr</code> is choosen as the working 
       directory in the following examples, the procedure can also 
       take place in a user's home directory. Ordinary users have normally not 
       the permissions to make changes in <code class="filename">/usr</code>, 
       but this can be changed by root. </p>

     <p> 
         You can retrieve or update the sources for your
         release using 
         <a class="ulink" href="current/#using-anoncvs-over-ssh" target="_top">anoncvs over
          ssh</a>
          by specifying the correct branch tag. For example, to
          checkout the sources for the NetBSD 3.1 release, you
          could use:
        </p>
        <pre class="programlisting">
$ cd /usr
$ export CVS_RSH=ssh 
$ cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot co -r netbsd-3-1 -P src</pre>

  <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
  Be sure to take care in selecting the correct and desired branch tag so
  you don't accidently <span class="emphasis"><em>downgrade</em></span> your source tree.
  </div>

  <p>To update an existing source tree, do:</p>

<pre class="programlisting">
$ cd /usr/src
$ export CVS_RSH=ssh 
$ cvs update -dP</pre>


  <h4 class="title">
<a name="tools"></a>Building the tools (<a href="#top">top</a>)
  </h4>

  <p>The next step is to build the toolchain. You need to 
  create an <code class="filename">obj/</code> and a <code class="filename">tools/</code> 
  directory, followed by a run of <span class="command"><strong>build.sh</strong></span>:</p>

  <pre class="programlisting">
$ mkdir /usr/obj /usr/tools
$ cd /usr/src
$ ./build.sh -O /usr/obj -T /usr/tools -U -u tools</pre>


        <h4 class="title">
<a name="kernel"></a>Building a new kernel (<a href="#top">top</a>)
  </h4>
        <p>
          Building a new kernel pretty much follows the steps
          as described in 
          <a class="ulink" href="kernel/#how_to_build_a_kernel" target="_top">this
          document</a>.
        </p>

<p>The steps to build the kernel are:</p>
<pre class="programlisting">
$ cd /usr/src
$ ./build.sh -O ../obj -T ../tools kernel=&lt;KERNEL&gt;
</pre>


      
        <h4 class="title">
<a name="userland"></a>Building a new  userland (<a href="#top">top</a>)
  </h4>
        <p>
          Please always refer to <code class="code">build.sh -h</code> and the
          files <span class="emphasis"><em>UPDATING</em></span> and
          <span class="emphasis"><em>BUILDING</em></span> for details - it's worth
          it, there are <span class="emphasis"><em>many</em></span> options that can
          be set on the command line or in
          <code class="filename">/etc/mk.conf</code>.
        </p>

<p>The build the userland, do:</p>
<pre class="programlisting">
$ ./build.sh -O ../obj -T ../tools -U distribution</pre>

      
  <h4 class="title">
<a name="installing"></a>Installing the kernel and userland (<a href="#top">top</a>)
  </h4>

<p>Installing the new kernel, rebooting (to ensure that the new kernel 
works) and installing the new userland are the final steps of the updating 
procedure:</p>
<pre class="programlisting">
$ cd /usr/src
$ su
# mv /netbsd /netbsd.old
# mv /usr/obj/sys/arch/&lt;ARCH&gt;/compile/&lt;KERNEL&gt;/netbsd /
# shutdown -r now
...
$ cd /usr/src
$ su
# ./build.sh -O ../obj -T ../tools -U install=/ </pre>

<p>If the new kernel <code class="filename">netbsd</code> does not boot 
successfully, you can fall back on booting the 
<code class="filename">netbsd.old</code> kernel.</p>


        <h4 class="title">
<a name="parts"></a>Updating only parts of the source tree (<a href="#top">top</a>)
  </h4>

        <p>
          If a security advisory has been issued, and you want
          to just rebuild the necessary libraries and applications,
          your best bet is to follow the instructions provided in the
          advisory. An example is given below:
        </p>

<pre class="programlisting">
$ cd src
$ export CVS_RSH=ssh cvs update -d -P -r netbsd-3-1 gnu/dist/sendmail/sendmail
$ cd gnu/usr.sbin/sendmail
$ make USETOOLS=no cleandir dependall
$ su
# make USETOOLS=no install</pre>


  <h4 class="title">
<a name="summary"></a>Terse summary of an updating procedure (<a href="#top">top</a>)
  </h4>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
            <p>Updating the sources:</p>
            <pre class="programlisting">
$ cd /usr/src
$ export CVS_RSH=ssh 
$ cvs update -dP</pre>
          </li>
<li class="listitem">
  <p>Building the new kernel and userland:</p>
  <pre class="programlisting">
$ cd /usr/src
$ ./build.sh -O ../obj -T ../tools tools
$ ./build.sh -O ../obj -T ../tools kernel=&lt;KERNEL&gt;
$ ./build.sh -O ../obj -T ../tools -U distribution</pre>
  </li>
<li class="listitem">
  <p>Installing the new kernel and userland:</p>
  <pre class="programlisting">
$ su
# mv /netbsd /netbsd.old
# mv /usr/obj/sys/arch/&lt;ARCH&gt;/compile/&lt;KERNEL&gt;/netbsd /
# shutdown -r now
...
$ cd /usr/src
$ su
# ./build.sh -O ../obj -T ../tools -U install=/ </pre>
  </li>
</ul></div>
</div></div></div>
<div class="navfoot"></div>
<div id="footer"><div id="footerContent"><center>
<span class="footfeed"><a href="http://www.NetBSD.org/cgi-bin/feedback.cgi">
	  Contact</a> |
      </span><span class="footcopy"><a href="../about/disclaimer.html">
      Disclaimer</a> |

      <span class="copyright">Copyright 1994-2012 The NetBSD Foundation, Inc. </span>ALL RIGHTS RESERVED.<br>NetBSD<sup>/sup> is a registered trademark of The NetBSD
	Foundation, Inc.</span>
</center></div></div>
</div></body>
</html>