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

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

Revision 1.73, Mon May 17 12:47:46 2021 UTC (5 months ago) by martin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.72: +8 -8 lines

Regen for 9.2

<!DOCTYPE html>
<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/books.html" title="Recommended reading">
<link rel="next" href="../docs/bsd/." title="Historic BSD information">
<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">
<link rel="stylesheet" href="../donations/thermo/fundraiser.css" type="text/css">
  
    <title>NetBSD Bootable CD ROM HOWTO</title>
  </head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<body class="website"><div class="webpage">
<a name="docs-bootcd"></a><div id="top"><a href="#mainContent" id="skiplink" tabindex="1">Skip to main content.</a></div>
<input id="hamburger" type="checkbox"><label class="menuicon" for="hamburger"><span></span><span></span><span></span></label><div id="navBar" role="navigation">
<div id="centralHeader"><div id="logo">
<a href="../"><img id="projectLogo" alt="" height="120" src="../images/NetBSD-smaller-tb.png"></a><a href="/"><div id="fundraiser">
<br><div id="fundraiser-amount"><div id="fundraiser-raised"></div></div>
</div></a>
</div></div>
<span class="doNotDisplay">
	  Navigation:
	</span><ul>
<li>
<a href="../">
	  Home</a><ul>
<li><a href="../changes/">
	    Recent changes</a></li>
<li><a href="//blog.NetBSD.org/">
	    NetBSD blog</a></li>
<li><a href="../gallery/presentations/">
	    Presentations</a></li>
</ul>
</li>
<li>
<a href="../about/">
	  About</a><ul>
<li><a href="../people/developers.html">
	    Developers</a></li>
<li><a href="../gallery/">
	    Gallery</a></li>
<li><a href="//wiki.NetBSD.org/ports/">
	    Ports</a></li>
<li><a href="//www.pkgsrc.org/">
	    Packages</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="//man.NetBSD.org/">
	    Manual pages</a></li>
<li><a href="//wiki.NetBSD.org/">
	    Wiki</a></li>
</ul>
</li>
<li>
<a href="../support/">
	  Support</a><ul>
<li><a href="/community/">
	    Community</a></li>
<li><a href="/mailinglists/">
	    Mailing lists</a></li>
<li><a href="../support/send-pr.html">
	    Bug reports</a></li>
<li><a href="../support/security/">
	    Security</a></li>
</ul>
</li>
<li>
<a href="../developers/">
	  Developers</a><ul>
<li><a href="http://cvsweb.NetBSD.org/">
	    CVSWeb</a></li>
<li><a href="//anonhg.NetBSD.org/">
	    Mercurial</a></li>
<li><a href="//nxr.NetBSD.org/">
	    Cross-reference</a></li>
<li><a href="//releng.NetBSD.org/">
	    Release engineering</a></li>
<li><a href="//wiki.NetBSD.org/projects/">
	    Projects list</a></li>
</ul>
</li>
</ul>
</div>
<div id="content"><div id="mainContent" class="fullWidth"><div class="rowOfBoxes">
<h1>NetBSD Bootable CD ROM HOWTO</h1>
<div class="sect1">
<div class="titlepage"></div>
    <p>
      This document attempts to explain how to make bootable NetBSD
      CD ROMs.
    </p>
  </div>
<h3 class="title"><a name="overview">Overview</a></h3>
<ul><li><a href="#creating-the-image">Creating the CD image</a></li></ul>
<h3 class="title"><a name="platforms">Platform specific instructions</a></h3>
<ul>
<li><a href="#alphaimage">NetBSD/alpha</a></li>
<li><a href="#i386image">NetBSD/i386</a></li>
<li><a href="#macppcimage">NetBSD/macppc</a></li>
<li><a href="#pmaximage">NetBSD/pmax</a></li>
<li><a href="#sgimips">NetBSD/sgimips</a></li>
<li><a href="#sparcimage">NetBSD/sparc</a></li>
<li><a href="#sparc64image">NetBSD/sparc64</a></li>
<li><a href="#sun2image">NetBSD/sun2</a></li>
<li><a href="#sun3image">NetBSD/sun3</a></li>
<li><a href="#vaximage">NetBSD/vax</a></li>
<li><a href="#multiimage">Multiple Machine</a></li>
</ul>
<h3 class="title"><a name="examining-the-image">Examining the CD image</a></h3>
<ul>
<li><a href="#netbsd_mountimage">Under NetBSD</a></li>
<li><a href="#linux_mountimage">Under Linux</a></li>
<li><a href="#solaris_mountimage">Under Solaris</a></li>
</ul>
<h3 class="title"><a name="burning-the-cd">Burning the CD</a></h3>
<ul>
<li><a href="#cdrecord">Using cdrecord (U*nix)</a></li>
<li><a href="#winrecord">Under Windows</a></li>
<li><a href="#macrecord">Under Mac OS</a></li>
</ul>
<hr>
<h3 class="title">Overview</h3>
        <h4 class="title">
