OpenSolaris Distribution Constructor Guide
Previous Next

Creating an Image

After you have set up the manifest file that you plan to use and customized the finalizer scripts if desired, you are ready to build an image by running the distro_const command.

The full syntax for this command is as follows:

Syntax: distro_const build [-R] [-r step] [-p step] [-l] manifest

Note - You need to run the distro_const command as root.


You can use the distro_const command to do either of the following:

  • Build an image in one step.

  • Build an image, but pause and restart the build as needed in order to examine the content of the image and debug the finalizer scripts during the build process.

Creating an Image in One Step

To run a complete build of an image without pausing, use the basic distro_const command without options as follows:

# distro_const build manifest

Replace manifest with the name of the manifest file to be used as the blueprint for your image. The build subcommand is required. When you enter this command, the distribution constructor pulls the needed packages for the image and builds the image to the specifications that you entered in the manifest file.

Using Checkpointing to Create an Image

You do not need to build an image without pausing. In fact, you may prefer to pause and restart the build process to debug your selection of files, packages, and scripts for creating an image. You can use the checkpointing options in the distro_const command to pause and restart the build process as needed.


Note - The checkpointing feature is enabled by default in a manifest file. However, checkpointing can only function when you specify ZFS dataset, or a mount point that correlates to a ZFS dataset , as your build area.

You can disable checkpointing in the manifest file by setting the checkpoint_enable parameter to false.


Use the checkpointing options that are available in the distro_const command as described in the following basic instructions.


Note - For a summary of the options that are available for the distro_const command, see distro_const Command Reference.


Creating an Image Using Checkpoint Options
  1. Before you build the image, check the valid steps at which you can choose to pause or resume the build by using the following command:
    # distro_const build [-l] manifest

    This command displays the valid steps at which you can pause or resume building an image. Use the step names provided by this command as valid values for the other checkpointing command options.


    Note - The build subcommand is required.


    For example, the following command confirms which checkpoints are available, given a manifest file named slim_cd_x86.xml.

    # distro_const build -l slim_cd_x86.xml

    After the command is run, the valid checkpointing steps are displayed as follows.

    Step           Resumable Description
    -------------- --------- -------------
    im-pop             X     Populate the image with packages
    im-mod             X     Image area modifications
    slim-im-mod             X     Slim CD image area modifications
    br-init            X     Boot root initialization
    slim-br-config     X     Slim CD boot-root configuration
    br-config          X     Boot root configuration
    br-arch            X     Boot root archiving
    slim-post-mod      X     Slim CD post-boot-root image area modifications
    grub-setup         X     Grub menu setup
    post-mod           X     Post bootroot image area modification
    gen-slim-cont      X     Generate Slim CD image content list
    iso                X     ISO image creation 

    Note - The check in the resumable field indicates that you can restart the build from this step.


  2. Use the following command to build an image, and to pause building the image at the specified step.
    # distro_const build [-p step] manifest

    Note - The build subcommand is required. The step and manifest fields are required.


    For example, the following command starts building an image and pauses the build before step im-mod modifies the image area:

    # distro_const build -p im-mod slim_cd_x86.xml
  3. Resume the build, either from the last step executed or from a specified step, by using one of the following alternatives:
    • Use the following command to resume building the image from a specified step.
      # distro_const build [-r step] manifest

      Note - The specified step must be either the step at which the previous build stopped executing, or an earlier step. A later step is not valid. The step and manifest fields are required. The build subcommand is required.


      For example, the following command resumes building the image where the im-mod modifies the image area:

      # distro_const build -r im-mod slim_cd_x86.xml
    • Use the following command to resume building the image from the last step executed.

      Note - The manifest field and the build subcommand are required.


      # distro_const build [-R] manifest

      For example, the following command resumes building the image from wherever the build had paused.

      # distro_const build -R slim_cd_x86.xml
Previous Next