8.2 scr Image Building Components

scr builds images using the Image Description Tree and the AdminServer.conf file. The Image Description Tree and AdminServer.conf file contain files and directories that define the structure, scripts, configuration files, and other components required to build client images for Point of Service systems.

The following sections review the image components required to build images with scr:

8.2.1 Image Description Tree

scr builds images using a specific file system directory structure known as the Image Description Tree. The Image Description Tree provides the structure, scripts, configuration files, and other components required to build client images for Point of Service systems. These components are stored under /opt/SLES/POS/system/image_name-version/.

Table 8-2 summarizes the Image Description Tree components required to build images with scr.

Table 8-2 Required components of an Image Description Tree

Component

Description

/opt/SLES/POS/system/image_name-version/IMAGE

An unformatted file that contains a brief description of the image and its function.

/opt/SLES/POS/system/image_name-version/VERSION

A file that contains the version number of the Image Description Tree, such as 1.1.2. If you want to change the version number of your Image Description Tree, you must edit the VERSION and the name of the Image Description Tree directory. If you only modify the version included in the directory, the scr tool does not list the correct version number.

scr replaces the version specified in the VERSION file with the version specified on the command line when you clone the Image Description Tree.

/opt/SLES/POS/system/image_name-version/files/

A subdirectory that contains special files, directories, and scripts, This function of this directory is to ensure that the RPM is used as the package manager before any packages are installed in the image. The entire directory is copied to the root of the image tree using cp -a.

This directory cannot contain any libraries or binary files. Any binaries and libraries required before the first RPM call must be extracted from the corresponding packages in advance.

/opt/SLES/POS/system/image_name-version/files-user/

A subdirectory that contains special files, directories, and scripts for adapting the image environment after the installation of all the image packages.

/opt/SLES/POS/system/image_name-version/package/

A subdirectory where ImageBuilder searches for RPM packages.

The directory is automatically initialized depending on the entries in the ImageBuilder configuration file, /etc/opt/SLES/POS/AdminServer.conf. For more information, see Section 8.2.2, AdminServer.conf.

If there is no package directory, ImageBuilder creates a link to the global package directory (/opt/SLES/POS/pac/) and the links designated in the AdminServer.conf file.

/opt/SLES/POS/system/image_name-version/script/

A subdirectory that contains Bash scripts that are called after a package is installed, primarily to remove the parts of a package that are not needed for the Point of Service system.

IMPORTANT:For these scripts to run, the script name must match the name of the RPM (without the version).

/opt/SLES/POS/system/image_name-version/config

A configuration file that indicates the image size, type, and base name. The structure of the file corresponds to the format Key: Value.

The configuration file defines the following keys:

  • size: image_size

    Image_size is defined as a number followed by M (megabyte) or G (gigabyte).

    The scr ImageBuilder tool automatically extends the image size if the specified configuration size value is too small. However, if the designated image_size value plus the additional space required to build the image is more than 100 MB, scr aborts with an error message.

    If the designated image_size is larger than the space required to build the image, scr does not reduce the image size. This is because, in some instances, the additional space might be required to run custom scripts included with the image.

  • type: ext2|ext3

    The image type is currently restricted to ext2 or ext3, although, if necessary, different formats are possible.

    If you have an existing ext2 image, you can change the file system by setting a flag in the scCashRegister or the scWorkstation objects rather than recreate the image. If ext3 is specified in either LDAP object, the Point of Service terminal extends the file system to ext3 when the image is deployed.

  • name: image_name

    Image_name indicates the base name of the image. When the image is generated, the image_name is automatically expanded to include the version number and the date. The version number is extracted from the VERSION file.

    scr replaces the image_name with the name specified on the command line when you clone the Image Description Tree.

  • timezone: relative_path_to_time_zone

    All time zone definitions are located in the /usr/share/zoneinfo directory. To specify which time zone you want to use in the image, enter the relative path to a specific time zone definition. For example, timezone:US/Mountain. The ImageBuilder uses this information to extract the corresponding time zone from the timezone package. The time zone value is then stored as /etc/localtime in the image.

  • imagetype: diskful|diskless

    The value for this optional parameter is either diskful or diskless. If imagetype is not specified, the image is built with the original setup description. If diskful is set, all the packages required to handle the image on a hard disk are included in the setup description. If diskless is set, all unnecessary packages are removed from the setup description.

/opt/SLES/POS/system/image_name-version/config (continued)

In addition to the keys described above, it is also possible to specify script variables in the Key:Value format. All values entered in the configuration file are stored in the .profile file before executing the scripts in the script directory. Using the following command, the .profile file is created at the root of the installed image so it can be sourced from any script:

test -f /.profile \&\& . /.profile

The parameters of the configuration file are then available as variables in the script and can be processed appropriately.

With the test -f /.profile \&\& . /.profile command, the following script variables may also be stored in the configuration file:

  • usbdrivers: file_names

    Contains a comma-separated list of filenames. The filenames are interpreted as USB driver names and correspondingly captured if they are contained in the kernel tree.

  • netdrivers: file_names

    Contains a comma-separated list of filenames. Every file is indicated relative to the directory /lib/modules/version/kernel/drivers/net. The names are interpreted as network drivers and captured if they are contained in the kernel tree.

  • drivers: file_names

    Contains a comma-separated list of filenames. Every file is indicated relative to the directory /lib/modules/version/kernel/. The names are interpreted as general driver names and captured if they are contained in the kernel tree.

  • locale: locale_names

    Contains a comma-separated list of valid locale names. The image only contains support for the given locales. This includes the glibc part as well as the X11 library. A list of valid locales can be obtained with the locale -a command.

  • keytable: console_keymap

    Contains the name of the console keymap to use. The name corresponds to a map file stored below the path /usr/share/kbd/keymaps. In addition, the KEYTABLE variable within the /etc/sysconfig/keyboard file is set according to the keyboard mapping.

