<chapter id="flashcreate-1"><title>Creating Solaris Flash Archives
(Tasks)</title><highlights><para>This chapter provides the procedures for creating a Solaris Flash archive.
These procedures include installing a master system and then creating a Solaris Flash archive
from that master system. You can also create a differential archive if you
have previously installed an archive on a clone system. When the differential
archive is created, two images are compared: the unchanged master image and
an updated image. The differential archive installs only the differences between
the two images. Also, procedures to create scripts are provided to reconfigure
or otherwise customize the archive.</para><itemizedlist><listitem><para><olink targetptr="flashcreate-2" remap="internal">Task Map: Creating Solaris
Flash Archives</olink></para>
</listitem><listitem><para><olink targetptr="flashcreate-3" remap="internal">Installing the Master System</olink></para>
</listitem><listitem><para><olink targetptr="flashcreate-65" remap="internal">Creating Customization Scripts</olink></para>
</listitem><listitem><para><olink targetptr="flashcreate-66" remap="internal">Creating a Solaris Flash
Archive</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="flashcreate-2"><title>Task Map: Creating Solaris Flash Archives</title><table frame="all" pgwide="1" id="flash-tbl-36"><title>Task Map: Creating
a Solaris Flash Archive to Install With an Initial Installation</title><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec0" colwidth="33*"/><colspec colname="colspec1" colwidth="33*"/><colspec colname="colspec2" colwidth="33*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Install your chosen software configuration on the master system</para>
</entry><entry><para>Determine the configuration that meets your needs and use any of the
Solaris installation methods to install the master system.</para>
</entry><entry><para><olink targetptr="flash-37" remap="internal">To Install the Master System for an Initial
Installation</olink></para>
</entry>
</row><row><entry><para>(Optional) Create customization scripts</para>
</entry><entry><para>Determine if you need to create scripts to do the following:</para><itemizedlist><listitem><para>Customize or reconfigure the archive </para>
</listitem><listitem><para>Protect local changes on  clone systems</para>
</listitem>
</itemizedlist>
</entry><entry><para><olink targetptr="flashcreate-65" remap="internal">Creating Customization Scripts</olink></para>
</entry>
</row><row><entry><para>Create the Solaris Flash archive</para>
</entry><entry><para>Use the <command>flarcreate</command> command to create an archive.</para>
</entry><entry><para><olink targetptr="flash-42" remap="internal">To Create a Solaris Flash Archive for an
Initial Installation</olink></para>
</entry>
</row><row><entry><para>(Optional) Save a copy of the archive</para>
</entry><entry><para>Keep a copy of the archive for future comparison to update a clone system
with a differential archive.</para>
</entry><entry><para><olink targetptr="flash-42" remap="internal">To Create a Solaris Flash Archive for an
Initial Installation</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</table><table frame="all" pgwide="1" id="flash-tbl-360"><title>Task Map: Creating
a Solaris Flash Archive to Update a Clone System</title><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec0" colwidth="33*"/><colspec colname="colspec1" colwidth="33*"/><colspec colname="colspec2" colwidth="33*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Prepare master image</para>
</entry><entry><para>Make changes to the unchanged master image such as adding or deleting
packages or installing patches.</para>
</entry><entry><para><olink targetptr="flashcreate-3" remap="internal">Installing the Master System</olink></para>
</entry>
</row><row><entry><para>(Optional) Create customization scripts</para>
</entry><entry><para>Determine if you need to create scripts to do the following:</para><itemizedlist><listitem><para>Customize or reconfigure the archive </para>
</listitem><listitem><para>Protect local changes on  clone systems</para>
</listitem>
</itemizedlist>
</entry><entry><para><olink targetptr="flashcreate-65" remap="internal">Creating Customization Scripts</olink></para>
</entry>
</row><row><entry><para>Create the Solaris Flash differential archive</para>
</entry><entry><orderedlist><listitem><para>Mount the unchanged master image.</para>
</listitem><listitem><para>Use the <command>flarcreate</command> command to compare the
two images  and create the differential archive.</para>
</listitem>
</orderedlist>
</entry><entry><para><olink targetptr="flash-420" remap="internal">To Create a Solaris Flash Differential
Archive With an Updated Master Image</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect1><sect1 id="flashcreate-3"><title>Installing the Master System</title><para>You
install the master system with the software configuration that you want other
systems to have. You can install clone systems with an initial installation
that overwrites all files on the system or with an update that only includes
the differences between two images.  For an initial installation, use any
of the Solaris installation methods to install the Solaris OS on the master
system. </para><para>If you have previously installed an archive on a clone system, you can
update that system with changes by using a differential archive.  The changes
are made to the original image such as installing patches, or adding and removing
packages. The differential archive overwrites only the files specified in
the archive. For the procedure that is for updating the original master image
and creating a differential archive, see <olink targetptr="flash-420" remap="internal">To Create
a Solaris Flash Differential Archive With an Updated Master Image</olink>.</para><task id="flash-37"><title>To Install the Master System for an Initial Installation</title><procedure><step id="flash-step-39"><para>Identify the system configuration that you
want to install.</para>
</step><step id="flash-step-40"><para>With the use of the Solaris installation programs,
install the Solaris OS on the master system. For a discussion of the different
installation program , refer to <olink targetdoc="solinstallpbiu" targetptr="planning-222" remap="external"><citetitle remap="section">Choosing a Solaris Installation Method</citetitle> in <citetitle remap="book">Solaris Express Installation Guide: Planning for Installation and Upgrade</citetitle></olink>.</para>
</step><step id="flash-step-41"><para>Customize your Solaris installation in any
of the following ways:</para><itemizedlist><listitem><para>Delete software.</para>
</listitem><listitem><para>Add software.</para>
</listitem><listitem><para>Modify configuration files. </para>
</listitem><listitem><para>Add support for peripheral devices on the clone system.</para>
</listitem>
</itemizedlist><para>You can create custom scripts or use the <command>flarcreate</command> command
to create the archive.</para><itemizedlist><listitem><para>To create custom scripts, see <olink targetptr="flashcreate-65" remap="internal">Creating
Customization Scripts</olink>.</para>
</listitem><listitem><para>To create the archive, see <olink targetptr="flashcreate-66" remap="internal">Creating
a Solaris Flash Archive</olink>.</para>
</listitem>
</itemizedlist>
</step>
</procedure>
</task>
</sect1><sect1 id="flashcreate-65"><title>Creating Customization Scripts</title><para>Scripts can customize
the archive. Use these scripts for the following purposes:</para><itemizedlist><listitem><para>A precreation script validates the archive at creation time
and prepares the archive for later customization, especially differential
archives. This script also can create a user-defined section in the archive.</para>
</listitem><listitem><para>A predeployment script validates the archive during installation
and prepares the archive for later customization.</para>
</listitem><listitem><para>A postdeployment script reconfigures a new system image on
a clone system.</para>
</listitem><listitem><para>A reboot script processes a final reconfiguration after the
system is rebooted.</para>
</listitem>
</itemizedlist><para>For guidelines about creating scripts, see <olink targetptr="flashoverview-48" remap="internal">Guidelines for Creating a Custom Script</olink>.</para><task id="flashcreate-55"><title>To Create a Precreation Script</title><tasksummary><para>This script runs during archive creation. The script has various uses.</para><itemizedlist><listitem><para>Validates the contents and the integrity of the software.
The script fails the archive creation if the integrity is broken. </para>
</listitem><listitem><para>Prepares products for later customization on clone system. </para>
</listitem><listitem><para>Registers other installation scripts dynamically during archive
creation. </para>
</listitem><listitem><para>Adds a message to the flash-creation summary file. The message
must be short and record only that scripts were started and finished and the
results. You can view the results in the summary section.</para>
</listitem>
</itemizedlist>
</tasksummary><procedure><step><para>Create the precreation script. Follow the guidelines that are
described in <olink targetptr="flashoverview-48" remap="internal">Guidelines for Creating a
Custom Script</olink>.</para>
</step><step id="flashcreate-step-74"><para>Store the script in the <filename>/etc/flash/precreation</filename> directory.</para>
</step>
</procedure><example id="flashcreate-ex-56"><title>Excerpts From a Precreation Script</title><para>The following examples are excerpts from a precreation script. </para><itemizedlist><listitem><para>To log the start time in the summary section, use the following
example:</para><programlisting>echo "MyApp precreation script started">> $FLASHDIR/summary</programlisting>
</listitem><listitem><para>To check the software integrity, use the <command>flcheck</command> command.
This command cannot be used at the command line. The syntax for this command
is as follows:</para><screen>flcheck <replaceable>software component files and directories</replaceable> ...| -</screen><para>For example, to validate the files and directories, use the following
example:</para><programlisting>flcheck <replaceable>software component files and directories</replaceable> 
If Not in selection - refuse creation

