8.1 scr Commands

The basic command line that provides all features required to build client and boot images is:

scr [options]

Table 8-1 summarizes the available scr options. For examples of how these options are applied, see Building Images with scr.

NOTE:If an option has an abbreviated form, the abbreviation is indicated below the option.

Table 8-1 scr command options

Option

 

Description

--build -b

 

Used in conjunction with --destdir, this option builds an image.

This process assumes the Image Description Tree has been previously prepared. For more information, see the --prepare option.

Images are created with a time stamp in the filename. Old images are kept on the server.

IMPORTANT:scr only maintains five builds of a single image in the same directory. When you generate the sixth build of an image, scr deletes the oldest image version. (scr determines the oldest image version by the image date.) If you want to maintain more than five versions of a single image, you must maintain them in separate directories.

For sample usage, see Building Images with scr.

--create image_name-version -c image_name-version

Used in conjunction with --image, this option clones an existing Image Description Tree.

The new Image Description Tree is created at /opt/SLES/POS/system/image_name-version/. The name of the new Image Description Tree designated with the --create option must include the image_name and version.

If you want to change the version number of your cloned Image Description Tree, you must edit the VERSION file located in the root of the Image Description Tree. The scr tool does not list the correct version number if you only modify the version included in the directory name.

For sample usage, see Cloning the Image Description Tree.

--create-data-image directory

Used in conjunction with --image and --destdir, this option creates a data-only image.

A data-only image is an ext2 image file containing only a copy of the Image Description Tree starting at the given directory. This kind of image cannot be used as operating system or boot image.

If a disk-based system is booting and the IMAGE variable in the config.MAC_address file includes an additional data image that will be downloaded to a /dev/ramx device, the data contents are automatically included into the system. If a data image is downloaded into a partition on the disk, the data is available at the mount point referring to the contents of the PART variable.

An advantage of this feature compared to the normal CONF workflow is that the data image is controlled in the same way as the client image, which means that any changes to the data image are detected automatically and the image is updated if necessary.

Images are created with a time stamp in the filename. Old images are kept on the server.

For sample usage, see Using Data Images to Manage External Configuration Files.

--create-iso

Used in conjunction with --destdir, this option creates an ISO image from a previously prepared root image tree.

For sample usage, see Section 10.1.5, Creating the CD ISO Image.

--destdir directory -d directory

Designates the destination directory for the image and the checksum file.

For sample usage, see Section 8.4.4, Building the Image.

--export-config

Exports the tarball included in the image with the --import-config option. The tarball contains the Image Description Tree and command line used to build the image.

--extend setup_file

Used in conjunction with --prepare, this option extends the image. It uses the setup_file to install additional RPM packages that are not part of any distribution.

The setup_file indicates additional RPMs with the following specifications:

  • Package description: A line in the setup_file that indicates what the package is called, which RPM options must be used to install it, which version of the package should be used, and in which directory the package is located. If no directory is indicated, the system searches for the package in the package directories designated in AdminServer.conf.

  • Config: Following the optional keyword config, the name of an RPM appears. The package is unpacked to the files-user directory with cpio.

For sample usage, see Adding a Package to a Custom File.

--feature list -f list

Used in conjunction with --prepare, this option defines features to include in the image after it has been prepared.

You can list one or more of the following features in a comma-separated list.

 

adduser:username [+group_name] [+nohome]=[password]:

Includes a user with a password in the image.

  • If the password is not provided, scr prompts for the user password during image preparation.
  • If an empty string is used, no password is set for the user.
  • If a group name is provided, the user is assigned to the group.
  • If the nohome flag is set, the user does not have a home directory.

 

addgroup:group_name

Includes a group with a group password in the image.

  • If no password is provided, scr prompts for the group password during image preparation.
  • If an empty string is used, no password is set for the group.

 

auth

Includes root authentication in the image. It requests a password for the root user during the generation of the file system image.

The encrypted password is then entered in the existing /etc/shadow.

 

boot_cd:config=CD_setup_directory

Creates a CD bootable image. It requires the CD setup directory as a parameter.

Use this option when generating the CDBoot image.

For sample usage, see Section 10.1.4, Generating the CDBoot Image.

 

serial_console

Includes serial console support in the image.

This option generates the corresponding files, inittab and security, and stores them in the files-user tree.

For sample usage, see Section 8.4.4, Building the Image.

 

set_serial

Includes a run-level script called setserial in the image.

This script enables a service to configure all available serial interfaces for raw access during boot. This is needed for Point of Service systems providing more than the standard /dev/ttyS0 and /dev/ttyS1 serial interfaces.

--gzip -z

 

Used in conjunction with --build, this option compresses the created image file using gzip.

--help -h

 

Lists all the scr command line options and their syntax.

--image image_name-version -i image_name-version

Defines the name of the Image Description Tree you want to prepare, build, or clone.

The tree name consists of the image name and the version number, separated by a dash. For example, browser-2.0.21.

For sample usage, see Section 8.4.4, Building the Image.

--import-config

Includes a tarball in the image that contains the Image Description Tree and command line used to build the image.

--keep-root

Used in conjunction with --prepare or --build, this option maintains the root image tree.

The root image tree is normally removed after an error or after the image is created using the --prepare option. This option prevents the root image tree from being deleted.

--keep-rpm

Used in conjunction with --build, this option maintains the RPM database.

The RPM database is normally removed from the image to save space. This option prevents the RPM database from being deleted.

--list

 

Shows a list of all available image descriptions and versions from which an image can be built.

To create an image from one of the listed items, use one of the scr build commands and specify the image name in the --image option.

For sample usage, see Section 8.4.4, Building the Image.

--logfile

 

Used in conjunction with --prepare, this option creates a log file of the image build process.

--no-stripping file

Maintains symbols in the image.

Executables and libraries are normally stripped out to discard symbols and save space. If symbols are needed, this option can be used.

  • If you specify a filename, only the matching files are not stripped.
  • If you do not specify a filename, nothing is stripped.
  • The --no-stripping --preserve-dates option preserves the date and time stamp while stripping.

NOTE:You can use this command to prevent stripping of symbols in JRE components.

The syntax of the file is based on glob patterns. Each line of the file specifies a glob pattern that can match exactly one file or multiple files. For example:

/usr/X11R6/bin/XFree86
/lib/*

This command prevents the file /usr/X11R6/bin/XFree86 and all files within the directory /lib from being stripped.

NOTE:Glob patterns don’t work recursively.

--setenv environment_variable= value -s environment_variable=value

Used in conjunction with the --prepare command, this option sets the environment variable.

For example, scr --prepare --image image-2.0.3 --setenv SCR_BUILD_DIR=/tmp

NOTE:The value of the SCR_BUILD_DIR environment variable creates an image root tree in the /tmp directory.

--prepare -p

 

Used in conjunction with --image, this option generates only the Image Description Tree; the file system image is not created. The resulting structure, the root image tree, can be manually modified.

The root directory of the image is named root-image_name-version and is located in the current directory.

For sample usage, see Section 8.4.4, Building the Image.

--unsetenv environment_ variable=value -u environment_variable=value

Used in conjunction with --prepare, this option unsets the environment variable. This option takes precedence over the --setenv option.

--verify -V

 

Used in conjunction with --prepare, this option verifies all RPM packages after they are installed. When finished, ImageBuilder displays the verification results.

For sample usage, see Section 8.4.4, Building the Image.

--version

 

Returns the ImageBuilder version number.