Annotation of htdocs/docs/bootcd.html, revision 1.2
1.1 dsieger 1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
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/books.html" title="Recommended reading">
9: <link rel="next" href="../docs/bsd/." title="Historic BSD information">
10: <link rel="first" href="../docs/Hardware/." title="Hardware Documentation">
11: <link rel="last" href="../docs/x/." title="NetBSD Documentation: The X Window System">
12: <link rel="stylesheet" href="/NetBSD.css" type="text/css">
13:
14: <title>NetBSD Bootable CD ROM HOWTO</title>
15: </head>
16: <body class="website"><div class="webpage">
17: <a name="docs-bootcd"></a><h1>NetBSD Bootable CD ROM HOWTO</h1>
18: <div class="sect1" lang="en">
19: <div class="titlepage"></div>
20: <p>
21: This document attempts to explain how to make bootable NetBSD
22: CD ROMs.
23: </p>
24: </div>
25: <h3 class="title"><a name="overview">Overview</a></h3>
26: <ul><li><a href="#creating-the-image">Creating the CD image</a></li></ul>
27: <h3 class="title"><a name="platforms">Platform specific instructions</a></h3>
28: <ul>
29: <li><a href="#alphaimage">NetBSD/alpha</a></li>
30: <li><a href="#i386image">NetBSD/i386</a></li>
31: <li><a href="#macppcimage">NetBSD/macppc</a></li>
32: <li><a href="#pmaximage">NetBSD/pmax</a></li>
33: <li><a href="#sgimips">NetBSD/sgimips</a></li>
34: <li><a href="#sparcimage">NetBSD/sparc</a></li>
35: <li><a href="#sparc64image">NetBSD/sparc64</a></li>
36: <li><a href="#sun2image">NetBSD/sun2</a></li>
37: <li><a href="#sun3image">NetBSD/sun3</a></li>
38: <li><a href="#vaximage">NetBSD/vax</a></li>
39: <li><a href="#multiimage">Multiple Machine</a></li>
40: </ul>
41: <h3 class="title"><a name="examining-the-image">Examining the CD image</a></h3>
42: <ul>
43: <li><a href="#netbsd_mountimage">Under NetBSD</a></li>
44: <li><a href="#linux_mountimage">Under Linux</a></li>
45: <li><a href="#solaris_mountimage">Under Solaris</a></li>
46: </ul>
47: <h3 class="title"><a name="burning-the-cd">Burning the CD</a></h3>
48: <ul>
49: <li><a href="#cdrecord">Using cdrecord (U*nix)</a></li>
50: <li><a href="#winrecord">Under Windows</a></li>
51: <li><a href="#macrecord">Under Mac OS</a></li>
52: </ul>
53: <hr>
54: <h3 class="title">Overview</h3>
55: <h4 class="title">
56: <a name="creating-the-image"></a>Creating the CD image (<a href="#overview">top</a>)
57: </h4>
58: <p>
59: The first step in making a CD ROM is to create an image of the CD.
60: This image will initially be stored as a (rather large, up to 650 Mb)
61: file on your hard drive and then later written to the CD.
62: </p>
63: <p>
64: This section assumes you have access to the program
65: <code class="code">mkisofs</code>. If you are making the CD image on a NetBSD
66: machine, you can install <code class="code">mkisofs</code> from the
67: <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/sysutils/cdrtools/README.html" target="_top"><code class="filename">sysutils/cdrtools</code></a>
68: package.
69: </p>
70: <p>
71: It is assumed the directory <code class="code">/cdsources</code> exists on your system
72: and contains all the files which you want to end up on the CD ROM.
73: One suggested layout for making an install CD is to follow the
74: directory structure on <a href="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-3.0/" target="_top">ftp.NetBSD.org</a>. For example:
75: </p>
76: <pre class="programlisting">
77: /cdsources/i386/.....
78: /cdsources/sparc/.....</pre>
79: <p>
80: </p>
81: <hr>
82: <h3 class="title">Platform specific instructions</h3>
83: <h4 class="title">
84: <a name="alphaimage"></a>NetBSD/alpha (<a href="#platforms">top</a>)
85: </h4>
86: <p>
87: There are 2 steps involved in making a NetBSD/alpha bootable CD ROM.
88: The first is to create an ISO 9660 image of whatever you want
89: to put on the CD. This image must have the secondary boot program and
90: kernel in its root directory. In addition, the primary boot program
91: will be needed for the second step. To put the boot programs and
92: kernel in the right places, do the following:
93: </p>
94:
95: <pre class="programlisting">
96: cd /cdsources/alpha/binary/sets
97: tar -zxvf base.tgz ./usr/mdec/boot ./usr/mdec/bootxx_cd9660
98: mv -f ./usr/mdec/boot /cdsources/boot
99: mkdir /tmp/mdec.alpha
100: mv -f ./usr/mdec/bootxx_cd9660 /tmp/mdec.alpha/bootxx_cd9660
101: rm -rf ./usr
102: cd /cdsources/alpha/installation/instkernel
103: cp -f netbsd.gz /cdsources/netbsd.gz</pre>
104:
105: <p>
106: Now create the ISO 9660 image.
107: </p>
108: <pre class="programlisting">mkisofs -o output.iso -l -J -R -allow-leading-dots /cdsources</pre>
109:
110: <p>
111: The second step is to install NetBSD/alpha disk and CD ROM bootstrap
112: software using <a href="http://netbsd.gw.com/cgi-bin/man-cgi?installboot+8+NetBSD-current">installboot(8)</a>. This is done with the
113: following command:
114: </p>
115:
116: <pre class="programlisting">installboot -m alpha -v output.iso /tmp/mdec.alpha/bootxx_cd9660</pre>
117:
118:
119: <h4 class="title">
120: <a name="i386image"></a>NetBSD/i386 (<a href="#platforms">top</a>)
121: </h4>
122: <p>
123: This section shows how to make a NetBSD/i386 bootable CD ROM. The
124: particular example is how to make a NetBSD-3.0/i386 install CD. It
125: is assumed that the directory <code class="code">/cdsources/</code> exists on your system
126: and contains all the files and the directory structure from the
127: <a href="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-3.0/i386/" target="_top">NetBSD-3.0/i386</a>
128: distribution.
129: The exact contents depend on what you want on your CD. The
130: important part is that
131: <code class="code">/cdsources/i386/installation/floppy/boot-big.fs</code> exists as that will
132: be used as the bootable image.
133: </p>
134: <p>
135: To create the CD image use the following command:
136: </p>
137:
138: <pre class="programlisting">
139: mkisofs -o output.iso -b i386/installation/floppy/boot-big.fs \
140: -c boot.catalog -l -J -R -allow-leading-dots /cdsources</pre>
141:
142: <p>
143: This will create a file, <code class="code">output.iso</code>, which is the CD image.
144: The options are:
145: </p>
146: <div class="itemizedlist"><ul type="disc">
147: <li>
148: <p>
149: <code class="code">-b i386/installation/floppy/boot-big.fs</code>
150: -- specifies the boot image to be used
151: </p>
152: </li>
153: <li>
154: <p>
155: <code class="code">-c boot.catalog</code>
156: -- creates a boot catalog
157: </p>
158: </li>
159: <li>
160: <p>
161: <code class="code">-l</code> -- Allow long (32 character) file names
162: </p>
163: </li>
164: <li>
165: <p><code class="code">-J</code> -- Includes Joliet extensions</p>
166: </li>
167: <li>
168: <p><code class="code">-R</code> -- Sets file permissions including setuid</p>
169: </li>
170: <li>
171: <p>
172: <code class="code">-allow-leading-dots</code> -- Allows filenames to begin with
173: “<span class="quote">.</span>”, was <code class="code">-L</code> in older versions
174: of mkisofs.
175: </p>
176: </li>
177: <li>
178: <p>
179: <code class="code">/cdsources</code> -- Specifies that the directory
180: <code class="code">/cdsources</code> is the root of the CD image
181: </p>
182: </li>
183: </ul></div>
184: <p>
185: </p>
186:
187: <h4 class="title">
188: <a name="macppcimage"></a>NetBSD/macppc (<a href="#platforms">top</a>)
189: </h4>
190: <p>
191: All supported macppc models can boot from the first session of a CD ROM.
192: The procedure for making a CD bootable depends on what version of Open
1.2 ! dsieger 193: Firmware your model has. Refer to the <a href="../ports/macppc/models.html" target="_top">NetBSD/macppc Model Support Page</a> to
1.1 dsieger 194: determine your system's Open Firmware version and its support status.
195: </p>
196:
197: <p>
198: It is assumed that the directory <code class="code">/cdsources/</code> exists on your
199: system and contains all the files and the directory structure from the <a href="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-3.0/macppc/" target="_top">NetBSD-3.0/macppc</a>
200: distribution. The exact contents depend on what you want on your CD.
201: </p>
202:
203: <p>
204: Make sure your <code class="code">/cdsources/</code> has <code class="code">ofwboot.xcf</code> (the macppc
205: bootloader) and a kernel (we suggest <code class="code">netbsd.GENERIC_MD</code>, the
206: ramdisk-based install kernel that supports all models).
207: </p>
208:
209: <pre class="programlisting">
210: cd /cdsources
211: cp macppc/binary/kernel/netbsd-GENERIC_MD.gz netbsd.macppc
212: cp macppc/installation/ofwboot.xcf .</pre>
213:
214: <p>
215: The NetBSD/macppc official ISO image is bootable on all supported models
216: because it does some special magic. The CD is created as an HFS
217: hybrid CD with an Apple Disk Partition Table using the <code class="code">-hfs -part</code>
218: options in mkisofs. The Partition Table is then modified to map (or point to)
219: a driver file which makes the CD bootable on the PPC Macintosh and the
220: driver file is appended to the end of the iso image.
221: </p>
222:
223: <p>
224: The CD won't be bootable via the
225: “<span class="quote"><code class="code">C</code></span>” snag key though. However
226: this can be added with the following, although it may not
227: work on all Macppc systems. (Adding the option will not
228: impair the use of booting via OpenFirmware commands.) To
229: do this, create a CHRP bootscript in a top-level
230: directory, tag the bootscript file with the proper Mac OS
231: Type and Creator, and "bless" the directory which contains
232: the file. Mkisofs will attach the proper Mac OS Type and
233: Creator codes while generating the ISO image file if the
234: following line is added to the file
235: <code class="code">/usr/src/distrib/cdrom/hfsmap.lst</code>:
236: </p>
237:
238: <pre class="programlisting">.chrp - 'chrp' 'tbxi'</pre>
239:
240: <p>
241: Then place the following file named <code class="code">bootscript</code> in the (top-level)
242: <code class="code">macppc</code> directory:
243: </p>
244:
245: <pre class="programlisting">
246: <CHRP-BOOT>
247: <COMPATIBLE>MacRISC</COMPATIBLE>
248: <DESCRIPTION>
249: NetBSD/macppc bootable CD script
250: </DESCRIPTION>
251: <BOOT-SCRIPT>
252: boot cd:,ofwboot.xcf netbsd.macppc
253: </BOOT-SCRIPT>
254: </CHRP-BOOT></pre>
255:
256: <p>Create the macppc bootable CD image using the following commands:</p>
257:
258: <pre class="programlisting">
259: cdrom_util="/usr/src/distrib/cdrom"
260: snag_boot="-map ${cdrom_util}/hfsmap.lst -hfs-bless ./macppc"
261: ofw_boot="-boot-hfs-file ${cdrom_util}/macppc_installboot/macppcboot.raw"
262: mkisofs -o output.iso -hfs -part ${snag_boot} ${ofw_boot} -l -J -r -allow-leading-dots /cdsources
263: blknum=`ls -l output.iso | awk '{print $5}'`
264: blknum=`expr ${blknum} / 512`
265: ${cdrom_util}/macppc_installboot/macppc_installboot output.iso ${blknum} 756
266: dd if=/usr/mdec/ofwboot bs=64k count=1 conv=sync >> output.iso</pre>
267:
268: <p>
269: Once you have burnt the CD, make sure Open Firmware can find the
270: bootloader on your new CD ROM (see
1.2 ! dsieger 271: <a href="../ports/macppc/faq.html#ofw-dir-listing" target="_top">How do I get a listing (in
1.1 dsieger 272: Open Firmware) of the files on my disk?</a> in the FAQ). This is
273: important, since Open Firmware treats the boot file name as case
274: sensitive. Most (if not all) Open Firmware 1.0.5, 1.1.22, and 2.0.x systems
275: will think the bootloader is <code class="code">OFWBOOT.XCF</code> and Open Firmware 3 should
276: properly see it as <code class="code">ofwboot.xcf</code>.
277: </p>
278:
279: <h4 class="title">
280: <a name="pmaximage"></a>NetBSD/pmax (<a href="#platforms">top</a>)
281: </h4>
282: <p>
283: NetBSD/pmax can boot from either a FFS or ISO 9660 CD ROM. This
284: section assumes you are making an ISO 9660 CD ROM. Please note that
285: the bootxx_cd9660 program was not added until <span class="emphasis"><em>after</em></span> NetBSD-1.4.x.
286: If you're running NetBSD-1.4.x, you can obtain <code class="code">boot.pmax</code>,
287: <code class="code">installboot</code>, and <code class="code">bootxx_cd9660</code> from a -current snapshot.
288: Make sure the sources are from <span class="emphasis"><em>after</em></span> late November, 1999.
289: </p>
290: <p>
291: There are 2 steps involved in making a NetBSD/pmax bootable CD ROM.
292: The first is to create an ISO 9660 image of whatever you want
293: to put on the CD. This image must have the secondary boot program
294: and kernel in its root directory.
295: In addition, the primary boot program
296: will be needed for the second step. To put the boot programs and
297: kernel in the right places, do the following:
298: </p>
299:
300: <pre class="programlisting">
301: cd /cdsources/pmax/binary/sets
302: tar -zxvf base.tgz ./usr/mdec/boot.pmax ./usr/mdec/bootxx_cd9660
303: mv -f ./usr/mdec/boot.pmax /cdsources/boot.pmax
304: mkdir /tmp/mdec.pmax
305: mv -f ./usr/mdec/bootxx_cd9660 /tmp/mdec.pmax/bootxx_cd9660
306: rmdir ./usr/mdec
307:
308: cd /cdsources/pmax/binary/kernel
309: cp -f install.gz /cdsources/netbsd.pmax.gz
310: gunzip /cdsources/netbsd.pmax.gz</pre>
311:
312: <p>
313: Now create the ISO 9660 image.
314: </p>
315:
316: <pre class="programlisting">mkisofs -o output.iso -l -J -r -allow-leading-dots /cdsources</pre>
317:
318: <p>
319: The second step is to install NetBSD/pmax disk and CD ROM bootstrap
320: software using <a href="http://netbsd.gw.com/cgi-bin/man-cgi?installboot+8+NetBSD-current">installboot(8)</a>. The
321: <a href="http://netbsd.gw.com/cgi-bin/man-cgi?installboot+8+NetBSD-current">installboot(8)</a> command is used in the following way:
322: </p>
323:
324: <pre class="programlisting">installboot -m pmax -v output.iso /usr/mdec/bootxx_cd9660</pre>
325:
326:
327: <h4 class="title">
328: <a name="sgimips"></a>NetBSD/sgimips (<a href="#platforms">top</a>)
329: </h4>
330: <p>
331: Please see <a href="http://mail-index.NetBSD.org/port-sgimips/2003/06/29/0000.html" target="_top">this
1.2 ! dsieger 332: posting</a> to the <a href="../mailinglists/#port-sgimips" target="_top">port-sgimips
1.1 dsieger 333: MailingList</a> for instructions on how to create a bootable CD ROM. Note
334: that these instructions have not been verified by the NetBSD developers (yet).
335: </p>
336:
337: <h4 class="title">
338: <a name="sparcimage"></a>NetBSD/sparc (<a href="#platforms">top</a>)
339: </h4>
340: <p>
341: There are three steps involved in making a NetBSD/sparc bootable CD ROM.
342: Step 1 is to create an "almost" full ISO 9660 image of whatever you want
343: to put on the CD. For example:
344: </p>
345:
346: <pre class="programlisting">mkisofs -o output.iso -l -J -r -allow-leading-dots /cdsources</pre>
347:
348: <p>
349: Now get a bootable floppy image. For NetBSD-3.0/sparc, this image
350: may be found at
351: <a href="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-3.0/sparc/installation/bootfs/boot.fs.gz" target="_top">ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-3.0/sparc/installation/bootfs/boot.fs.gz</a>
352: </p>
353:
354: <p>
355: The final step is to rewrite the ISO image with (a) a sun disklabel at
356: the start, (b) the original image at the end, and (c) with the right
357: offset/size values in the disklabel for the bootloader. The program
358: <code class="code">mksunbootcd</code> will perform this task. If <code class="code">mksunbootcd</code>
359: is not installed on your system, it can be installed from the
360: <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/sysutils/mksunbootcd/README.html" target="_top"><code class="filename">sysutils/mksunbootcd</code></a>
361: package. If you're creating the image on a non-NetBSD system, you
362: can try compiling <code class="code">mksunbootcd</code> on your system. The sources
363: are available at
364: <a href="ftp://ftp.NetBSD.org/pub/NetBSD/misc/mksunbootcd/" target="_top">ftp://ftp.NetBSD.org/pub/NetBSD/misc/mksunbootcd/</a>.
365: </p>
366:
367: <p>
368: To use <code class="code">mksunbootcd</code> use the following:
369: </p>
370:
371: <pre class="programlisting">mksunbootcd output.iso boot.fs boot.fs boot.fs</pre>
372:
373: <p>
374: The bootable image is listed three times corresponding to what will get
375: booted by a sun4, sun4c and sun4m system respectively. If you have
376: different bootable images for the three machines, or if you also have
377: a bootable image for sun2, sun3, and sun3x systems, you can do something
378: like:
379: </p>
380:
381: <pre class="programlisting">mksunbootcd output.iso boot-sun4.fs boot-sun4c.fs boot-sun4m.fs boot-sun3.fs</pre>
382:
383: <p>
384: Note that <code class="code">mksunbootcd</code> rewrites the <code class="code">output.iso</code> file, so
385: don't run it multiple times.
386: </p>
387:
388: <p>
389: As a note, this step is fine to perform on a NFS mounted directory. Ie,
390: if your ISO image is on a remote machine, it can be mounted on a NetBSD
391: machine for running <code class="code">mksunbootcd</code> without requiring extreme amounts
392: of data to be transferred over the network.
393: </p>
394:
395: <h4 class="title">
396: <a name="sparc64image"></a>NetBSD/sparc64 (<a href="#platforms">top</a>)
397: </h4>
398: <p>
399: There are three steps involved in making a NetBSD/sparc64 bootable CD ROM.
400: Step 1 is to create an "almost" full ISO 9660 image of whatever you want to
401: put on the CD. For example:
402: </p>
403:
404: <pre class="programlisting">mkisofs -o output.iso -l -J -r -allow-leading-dots /cdsources</pre>
405:
406: <p>
407: Now get a bootable floppy image. For NetBSD-3.0/sparc64, this image
408: may be found at <a href="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-3.0/sparc64/installation/misc/boot.fs.gz" target="_top">ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-3.0/sparc64/installation/misc/boot.fs.gz</a>.
409: </p>
410:
411: <p>
412: The final step is to rewrite the ISO image with (a) a sun disklabel at
413: the start, (b) the original image at the end, and (c) with the right
414: offset/size values in the disklabel for the bootloader. The program
415: <code class="code">sunbootcd.sh</code> will perform this task. If <code class="code">sunbootcd.sh</code>
416: is not installed on your system, it can be obtained from <a href="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-current/src/distrib/common/sunbootcd.sh" target="_top">ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-current/src/distrib/common/sunbootcd.sh</a>.
417: </p>
418:
419: <p>
420: To use <code class="code">sunbootcd.sh</code> use the following:
421: </p>
422:
423: <pre class="programlisting">sunbootcd.sh output.iso - - - - boot.fs</pre>
424:
425: <p>
426: The arguments are for bootable images for sun4, sun4c, sun4m, sun4d, and
427: sun4u. Specifying a dash instead of a boot image means the CD will not be
428: bootable for that platform. In the above example the only platform given
429: a boot image is sun4u.
430: </p>
431:
432: <p>
433: Note that <code class="code">sunbootcd.sh</code> rewrites the <code class="code">output.iso</code> file, so
434: don't run it multiple times.
435: </p>
436:
437: <p>
438: As a note, this step is fine to perform on a NFS mounted directory. Ie,
439: if your ISO image is on a remote machine, it can be mounted on a NetBSD
440: machine for running <code class="code">sunbootcd.sh</code> without requiring extreme amounts
441: of data to be transferred over the network.
442: </p>
443:
444: <p>
445: Be aware that <code class="code">sunbootcd.sh</code> will produce a CD that is not
446: recognized by vold under Solaris 10. If you want to mount the NetBSD
447: install CD under Solaris, you will first need to stop vold.
448: </p>
449:
450: <pre class="programlisting">/etc/init.d/volmgt stop</pre>
451:
452:
453: <h4 class="title">
454: <a name="sun2image"></a>NetBSD/sun2 (<a href="#platforms">top</a>)
455: </h4>
456: <p>
457: To make a NetBSD/sun2 bootable CD ROM, follow the procedure below for
458: making a NetBSD/sun3 bootable CD ROM. This procedure makes a single
459: CD ROM that will boot on both sun2 and sun3 systems.
460: </p>
461:
462: <p>
463: <span class="emphasis"><em>Optional:</em></span> When following the procedure below, it is beneficial
464: to uncompress the sun2 miniroot
465: (<code class="code">/cdsources/sun2/installation/miniroot.fs.gz</code>) and binary sets
466: (<code class="code">/cdsources/sun2/binary/sets/*.tgz</code>)
467: before writing the ISO 9660 image. This is entirely optional, and consumes
468: a lot of space on the ISO 9660 image, but saves time during installation
469: because decompression is very slow on the sun2.
470: </p>
471:
472: <h4 class="title">
473: <a name="sun3image"></a>NetBSD/sun3 (<a href="#platforms">top</a>)
474: </h4>
475: <p>
476: There are three steps involved in making a NetBSD/sun3 bootable CD ROM, and
477: this will result in a CD ROM that can also boot NetBSD/sun2.
478: </p>
479:
480: <p>
481: Step 1 is to create an "almost" full ISO 9660 image of whatever you want
482: to put on the CD. For example:
483: </p>
484:
485: <pre class="programlisting">mkisofs -o output.iso -l -J -r -allow-leading-dots /cdsources</pre>
486:
487: <p>
488: Now build a bootable ffs image. This image is currently not included in
489: the release, so you have to put it together yourself.
490: </p>
491:
492: <pre class="programlisting">
493: mkdir /tmp/boot-sun3
494: cd /tmp/boot-sun3
495: gzip -cd < /cdsources/sun2/binary/kernel/netbsd.RAMDISK.gz > netbsd.sun2
496: ln netbsd.sun2 vmunix
497: gzip -cd < /cdsources/sun3/binary/kernel/netbsd.RAMDISK.gz > netbsd.sun3
498: gzip -cd < /cdsources/sun3/binary/kernel/netbsd.RAMDISK3X.gz > netbsd.sun3x
499: tar xzvf /cdsources/sun3/binary/sets/base.tgz ./usr/mdec
500: mv usr/mdec/ufsboot .
501: mv usr/mdec/bootxx /tmp/bootxx.sun3
502: rm -rf /tmp/boot-sun3/usr
503:
504: echo /set type=file uname=root gname=wheel mode=0755 > /tmp/boot-sun3.spec
505: echo . type=dir >> /tmp/boot-sun3.spec
506: echo ufsboot mode=0644 >> /tmp/boot-sun3.spec
507: /bin/ls netbsd* vmunix >> /tmp/boot-sun3.spec
508:
509: makefs -t ffs -B be -F /tmp/boot-sun3.spec /tmp/boot-sun3.fs /tmp/boot-sun3
510:
511: installboot -m sun3 -v /tmp/boot-sun3.fs /tmp/bootxx.sun3 ufsboot</pre>
512:
513: <p>
514: The final step is to rewrite the ISO image with (a) a sun disklabel at
515: the start, (b) the original image at the end, and (c) with the right
516: offset/size values in the disklabel for the bootloader. The program
517: <code class="code">mksunbootcd</code> will perform this task. If <code class="code">mksunbootcd</code>
518: is not installed on your system, it can be installed from the
519: <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/sysutils/mksunbootcd/README.html" target="_top"><code class="filename">sysutils/mksunbootcd</code></a>
520: package. If you're creating the image on a non-NetBSD system, you
521: can try compiling <code class="code">mksunbootcd</code> on your system. The sources
522: are available at
523: <a href="ftp://ftp.NetBSD.org/pub/NetBSD/misc/mksunbootcd/" target="_top">ftp://ftp.NetBSD.org/pub/NetBSD/misc/mksunbootcd/</a>.
524: </p>
525:
526: <p>
527: To use <code class="code">mksunbootcd</code> use the following:
528: </p>
529:
530: <pre class="programlisting">mksunbootcd output.iso /tmp/boot-sun3.fs </pre>
531:
532: <p>
533: Note that <code class="code">mksunbootcd</code> is also used to make a bootable CD ROM
534: for sparc systems. It is possible to make a bootable CD ROM that will
535: boot on sparc, sun2, sun3, and sun3x by doing something like:
536: </p>
537:
538: <pre class="programlisting">mksunbootcd output.iso boot-sun4.fs boot-sun4c.fs boot-sun4m.fs boot-sun3.fs</pre>
539:
540: <p>
541: You can rearrange the ordering of the bootable filesystems in any way
542: you want; this only changes the partition numbers that the different
543: filesystems end up with, thus changing the partition number you need
544: to give to the PROM <code class="code">b</code> or <code class="code">boot</code> command to boot the
545: right filesystem for a given architecture.
546: </p>
547:
548: <p>
549: Note that <code class="code">mksunbootcd</code> rewrites the <code class="code">output.iso</code> file, so
550: don't run it multiple times.
551: </p>
552:
553: <p>
554: As a note, this step is fine to perform on a NFS mounted directory. Ie,
555: if your ISO image is on a remote machine, it can be mounted on a NetBSD
556: machine for running <code class="code">mksunbootcd</code> without requiring extreme amounts
557: of data to be transferred over the network.
558: </p>
559:
560: <h4 class="title">
561: <a name="vaximage"></a>NetBSD/vax (<a href="#platforms">top</a>)
562: </h4>
563: <p>
564: NetBSD/vax can boot from either a FFS or ISO 9660 CD ROM. This
565: section assumes you are making an ISO 9660 CD ROM. Please note that
566: this capability was not added until NetBSD-1.5
567: </p>
568:
569: <p>
570: There are 2 steps involved in making a NetBSD/vax bootable CD ROM.
571: The first is to create an ISO 9660 image of whatever you want
572: to put on the CD. This image must have the secondary boot program
573: and kernel in its root directory.
574: In addition, the primary boot program
575: will be needed for the second step. To put the boot programs and
576: kernel in the right places, do the following:
577: </p>
578:
579: <pre class="programlisting">
580: cd /cdsources/vax/binary/sets
581: tar -zxvf base.tgz ./usr/mdec/boot ./usr/mdec/xxboot
582: mv -f ./usr/mdec/boot /cdsources/boot.vax
583: mkdir /tmp/mdec.vax
584: mv -f ./usr/mdec/xxboot /tmp/mdec.vax/xxboot
585: rmdir ./usr/mdec
586:
587: cd /cdsources/vax/installation/netboot
588: cp -f install.ram.gz /cdsources/netbsd.vax.gz
589: gunzip -f /cdsources/netbsd.vax.gz</pre>
590:
591: <p>
592: Now create the ISO 9660 image.
593: </p>
594:
595: <pre class="programlisting">mkisofs -o output.iso -l -J -r -allow-leading-dots /cdsources</pre>
596:
597: <p>
598: The second step is to install NetBSD/vax disk and CD ROM bootstrap
599: software using <a href="http://netbsd.gw.com/cgi-bin/man-cgi?installboot+8+NetBSD-current">installboot(8)</a>. The
600: <a href="http://netbsd.gw.com/cgi-bin/man-cgi?installboot+8+NetBSD-current">installboot(8)</a> command is used in the following way:
601: </p>
602:
603: <pre class="programlisting">installboot -m vax -v output.iso /usr/mdec/xxboot</pre>
604:
605:
606: <h4 class="title">
607: <a name="multiimage"></a>Multiple Machine (<a href="#platforms">top</a>)
608: </h4>
609: <p>
610: NetBSD-current has infrastructure in
611: <code class="code"><a href="http://cvsweb.NetBSD.org/bsdweb.cgi/src/distrib/cdrom?rev=HEAD&content-type=text/x-cvsweb-markup" target="_top">src/distrib/cdrom</a></code>
612: to build CDs which can boot multiple machines.
613: This has been used to build a four CD set containing thirty-nine platforms,
614: with eight platforms able to boot off the CDs.
615: This technique requires <code class="code">mkisofs</code> version 1.15a34 or newer.
616: </p>
617:
618: <p>
619: Alternatively, multiple machine boot CDs can be created with the
620: following manual procedure.
621: This procedure
622: has been successfully used to create a single CD which is bootable on
623: alpha, i386, pmax, and sparc. It should be possible to also make the
624: CD bootable on macppc, vax and on sun2, sun3 and sun3x.
625: To create a CD which is bootable by multiple architectures, use the
626: following steps in this order. Please note that the order is critical.
627:
628: </p>
629: <div class="itemizedlist"><ul type="disc">
630: <li>
631: <p>
632: Make sure you have all the required files including the various
633: kernels and boot programs listed in the individual machine
634: sections.
635: </p>
636: </li>
637: <li>
638: <p>
639: Include a directory somewhere in the <code class="code">cdsources</code>
640: directory called <code class="code">mdec.pmax</code>
641: and include the pmax <code class="code">bootxx_cd9660</code> file there. For example,
642: <code class="code">/cdsources/usr/mdec.pmax/bootxx_cd9660</code>.
643: </p>
644: </li>
645: <li>
646: <p>
647: Include a directory somewhere in the <code class="code">cdsources</code>
648: directory called <code class="code">mdec.vax</code>
649: and include the vax <code class="code">xxboot</code> file there. For example,
650: <code class="code">/cdsources/usr/mdec.vax/xxboot</code>.
651: </p>
652: </li>
653: <li>
654: <p>
655: Include the macppc <code class="code">ofwboot.xcf</code> bootloader in <code class="code">/cdsources</code>.
656: </p>
657: </li>
658: <li>
659: <p>
660: Create an i386 bootable image.
661:
662: </p>
663: <pre class="programlisting">
664: sh
665: mkisofs -v -v -o output.iso -b i386/installation/floppy/boot-big.fs \
666: -c boot.catalog -l -J -r -allow-leading-dots /cdsources 2>&1 | tee /tmp/mkisofs.log
667: exit</pre>
668: <p>
669:
670: Note that the appearance of the <code class="code">-v</code> flag twice is required. If you are
671: making a bootable CD for an Open Firmware 3 macppc model, make sure to include
672: <code class="code">-hfs -part</code> in the parameters for <code class="code">mkisofs</code>.
673: </p>
674: </li>
675: <li>
676: <p>
677: Run <code class="code">mksunbootcd</code> on a NetBSD/sparc machine to install sparc
678: and sun2/sun3 bootblocks. Alternatively, install the
679: <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/sysutils/mksunbootcd/README.html" target="_top"><code class="filename">sysutils/mksunbootcd</code></a>
680: package on your favorite NetBSD machine.
681:
682: </p>
683: <pre class="programlisting">mksunbootcd output.iso boot-sun4.fs boot-sun4c.fs boot-sun4m.fs boot-sun3.fs</pre>
684: <p>
685: </p>
686: </li>
687: <li>
688: <p>
689: Run the <a href="http://netbsd.gw.com/cgi-bin/man-cgi?installboot+8+NetBSD-current">installboot(8)</a> program targeted for
690: NetBSD/pmax to install the pmax bootblocks.
691: Note that in order to coexist with other NetBSD boot blocks, the pmax
692: boot block is appended to the end of the ISO file system.
693:
694: </p>
695: <pre class="programlisting">installboot -m pmax -v -o append,sunsum output.iso /tmp/mdec.pmax/bootxx_cd9660</pre>
696: <p>
697:
698: The <code class="code">-o append,sunsum</code> option appends the first stage boot block to
699: the end of the ISO file system, and restores the checksum used when booting
700: on a sun.
701: </p>
702: </li>
703: <li>
704: <p>
705: Run the <a href="http://netbsd.gw.com/cgi-bin/man-cgi?installboot+8+NetBSD-current">installboot(8)</a> program targeted for
706: NetBSD/vax to install the vax bootblocks.
707: Note that in order to coexist with other NetBSD boot blocks, the vax
708: boot block is appended to the end of the ISO file system.
709:
710: </p>
711: <pre class="programlisting">installboot -m vax -v -o append,sunsum output.iso /tmp/mdec.vax/xxboot</pre>
712: <p>
713:
714: (See the pmax entry above for an explanation of the flags).
715: </p>
716: </li>
717: <li>
718: <p>
719: Run the <a href="http://netbsd.gw.com/cgi-bin/man-cgi?installboot+8+NetBSD-current">installboot(8)</a> program targeted for
720: NetBSD/alpha to install the alpha bootblocks.
721:
722: </p>
723: <pre class="programlisting">installboot -m alpha -v -o append,sunsum output.iso /tmp/mdec.alpha/bootxx_cd9660</pre>
724: <p>
725:
726: Note that the alpha installboot must occur after the others, because
727: currently it's the only machine dependent back-end for
728: <code class="code">installboot(8)</code> that can calculate the alpha checksum.
729: (See the pmax entry above for an explanation of the flags).
730: </p>
731: </li>
732: </ul></div>
733: <p>
734: </p>
735: <hr>
736: <h3 class="title">Examining the CD image</h3>
737: <h4 class="title">
738: <a name="netbsd_mountimage"></a>Under NetBSD (<a href="#examining-the-image">top</a>)
739: </h4>
740: <p>
741: Mount the CD image using the following:
742: </p>
743:
744: <pre class="programlisting">
745: vnconfig -c vnd0 output.iso
746: mount -t cd9660 /dev/vnd0c /mnt</pre>
747:
748: <p>
749: Please note that on i386 systems, you should use <code class="code">/dev/vnd0d</code> instead
750: of <code class="code">/dev/vnd0c</code>.
751: Now you can cd to /mnt and explore your newly created CD image.
752: To unmount the image, do the following:
753: </p>
754:
755: <pre class="programlisting">
756: umount /mnt
757: vnconfig -u vnd0</pre>
758:
759:
760: <h4 class="title">
761: <a name="linux_mountimage"></a>Under Linux (<a href="#examining-the-image">top</a>)
762: </h4>
763: <p>
764: Linux has a similar capability. To mount the CD image:
765: </p>
766:
767: <pre class="programlisting">mount -t iso9660 -o ro,loop=/dev/loop0 output.iso /mnt</pre>
768:
769: <p>
770: and to unmount the CD image:
771: </p>
772:
773: <pre class="programlisting">umount /mnt</pre>
774:
775:
776: <h4 class="title">
777: <a name="solaris_mountimage"></a>Under Solaris (<a href="#examining-the-image">top</a>)
778: </h4>
779: <p>
780: Solaris-8 and newer is reported to be able to also mount
781: the CD image. See the <code class="code">lofiadm</code> manpage on solaris
782: for more details on how to do this.
783: </p>
784:
785: <p>
786: For older versions of Solaris, you might want to try the
787: <code class="code">fbk</code> driver written by Joerg Schilling. The <code class="code">fbk</code> driver
788: is available from
789: <a href="ftp://ftp.berlios.de/pub/schily/kernel/fbk/" target="_top">ftp://ftp.berlios.de/pub/schily/kernel/fbk/</a>.
790: Please refer to the <code class="code">fbk</code> documentation for installation instructions.
791: Once the <code class="code">fbk</code> driver is installed on your system, you can mount the ISO 9660 image
792: with the following command:
793: </p>
794:
795: <pre class="programlisting">mount -F fbk -o ro,type=hsfs /dev/fbk0:output.iso /mnt</pre>
796:
797: <p>
798: and to unmount the CD image:
799: </p>
800:
801: <pre class="programlisting">umount /mnt</pre>
802:
803: <hr>
804: <h3 class="title">Burning the CD</h3>
805: <h4 class="title">
806: <a name="cdrecord"></a>Using cdrecord (U*nix) (<a href="#burning-the-cd">top</a>)
807: </h4>
808: <p>
809: The program <code class="code">cdrecord</code> may be used to burn the CD image to the
810: CD. <code class="code">cdrecord</code> is included in the
811: <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/sysutils/cdrtools/README.html" target="_top"><code class="filename">sysutils/cdrtools</code></a>
812: package.
813: </p>
814:
815: <p>
816: An example of the use of <code class="code">cdrecord</code> is the following:
817: </p>
818:
819: <pre class="programlisting">cdrecord -v speed=4 dev=/dev/cd1c output.iso</pre>
820:
821: <p>
822: You will need to substitute the correct speed for your CD writer and
823: the correct device for your system (for i386 it would be
824: <code class="code">/dev/cd1d</code>).
825: </p>
826:
827: <h4 class="title">
828: <a name="winrecord"></a>Under Windows (<a href="#burning-the-cd">top</a>)
829: </h4>
830: <p>
831: There are several programs available for Windows which will write an
832: ISO 9660 image to a CD. This section is not an endorsement for any of
833: these programs in particular, but is intended to at least mention some
834: of the alternatives.
835:
836: </p>
837: <div class="itemizedlist"><ul type="disc">
838: <li>
839: <p>
840: <a href="http://www.goldenhawk.com/cdrwin.htm" target="_top">CDRWIN</a>.
841: Commercial software that can create bootable (by i386) ISO 9660 images
842: and write them to CD.
843: </p>
844: </li>
845: <li>
846: <p>
847: <a href="http://www.goldenhawk.com/freeware.htm" target="_top">FILE2CD</a>.
848: Freeware program which can write an ISO 9660 image to CD.
849: </p>
850: </li>
851: <li>
852: <p>
853: <a href="http://www.roxio.com/en/products/ecdc/index.jhtml" target="_top">
854: Roxio Easy CD Creator</a>. Commercial software.
855: </p>
856: </li>
857: <li>
858: <p>
859: <a href="http://www.ahead.de/en/index.html" target="_top">Ahead Nero
860: Burning ROM</a>. Commercial software.
861: </p>
862: </li>
863: <li>
864: <p>
865: <a href="ftp://ftp.berlios.de/pub/cdrecord/alpha/win32/" target="_top">CDRECORD</a>.
866: Free software that can create bootable ISO 9660 images and write them to CD.
867: This does not include a graphical interface, it is command line only.
868: This depends on an ASPI driver, which is available
869: <a href="http://www.adaptec.com/worldwide/support/driverdetail.jsp?cat=%2fProduct%2fASPI-4.70&filekey=aspi_v470.exe" target="_top">here</a>.
870: For IDE drives you will need to modify your registry:
871: </p>
872:
873: <pre class="programlisting">
874: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ASPI32]
875: "ErrorControl"=dword:00000001
876: "Start"=dword:00000001
877: "Type"=dword:00000001
878: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ASPI32\Parameters]
879: "ExcludeMiniports"=""</pre>
880:
881: </li>
882: </ul></div>
883: <p>
884: </p>
885:
886: <h4 class="title">
887: <a name="macrecord"></a>Under Mac OS (<a href="#burning-the-cd">top</a>)
888: </h4>
889: <p>
890: On Mac OS X, the program <span><strong class="command">hdiutil</strong></span> may be used to burn the
891: ISO image to the CD.
892: </p>
893:
894: <p>
895: An example of the use of <span><strong class="command">hdiutil</strong></span> is the following:
896: </p>
897:
898: <pre class="programlisting">hdiutil burn output.iso -verbose -noverifyburn</pre>
899:
900: <p>
901: You may need to use additional options which are documented in the
902: hdiutil <a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/hdiutil.1.html" target="_top">documentation</a>.
903: </p>
904:
905: <p>
906: There are also several other programs available for Mac OS which will write an
907: ISO 9660 image to a CD. This section is not an endorsement for any of
908: these programs in particular, but is intended to at least mention some
909: of the alternatives.
910: </p>
911:
912: <div class="itemizedlist"><ul type="disc"><li>
913: <p>
914: <a href="http://www.roxio.com/en/products/toast/index.jhtml" target="_top">Roxio
915: Toast</a>. Commercial software.
916: </p>
917: </li></ul></div>
918: <div class="navfoot">
919: <hr>
920: <table border="0" summary="Footer navigation"><tr>
921: <td class="foothome"><span class="foothome"><a href="../."><img src="/images/NetBSD-flag.png" alt="[NetBSD flag]" border="0" width="90" height="90"></a></span></td>
922: <td class="foothome">
923: <span class="foothome"><a href="../.">Home page</a></span><br>
924: </td>
925: </tr></table>
926: <hr>
927: </div>
928: <p></p>
929: <span class="footfeed"><a href="http://www.NetBSD.org/cgi-bin/feedback.cgi">(contact us)</a></span>
930:
931:
1.2 ! dsieger 932: <span class="foottag">Generated from <em>%NetBSD: bootcd.xml,v 1.2 2007/06/09 18:11:04 dsieger Exp %</em></span><br><span class="footcopy"><a href="/Misc/disclaimer.html"><span class="copyright">Copyright © 1994-2007 The NetBSD Foundation, Inc. </span>ALL RIGHTS RESERVED.<br>NetBSD<sup>®</sup> is a registered trademark of The NetBSD
1.1 dsieger 933: Foundation, Inc.</a></span>
934: </div></body>
935: </html>
CVSweb <webmaster@jp.NetBSD.org>