echo "Myapp Integrity Damage">>$FLASHDIR/summary</programlisting><para>Or, to keep new files and directories that are unexpected and not fail
the archive creation, use the following example:</para><programlisting>flcheck <replaceable>software component files and directories</replaceable> 
If Not in selection include by force
flinclude <replaceable>software component</replaceable></programlisting>
</listitem><listitem><para>To register deployment scripts and data, use the following
example:</para><itemizedlist><listitem><para>Copy the script to the following directory:</para><programlisting>cp <replaceable>predeployment script</replaceable> /etc/flash/predeployment</programlisting>
</listitem><listitem><para>Or, to register the script dynamically during archive creation,
copy the script to the following directory.</para><programlisting>cp <replaceable>predeployment script</replaceable> $FLASHDIR/predeployment</programlisting>
</listitem>
</itemizedlist>
</listitem><listitem><para>To see application-specific data in a user-defined section,
use the following example:</para><programlisting>cp <replaceable>custom section</replaceable> $FLASHDIR/custom_sections/MyApp</programlisting>
</listitem><listitem><para>To log the success of the installation in the summary section,
use the following example:</para><programlisting width="80100">echo "product one flash preparation started." >>$FLASH_DIR/summary
...
echo "product one flash preparation finished successfully">>$FLASH_DIR/summary</programlisting>
</listitem>
</itemizedlist>
</example><example id="flashcreate-ex-82"><title>Precreation Script</title><programlisting>#!/bin/sh
echo "Test precreation script started" >> $FLASH_DIR/summary
cat /opt/TestApp/critical_file_list | flcheck -
if [ $? != 0 ]; then
	echo "Test precreation script failure" >> $FLASH_DIR/summary
	exit 1
fi
echo "Test precreation script started" >> $FLASH_DIR/summary
/opt/TestApplication/license_cloning
	$FLASH_DIR/predeployment/.TestApplicationLicenceTransfer \
	$FLASH_DIR/custom_sections/TestApplicationLicenceCounter