<a name="creating-the-image"></a>Creating the CD image</h4>
        <p>
          The first step in making a CD ROM is to create an image of the CD.
          This image will initially be stored as a (rather large, up to 650 Mb)
          file on your hard drive and then later written to the CD.
        </p>
        <p>
          This section assumes you have access to the program
          <code class="code">mkisofs</code>.  If you are making the CD image on a NetBSD
          machine, you can install <code class="code">mkisofs</code> from the
          <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/sysutils/cdrtools/index.html" target="_top"><code class="filename">sysutils/cdrtools</code></a>
          package.
        </p>
        <p>
          It is assumed the directory <code class="code">/cdsources</code> exists on your system
          and contains all the files which you want to end up on the CD ROM.
          One suggested layout for making an install CD is to follow the
          directory structure on <a class="ulink" href="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-3.0/" target="_top">ftp.NetBSD.org</a>.  For example:
          </p>
<pre class="programlisting">
/cdsources/i386/.....
/cdsources/sparc/.....</pre>
<p>
        </p>
      <hr>
<h3 class="title">Platform specific instructions</h3>
        <h4 class="title">
<a name="alphaimage"></a>NetBSD/alpha</h4>
        <p>
          There are 2 steps involved in making a NetBSD/alpha bootable CD ROM.
          The first is to create an ISO 9660 image of whatever you want
          to put on the CD.  This image must have the secondary boot program and
          kernel in its root directory.  In addition, the primary boot program
          will be needed for the second step.  To put the boot programs and 
          kernel in the right places, do the following:
        </p>

        <pre class="programlisting">
cd /cdsources/alpha/binary/sets
tar -zxvf base.tgz ./usr/mdec/boot ./usr/mdec/bootxx_cd9660
mv -f ./usr/mdec/boot /cdsources/boot
mkdir /tmp/mdec.alpha
mv -f ./usr/mdec/bootxx_cd9660 /tmp/mdec.alpha/bootxx_cd9660
rm -rf ./usr
cd /cdsources/alpha/installation/instkernel
cp -f netbsd.gz /cdsources/netbsd.gz</pre>

        <p>
          Now create the ISO 9660 image.
        </p>
        <pre class="programlisting">mkisofs -o output.iso -l -J -R -allow-leading-dots /cdsources</pre>

        <p>
          The second step is to install NetBSD/alpha disk and CD ROM bootstrap
          software using <a href="//man.NetBSD.org/NetBSD-9.2/i386/installboot.8">installboot(8)</a>.  This is done with the
          following command:
        </p>

        <pre class="programlisting">installboot -m alpha -v output.iso /tmp/mdec.alpha/bootxx_cd9660</pre>

      
        <h4 class="title">
<a name="i386image"></a>NetBSD/i386</h4>
        <p>
          This section shows how to make a NetBSD/i386 bootable CD ROM.  The
          particular example is how to make a NetBSD-3.0/i386 install CD.  It
          is assumed that the directory <code class="code">/cdsources/</code> exists on your system
          and contains all the files and the directory structure from the
          <a class="ulink" href="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-3.0/i386/" target="_top">NetBSD-3.0/i386</a>
          distribution.
          The exact contents depend on what you want on your CD.  The
          important part is that
          <code class="code">/cdsources/i386/installation/floppy/boot-big.fs</code> exists as that will
          be used as the bootable image.
        </p>
        <p>
          To create the CD image use the following command:
        </p>

        <pre class="programlisting">
mkisofs -o output.iso -b i386/installation/floppy/boot-big.fs \ 
  -c boot.catalog -l -J -R -allow-leading-dots /cdsources</pre>

        <p>
          This will create a file, <code class="code">output.iso</code>, which is the CD image.
          The options are:
          </p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
              <p>
                <code class="code">-b i386/installation/floppy/boot-big.fs</code>
                -- specifies the boot image to be used
              </p>
            </li>
<li class="listitem">
              <p>
                <code class="code">-c boot.catalog</code>
                -- creates a boot catalog
              </p>
            </li>
<li class="listitem">
              <p>
                <code class="code">-l</code> -- Allow long (32 character) file names
              </p>
            </li>
<li class="listitem">
              <p><code class="code">-J</code> -- Includes Joliet extensions</p>
            </li>
<li class="listitem">
              <p><code class="code">-R</code> -- Sets file permissions including setuid</p>
            </li>
<li class="listitem"> 
              <p>
                <code class="code">-allow-leading-dots</code> -- Allows filenames to begin with
                <span class="quote">&#8220;<span class="quote">.</span>&#8221;</span>, was <code class="code">-L</code> in older versions
		of mkisofs.
              </p>
            </li>
<li class="listitem">
              <p>
                <code class="code">/cdsources</code> -- Specifies that the directory
                <code class="code">/cdsources</code> is the root of the CD image
              </p>
            </li>
</ul></div>
<p>
        </p>
      
        <h4 class="title">
