Annotation of htdocs/docs/updating.html, Revision 1.57
1.21 jym 1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
1.1 dsieger 2: <html>
3: <head>
4: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5: <meta name="generator" content="Website XSL Stylesheet V2.6.0">
6: <link rel="home" href="../." title="Welcome to The NetBSD Project: Of course it runs NetBSD.">
7: <link rel="up" href="../docs/." title="NetBSD Documentation">
8: <link rel="previous" href="../docs/software/." title="Application Software for NetBSD">
9: <link rel="next" href="../docs/vmware.html" title="NetBSD Documentation: Running VMWare on NetBSD">
10: <link rel="first" href="../docs/Hardware/." title="Hardware Documentation">
11: <link rel="last" href="../docs/x/." title="NetBSD Documentation: The X Window System">
1.13 dsieger 12: <link rel="stylesheet" href="../global.css" type="text/css">
1.52 maya 13: <link rel="stylesheet" href="../donations/thermo/fundraiser.css" type="text/css">
1.1 dsieger 14:
15: <title>Updating a stable NetBSD release</title>
16: </head>
1.53 maya 17: <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
1.1 dsieger 18: <body class="website"><div class="webpage">
1.46 maya 19: <a name="docs-updating"></a><div id="top"><a href="#mainContent" id="skiplink" tabindex="1">Skip to main content.</a></div>
1.53 maya 20: <input id="hamburger" type="checkbox"><label class="menuicon" for="hamburger"><span></span><span></span><span></span></label><div id="navBar" role="navigation">
1.33 maya 21: <div id="centralHeader"><div id="logo">
1.54 maya 22: <a href="../"><img id="projectLogo" alt="" height="120" src="../images/NetBSD-smaller-tb.png"></a><a href="/"><div id="fundraiser">
1.52 maya 23: <br><div id="fundraiser-amount"><div id="fundraiser-raised"></div></div>
24: </div></a>
1.33 maya 25: </div></div>
1.6 dsieger 26: <span class="doNotDisplay">
27: Navigation:
1.21 jym 28: </span><ul>
29: <li>
30: <a href="../">
1.55 maya 31: Home</a><ul>
1.21 jym 32: <li><a href="../changes/">
33: Recent changes</a></li>
1.36 maya 34: <li><a href="//blog.NetBSD.org/">
1.21 jym 35: NetBSD blog</a></li>
1.51 maya 36: <li><a href="../gallery/presentations/">
37: Presentations</a></li>
1.21 jym 38: </ul>
39: </li>
40: <li>
41: <a href="../about/">
42: About</a><ul>
1.42 maya 43: <li><a href="../people/developers.html">
1.55 maya 44: Developers</a></li>
1.21 jym 45: <li><a href="../gallery/">
1.48 leot 46: Gallery</a></li>
1.55 maya 47: <li><a href="//wiki.NetBSD.org/ports/">
48: Ports</a></li>
1.57 ! nia 49: <li><a href="//cdn.netbsd.org/pub/pkgsrc/current/pkgsrc/README.html">
1.55 maya 50: Packages</a></li>
1.21 jym 51: </ul>
52: </li>
53: <li>
54: <a href="../docs/">
55: Documentation</a><ul>
56: <li><a href="../docs/misc/index.html">
57: FAQ & HOWTOs</a></li>
58: <li><a href="../docs/guide/en/">
59: The Guide</a></li>
1.57 ! nia 60: <li><a href="//man.NetBSD.org/">
1.21 jym 61: Manual pages</a></li>
1.36 maya 62: <li><a href="//wiki.NetBSD.org/">
1.21 jym 63: Wiki</a></li>
64: </ul>
65: </li>
66: <li>
67: <a href="../support/">
68: Support</a><ul>
1.56 leot 69: <li><a href="/community/">
1.55 maya 70: Community</a></li>
1.56 leot 71: <li><a href="/mailinglists/">
72: Mailing lists</a></li>
1.21 jym 73: <li><a href="../support/send-pr.html">
1.55 maya 74: Bug reports</a></li>
1.21 jym 75: <li><a href="../support/security/">
76: Security</a></li>
77: </ul>
78: </li>
79: <li>
80: <a href="../developers/">
81: Developers</a><ul>
1.39 maya 82: <li><a href="http://cvsweb.NetBSD.org/">
1.55 maya 83: CVSWeb</a></li>
84: <li><a href="//anonhg.NetBSD.org/">
85: Mercurial</a></li>
1.36 maya 86: <li><a href="//nxr.NetBSD.org/">
1.21 jym 87: Cross-reference</a></li>
1.36 maya 88: <li><a href="//releng.NetBSD.org/">
1.21 jym 89: Release engineering</a></li>
1.36 maya 90: <li><a href="//wiki.NetBSD.org/projects/">
1.21 jym 91: Projects list</a></li>
92: </ul>
93: </li>
94: </ul>
1.3 dsieger 95: </div>
1.45 maya 96: <div id="content"><div id="mainContent" class="fullWidth"><div class="rowOfBoxes">
1.3 dsieger 97: <h1>Updating a stable NetBSD release</h1>
1.1 dsieger 98: <h3 class="title"><a name="top"></a></h3>
99: <ul>
100: <li><a href="#current">Tracking -current</a></li>
101: <li><a href="#update-src">Updating the sources</a></li>
1.10 weinem 102: <li><a href="#tools">Building the tools</a></li>
1.1 dsieger 103: <li><a href="#kernel">Building a new kernel</a></li>
1.9 weinem 104: <li><a href="#userland">Building a new userland</a></li>
105: <li><a href="#installing">Installing the kernel and userland</a></li>
1.1 dsieger 106: <li><a href="#parts">Updating only parts of the source tree</a></li>
1.10 weinem 107: <li><a href="#summary">Terse summary of an updating procedure</a></li>
1.1 dsieger 108: </ul>
109: <hr>
110: <h3 class="title"></h3>
111: <h4 class="title">
1.43 maya 112: <a name="current"></a>Tracking -current</h4>
1.1 dsieger 113: <p>
114: See
1.13 dsieger 115: <a class="ulink" href="current/" target="_top">this document</a>
1.9 weinem 116: for our documentation on how to track NetBSD-current.
1.1 dsieger 117: </p>
118:
119: <h4 class="title">
1.43 maya 120: <a name="update-src"></a>Updating the sources</h4>
1.1 dsieger 121: <p>
122: If you are running a stable NetBSD release (such as
1.29 snj 123: <a class="ulink" href="../releases/formal-6/" target="_top">NetBSD 6.1</a>),
1.1 dsieger 124: in a production environment, you should occasionally
125: update your sources and rebuild the system or the kernel,
126: in order to incorporate any security fixes that have been
127: applied to the branch since its release.
128: </p>
129:
1.10 weinem 130: <p>Most of the following steps can be done as ordinary user.
131: Only the installation of a new kernel and the userland will require
132: root privileges.
133: Although <code class="filename">/usr</code> is choosen as the working
134: directory in the following examples, the procedure can also
135: take place in a user's home directory. Ordinary users have normally not
136: the permissions to make changes in <code class="filename">/usr</code>,
137: but this can be changed by root. </p>
138:
139: <p>
1.1 dsieger 140: You can retrieve or update the sources for your
141: release using
1.13 dsieger 142: <a class="ulink" href="current/#using-anoncvs-over-ssh" target="_top">anoncvs over
1.1 dsieger 143: ssh</a>
144: by specifying the correct branch tag. For example, to
1.29 snj 145: checkout the sources for the NetBSD 6.1 release branch, you
146: would use:
1.1 dsieger 147: </p>
148: <pre class="programlisting">
149: $ cd /usr
1.10 weinem 150: $ export CVS_RSH=ssh
1.29 snj 151: $ cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot co -r netbsd-6-1 -P src</pre>
1.1 dsieger 152:
1.26 tron 153: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1 dsieger 154: <h3 class="title">Note</h3>
1.9 weinem 155: Be sure to take care in selecting the correct and desired branch tag so
156: you don't accidently <span class="emphasis"><em>downgrade</em></span> your source tree.
157: </div>
1.1 dsieger 158:
1.9 weinem 159: <p>To update an existing source tree, do:</p>
1.1 dsieger 160:
1.9 weinem 161: <pre class="programlisting">
162: $ cd /usr/src
1.10 weinem 163: $ export CVS_RSH=ssh
1.9 weinem 164: $ cvs update -dP</pre>
1.1 dsieger 165:
1.10 weinem 166:
167: <h4 class="title">
1.43 maya 168: <a name="tools"></a>Building the tools</h4>
1.10 weinem 169:
1.38 leot 170: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
171: <h3 class="title">Note</h3>
172: Please always refer to <code class="code">build.sh -h</code> and the
173: files <code class="filename">UPDATING</code> and
174: <code class="filename">BUILDING</code> for details - it's worth
175: it, there are <span class="emphasis"><em>many</em></span> options that can
176: be set on the command line or in
177: <code class="filename">/etc/mk.conf</code>.
178: </div>
179:
1.10 weinem 180: <p>The next step is to build the toolchain. You need to
181: create an <code class="filename">obj/</code> and a <code class="filename">tools/</code>
1.13 dsieger 182: directory, followed by a run of <span class="command"><strong>build.sh</strong></span>:</p>
1.10 weinem 183:
184: <pre class="programlisting">
185: $ mkdir /usr/obj /usr/tools
186: $ cd /usr/src
187: $ ./build.sh -O /usr/obj -T /usr/tools -U -u tools</pre>
188:
189:
1.1 dsieger 190: <h4 class="title">
1.43 maya 191: <a name="kernel"></a>Building a new kernel</h4>
1.1 dsieger 192: <p>
193: Building a new kernel pretty much follows the steps
194: as described in
1.13 dsieger 195: <a class="ulink" href="kernel/#how_to_build_a_kernel" target="_top">this
1.9 weinem 196: document</a>.
1.1 dsieger 197: </p>
1.9 weinem 198:
199: <p>The steps to build the kernel are:</p>
200: <pre class="programlisting">
201: $ cd /usr/src
1.38 leot 202: $ ./build.sh -O ../obj -T ../tools -U kernel=<KERNEL>
1.9 weinem 203: </pre>
204:
205:
1.1 dsieger 206:
207: <h4 class="title">
1.43 maya 208: <a name="userland"></a>Building a new userland</h4>
1.1 dsieger 209:
1.9 weinem 210: <p>The build the userland, do:</p>
211: <pre class="programlisting">
1.14 apb 212: $ ./build.sh -O ../obj -T ../tools -U distribution</pre>
1.9 weinem 213:
1.1 dsieger 214:
1.9 weinem 215: <h4 class="title">
1.43 maya 216: <a name="installing"></a>Installing the kernel and userland</h4>
1.9 weinem 217:
218: <p>Installing the new kernel, rebooting (to ensure that the new kernel
219: works) and installing the new userland are the final steps of the updating
220: procedure:</p>
221: <pre class="programlisting">
222: $ cd /usr/src
223: $ su
224: # mv /netbsd /netbsd.old
1.15 mishka 225: # mv /usr/obj/sys/arch/<ARCH>/compile/<KERNEL>/netbsd /
1.9 weinem 226: # shutdown -r now
227: ...
228: $ cd /usr/src
229: $ su
230: # ./build.sh -O ../obj -T ../tools -U install=/ </pre>
231:
1.10 weinem 232: <p>If the new kernel <code class="filename">netbsd</code> does not boot
233: successfully, you can fall back on booting the
234: <code class="filename">netbsd.old</code> kernel.</p>
1.9 weinem 235:
236:
1.1 dsieger 237: <h4 class="title">
1.43 maya 238: <a name="parts"></a>Updating only parts of the source tree</h4>
1.10 weinem 239:
1.1 dsieger 240: <p>
241: If a security advisory has been issued, and you want
242: to just rebuild the necessary libraries and applications,
243: your best bet is to follow the instructions provided in the
244: advisory. An example is given below:
245: </p>
246:
1.9 weinem 247: <pre class="programlisting">
1.1 dsieger 248: $ cd src
1.29 snj 249: $ export CVS_RSH=ssh cvs update -d -P -r netbsd-6-1
250: $ cd libexec/httpd
1.1 dsieger 251: $ make USETOOLS=no cleandir dependall
252: $ su
253: # make USETOOLS=no install</pre>
254:
1.10 weinem 255:
256: <h4 class="title">
1.43 maya 257: <a name="summary"></a>Terse summary of an updating procedure</h4>
1.26 tron 258: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.19 spz 259: <li class="listitem">
1.10 weinem 260: <p>Updating the sources:</p>
1.1 dsieger 261: <pre class="programlisting">
262: $ cd /usr/src
1.10 weinem 263: $ export CVS_RSH=ssh
264: $ cvs update -dP</pre>
1.1 dsieger 265: </li>
1.19 spz 266: <li class="listitem">
1.10 weinem 267: <p>Building the new kernel and userland:</p>
268: <pre class="programlisting">
1.1 dsieger 269: $ cd /usr/src
1.15 mishka 270: $ ./build.sh -O ../obj -T ../tools tools
1.9 weinem 271: $ ./build.sh -O ../obj -T ../tools kernel=<KERNEL>
1.14 apb 272: $ ./build.sh -O ../obj -T ../tools -U distribution</pre>
1.10 weinem 273: </li>
1.19 spz 274: <li class="listitem">
1.10 weinem 275: <p>Installing the new kernel and userland:</p>
276: <pre class="programlisting">
1.1 dsieger 277: $ su
278: # mv /netbsd /netbsd.old
1.15 mishka 279: # mv /usr/obj/sys/arch/<ARCH>/compile/<KERNEL>/netbsd /
1.9 weinem 280: # shutdown -r now
281: ...
1.1 dsieger 282: $ cd /usr/src
283: $ su
1.9 weinem 284: # ./build.sh -O ../obj -T ../tools -U install=/ </pre>
1.10 weinem 285: </li>
1.1 dsieger 286: </ul></div>
1.9 weinem 287: </div></div></div>
1.3 dsieger 288: <div class="navfoot"></div>
1.17 mishka 289: <div id="footer"><div id="footerContent"><center>
1.36 maya 290: <span class="footfeed"><a href="//www.NetBSD.org/cgi-bin/feedback.cgi">
1.3 dsieger 291: Contact</a> |
1.12 kano 292: </span><span class="footcopy"><a href="../about/disclaimer.html">
1.3 dsieger 293: Disclaimer</a> |
294:
1.57 ! nia 295: <span class="copyright">Copyright © 1994-2021 The NetBSD Foundation, Inc. </span>ALL RIGHTS RESERVED.<br>NetBSD<sup>®</sup> is a registered trademark of The NetBSD
1.3 dsieger 296: Foundation, Inc.</span>
1.17 mishka 297: </center></div></div>
1.1 dsieger 298: </div></body>
299: </html>
CVSweb <webmaster@jp.NetBSD.org>