echo "Test precreation script finished" >> $FLASH_DIR/summary
exit 0</programlisting>
</example>
</task><sect2 id="egyrh"><title>Using a Precreation Script to Create a User-Defined
Archive Section</title><para>A precreation script can create a user-defined section in the archive
to provide specific application information. This section is intended for
archive maintenance. The script must be put in the <filename>$FLASH_DIR/sections</filename> directory.
The Solaris Flash archive does not process a user-defined section. For
example, a section could contain a description of the archive or perhaps a
script to check the integrity of an application. </para><para>A user-defined section requires the following format.</para><itemizedlist><listitem><para>Must be line oriented</para>
</listitem><listitem><para>Must terminate with newline (ASCII 0x0a) characters</para>
</listitem><listitem><para>Can have unlimited  length of individual lines </para>
</listitem><listitem><para>Must encode binary data  by using base64 or a similar algorithm</para>
</listitem>
</itemizedlist>
</sect2><task id="flashcreate-67"><title>To Create a Predeployment Script</title><tasksummary><para>This script is run before the installation of the archive. If the script
is meant to validate the archive, it is kept in the archive. If the script
is meant to preserve local configurations on the clone system, it is kept
on the clone system. This script also can analyze and collect local data necessary
for later customization. For example, client-specific information can be saved
before being overwitten by files about to be extracted. This information can
then be used in the final stage after extraction.</para>
</tasksummary><procedure><step><para>Create the predeployment script.  Follow the guidelines that are
described in <olink targetptr="flashoverview-48" remap="internal">Guidelines for Creating a
Custom Script</olink>.</para>
</step><step id="flashcreate-step-720"><para>Store the script in one of the following
directories.</para><itemizedlist><listitem><para>For archive validation, store in the <filename>/etc/flash/predeployment</filename> directory.</para>
</listitem><listitem><para>If you are referencing with a precreation script, store in
the <filename>$FLASH_DIR/preinstall</filename> directory. </para>
</listitem><listitem><para>If you are preserving configurations on a clone system, provide
the path to the script that is stored on the clone system with the <literal>local_customization</literal> keyword in the JumpStart profile.</para>
</listitem>
</itemizedlist>
</step>
</procedure><example id="flashcreate-ex-59"><title>Predeployment Script</title><programlisting>#!/bin/sh
$FLASH_DIR/TestApplication/check_hardware
if [ $? != 0 ]; then
	echo Unsupported hardware
	exit 1
fi
$FLASH_DIR/TestApplication/check_licence_key
if [ $? != 0 ]; then
	echo No license for this host
	exit 1
fi
$FLASH_DIR/TestApplication/deploy_license_key \
	$FLASH_DIR/TestApplication/.TestApplicationLicenceTransfer
$FLASH_DIR/TestApplication/save_data_files $FLASH_DIR/flash