<a name="macppcimage"></a>NetBSD/macppc</h4>
        <p>
          All supported macppc models can boot from the first session of a CD ROM.
          The procedure for making a CD bootable depends on what version of Open
          Firmware your model has. Refer to the <a class="ulink" href="../ports/macppc/models.html" target="_top">NetBSD/macppc Model Support Page</a> to
          determine your system's Open Firmware version and its support status. 
        </p>

        <p>
          It is assumed that the directory <code class="code">/cdsources/</code> exists on your
          system and contains all the files and the directory structure from the <a class="ulink" href="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-3.0/macppc/" target="_top">NetBSD-3.0/macppc</a>
          distribution.  The exact contents depend on what you want on your CD.
        </p>

        <p>
          Make sure your <code class="code">/cdsources/</code> has <code class="code">ofwboot.xcf</code> (the macppc
          bootloader) and a kernel (we suggest <code class="code">netbsd.GENERIC_MD</code>, the 
          ramdisk-based install kernel that supports all models).
        </p>

        <pre class="programlisting">
cd /cdsources
cp macppc/binary/kernel/netbsd-GENERIC_MD.gz netbsd.macppc
cp macppc/installation/ofwboot.xcf .</pre>

        <p>
          The NetBSD/macppc official ISO image is bootable on all supported models
          because it does some special magic.  The CD is created as an HFS
          hybrid CD with an Apple Disk Partition Table using the <code class="code">-hfs -part</code>
          options in mkisofs. The Partition Table is then modified to map (or point to)
          a driver file which makes the CD bootable on the PPC Macintosh and the
          driver file is appended to the end of the iso image.
        </p>

        <p>
          The CD won't be bootable via the
          <span class="quote">&#8220;<span class="quote"><code class="code">C</code></span>&#8221;</span> snag key though.  However
          this can be added with the following, although it may not
          work on all Macppc systems. (Adding the option will not
          impair the use of booting via OpenFirmware commands.)  To
          do this, create a CHRP bootscript in a top-level
          directory, tag the bootscript file with the proper Mac OS
          Type and Creator, and "bless" the directory which contains
          the file.  Mkisofs will attach the proper Mac OS Type and
          Creator codes while generating the ISO image file if the
          following line is added to the file
          <code class="code">/usr/src/distrib/cdrom/hfsmap.lst</code>:
        </p>

        <pre class="programlisting">.chrp - 'chrp' 'tbxi'</pre>

        <p>
          Then place the following file named <code class="code">bootscript</code> in the (top-level)
          <code class="code">macppc</code> directory:
        </p>

        <pre class="programlisting">
&lt;CHRP-BOOT&gt;
&lt;COMPATIBLE&gt;MacRISC&lt;/COMPATIBLE&gt;
&lt;DESCRIPTION&gt;
NetBSD/macppc bootable CD script
&lt;/DESCRIPTION&gt;
&lt;BOOT-SCRIPT&gt;
boot cd:,ofwboot.xcf netbsd.macppc
&lt;/BOOT-SCRIPT&gt;
&lt;/CHRP-BOOT&gt;</pre>

        <p>Create the macppc bootable CD image using the following commands:</p>

        <pre class="programlisting">
cdrom_util="/usr/src/distrib/cdrom"
snag_boot="-map ${cdrom_util}/hfsmap.lst -hfs-bless ./macppc"
ofw_boot="-boot-hfs-file ${cdrom_util}/macppc_installboot/macppcboot.raw"
mkisofs -o output.iso -hfs -part ${snag_boot} ${ofw_boot} -l -J -r -allow-leading-dots /cdsources
blknum=`ls -l output.iso | awk '{print $5}'`
blknum=`expr ${blknum} / 512`
${cdrom_util}/macppc_installboot/macppc_installboot output.iso ${blknum} 756
dd if=/usr/mdec/ofwboot bs=64k count=1 conv=sync &gt;&gt; output.iso</pre>

        <p>
          Once you have burnt the CD, make sure Open Firmware can find the
          bootloader on your new CD ROM (see
          <a class="ulink" href="../ports/macppc/faq.html#ofw-dir-listing" target="_top">How do I get a listing (in
          Open Firmware) of the files on my disk?</a> in the FAQ).  This is
          important, since Open Firmware treats the boot file name as case
          sensitive.  Most (if not all) Open Firmware 1.0.5, 1.1.22, and 2.0.x systems 
          will think the bootloader is <code class="code">OFWBOOT.XCF</code> and Open Firmware 3 should
          properly see it as <code class="code">ofwboot.xcf</code>. 
        </p>
      
        <h4 class="title">
<a name="pmaximage"></a>NetBSD/pmax</h4>
        <p>
          NetBSD/pmax can boot from either a FFS or ISO 9660 CD ROM.  This
          section assumes you are making an ISO 9660 CD ROM.   Please note that 
          the bootxx_cd9660 program was not added until <span class="emphasis"><em>after</em></span> NetBSD-1.4.x.
          If you're running NetBSD-1.4.x, you can obtain <code class="code">boot.pmax</code>,
          <code class="code">installboot</code>, and <code class="code">bootxx_cd9660</code> from a -current snapshot.
          Make sure the sources are from <span class="emphasis"><em>after</em></span> late November, 1999.
        </p>
        <p>
          There are 2 steps involved in making a NetBSD/pmax bootable CD ROM.
          The first is to create an ISO 9660 image of whatever you want
          to put on the CD.  This image must have the secondary boot program
          and kernel in its root directory.
          In addition, the primary boot program 
          will be needed for the second step.  To put the boot programs and 
          kernel in the right places, do the following:
        </p>

        <pre class="programlisting">