A representation of the configuration file for the disknetboot-2.0.21 image description is shown below:

name:initrd-disknetboot
size:15M
type:ext2
netdrivers:pcnet32.o,mii.o,natsemi.o,tulip/tulip.o

/opt/SLES/POS/system.image_name-version/config.cleanup

An optional configuration script for the image. This script is called at the end of the installation and after all the installation scripts have run. It is designed to clean up the image system. The target programs and files are those needed only while the installation scripts are running.

/opt/SLES/POS/system.image_name-version/config.system

An optional configuration script for the image. This script is called at the end of the installation but before the installation scripts have run. It is designed to configure the image system, such as the activation or deactivation of certain services (insserv). The call is not made until after the switch to the image has been made with chroot.

IMPORTANT:This file provides the scripts required to install the image. In most instances, we recommend that you do not modify this file.

/opt/SLES/POS/system/image_name-version/setup

A configuration file that indicates which packages make up the image and which RPM options must be used to install them. Each package can also be accompanied by a specific version of the package.

The structure of the file is as follows:

package_basename : RPM_option : package_version

Multiple RPM options are separated from each other by commas. If an executable shell script with the same name as the package base name is present in the script directory, it is executed after the installation of all the packages.

For an example of a sample setup file, see Section C.1, Sample setup File.

/opt/SLES/POS/system/image_name-version/setup.user

An optional configuration file that can be present in addition to setup. The file has the same format as the setup file, but a path to the package can be indicated after the package version.

The structure of the file is as follows:

Package Basename : RPM Option : Package Version : Path

For an example of a sample setup.user file, see Section C.2, Sample setup.user File.

/opt/SLES/POS/system/image_name-version/setup.txt

An optional information file for the LDAP system. This file contains information regarding which configuration files are required by the image and whether they are hardware or system--dependent. The structure of the file is as follows:

flag : configuration_file_name

The configuration_file_name includes the full file path.

The following values can be set for the flag value:

  • SYS specifies that the configuration file is a hardware-independent, such as /etc/ntp.conf.

  • HWD specifies that the configuration file is hardware-dependent, such as /etc/X11/XF86Config.

8.2.2 AdminServer.conf

When scr generates an image, it searches the paths listed in the AdminServer.conf file to find the RPM packages required to create the image. This ASCII, line-based file is located at etc/opt/SLES/POS/. It provides the paths to the distribution directories where you have copied the Novell Linux Point of Service CDs.

The AdminServer.conf file also references the maintenance directory. The maintenance directory is essentially an “override” directory. RPMs located in this directory take precedence over RPMs located in the distribution directories. You can add any RPM to this directory that you want scr to use in lieu of the default RPMs in the distribution directories. By default, the maintenance directory contains the glibc and devs RPMs. For a detailed breakdown of the maintenance directory structure, see Section B.1, Administration Server Directory Structure.

Information is organized in simple key=value format where the value after the key indicates the path to an Novell Linux Point of Service CD. For example, the following is the AdminServer.conf file for an NLD distribution:

SLESCD0=/opt/SLES/POS/maintenance/nld
SLESCD1=/opt/SLES/POS/dist/NLD9/SP1/CD1
SLESCD2=/opt/SLES/POS/dist/NLD9/SP1/CD2
SLESCD3=/opt/SLES/POS/dist/NLD9/FCS/CD1
SLESCD4=/opt/SLES/POS/dist/NLD9/FCS/CD2
SLESCD5=/opt/SLES/POS/dist/NLD9/FCS/CD3
SLESCD6=/opt/SLES/POS/dist/NLPOS9/FCS/CD4

The AdminServer.conf file for a SLES distribution appears as follows:

SLESCD0=/opt/SLES/POS/maintenance/sles
SLESCD1=/opt/SLES/POS/dist/NLPOS9/FCS/CD1
SLESCD2=/opt/SLES/POS/dist/NLPOS9/FCS/CD2
SLESCD3=/opt/SLES/POS/dist/NLPOS9/FCS/CD4
SLESCD4=/opt/SLES/POS/dist/SLES9/FCS/CD1
SLESCD5=/opt/SLES/POS/dist/SLES9/FCS/CD2
SLESCD6=/opt/SLES/POS/dist/SLES9/FCS/CD3

The order in which the CDs are listed is important because when scr generates the image, it searches each CD in the designated order for RPMs listed in the setup file. For example, given the preceding AdminServer.conf file, ImageBuilder searches for RPM packages beginning with /opt/SLES/POS/maintenance/nld and ending with /opt/SLES/POS/dist/NLPOS9/FCS/CD4. Note that the maintenance directory is listed first so scr uses any RPM it finds in this directory before it searches the distribution directories.

The POSCDTool is used to generate the AdminServer.conf file. For more information on this process, see Section 7.3.4, Generating AdminServer.conf or Distribution.xml.

NOTE:If you receive a newer SLES9 Service Pack CD, run the poscdtool utility to regenerate the AdminServer.conf file.