exit 0</programlisting>
</example>
</task><task id="flashcreate-70"><title>To Create a Postdeployment Script</title><tasksummary><para>This script is kept in the archive or stored in a local directory on
the clone system and runs after installation. The script reconfigures a new
system image on a clone system. If the script is stored in the archive, the
changes affect all the clone systems. If the script is stored in a local directory
on the clone system, the changes affect only the clone system. For example,
client-specific information that is saved by a predeployment script can be
applied to the clone environment, completing the installation.</para><para>Postdeployment scripts can also be used to clean up files after the
archive is installed. For example, log files such as those files in <filename>/var/adm</filename> can be cleaned out.</para><note><para>Not all log files need a script for cleanup. Log files in <filename>/var/tmp</filename> can be excluded when the archive is created.</para>
</note>
</tasksummary><procedure><step><para>Create the postdeployment script. Follow the guidelines that are
described in <olink targetptr="flashoverview-48" remap="internal">Guidelines for Creating a
Custom Script</olink>.</para>
</step><step id="flashcreate-step-745"><para>Store the script in one of the following
directories.</para><itemizedlist><listitem><para>To affect all clone systems, store the script in the <filename>/etc/flash/postdeployment</filename> directory.</para>
</listitem><listitem><para>To affect only a local clone system, provide the path to the
script that is stored on the clone system with the <literal>local_customization</literal> keyword
in the JumpStart profile.</para>
</listitem>
</itemizedlist>
</step>
</procedure><example id="flashcreate-ex-60"><title>Postdeployment Script</title><programlisting>#!/bin/sh
$FLASH_DIR/TestApplication/clone_reconfiguration
$FLASH_DIR/TestApplication/restore_data $FLASH_DIR/flash</programlisting>
</example>
</task><task id="flashcreate-68"><title>To Create a Reboot Script</title><tasksummary><para>This script is kept in the archive and runs after the system is rebooted.
The script does any final configuration after system reconfiguration. </para><para>After you install the Solaris Flash archive on a clone system,
some host-specific files are deleted and are re-created for the clone machine.
The installation program uses the <command>sys-unconfig</command>(1M) command
and the <command>sysidtool</command>(1M) programs to delete and re-create
host-specific network configuration files. The files that are re-created include,
for example, <filename>/etc/hosts</filename>, <filename>/etc/defaultrouter</filename>,
and <filename>/etc/defaultdomain</filename>. You can use the reboot script
for any final reconfiguration.</para>
</tasksummary><procedure><step><para>Create the <literal>reboot</literal> script. </para>
</step><step id="flashcreate-step-741"><para>Store the script in the <filename>/etc/flash/reboot</filename> directory.</para>
</step>
</procedure><example id="flashcreate-ex-63"><title>Creating a <literal>reboot</literal> Script</title><programlisting>#!/bin/sh 
$FLASH_DIR/TestApplication/finalize_license</programlisting>
</example>
</task>
</sect1><sect1 id="flashcreate-66"><title>Creating a Solaris Flash Archive</title><para>You can create an archive with an initial installation that overwrites
all the files on the clone system, or you can create a differential archive
that only overwrites the changes that are specified. For an overview of a
differential archive, see <olink targetptr="flashoverview-47" remap="internal">Planning to
Create the Solaris Flash Differential Archive for an Update</olink>.</para><caution><para>A Solaris Flash archive cannot
be properly created when a non-global zone is installed. The Solaris Flash
feature is not compatible  with the Solaris Zones partitioning technology.
If you create a Solaris Flash archive, the resulting  archive is not installed
properly when the archive is deployed under these conditions:</para><itemizedlist><listitem><para>The archive is created in a non-global zone</para>
</listitem><listitem><para>The archive is created in a global zone that has non-global
zones installed</para>
</listitem>
</itemizedlist>
</caution><task id="flash-42"><title>To Create a Solaris Flash Archive for an Initial
Installation</title><tasksummary><para>After you install the master system, create a Solaris Flash archive
to use to install other systems.</para>
</tasksummary><procedure>&suStepA;<step id="flash-step-44"><para>Boot the master system and run it in as inactive
a state as possible.</para><para>When possible, run the system in single-user
mode. If that is not possible, shut down any applications that you want to
archive and any applications that require extensive operating system resources. </para><para>You can create a Solaris Flash archive while the master system
is running in multiuser mode, single-user mode, or while booted from one of
the following:</para><itemizedlist><listitem><para>Solaris Operating System DVD.</para>
</listitem><listitem><para>Solaris Software - 1  CD.</para>
</listitem><listitem><para>An image of the Solaris Software. If you are using CD media,
the image could include the Solaris Languages CDs if needed.</para>
</listitem>
</itemizedlist>
</step><step id="flash-step-45"><para>To create the archive, use the <command>flarcreate</command> command.</para><screen># <userinput>flarcreate -n <replaceable>name</replaceable> <replaceable>options</replaceable> <replaceable>path/filename</replaceable></userinput></screen><variablelist><varlistentry><term><replaceable>name</replaceable></term><listitem><para>The name that you give the archive. The <replaceable>name</replaceable> you
specify is the value of the <literal>content_name</literal> keyword.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>options</replaceable></term><listitem><para>For a description of options, see <olink targetptr="flash-53" remap="internal">flar
Command</olink>.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>path</replaceable></term><listitem><para>The path to the directory in which you want to save the archive
file.  If you do not specify a path, <command>flarcreate</command> saves the
archive file in the current directory.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>filename</replaceable></term><listitem><para>The name of the archive file.</para>
</listitem>
</varlistentry>
</variablelist><itemizedlist><listitem><para>If the archive creation is successful, the <command>flarcreate</command> command
returns an exit code of 0.</para>
</listitem><listitem><para>If the archive creation fails, the <command>flarcreate</command> command
returns a nonzero exit code.</para>
</listitem>
</itemizedlist>
</step><step id="flashcreate-step-86"><para>Make a copy of the archive and save it.
The copy can be used in the future to update a clone system with a differential
archive.</para>
</step>
</procedure>
</task><sect2 id="flashcreate-222"><title>Creating a Solaris Flash Archive (Examples)</title><para>File systems can be copied exactly or can be customized by excluding
some directories or files. You can achieve the same results by using different
options. Use the options that best suit your environment. </para><para>The file systems in the following
examples have been greatly simplified for clarification. Rather than use file
system names such as <filename>/var</filename>, <filename>/usr</filename>,
or <filename>/opt</filename>, the master system file structure for these examples
is the following:</para><screen><filename>/aaa/bbb/ccc/ddd
/aaa/bbb/fff
/aaa/eee
/ggg</filename></screen><caution><para>Use the <command>flarcreate</command> file-exclusion options
with caution. If you exclude some directories, others that you were unaware
of might be left in the archive, such as system configuration files. The system
would then be inconsistent and the installation would not work. Excluding
directories and files is best used with data that can easily be removed without
disrupting the system, such as large data files.</para>
</caution><sect3 id="flashcreat-ex-256"><title>Creating a Solaris Flash Archive
(Various Examples)</title><example id="flashcreate-ex-46"><title>Creating an Exact Duplicate Archive</title><para>In this example, the archive is named <literal>archive1</literal>. This
archive is copied exactly from the master system and then compressed. The
archive is an exact duplicate of the master system and is stored in <filename>archive1.flar</filename>.</para><screen># <userinput>flarcreate -n archive1 -c archive1.flar</userinput></screen><para>To check the file structure of the archive, type the following.</para><screen># <userinput>flar info -l archive1.flar</userinput>lost+found
export
export/home
export/home/lost+found
var
var/sadm
var/sadm/install
var/sadm/install/admin
var/sadm/install/admin/default
var/sadm/install/logs
var/sadm/install/contents
var/sadm/install/.lockfile
var/sadm/install/.pkg.lock
var/sadm/pkg
var/sadm/pkg/SUNWocfd
var/sadm/pkg/SUNWocfd/install
var/sadm/pkg/SUNWocfd/install/copyright
var/sadm/pkg/SUNWocfd/save
var/sadm/pkg/SUNWocfd/save/pspool
var/sadm/pkg/SUNWocfd/save/pspool/SUNWocfd
.....
.....
    usr/bin/sparcv7