cd /cdsources/pmax/binary/sets
tar -zxvf base.tgz ./usr/mdec/boot.pmax ./usr/mdec/bootxx_cd9660
mv -f ./usr/mdec/boot.pmax /cdsources/boot.pmax
mkdir /tmp/mdec.pmax
mv -f ./usr/mdec/bootxx_cd9660 /tmp/mdec.pmax/bootxx_cd9660
rmdir ./usr/mdec

cd /cdsources/pmax/binary/kernel
cp -f install.gz /cdsources/netbsd.pmax.gz
gunzip /cdsources/netbsd.pmax.gz</pre>

        <p>
          Now create the ISO 9660 image.
        </p>

        <pre class="programlisting">mkisofs -o output.iso -l -J -r -allow-leading-dots /cdsources</pre>

        <p>
          The second step is to install NetBSD/pmax disk and CD ROM bootstrap
          software using <a href="//man.NetBSD.org/NetBSD-9.2/i386/installboot.8">installboot(8)</a>.  The
          <a href="//man.NetBSD.org/NetBSD-9.2/i386/installboot.8">installboot(8)</a> command is used in the following way:
        </p>

        <pre class="programlisting">installboot -m pmax -v output.iso /usr/mdec/bootxx_cd9660</pre>

      
        <h4 class="title">
<a name="sgimips"></a>NetBSD/sgimips</h4>
        <p>
          Please see <a class="ulink" href="http://mail-index.NetBSD.org/port-sgimips/2003/06/29/0000.html" target="_top">this
          posting</a> to the <a class="ulink" href="../mailinglists/#port-sgimips" target="_top">port-sgimips
          MailingList</a> for instructions on how to create a bootable CD ROM.  Note
          that these instructions have not been verified by the NetBSD developers (yet).
        </p>
      
        <h4 class="title">
<a name="sparcimage"></a>NetBSD/sparc</h4>
        <p>
          There are three steps involved in making a NetBSD/sparc bootable CD ROM.
          Step 1 is to create an "almost" full ISO 9660 image of whatever you want
          to put on the CD.  For example:
        </p>

        <pre class="programlisting">mkisofs -o output.iso -l -J -r -allow-leading-dots /cdsources</pre>

        <p>
          Now get a bootable floppy image.  For NetBSD-3.0/sparc, this image
          may be found at
          <a class="ulink" 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>
        </p>

        <p>
          The final step is to rewrite the ISO image with (a) a sun disklabel at
          the start, (b) the original image at the end, and (c) with the right
          offset/size values in the disklabel for the bootloader.  The program
          <code class="code">mksunbootcd</code> will perform this task.  If <code class="code">mksunbootcd</code>
          is not installed on your system, it can be installed from the
          <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/sysutils/mksunbootcd/index.html" target="_top"><code class="filename">sysutils/mksunbootcd</code></a>
          package.  If you're creating the image on a non-NetBSD system, you
          can try compiling <code class="code">mksunbootcd</code> on your system.  The sources
          are available at
          <a class="ulink" href="ftp://ftp.NetBSD.org/pub/NetBSD/misc/mksunbootcd/" target="_top">ftp://ftp.NetBSD.org/pub/NetBSD/misc/mksunbootcd/</a>.
        </p>

        <p>
          To use <code class="code">mksunbootcd</code> use the following:
        </p>

        <pre class="programlisting">mksunbootcd output.iso boot.fs boot.fs boot.fs</pre>

        <p>
          The bootable image is listed three times corresponding to what will get
          booted by a sun4, sun4c and sun4m system respectively.  If you have
          different bootable images for the three machines, or if you also have
          a bootable image for sun2, sun3, and sun3x systems, you can do something
          like:
        </p>

        <pre class="programlisting">mksunbootcd output.iso boot-sun4.fs boot-sun4c.fs boot-sun4m.fs boot-sun3.fs</pre>

        <p>
          Note that <code class="code">mksunbootcd</code> rewrites the <code class="code">output.iso</code> file, so
          don't run it multiple times.
        </p>

        <p>
          As a note, this step is fine to perform on a NFS mounted directory.  Ie, 
          if your ISO image is on a remote machine, it can be mounted on a NetBSD
          machine for running <code class="code">mksunbootcd</code> without requiring extreme amounts
          of data to be transferred over the network.
        </p>
      
        <h4 class="title">
