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

File: [cvs.NetBSD.org] / htdocs / docs / bootcd.xml (download)

Revision 1.2, Sat Jun 9 18:11:04 2007 UTC (14 years, 4 months ago) by dsieger
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +5 -5 lines

fix links in docs/

<?xml version="1.0"?>
<!DOCTYPE webpage
  PUBLIC "-//NetBSD//DTD Website-based NetBSD Extension//EN"
    "http://www.NetBSD.org/XML/htdocs/lang/share/xml/website-netbsd.dtd">

<webpage id="docs-bootcd">
  <config param="desc" value="NetBSD Bootable CD ROM HOWTO"/>
  <config param="cvstag" value="$NetBSD: bootcd.xml,v 1.2 2007/06/09 18:11:04 dsieger Exp $"/>
  <config param="rcsdate" value="$Date: 2007/06/09 18:11:04 $"/>
  <head>
  <!-- Copyright (c) 2000-2006
  	The NetBSD Foundation, Inc.  ALL RIGHTS RESERVED. -->
    <title>NetBSD Bootable CD ROM HOWTO</title>
  </head>

  <sect1 id="top">
    <para>
      This document attempts to explain how to make bootable NetBSD
      CD ROMs.
    </para>
  </sect1>

  <sect1 role="toc">

    <sect2 id="overview">
      <title>Overview</title>

      <sect3 id="creating-the-image">
        <title>Creating the CD image</title>
        <para>
          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.
        </para>
        <para>
          This section assumes you have access to the program
          <code>mkisofs</code>.  If you are making the CD image on a NetBSD
          machine, you can install <code>mkisofs</code> from the
          <filename role="pkg">sysutils/cdrtools</filename>
          package.
        </para>
        <para>
          It is assumed the directory <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 <ulink
          url="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-3.0/">ftp.NetBSD.org</ulink>.  For example:
          <programlisting>