usr/bin/sparcv7/savecore
usr/bin/sparcv7/gcore
....
....
usr/lib/diff3prog
usr/lib/madv.so.1
usr/lib/mpss.so.1
usr/lib/cpu
usr/lib/cpu/sparcv8plus
....
....
devices/pseudo/udp6@0:udp6
devices/pseudo/udp@0:udp
devices/pseudo/tcp@0:tcp
devices/pseudo/iwscn@0:iwscn
devices/pseudo/wc@0:wscons
devices/pseudo/tcp6@0:tcp6
devices/pseudo/sctp6@0:sctp6
var/fm/fmd/ckpt
var/fm/fmd/rsrc
kernel/drv/st.conf
kernel/drv/st.conf
kernel/drv/st.conf
kernel/drv/st.conf
#</screen>
</example><example id="geulu"><title>Creating an Archive With the <command>cpio</command> Copy
Method for Backward Compatibility</title><para>In this example,
the archive must be a <command>cpio</command> archive because of backward
compatibility issues. The default <command>pax</command> copy method is not
used, but the <option>L cpio</option> option is used to create a <command>cpio</command> archive.
When you use the <option>L cpio</option> option, individual files cannot be
over 4 Gbytes. The archive is named <literal>archive1</literal>. This archive
is copied exactly from the master system and then compressed. The archive
is an exact duplicate of the master system and is stored in <filename>archive1.flar</filename>.</para><screen># <userinput>flarcreate -L cpio -n archive1 -c archive1.flar</userinput></screen><para>To check the file structure of the archive, type the following.</para><screen># <userinput>flar info -l archive1.flar</userinput>
aaa
aaa/bbb
aaa/bbb/ccc
aaa/bbb/ccc/ddd
aaa/bbb/fff
aaa/eee
aaa/eee
ggg</screen>
</example><example id="flashcreate-ex-5001"><title>Creating an Archive From an Alternate
root (<filename>/</filename>) File System</title><para>In this example, the archive is named <literal>archive4</literal>. This
archive is copied exactly from the master system and then compressed. The
archive is an exact duplicate of the master system and is stored in <filename>archive4.flar</filename>. The <option>R</option> option is used to create the archive from
another directory tree.</para><screen># <userinput>flarcreate -n archive4 -c -R /x/yy/zz archive4.flar</userinput></screen>
</example><example id="flashcreate-ex-81"><title>Creating an Archive and Adding Keywords
to Describe the Archive</title><para>In this example, the archive is named <literal>archive3</literal>. This
archive is copied exactly from the master system and then compressed. Options
add descriptions to the archive-identification section, which can help you
to identify the archive later. For information about keywords, their values,
and formats, see <olink targetptr="flash-51" remap="internal">Solaris Flash Keywords</olink>.</para><screen># <userinput>flarcreate -n archive3 -i 20000131221409 -m pumbaa \
 -e "Solaris 8 Print Server" -a "Mighty Matt" -U "Internal Finance" \
 -T server archive3.flar</userinput> </screen><para>After the archive is created, you can access the archive identification
section that contains the detailed description. An example of an archive identification
section follows.</para><screen>section_begin=identification
     files_archived_method=pax     files_compressed_method=compress
     files_archived_size=259323342
     files_unarchived_size=591238111
     creation_date=20000131221409
     creation_master=pumbaa
     content_name=Finance Print Server
     content_type=server
     content_description=Solaris 8 Print Server
     content_author=Mighty Matt
     content_architectures=sun4u
     creation_node=pumbaa
     creation_hardware_class=sun4u
     creation_platform=SUNW,Sun-Fire
     creation_processor=sparc
     creation_release=5.9
     creation_os_name=SunOS
     creation_os_version=s81_49
     x-department=Internal Finance</screen>
</example>
</sect3><sect3 id="flashcreat-ex-255"><title>Creating a Solaris Flash Archive
and Customizing Files (Examples)</title><example id="flashcreate-ex-47"><title>Creating an Archive and Excluding and
Including Files and Directories</title><para>In
this example, the archive is named <literal>archive2</literal>. This archive
is copied from the master system but is not an exact copy. The content under
the /aaa directory is excluded, but the content in <filename>/aaa/bbb/ccc</filename> remains. </para><screen># <userinput>flarcreate -n archive2 -x /aaa -y /aaa/bbb/ccc  archive2.flar</userinput></screen><para>To check the file structure of the archive, type the following. The
excluded directories that include copied files appear, but only the files
that were restored contain data.</para><screen># <userinput>flar info -l aaa</userinput>
aaa
aaa/bbb/ccc
aaa/bbb/ccc/ddd
aaa/bbb
ggg</screen>
</example><example id="flashcreate-ex-51"><title>Creating an Archive Excluding and Including
Files and Directories by Using Lists</title><para>In
this example, the archive is named <literal>archive5</literal>. This archive
is copied from the master system but is not an exact copy. </para><para>The <filename>exclude</filename> file contains the following list:</para><screen>/aaa</screen><para>The <filename>include</filename> file contains the following list:</para><screen>/aaa/bbb/ccc</screen><para>The content under the /aaa directory is excluded, but the content in <filename>/aaa/bbb/ccc</filename> remains. </para><screen># <userinput>flarcreate -n archive5 -X exclude -f include  archive5.flar</userinput></screen><para>To check about the file structure of the archive, type the following.
The excluded directories that include copied files appear, but only the files
that were restored contain data.</para><screen># <userinput>flar info -l archive5.flar</userinput>
aaa
aaa/bbb/ccc
aaa/bbb/ccc/ddd
aaa/bbb
ggg</screen>
</example><example id="flashcreate1-ex-517"><title>Creating an Archive Excluding Files
and Directories by Using a List and Restoring a Directory</title><para>You
can combine options <option>x</option>, <option>y</option>, <option>X</option> and <option>f</option>. In this example, options <option>X</option> and <option>y</option> are
combined. The archive is named <literal>archive5</literal>. This archive is
copied from the master system but is not an exact copy. </para><para>The <filename>exclude</filename> file contains the following list:</para><screen>/aaa</screen><para>The <option>y</option> option restores the <filename>/aaa/bbb/ccc</filename> directory.
The following command produces the archive.</para><screen># <userinput>flarcreate -n archive5 -X exclude -y /aaa/bbb/ccc  archive5.flar</userinput></screen><para>To check about the file structure of the archive, type the following.
 The excluded directories that include copied files appear, but only the files