<a name="sparc64image"></a>NetBSD/sparc64</h4>
        <p>
          There are three steps involved in making a NetBSD/sparc64 bootable CD ROM.
          Step 1 is to create an "almost" full ISO 9660 image of whatever you want to
          put on the CD.  For example:
        </p>

        <pre class="programlisting">mkisofs -o output.iso -l -J -r -allow-leading-dots /cdsources</pre>

        <p>
          Now get a bootable floppy image.  For NetBSD-3.0/sparc64, this image
          may be found at <a class="ulink" 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>.
        </p>

        <p>
          The final step is to rewrite the ISO image with (a) a sun disklabel at
          the start, (b) the original image at the end, and (c) with the right
          offset/size values in the disklabel for the bootloader.  The program
          <code class="code">sunbootcd.sh</code> will perform this task.  If <code class="code">sunbootcd.sh</code>
          is not installed on your system, it can be obtained from <a class="ulink" 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>.
        </p>

        <p>
          To use <code class="code">sunbootcd.sh</code> use the following:
        </p>

        <pre class="programlisting">sunbootcd.sh output.iso - - - - boot.fs</pre>

        <p>
          The arguments are for bootable images for sun4, sun4c, sun4m, sun4d, and
          sun4u.  Specifying a dash instead of a boot image means the CD will not be
          bootable for that platform.  In the above example the only platform given
          a boot image is sun4u.
        </p>

        <p>
          Note that <code class="code">sunbootcd.sh</code> rewrites the <code class="code">output.iso</code> file, so
          don't run it multiple times.
        </p>

        <p>
          As a note, this step is fine to perform on a NFS mounted directory.  Ie, 
          if your ISO image is on a remote machine, it can be mounted on a NetBSD
          machine for running <code class="code">sunbootcd.sh</code> without requiring extreme amounts
          of data to be transferred over the network.
        </p>

        <p>
          Be aware that <code class="code">sunbootcd.sh</code> will produce a CD that is not
          recognized by vold under Solaris 10.  If you want to mount the NetBSD
          install CD under Solaris, you will first need to stop vold.
        </p>

        <pre class="programlisting">/etc/init.d/volmgt stop</pre>

      
        <h4 class="title">
