创建定制 Oracle® Solaris 11.2 安装映像

退出打印视图

更新时间: 2014 年 7 月
 
 

如何分阶段构建映像

您可以使用 distro_const 命令中提供的选项停止和重新启动处于映像生成过程中各个检查点的构建进程,以便检查和调试针对要构建的映像选择的文件、软件包和脚本。

  1. 成为管理员。

    有关更多信息,请参见在 Oracle Solaris 11.2 中确保用户和进程的安全 中的使用所指定的管理权限

  2. 下载 distribution-constructor 软件包。
  3. 为映像选择清单。
  4. (u53ef选)如果需要,对清单进行定制并添加对定制脚本的引用。
  5. 查看您可以选择暂停或继续构建操作的有效检查点。
    # distro_const build -l manifest.xml

    该命令显示可以暂停或恢复构建映像的有效检查点。对于其他检查点命令选项,将该命令提供的检查点名称用作有效值。

    例如,以下命令确认对于名为 dc_livecd.xml 的清单文件有哪些检查点可用。

    # distro_const build –l /usr/share/distro_const/dc_livecd.xml
    Checkpoint        Resumable Description
    --------------    --------- -------------
    transfer-ips-install      X Transfer package contents from IPS
    set-ips-attributes        X Set post-installation IPS attributes
    pre-pkg-img-mod           X Pre-package image modification
    ba-init                   X Boot archive initialization
    ba-config                 X Boot archive configuration
    ba-arch                   X Boot archive archiving
    boot-setup                  Setup LiveCD boot menu
    pkg-img-mod                 Package image area modifications
    create-iso                  ISO image creation
    create-usb                  USB image creation
    

    注 - 在该命令输出样例中,可恢复字段中的 "X" 表示可以从该检查点重新启动构建。
  6. 构建映像,然后在指定的检查点上暂停构建映像。
    # distro_const build -p checkpoint manifest

    例如,以下命令启动构建映像,并在 ba-arch 修改映像区域之前暂停构建:

    # distro_const build –p ba-arch /usr/share/distro_const/dc_livecd.xml
  7. 从指定的检查点恢复构建映像。
    # distro_const build -r checkpoint manifest

    注 - 指定的检查点必须是上一次构建停止执行的检查点,或者是更早的检查点。以后的检查点无效。

    例如,以下命令在 ba-arch 阶段恢复构建映像。

    # distro_const build –r ba-arch /usr/share/distro_const/dc_livecd.xml

    注 - 可以在 build 命令中组合使用暂停和恢复选项。
  8. (u53ef选)构建完成后,可以查看用于报告构建过程的日志文件。

    构建输出会显示日志文件的位置。