that were restored contain data.</para><screen># <userinput>flar info -l archive5.flar</userinput>
aaa
aaa/bbb
aaa/bbb/ccc
aaa/bbb/ccc/ddd
ggg</screen>
</example><example id="flashcreate-ex-480"><title>Creating an Archive Excluding and
Including Files and Directories by Using a List With the <option>z</option> Option</title><para>In this example, the archive is named <literal>archive3</literal>.
It is copied from the master system but is not an exact copy. The files and
directories to be selected are included in <filename>filter1</filename> file.
Within the files, the directories are marked with a minus (-) or a plus (+)
to indicate which files to exclude and restore. In this example, the directory <filename>/aaa</filename> is excluded with a minus and the subdirectory <filename>/aaa/bbb/ccc</filename> is restored with a plus. The <filename>filter1</filename> file
contains the following list.</para><screen>- /aaa
+ /aaa/bbb/ccc</screen><para>The following command produces the archive.</para><screen># <userinput>flarcreate -n archive3 -z filter1 archive3.flar</userinput> </screen><para>To check the file structure of the archive, type the following command.
The excluded directories that include copied files appear, but only the files
that were restored contain data.</para><screen># <userinput>flar info -l archive3.flar</userinput>
aaa
aaa/bbb
aaa/bbb/ccc
aaa/bbb/ccc/ddd
ggg</screen>
</example>
</sect3>
</sect2><task id="flash-420"><title>To Create a Solaris Flash Differential Archive
With an Updated Master Image</title><tasksummary><para>Before creating a differential
archive, you need two images to compare: an unchanged master image and an
updated master image. One image is the unchanged master image that has been
kept unchanged. This image was stored and needs to be accessed. The second
image is the unchanged master image that is updated with minor changes. The
root (<filename>/</filename>) file system is the default for the new image,
but you can access this image if it has been stored elsewhere. After you have
the two images, you can create a differential archive, which contains only
the differences between the two images. The differential archive can then
be installed on clones that were installed previously with the unchanged master
image.</para>
</tasksummary><procedure><step id="flash-step-390"><para>Prepare the master system with changes. Before
changes are made, the master system should be running a duplicate of the original
archive.</para><note><para>A copy of the unchanged master image must be kept protected from
changes and available for mounting later.</para>
</note>
</step><step id="flashcreate-step-75"><para>Update the unchanged master image with
any of the following changes.</para><itemizedlist><listitem><para>Delete packages.</para>
</listitem><listitem><para>Add packages or patches.</para>
</listitem><listitem><para>Modify configuration files.</para>
</listitem><listitem><para>Add support for peripheral devices on the clone system.</para>
</listitem>
</itemizedlist>
</step><step id="flashcreate-step-83"><para>(Optional) Create custom scripts. See <olink targetptr="flashcreate-65" remap="internal">Creating Customization Scripts</olink>.</para>
</step>&suStepA;<step id="flashcreate-step-78"><para>Deliver the unchanged master image in
a mount point.</para><itemizedlist><listitem><para>If the unchanged master image is stored on an inactive boot
environment, retrieve it by using the <command>lumount</command> command. </para><screen># <userinput>lumount</userinput> <replaceable>BE_name</replaceable> <replaceable>mountpoint</replaceable></screen><variablelist><varlistentry><term><replaceable>BE_name</replaceable></term><listitem><para>Specifies the boot environment name where the unchanged master
image is stored</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>mountpoint</replaceable></term><listitem><para>Specifies a root (<filename>/</filename>) file system where
the image is stored</para>
</listitem>
</varlistentry>
</variablelist><para>In the following example, the inactive boot environment is named <literal>unchanged_master1</literal>. The mount point is the directory <filename>/a</filename> on the
master system.</para><screen># <userinput>lumount  unchanged_master1 /a</userinput></screen>
</listitem><listitem><para>If the image is stored on a clone, mount the clone by using
NFS. </para><orderedlist><listitem><para>On the master system, share the clone's root (<filename>/</filename>)
file system and give the master root permissions on the clone system.</para><para>Use either the <command>sharemgr</command> utility or the <command>share</command> command
as follows.</para><note><para><emphasis role="strong">Starting
with the 5/07 Developer release,</emphasis> the <command>sharemgr</command> utility
introduces the concept of share groups. See <olink targetdoc="sysadv4" targetptr="gcrvu" remap="external"><citetitle remap="section">sharemgr Command</citetitle> in <citetitle remap="book">System Administration Guide: Network Services</citetitle></olink>.</para>
</note><itemizedlist><listitem><para><literal>#</literal> <userinput>share -F nfs -o rw,root=</userinput><replaceable>master_system</replaceable> <userinput>"/"</userinput></para>
</listitem><listitem><para><literal>#</literal> <userinput>sharemgr add-share</userinput> <option>d</option> <replaceable>master_system</replaceable> <option>s</option> <userinput>"/" default</userinput></para><para><literal>#</literal> <userinput>sharemgr
set</userinput> <option>P</option> <replaceable>nfs</replaceable> <option>S</option> <replaceable>sys</replaceable> <option>p</option> <userinput>rw="*"</userinput> <option>s</option> <userinput>"/" default</userinput></para><para><literal>#</literal> <userinput>sharemgr
set</userinput> <option>P</option> <replaceable>nfs</replaceable> <option>S</option> <replaceable>sys</replaceable> <option>p</option> <userinput>root=</userinput><replaceable>master_system</replaceable> <option>s</option> <userinput>"/" default</userinput></para>
</listitem>
</itemizedlist><para><replaceable>master_system</replaceable> is the name
of the master system.</para>
</listitem><listitem><para>On the master system, mount the clone.</para><screen># <userinput>mount -F nfs</userinput> <replaceable>clone_system</replaceable><userinput>:/</userinput> <replaceable>master_dir</replaceable></screen><variablelist><varlistentry><term><replaceable>clone_system</replaceable></term><listitem><para>Specifies the name of the system to be mounted</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>master_dir</replaceable></term><listitem><para>Specifies the directory where the unchanged master image is
stored</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem><listitem><para>If you saved the image with the <command>ufsdump</command> command,
use the <command>ufsrestore</command> command to retrieve a copy. For information
about how to use these commands, see <olink targetdoc="sagdfs" targetptr="bkupref-12756" remap="external">Chapter 27, <citetitle remap="chapter">UFS Backup and Restore Commands (Reference),</citetitle> in <citetitle remap="book">System Administration Guide: Devices and File Systems</citetitle></olink>.</para>
</listitem>
</itemizedlist>
</step><step id="flash-step-450"><para>Create the differential archive.</para><screen># <userinput>flarcreate -n <replaceable>archive_name</replaceable> -A <replaceable>unchanged_master_image_dir</replaceable> \
  <replaceable>options</replaceable> <replaceable>path/filename</replaceable></userinput></screen><variablelist><varlistentry><term><replaceable>archive_name</replaceable></term><listitem><para>Specifies the name that you give the archive. The <replaceable>archive_name</replaceable> you specify is the value of the <literal>content_name</literal> keyword.