<a name="sun2image"></a>NetBSD/sun2</h4>
        <p>
          To make a NetBSD/sun2 bootable CD ROM, follow the procedure below for 
          making a NetBSD/sun3 bootable CD ROM.  This procedure makes a single 
          CD ROM that will boot on both sun2 and sun3 systems.
        </p>

        <p>
          <span class="emphasis"><em>Optional:</em></span> When following the procedure below, it is beneficial
          to uncompress the sun2 miniroot 
          (<code class="code">/cdsources/sun2/installation/miniroot.fs.gz</code>) and binary sets 
          (<code class="code">/cdsources/sun2/binary/sets/*.tgz</code>) 
          before writing the ISO 9660 image.  This is entirely optional, and consumes
          a lot of space on the ISO 9660 image, but saves time during installation 
          because decompression is very slow on the sun2.
        </p>
      
        <h4 class="title">
<a name="sun3image"></a>NetBSD/sun3</h4>
        <p>
          There are three steps involved in making a NetBSD/sun3 bootable CD ROM, and
          this will result in a CD ROM that can also boot NetBSD/sun2.
        </p>

        <p>
          Step 1 is to create an "almost" full ISO 9660 image of whatever you want
          to put on the CD.  For example:
        </p>

        <pre class="programlisting">mkisofs -o output.iso -l -J -r -allow-leading-dots /cdsources</pre>

        <p>
          Now build a bootable ffs image.  This image is currently not included in
          the release, so you have to put it together yourself.
        </p>

        <pre class="programlisting">
mkdir /tmp/boot-sun3
cd /tmp/boot-sun3
gzip -cd &lt; /cdsources/sun2/binary/kernel/netbsd.RAMDISK.gz &gt; netbsd.sun2
ln netbsd.sun2 vmunix
gzip -cd &lt; /cdsources/sun3/binary/kernel/netbsd.RAMDISK.gz &gt; netbsd.sun3
gzip -cd &lt; /cdsources/sun3/binary/kernel/netbsd.RAMDISK3X.gz &gt; netbsd.sun3x
tar xzvf /cdsources/sun3/binary/sets/base.tgz ./usr/mdec
mv usr/mdec/ufsboot .
mv usr/mdec/bootxx /tmp/bootxx.sun3
rm -rf /tmp/boot-sun3/usr

echo /set type=file uname=root gname=wheel mode=0755 &gt; /tmp/boot-sun3.spec
echo . type=dir &gt;&gt; /tmp/boot-sun3.spec
echo ufsboot mode=0644 &gt;&gt; /tmp/boot-sun3.spec
/bin/ls netbsd* vmunix &gt;&gt; /tmp/boot-sun3.spec

makefs -t ffs -B be -F /tmp/boot-sun3.spec /tmp/boot-sun3.fs /tmp/boot-sun3

installboot -m sun3 -v /tmp/boot-sun3.fs /tmp/bootxx.sun3 ufsboot</pre>

        <p>
          The final step is to rewrite the ISO image with (a) a sun disklabel at
          the start, (b) the original image at the end, and (c) with the right
          offset/size values in the disklabel for the bootloader.  The program
          <code class="code">mksunbootcd</code> will perform this task.  If <code class="code">mksunbootcd</code>
          is not installed on your system, it can be installed from the
          <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/sysutils/mksunbootcd/index.html" target="_top"><code class="filename">sysutils/mksunbootcd</code></a>
          package.  If you're creating the image on a non-NetBSD system, you
          can try compiling <code class="code">mksunbootcd</code> on your system.  The sources
          are available at
          <a class="ulink" href="ftp://ftp.NetBSD.org/pub/NetBSD/misc/mksunbootcd/" target="_top">ftp://ftp.NetBSD.org/pub/NetBSD/misc/mksunbootcd/</a>.
        </p>

        <p>
          To use <code class="code">mksunbootcd</code> use the following:
        </p>

        <pre class="programlisting">mksunbootcd output.iso /tmp/boot-sun3.fs </pre>

        <p>
          Note that <code class="code">mksunbootcd</code> is also used to make a bootable CD ROM
          for sparc systems.  It is possible to make a bootable CD ROM that will
          boot on sparc, sun2, sun3, and sun3x by doing something like:
        </p>

        <pre class="programlisting">mksunbootcd output.iso boot-sun4.fs boot-sun4c.fs boot-sun4m.fs boot-sun3.fs</pre>

        <p>
          You can rearrange the ordering of the bootable filesystems in any way
          you want; this only changes the partition numbers that the different
          filesystems end up with, thus changing the partition number you need
          to give to the PROM <code class="code">b</code> or <code class="code">boot</code> command to boot the
          right filesystem for a given architecture.
        </p>

        <p>
          Note that <code class="code">mksunbootcd</code> rewrites the <code class="code">output.iso</code> file, so
          don't run it multiple times.
        </p>

        <p>
          As a note, this step is fine to perform on a NFS mounted directory.  Ie, 
          if your ISO image is on a remote machine, it can be mounted on a NetBSD
          machine for running <code class="code">mksunbootcd</code> without requiring extreme amounts
          of data to be transferred over the network.
        </p>
      
        <h4 class="title">
<a name="vaximage"></a>NetBSD/vax</h4>
        <p>
          NetBSD/vax can boot from either a FFS or ISO 9660 CD ROM.  This
          section assumes you are making an ISO 9660 CD ROM.   Please note that
          this capability was not added until NetBSD-1.5
        </p>

        <p>
          There are 2 steps involved in making a NetBSD/vax bootable CD ROM.
          The first is to create an ISO 9660 image of whatever you want
          to put on the CD.  This image must have the secondary boot program
          and kernel in its root directory.
          In addition, the primary boot program
          will be needed for the second step.  To put the boot programs and
          kernel in the right places, do the following:
        </p>

        <pre class="programlisting">
cd /cdsources/vax/binary/sets
tar -zxvf base.tgz ./usr/mdec/boot ./usr/mdec/xxboot
mv -f ./usr/mdec/boot /cdsources/boot.vax
mkdir /tmp/mdec.vax
mv -f ./usr/mdec/xxboot /tmp/mdec.vax/xxboot
rmdir ./usr/mdec

cd /cdsources/vax/installation/netboot
cp -f install.ram.gz /cdsources/netbsd.vax.gz
gunzip -f /cdsources/netbsd.vax.gz</pre>

        <p>
          Now create the ISO 9660 image.
        </p>

        <pre class="programlisting">mkisofs -o output.iso -l -J -r -allow-leading-dots /cdsources</pre>

        <p>
          The second step is to install NetBSD/vax disk and CD ROM bootstrap
          software using <a href="//man.NetBSD.org/NetBSD-9.2/i386/installboot.8">installboot(8)</a>.  The
          <a href="//man.NetBSD.org/NetBSD-9.2/i386/installboot.8">installboot(8)</a> command is used in the following way:
        </p>

        <pre class="programlisting">installboot -m vax -v output.iso /usr/mdec/xxboot</pre>

      
        <h4 class="title">
<a name="multiimage"></a>Multiple Machine</h4>
        <p>
          NetBSD-current has infrastructure in
          <code class="code"><a class="ulink" href="http://cvsweb.NetBSD.org/bsdweb.cgi/src/distrib/cdrom?rev=HEAD&amp;content-type=text/x-cvsweb-markup" target="_top">src/distrib/cdrom</a></code>
          to build CDs which can boot multiple machines.
          This has been used to build a four CD set containing thirty-nine platforms,
          with eight platforms able to boot off the CDs.
          This technique requires <code class="code">mkisofs</code> version 1.15a34 or newer.    
        </p>

        <p>
          Alternatively, multiple machine boot CDs can be created with the
          following manual procedure.
          This procedure
          has been successfully used to create a single CD which is bootable on
          alpha, i386, pmax, and sparc.  It should be possible to also make the
          CD bootable on macppc, vax and on sun2, sun3 and sun3x.
          To create a CD which is bootable by multiple architectures, use the
          following steps in this order.  Please note that the order is critical.

          </p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
              <p>
                Make sure you have all the required files including the various
                kernels and boot programs listed in the individual machine
                sections.
              </p>
            </li>
<li class="listitem">
              <p>
                Include a directory somewhere in the <code class="code">cdsources</code>
                directory called <code class="code">mdec.pmax</code>
                and include the pmax <code class="code">bootxx_cd9660</code> file there.  For example,
                <code class="code">/cdsources/usr/mdec.pmax/bootxx_cd9660</code>.
               </p>
             </li>
<li class="listitem">
               <p>
                  Include a directory somewhere in the <code class="code">cdsources</code>
                  directory called <code class="code">mdec.vax</code>
                  and include the vax <code class="code">xxboot</code> file there.  For example,
                  <code class="code">/cdsources/usr/mdec.vax/xxboot</code>.
               </p>
             </li>
<li class="listitem">
               <p>
                 Include the macppc <code class="code">ofwboot.xcf</code> bootloader in <code class="code">/cdsources</code>.
               </p>
             </li>
<li class="listitem">
               <p>
                 Create an i386 bootable image.

                 </p>
<pre class="programlisting">
sh
mkisofs -v -v -o output.iso -b i386/installation/floppy/boot-big.fs \ 
  -c boot.catalog -l -J -r -allow-leading-dots /cdsources 2&gt;&amp;1 | tee /tmp/mkisofs.log
exit</pre>
<p>

                 Note that the appearance of the <code class="code">-v</code> flag twice is required.  If you are
                 making a bootable CD for an Open Firmware 3 macppc model, make sure to include
                 <code class="code">-hfs -part</code> in the parameters for <code class="code">mkisofs</code>.
               </p>
             </li>
<li class="listitem">
               <p>
                 Run <code class="code">mksunbootcd</code> on a NetBSD/sparc machine to install sparc
                 and sun2/sun3 bootblocks.  Alternatively, install the 
                 <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/sysutils/mksunbootcd/index.html" target="_top"><code class="filename">sysutils/mksunbootcd</code></a>
                 package on your favorite NetBSD machine.

                 </p>
<pre class="programlisting">mksunbootcd output.iso boot-sun4.fs boot-sun4c.fs boot-sun4m.fs boot-sun3.fs</pre>
<p>
               </p>
             </li>
<li class="listitem">
               <p>
                 Run the <a href="//man.NetBSD.org/NetBSD-9.2/i386/installboot.8">installboot(8)</a> program targeted for
                 NetBSD/pmax to install the pmax bootblocks.
                 Note that in order to coexist with other NetBSD boot blocks, the pmax
                 boot block is appended to the end of the ISO file system.

                 </p>
<pre class="programlisting">installboot -m pmax -v -o append,sunsum output.iso /tmp/mdec.pmax/bootxx_cd9660</pre>
<p>

                 The <code class="code">-o append,sunsum</code> option appends the first stage boot block to
                 the end of the ISO file system, and restores the checksum used when booting
                 on a sun.
               </p>
             </li>
<li class="listitem">
               <p>
                 Run the <a href="//man.NetBSD.org/NetBSD-9.2/i386/installboot.8">installboot(8)</a> program targeted for
                 NetBSD/vax to install the vax bootblocks.
                 Note that in order to coexist with other NetBSD boot blocks, the vax
                 boot block is appended to the end of the ISO file system.

                 </p>
<pre class="programlisting">installboot -m vax -v -o append,sunsum output.iso /tmp/mdec.vax/xxboot</pre>
<p>

                 (See the pmax entry above for an explanation of the flags).
               </p>
             </li>
<li class="listitem">
               <p>
                 Run the <a href="//man.NetBSD.org/NetBSD-9.2/i386/installboot.8">installboot(8)</a> program targeted for
                 NetBSD/alpha to install the alpha bootblocks.

                 </p>
<pre class="programlisting">installboot -m alpha -v -o append,sunsum output.iso /tmp/mdec.alpha/bootxx_cd9660</pre>
<p>

                 Note that the alpha installboot must occur after the others, because
                 currently it's the only machine dependent back-end for
                 <code class="code">installboot(8)</code> that can calculate the alpha checksum.
                 (See the pmax entry above for an explanation of the flags).
               </p>
             </li>
</ul></div>
<p>
        </p>
      <hr>
<h3 class="title">Examining the CD image</h3>
<p>
        It is possible to mount the cd image to examine the filesystem you
        just created.
      </p>
        <h4 class="title">
<a name="netbsd_mountimage"></a>Under NetBSD</h4>
        <p>
          Mount the CD image using the following:
        </p>

        <pre class="programlisting">
vnconfig -c vnd0 output.iso
mount -t cd9660 /dev/vnd0c /mnt</pre>

        <p>
          Please note that on i386 systems, you should use <code class="code">/dev/vnd0d</code> instead
          of <code class="code">/dev/vnd0c</code>.
          Now you can cd to /mnt and explore your newly created CD image.
          To unmount the image, do the following:
        </p>

        <pre class="programlisting">
umount /mnt 
vnconfig -u vnd0</pre>

      
        <h4 class="title">
<a name="linux_mountimage"></a>Under Linux</h4>
        <p>
          Linux has a similar capability.  To mount the CD image:
        </p>

        <pre class="programlisting">mount -t iso9660 -o ro,loop=/dev/loop0 output.iso /mnt</pre>

        <p>
          and to unmount the CD image:
        </p>

        <pre class="programlisting">umount /mnt</pre>

      
        <h4 class="title">
<a name="solaris_mountimage"></a>Under Solaris</h4>
        <p>
          Solaris-8 and newer is reported to be able to also mount
          the CD image.  See the <code class="code">lofiadm</code> manpage on solaris
          for more details on how to do this. 
        </p>

        <p>
          For older versions of Solaris, you might want to try the
          <code class="code">fbk</code> driver written by Joerg Schilling.  The <code class="code">fbk</code> driver
          is available from
          <a class="ulink" href="ftp://ftp.berlios.de/pub/schily/kernel/fbk/" target="_top">ftp://ftp.berlios.de/pub/schily/kernel/fbk/</a>.
          Please refer to the <code class="code">fbk</code> documentation for installation instructions.
          Once the <code class="code">fbk</code> driver is installed on your system, you can mount the ISO 9660 image
          with the following command:
        </p>

        <pre class="programlisting">mount -F fbk -o ro,type=hsfs /dev/fbk0:output.iso  /mnt</pre>

        <p>
          and to unmount the CD image:
        </p>

        <pre class="programlisting">umount /mnt</pre>

      <hr>
<h3 class="title">Burning the CD</h3>
        <h4 class="title">
<a name="cdrecord"></a>Using cdrecord (U*nix)</h4>
        <p>
          The program <code class="code">cdrecord</code> may be used to burn the CD image to the
          CD. <code class="code">cdrecord</code> is included in the
          <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/sysutils/cdrtools/index.html" target="_top"><code class="filename">sysutils/cdrtools</code></a>
          package.
        </p>

        <p>
          An example of the use of <code class="code">cdrecord</code> is the following:
        </p>

        <pre class="programlisting">cdrecord -v speed=4 dev=/dev/cd1c output.iso</pre>

        <p>
          You will need to substitute the correct speed for your CD writer and
          the correct device for your system (for i386 it would be
          <code class="code">/dev/cd1d</code>).
        </p>
      
        <h4 class="title">
<a name="winrecord"></a>Under Windows</h4>
        <p>
          There are several programs available for Windows which will write an
          ISO 9660 image to a CD.  This section is not an endorsement for any of
          these programs in particular, but is intended to at least mention some
          of the alternatives.

          </p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
              <p>
                <a class="ulink" href="http://www.goldenhawk.com/cdrwin.htm" target="_top">CDRWIN</a>.
                Commercial software that can create bootable (by i386) ISO 9660 images
                and write them to CD.
              </p>
            </li>
<li class="listitem">
              <p>
                <a class="ulink" href="http://www.goldenhawk.com/freeware.htm" target="_top">FILE2CD</a>.
                Freeware program which can write an ISO 9660 image to CD.
              </p>
            </li>
<li class="listitem">
              <p>
                <a class="ulink" href="http://www.roxio.com/en/products/ecdc/index.jhtml" target="_top">
                Roxio Easy CD Creator</a>.  Commercial software.
              </p>
            </li>
<li class="listitem">
              <p>
                <a class="ulink" href="http://www.ahead.de/en/index.html" target="_top">Ahead Nero
                Burning ROM</a>.  Commercial software.
              </p>
            </li>
<li class="listitem">
               <p>
                 <a class="ulink" href="ftp://ftp.berlios.de/pub/cdrecord/alpha/win32/" target="_top">CDRECORD</a>.
                 Free software that can create bootable ISO 9660 images and write them to CD.
                 This does not include a graphical interface, it is command line only.
                 This depends on an ASPI driver, which is available
                 <a class="ulink" href="http://www.adaptec.com/worldwide/support/driverdetail.jsp?cat=%2fProduct%2fASPI-4.70&amp;filekey=aspi_v470.exe" target="_top">here</a>.
                 For IDE drives you will need to modify your registry:
               </p>

               <pre class="programlisting">
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ASPI32]  
"ErrorControl"=dword:00000001  
"Start"=dword:00000001  
"Type"=dword:00000001  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ASPI32\Parameters]  
"ExcludeMiniports"=""</pre>

            </li>
</ul></div>
<p>
        </p>
      
        <h4 class="title">
<a name="macrecord"></a>Under Mac OS</h4>
        <p>
          On Mac OS X, the program <span class="command"><strong>hdiutil</strong></span> may be used to burn the
          ISO image to the CD.
        </p>

        <p>
          An example of the use of <span class="command"><strong>hdiutil</strong></span> is the following:
        </p>

        <pre class="programlisting">hdiutil burn output.iso -verbose -noverifyburn</pre>

        <p>
          You may need to use additional options which are documented in the
          hdiutil <a class="ulink" href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/hdiutil.1.html" target="_top">documentation</a>.
        </p>

        <p>
          There are also several other programs available for Mac OS which will write an
          ISO 9660 image to a CD.  This section is not an endorsement for any of
          these programs in particular, but is intended to at least mention some
          of the alternatives.
        </p>

        <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
            <p>
              <a class="ulink" href="http://www.roxio.com/en/products/toast/index.jhtml" target="_top">Roxio
              Toast</a>.  Commercial software.
            </p>
          </li></ul></div>
      </div></div></div>
<div class="navfoot"></div>
<div id="footer"><div id="footerContent"><center>
<span class="footfeed"><a href="//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-2021 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>