/cdsources/i386/.....
/cdsources/sparc/.....</programlisting>
        </para>
      </sect3>
    </sect2>

    <sect2 id="platforms">
      <title>Platform specific instructions</title>

      <sect3 id="alphaimage">
        <title>NetBSD/alpha</title>
        <para>
          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:
        </para>

        <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</programlisting>

        <para>
          Now create the ISO 9660 image.
        </para>
        <programlisting>mkisofs -o output.iso -l -J -R -allow-leading-dots /cdsources</programlisting>

        <para>
          The second step is to install NetBSD/alpha disk and CD ROM bootstrap
          software using &man.installboot.8;.  This is done with the
          following command:
        </para>

        <programlisting>installboot -m alpha -v output.iso /tmp/mdec.alpha/bootxx_cd9660</programlisting>

      </sect3>

      <sect3 id="i386image">
        <title>NetBSD/i386</title>
        <para>
          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>/cdsources/</code> exists on your system
          and contains all the files and the directory structure from the
          <ulink
          url="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-3.0/i386/">NetBSD-3.0/i386</ulink>
          distribution.
          The exact contents depend on what you want on your CD.  The
          important part is that
          <code>/cdsources/i386/installation/floppy/boot-big.fs</code> exists as that will
          be used as the bootable image.
        </para>
        <para>
          To create the CD image use the following command:
        </para>

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

        <para>
          This will create a file, <code>output.iso</code>, which is the CD image.
          The options are:
          <itemizedlist>
            <listitem>
              <para>
                <code>-b i386/installation/floppy/boot-big.fs</code>
                -- specifies the boot image to be used
              </para>
            </listitem>
            <listitem>
              <para>
                <code>-c boot.catalog</code>
                -- creates a boot catalog
              </para>
            </listitem>
            <listitem>
              <para>
                <code>-l</code> -- Allow long (32 character) file names
              </para>
            </listitem>
            <listitem>
              <para><code>-J</code> -- Includes Joliet extensions</para>
            </listitem>
            <listitem>
              <para><code>-R</code> -- Sets file permissions including setuid</para>
            </listitem>
            <listitem> 
              <para>
                <code>-allow-leading-dots</code> -- Allows filenames to begin with
                <quote>.</quote>, was <code>-L</code> in older versions
		of mkisofs.
              </para>
            </listitem>
            <listitem>
              <para>
                <code>/cdsources</code> -- Specifies that the directory
                <code>/cdsources</code> is the root of the CD image
              </para>
            </listitem>
          </itemizedlist>
        </para>
      </sect3>

      <sect3 id="macppcimage">
        <title>NetBSD/macppc</title>
        <para>
          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 <ulink
          url="../ports/macppc/models.html">NetBSD/macppc Model Support Page</ulink> to
          determine your system's Open Firmware version and its support status. 
        </para>

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

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

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

        <para>
          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>-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.
        </para>

        <para>
          The CD won't be bootable via the
          <quote><code>C</code></quote> 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>/usr/src/distrib/cdrom/hfsmap.lst</code>:
        </para>

        <programlisting>.chrp - 'chrp' 'tbxi'</programlisting>

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

        <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;</programlisting>

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

        <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</programlisting>

        <para>
          Once you have burnt the CD, make sure Open Firmware can find the
          bootloader on your new CD ROM (see
          <ulink url="../ports/macppc/faq.html#ofw-dir-listing">How do I get a listing (in
          Open Firmware) of the files on my disk?</ulink> 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>OFWBOOT.XCF</code> and Open Firmware 3 should
          properly see it as <code>ofwboot.xcf</code>. 
        </para>
      </sect3>

      <sect3 id="pmaximage">
        <title>NetBSD/pmax</title>
        <para>
          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 <emphasis>after</emphasis> NetBSD-1.4.x.
          If you're running NetBSD-1.4.x, you can obtain <code>boot.pmax</code>,
          <code>installboot</code>, and <code>bootxx_cd9660</code> from a -current snapshot.
          Make sure the sources are from <emphasis>after</emphasis> late November, 1999.
        </para>
        <para>
          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:
        </para>

        <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</programlisting>

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

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

        <para>
          The second step is to install NetBSD/pmax disk and CD ROM bootstrap
          software using &man.installboot.8;.  The
          &man.installboot.8; command is used in the following way:
        </para>

        <programlisting>installboot -m pmax -v output.iso /usr/mdec/bootxx_cd9660</programlisting>

      </sect3>

      <sect3 id="sgimips">
        <title>NetBSD/sgimips</title>
        <para>
          Please see <ulink
          url="http://mail-index.NetBSD.org/port-sgimips/2003/06/29/0000.html">this
          posting</ulink> to the <ulink url="../mailinglists/#port-sgimips">port-sgimips
          MailingList</ulink> for instructions on how to create a bootable CD ROM.  Note
          that these instructions have not been verified by the NetBSD developers (yet).
        </para>
      </sect3>

      <sect3 id="sparcimage">
        <title>NetBSD/sparc</title>
        <para>
          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:
        </para>

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

        <para>
          Now get a bootable floppy image.  For NetBSD-3.0/sparc, this image
          may be found at
          <ulink url="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-3.0/sparc/installation/bootfs/boot.fs.gz"/>
        </para>

        <para>
          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>mksunbootcd</code> will perform this task.  If <code>mksunbootcd</code>
          is not installed on your system, it can be installed from the
          <filename role="pkg">sysutils/mksunbootcd</filename>
          package.  If you're creating the image on a non-NetBSD system, you
          can try compiling <code>mksunbootcd</code> on your system.  The sources
          are available at
          <ulink url="ftp://ftp.NetBSD.org/pub/NetBSD/misc/mksunbootcd/"/>.
        </para>

        <para>
          To use <code>mksunbootcd</code> use the following:
        </para>

        <programlisting>mksunbootcd output.iso boot.fs boot.fs boot.fs</programlisting>

        <para>
          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:
        </para>

        <programlisting>mksunbootcd output.iso boot-sun4.fs boot-sun4c.fs boot-sun4m.fs boot-sun3.fs</programlisting>

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

        <para>
          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>mksunbootcd</code> without requiring extreme amounts
          of data to be transferred over the network.
        </para>
      </sect3>

      <sect3 id="sparc64image">
        <title>NetBSD/sparc64</title>
        <para>
          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:
        </para>

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

        <para>
          Now get a bootable floppy image.  For NetBSD-3.0/sparc64, this image
          may be found at <ulink url="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-3.0/sparc64/installation/misc/boot.fs.gz"/>.
        </para>

        <para>
          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>sunbootcd.sh</code> will perform this task.  If <code>sunbootcd.sh</code>
          is not installed on your system, it can be obtained from <ulink url="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-current/src/distrib/common/sunbootcd.sh"/>.
        </para>

        <para>
          To use <code>sunbootcd.sh</code> use the following:
        </para>

        <programlisting>sunbootcd.sh output.iso - - - - boot.fs</programlisting>

        <para>
          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.
        </para>

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

        <para>
          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>sunbootcd.sh</code> without requiring extreme amounts
          of data to be transferred over the network.
        </para>

        <para>
          Be aware that <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.
        </para>

        <programlisting>/etc/init.d/volmgt stop</programlisting>

      </sect3>

      <sect3 id="sun2image">
        <title>NetBSD/sun2</title>
        <para>
          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.
        </para>

        <para>
          <emphasis>Optional:</emphasis> When following the procedure below, it is beneficial
          to uncompress the sun2 miniroot 
          (<code>/cdsources/sun2/installation/miniroot.fs.gz</code>) and binary sets 
          (<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.
        </para>
      </sect3>

      <sect3 id="sun3image">
        <title>NetBSD/sun3</title>
        <para>
          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.
        </para>

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

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

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

        <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</programlisting>

        <para>
          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>mksunbootcd</code> will perform this task.  If <code>mksunbootcd</code>
          is not installed on your system, it can be installed from the
          <filename role="pkg">sysutils/mksunbootcd</filename>
          package.  If you're creating the image on a non-NetBSD system, you
          can try compiling <code>mksunbootcd</code> on your system.  The sources
          are available at
          <ulink url="ftp://ftp.NetBSD.org/pub/NetBSD/misc/mksunbootcd/"/>.
        </para>

        <para>
          To use <code>mksunbootcd</code> use the following:
        </para>

        <programlisting>mksunbootcd output.iso /tmp/boot-sun3.fs </programlisting>

        <para>
          Note that <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:
        </para>

        <programlisting>mksunbootcd output.iso boot-sun4.fs boot-sun4c.fs boot-sun4m.fs boot-sun3.fs</programlisting>

        <para>
          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>b</code> or <code>boot</code> command to boot the
          right filesystem for a given architecture.
        </para>

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

        <para>
          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>mksunbootcd</code> without requiring extreme amounts
          of data to be transferred over the network.
        </para>
      </sect3>

      <sect3 id="vaximage">
        <title>NetBSD/vax</title>
        <para>
          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
        </para>

        <para>
          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:
        </para>

        <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</programlisting>

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

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

        <para>
          The second step is to install NetBSD/vax disk and CD ROM bootstrap
          software using &man.installboot.8;.  The
          &man.installboot.8; command is used in the following way:
        </para>

        <programlisting>installboot -m vax -v output.iso /usr/mdec/xxboot</programlisting>

      </sect3>

      <sect3 id="multiimage">
        <title>Multiple Machine</title>
        <para>
          NetBSD-current has infrastructure in
          <code><ulink url="http://cvsweb.NetBSD.org/bsdweb.cgi/src/distrib/cdrom?rev=HEAD&amp;content-type=text/x-cvsweb-markup">src/distrib/cdrom</ulink></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>mkisofs</code> version 1.15a34 or newer.    
        </para>

        <para>
          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.

          <itemizedlist>
            <listitem>
              <para>
                Make sure you have all the required files including the various
                kernels and boot programs listed in the individual machine
                sections.
              </para>
            </listitem>

            <listitem>
              <para>
                Include a directory somewhere in the <code>cdsources</code>
                directory called <code>mdec.pmax</code>
                and include the pmax <code>bootxx_cd9660</code> file there.  For example,
                <code>/cdsources/usr/mdec.pmax/bootxx_cd9660</code>.
               </para>
             </listitem>
             <listitem>
               <para>
                  Include a directory somewhere in the <code>cdsources</code>
                  directory called <code>mdec.vax</code>
                  and include the vax <code>xxboot</code> file there.  For example,
                  <code>/cdsources/usr/mdec.vax/xxboot</code>.
               </para>
             </listitem>
             <listitem>
               <para>
                 Include the macppc <code>ofwboot.xcf</code> bootloader in <code>/cdsources</code>.
               </para>
             </listitem>
             <listitem>
               <para>
                 Create an i386 bootable image.

                 <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</programlisting>

                 Note that the appearance of the <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>-hfs -part</code> in the parameters for <code>mkisofs</code>.
               </para>
             </listitem>
             <listitem>
               <para>
                 Run <code>mksunbootcd</code> on a NetBSD/sparc machine to install sparc
                 and sun2/sun3 bootblocks.  Alternatively, install the 
                 <filename role="pkg">sysutils/mksunbootcd</filename>
                 package on your favorite NetBSD machine.

                 <programlisting>mksunbootcd output.iso boot-sun4.fs boot-sun4c.fs boot-sun4m.fs boot-sun3.fs</programlisting>
               </para>
             </listitem>
             <listitem>
               <para>
                 Run the &man.installboot.8; 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.

                 <programlisting>installboot -m pmax -v -o append,sunsum output.iso /tmp/mdec.pmax/bootxx_cd9660</programlisting>

                 The <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.
               </para>
             </listitem>
             <listitem>
               <para>
                 Run the &man.installboot.8; 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.

                 <programlisting>installboot -m vax -v -o append,sunsum output.iso /tmp/mdec.vax/xxboot</programlisting>

                 (See the pmax entry above for an explanation of the flags).
               </para>
             </listitem>
             <listitem>
               <para>
                 Run the &man.installboot.8; program targeted for
                 NetBSD/alpha to install the alpha bootblocks.

                 <programlisting>installboot -m alpha -v -o append,sunsum output.iso /tmp/mdec.alpha/bootxx_cd9660</programlisting>

                 Note that the alpha installboot must occur after the others, because
                 currently it's the only machine dependent back-end for
                 <code>installboot(8)</code> that can calculate the alpha checksum.
                 (See the pmax entry above for an explanation of the flags).
               </para>
             </listitem>
          </itemizedlist>
        </para>
      </sect3>
    </sect2>

    <sect2 id="examining-the-image">
      <title>Examining the CD image</title>
      <para>
        It is possible to mount the cd image to examine the filesystem you
        just created.
      </para>

      <sect3 id="netbsd_mountimage">
        <title>Under NetBSD</title>
        <para>
          Mount the CD image using the following:
        </para>

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

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

        <programlisting>
umount /mnt 
vnconfig -u vnd0</programlisting>

      </sect3>

      <sect3 id="linux_mountimage">
        <title>Under Linux</title>
        <para>
          Linux has a similar capability.  To mount the CD image:
        </para>

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

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

        <programlisting>umount /mnt</programlisting>

      </sect3>

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

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

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

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

        <programlisting>umount /mnt</programlisting>

      </sect3>
    </sect2>

    <sect2 id="burning-the-cd">
      <title>Burning the CD</title>

      <sect3 id="cdrecord">
        <title>Using cdrecord (U*nix)</title>
        <para>
          The program <code>cdrecord</code> may be used to burn the CD image to the
          CD. <code>cdrecord</code> is included in the
          <filename role="pkg">sysutils/cdrtools</filename>
          package.
        </para>

        <para>
          An example of the use of <code>cdrecord</code> is the following:
        </para>

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

        <para>
          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>/dev/cd1d</code>).
        </para>
      </sect3>

      <sect3 id="winrecord">
        <title>Under Windows</title>
        <para>
          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.

          <itemizedlist>
            <listitem>
              <para>
                <ulink url="http://www.goldenhawk.com/cdrwin.htm">CDRWIN</ulink>.
                Commercial software that can create bootable (by i386) ISO 9660 images
                and write them to CD.
              </para>
            </listitem>
            <listitem>
              <para>
                <ulink url="http://www.goldenhawk.com/freeware.htm">FILE2CD</ulink>.
                Freeware program which can write an ISO 9660 image to CD.
              </para>
            </listitem>
            <listitem>
              <para>
                <ulink url="http://www.roxio.com/en/products/ecdc/index.jhtml">
                Roxio Easy CD Creator</ulink>.  Commercial software.
              </para>
            </listitem>
            <listitem>
              <para>
                <ulink url="http://www.ahead.de/en/index.html">Ahead Nero
                Burning ROM</ulink>.  Commercial software.
              </para>
            </listitem>
            <listitem>
               <para>
                 <ulink url="ftp://ftp.berlios.de/pub/cdrecord/alpha/win32/">CDRECORD</ulink>.
                 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
                 <ulink url="http://www.adaptec.com/worldwide/support/driverdetail.jsp?cat=%2fProduct%2fASPI-4.70&amp;filekey=aspi_v470.exe">here</ulink>.
                 For IDE drives you will need to modify your registry:
               </para>

               <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"=""</programlisting>

            </listitem>
          </itemizedlist>
        </para>
      </sect3>

      <sect3 id="macrecord">
        <title>Under Mac OS</title>
        <para>
          On Mac OS X, the program <command>hdiutil</command> may be used to burn the
          ISO image to the CD.
        </para>

        <para>
          An example of the use of <command>hdiutil</command> is the following:
        </para>

        <screen>hdiutil burn output.iso -verbose -noverifyburn</screen>

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

        <para>
          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.
        </para>

        <itemizedlist>
          <listitem>
            <para>
              <ulink url="http://www.roxio.com/en/products/toast/index.jhtml">Roxio
              Toast</ulink>.  Commercial software.
            </para>
          </listitem>
        </itemizedlist>
      </sect3>
    </sect2>
  </sect1>
</webpage>