The name is listed in the archive-identification section.</para>
</listitem>
</varlistentry><varlistentry><term><option>A</option> <replaceable>unchanged_master_image_dir</replaceable></term><listitem><para>Creates a differential archive by comparing a new system image
with the image that is specified by the <replaceable>unchanged_master_image_dir</replaceable> argument.
By default, the new system image is root (<filename>/</filename>). You can
change the default with the <option>R</option> option. <replaceable>unchanged_master_image_dir</replaceable> is a directory where the unchanged system image is stored or
mounted through UFS, NFS, or the <command>lumount</command> command.</para><para>You can include and exclude some files by using the options for contents
selection. For a list of options, see <olink targetptr="flash-53" remap="internal">flar Command</olink>.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>options</replaceable></term><listitem><para>For a description of options, see <olink targetptr="flash-53" remap="internal">flar
Command</olink>.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>path</replaceable></term><listitem><para>Specifies the path to the directory in which you want to save
the archive file.  If you do not specify a path, <command>flarcreate</command> saves
the archive file in the current directory.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>filename</replaceable></term><listitem><para>Specifies the name of the archive file.</para>
</listitem>
</varlistentry>
</variablelist><itemizedlist><listitem><para>If the differential archive creation is successful, the <command>flarcreate</command> command returns an exit code of 0.</para>
</listitem><listitem><para>If the differential archive creation fails, the <command>flarcreate</command> command returns a nonzero exit code.</para>
</listitem>
</itemizedlist><para>For procedures about installing an archive, see <olink targetdoc="solinstalladv" targetptr="flash-46" remap="external"><citetitle remap="section">To Prepare to Install a Solaris Flash Archive With a Custom JumpStart Installation</citetitle> in <citetitle remap="book">Solaris Express Installation Guide: Custom JumpStart and Advanced Installations</citetitle></olink>.</para>
</step>
</procedure><example id="flashcreate-ex-88"><title>Creating a Differential Archive With the New Master Image on the Master
System</title><para>In this example, the directory for unchanged master image is named <literal>unchanged_master1</literal>. The new master image that contains changes is
the root (<filename>/</filename>) directory. The new master image is compared
to the unchanged master image and the resulting differential archive is then
compressed. The differential archive is stored in <filename>diffarchive1.flar</filename> file.
The archive contains files that are to be deleted, changed, or added when
installed. </para><screen># <userinput>flarcreate -n diffarchive1</userinput> <option>A</option> <userinput>/a/unchanged_master1 -c diffarchive1.flar</userinput></screen>
</example><example id="flashcreate-ex-50"><title>Creating a Differential Archive With the Images Stored on an Inactive
Boot Environment</title><para>In this example, the unchanged master image, <literal>unchanged_master1</literal>,
is stored on an inactive boot environment and is accessed by mounting the
boot environment. The new master image is the root (<filename>/</filename>)
directory. The new master image is compared to the unchanged master and the
resulting differential archive is then compressed. The archive is stored in <filename>diffarchive4.flar</filename>. The archive contains files that are to be deleted,
changed, or added when installed. </para><screen># <userinput>lumount unchanged_master1 /a</userinput>
# <userinput>flarcreate -n diffarchive4 -A /a -c  diffarchive4.flar</userinput></screen>
</example>
</task><task id="flash-4200"><title>To Create a Solaris Flash Differential Archive
by Using Solaris Live Upgrade</title><tasksummary><para>To manage system updates, you can use Solaris Live Upgrade to
copy the OS, which creates a new boot environment. This copy can be compared
to the master system that has been updated with minor changes. The resulting Solaris Flash differential
archive can then be installed on clone systems.</para><para>For more information about Solaris Live Upgrade, see <olink targetdoc="solinstallupg" targetptr="luoverview-1" remap="external">Chapter 2, <citetitle remap="chapter">Solaris Live Upgrade (Overview),</citetitle> in <citetitle remap="book">Solaris Express Installation Guide:  Solaris Live Upgrade and Upgrade Planning</citetitle></olink>.</para>
</tasksummary><procedure><step id="flash-step-3900"><para>From the unchanged master system, create
a new boot environment by using the <command>lucreate</command> command. </para><para>This new boot environment is an exact copy of the master system and
can be used to create the differential archive.</para>
</step>&suStepA;<step id="flashcreate-step-1"><para>Check the status of the two boot environments.</para><screen># <userinput>lustatus copy_BE</userinput>

boot environment   Is        Active  Active     Can	    Copy
Name               Complete  Now	 OnReboot   Delete	 Status
------------------------------------------------------------------------
master_BE          yes       yes     yes        no       -     
copy_BE            yes       no      no         yes      -  </screen>
</step><step id="flashcreate-step-7500"><para>Update the master image with any of
the following changes.</para><itemizedlist><listitem><para>Delete packages.</para>
</listitem><listitem><para>Add packages or patches.</para>
</listitem><listitem><para>Modify configuration files.</para>
</listitem><listitem><para>Add support for peripheral devices on the clone system.</para>
</listitem>
</itemizedlist>
</step><step id="flashcreate-step-830"><para>(Optional) Create custom scripts. See <olink targetptr="flashcreate-65" remap="internal">Creating Customization Scripts</olink>.</para>
</step><step id="flash-step-451"><para>Create the differential archive.</para><substeps><step><para>Mount the newly created boot environment.</para><screen><userinput># lumount</userinput> <replaceable>BE_name</replaceable> <userinput>/a</userinput></screen>
</step><step id="flashcreate-step-201"><para>Create the differential archive by comparing
the master system to the boot environment.</para><screen> # <userinput>flarcreate -n <replaceable>archive_name</replaceable> -A <replaceable>new_BE_dir</replaceable>\  <replaceable>options</replaceable> <replaceable>path/filename</replaceable></userinput></screen><variablelist><varlistentry><term><replaceable>archive_name</replaceable></term><listitem><para>Specifies the name that you give the archive. </para>
</listitem>
</varlistentry><varlistentry><term><option>A</option> <replaceable>new_BE_dir</replaceable></term><listitem><para>Creates a differential archive by comparing a new system image
with the image that is specified by the <replaceable>new BE_dir</replaceable> argument.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>options</replaceable></term><listitem><para>For a list of options, see <olink targetptr="flash-53" remap="internal">flar
Command</olink>.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>path</replaceable></term><listitem><para>Specifies the path to the directory in which you want to save
the archive file.  If you do not specify a path, <command>flarcreate</command> saves
the archive file in the current directory.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>filename</replaceable></term><listitem><para>Specifies the name of the archive file.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step id="flashcreate-step-3"><para>Unmount the new boot environment.</para><screen># <userinput>luumount</userinput> <replaceable>copy_BE</replaceable></screen>
</step>
</substeps><para>The <command>flarcreate</command> command returns an exit code.</para><itemizedlist><listitem><para>If the creation is successful, an exit code of 0 is returned.</para>
</listitem><listitem><para>If a failure occurs, a nonzero exit code is returned.</para>
</listitem>
</itemizedlist>
</step><step id="flashcreate-step-2"><para>Install the Solaris Flash differential
archive by using a JumpStart profile.</para><para>The clone systems that are
to be installed must be a duplicate of the original master system or the installation
fails.</para><para>The following example profile installs a differential archive, <literal>test.diff</literal>, on the device <literal>c1t1d0s0</literal>.</para><screen>JumpStart profile
-----------------------
install_type  flash_update
archive_location http server /rw/test.diff
root_device c1t1d0s0</screen>
</step>
</procedure><example id="flashcreate-ex-1"><title>Creating a Differential Archive by Using Solaris Live Upgrade</title><para><literal>master_BE</literal> is
the name of the current boot environment. <literal>copy_BE</literal> is the
name of the new boot environment. The file systems root (<filename>/</filename>)
and <filename>/usr</filename> are placed on <literal>s0</literal> and <literal>s3</literal>. The <command>lustatus</command> command reports that the new boot
environment copy is complete. The <filename>SUNWman</filename> package is
added to the master system. After the master system is updated by adding the <filename>SUNWman</filename> package, the <command>flarcreate</command> command creates
a differential archive by comparing the changed master and the unchanged new
boot environment.</para><screen># <userinput>lucreate -c master_BE  -m /:/dev/dsk/c0t1d0s0:ufs \
-m /usr:/dev/dsk/c0t1d0s3:ufs -n copy_BE</userinput>
# <userinput>lustatus</userinput>
# <userinput>pkgadd SUNWman</userinput>
# <userinput>lumount copy_BE /a</userinput>
# <userinput>flarcreate -n test.diff -c -A /a /net/server/export/test.diff</userinput>
# <userinput>luumount copy_BE</userinput></screen><para>Install the differential archive on clone systems. For procedures about
installing an archive, see <olink targetdoc="solinstalladv" targetptr="flash-46" remap="external"><citetitle remap="section">To Prepare to Install a Solaris Flash Archive With a Custom JumpStart Installation</citetitle> in <citetitle remap="book">Solaris Express Installation Guide: Custom JumpStart and Advanced Installations</citetitle></olink>.</para><para>The following image shows the creation of the new boot environment by
using the <command>lucreate</command> command.</para><mediaobject><imageobject><imagedata entityref="lu-diff-flash"/>
</imageobject><textobject><simpara>The context describes the illustration.</simpara>
</textobject>
</mediaobject>
</example>
</task>
</sect1>
</chapter>