Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
Applies to SUSE Linux Enterprise Point of Service 11 SP3 and SUSE Linux Enterprise Point of Service 12 Image Server

8 Building SUSE Linux Enterprise Point of Service Images on SUSE Linux Enterprise Server 11-Based Image Server

SUSE Linux Enterprise Point of Service uses KIWI as the main tool for creating Point of Service system images. YaST also provides Image Creator, a GUI front-end to KIWI for easy image building. It is recommended to use this graphical front-end to build system images.

8.1 Building Images with the Image Creator Tool

Image Creator, the recommended graphical front-end to build images, can be started from YaST by choosing Miscellaneous › Image Creator.

When Image Creator is started, the Image Creator Configuration Overview dialog is shown. It lists image configurations saved in the /var/lib/SLEPOS/system directory. You can add, delete, or edit configurations by using the appropriate buttons in the dialog. Images can be built from a newly added configuration or from a configuration opened by Edit.

The Image Creator Configuration Overview
Figure 8.1: The Image Creator Configuration Overview
Note
Note: Login in as root User

To be able to log in as root on the terminal, you need to create the root user and assign a password to it in the Users tab.

Note
Note: Creating Images from Scratch

Only image templates shipped with SUSE Linux Enterprise Point of Service are supported. If you want to prepare your own image from scratch, the SUSE Linux Enterprise 11 Software Development Kit (SLE-11-SDK) product must be used and the kiwi-desc-* packages installed. There is no L3 support available for the SLE-11-SDK product.

Important
Important: Building 32-bit Images on 64-bit Machines

Terminals based on SUSE Linux Enterprise Point of Service 11 need 32-bit images. If you want to build 32-bit images on a 64-bit machine, the Subscription Management Tool (SMT) must be used for repository management. It is also recommended to use SMT for SUSE Linux Enterprise update repositories (SLES-11-Updates, SLE-11-POS-Updates). For SMT configuration, see Subscription Management Tool Guide.

If SMT is configured, add repositories in Image Creator. Click Add › Specify URL and enter the repository URL, for example: http://smt.mycompany.us/repo/$RCE/SLES11-Updates/sle-11-i586/.

The linux32 kiwi command needs to be used when building 32-bit images on 64-bit machines.

8.1.1 Creating an Image Based on Templates

To create a new image configuration from a template shipped with SUSE Linux Enterprise Point of Service follow these steps:

  1. Click Miscellaneous › Image Creator in the YaST control center.

  2. In the Image Creator Configuration Overview dialog, click Add. The Image Preparation dialog appears.

  3. Enter the name of the new configuration in the KIWI Configuration.

  4. Select Base on Template and choose the template to use from the list. If you want to re-use a previously created configuration, select Base on Existing Configuration and choose the directory with the configuration to use.

  5. Select the Image Type you want to create. To create a bootable live CD with a system image, choose Live ISO Image. To create a bootable USB flash drive with a system image, choose USB Stick Image. If you need to boot clients from the network using PXE/DHCP and then download a system image from the network, select Network Boot Image.

  6. The path in which the directory with the image will be created is set in the Output Directory. The default value is determined by the template and you can leave it as it is.

  7. Package repositories used for creating the image are listed in the Package Repository table. The templates include paths to copies of the SUSE Linux Enterprise Server and SUSE Linux Enterprise Point of Service source media located in the default distribution directory /var/lib/SLEPOS/dist/.

    To add a new repository, click Add, select the type of the repository and enter the required information. If the image building server is on the same architecture as the terminals (i586), it is possible to use update repositories defined in the operating system. To add a system repository, configure the update repository according to the SLES Administration Guide and use Add From System in Image Creator.

    It is also possible to manually add selected packages to the /var/lib/SLEPOS/system/image_name/repo/ directory.

  8. Click Next to proceed with creating the image configuration. Image Creator now downloads the repository metadata. This action may take some time. If the configured repositories are not valid, Image Creator will report that.

  9. In the Image Configuration dialog, add root and other needed users. Otherwise, you can use the default values defined in the template. To edit the settings, see Section 8.1.7, “Image Configuration Settings”. Click Finish.

  10. You are asked if the image should be created now. To create the image, select Yes. If you choose No, the image configuration will be saved but no image will be built.

  11. A window showing logs opens. After successfully creating the image, click OK. The path to the directory containing the new image is shown. Click OK.

8.1.2 Building Network Boot Images

In environments where the available network infrastructure is suitable to boot SUSE Linux Enterprise Point of Service terminals over LAN, you can use network boot images and boot clients using PXE/DHCP. Network boot images are built together with any system image when the Network Boot Image option in Image Creator is selected. If you want to create a system image with a network boot image using Image Creator, follow these steps:

  1. Start Image Creator and create an image as described in Section 8.1.1, “Creating an Image Based on Templates”. Select Network Boot Image as Image Type.

  2. Manually copy all the created files including the MD5 checksum files to the /srv/SLEPOS/boot/ and /srv/SLEPOS/image/ directories on the administration server. For more information, see Section 4.4, “Copying the Boot Image Files” and Section 4.5, “Copying the System Image Files”.

8.1.3 Building Bootable CD Images with a System Image

In environments where no suitable network infrastructure is available to boot SUSE Linux Enterprise Point of Service terminals over the LAN, you can use bootable live CDs containing system images. To create such images using Image Creator, follow these steps:

  1. Start Image Creator and create an image as described in Section 8.1.1, “Creating an Image Based on Templates”. Select Live ISO Image as Image Type.

  2. After the image creation is completed, burn the created image to CD using any CD burning application, for example Nautilus in GNOME or k3b in KDE.

8.1.4 Building Bootable CD Images without a System Image

If the terminals are not able to boot from network over the PXE/DHCP but the network is present, CDs without a system image can be used to boot the client system. The system image is downloaded from the network after the boot process. To create such images using Image Creator, follow these steps:

  1. Start Image Creator and create an image as described in Section 8.1.1, “Creating an Image Based on Templates”. Select Network Boot Image as Image Type.

  2. Change to the directory containing the created image.

  3. The ISO image should now be created using KIWI.

    kiwi --bootcd path_to_the_initrd

    For example:

    kiwi --bootcd initrd-netboot-suse-SLES11.i686-2.1.1.splash.gz

  4. After the image creation is completed, burn the created ISO image to CD using any CD burning application, for example Nautilus in GNOME or k3b in KDE.

8.1.5 Building Server Images in Image Creator

For building server images (for Administration Server, Branch Server or Combo Server) with Image Creator, a 64-bit Image Building Server is necessary. The 32bit Architecture Image option in Image Creator should be unchecked when building these images.

8.1.6 Adding Installable Documentation in RPM Format

To include documentation packages in RPM format in your images, follow this procedure:

  1. Create a new image with Image Creator.

  2. Finish the image settings and quit the Image Creator without building the image.

  3. In the /var/lib/SLEPOS/system/image_name/config.xml file, remove the line containing <rpm-excludedocs>True</rpm-excludedocs>.

  4. Return to the Image Creator, edit the last image, and start building the image.

8.1.7 Image Configuration Settings

In the Image Configuration tab, adjust the configuration of the software in the resulting image. In the relevant fields, set the Version of the image and its Size in the selected Units. If the Additive option is active, the value entered in Size is added to the size of the selected packages. The set value is the minimal free space on the image.

To add or remove a pattern or a package from the Installed Software list, click Change. Packages in the Ignored Software list are removed from any patterns to be installed, but they remain installed and are available to be selected as individual packages or dependencies. Packages in the Packages to Delete list are always uninstalled from the target image without any dependency checking. To put packages on a list, click in the list window and write the name of the packages with one name per line.

Note
Note: Package Versions and Taboos

Image Creator does not support package version selection and it installs the newest package version all time. Taboos are also not supported.

Note
Note: Deleted Dependencies

If you add any package to a template-based image, make sure that it does not depend on any packages set to be deleted. Remove these packages with dependencies from the Packages to Delete list, because otherwise the added software will not work.

In the Description tab, enter information about the Author of the image including Contact information and image Specification.

In the Users tab, create users that need to be available in the target system. For each user, specify Login Name, Full Name, Password, Home Directory and UID. In Group Name and GID, specify the group to which the users belong.

Note
Note: Conflicting User Groups

If the GID of any user group specified in this dialog conflicts with a GID of any group created by selected packages in post-installation scripts, image building will fail. In such a case, use different GIDs.

In the Scripts tab, you can adjust configuration scripts that are used to build the image.

The Directories tab contains two tables. In the Directory with System Configuration table, you can specify directories to copy to the root directory of the resulting system. For example, add a directory with configuration files. In the second table, Directory with Scripts, add scripts to the config directory to run after the installation of all the image packages.

8.2 Building Images with KIWI

KIWI is a full-blown imaging suite that allows you to configure, build, and deploy your own operating system images. The KIWI workflow is divided into three distinct stages:

Preparing the Image Configuration (Physical Extend)

Determine which packages are installed on your image and which configuration files are included with the image. Create a directory holding the contents of the new file system from a software package source such as SUSE Linux Enterprise Server and create an image description file, (config.xml). The resulting infrastructure is called the physical extend. For a detailed description of the image configuration procedure, refer to Section 8.2.2, “Preparing the Image Configuration”.

Creating the Image (Logical Extend)

The image itself is created using the data gathered in the physical extend. The resulting image is called logical extend. The image creation process does not require user interaction, but can be fine-tuned by modifying the images.sh script that is called during the creation process. For a detailed description of the image creation procedure, refer to Section 8.2.3, “Creating the KIWI Image”.

Deploying the Image

The final image can be deployed using various different methods. SUSE Linux Enterprise Point of Service supports PXE net boot, live system images, and USB flash drive images.

Tip
Tip: Using SUSE Linux Enterprise Point of Service Image Templates

SUSE Linux Enterprise Point of Service provides several templates that may be used to create new images. All the delivered templates are stored in the /usr/share/kiwi/image/SLEPOS/ directory. When using these templates, copy contents of the directory that contains the respective configuration to a new subdirectory in /var/lib/SLEPOS/system/.

8.2.1 Understanding the KIWI Configuration

KIWI configurations as used in SUSE Linux Enterprise Point of Service should always reside in /var/lib/SLEPOS/system/image_name. The main configuration file that contains the most important aspects of the image description is called config.xml and resides in /var/lib/SLEPOS/system/image_name/config.xml. A typical image configuration directory for SUSE Linux Enterprise Point of Service can include the following items:

config.xml

This file is used to define the image type, base name, repositories used to build the image, profiles, options, and the package/pattern list. The wireless support is also enabled here. For a more detailed example of a typical SUSE Linux Enterprise Point of Service config.xml, refer to Example 8.1, “An Example config.xml Image Description”.

config.sh

config.sh is an optional image configuration script. It is executed at the end of the installation of the image after the chroot command is used to switch to the image. It can be used to configure the image system by activating or deactivating services.

images.sh

images.sh is an optional clean up script that runs before the image creation process is started and the logical extend is created. It removes files that are only needed while the physical extend exists.

config

The config directory is an optional directory that may contain shell scripts to be executed after all packages have been installed. You could, for example manipulate a package to remove parts that are not needed for the operating system by adding the relevant script to the config directory. Make sure the name of your Bash scripts resembles the package name specified in config.xml.

repo

The repo directory is an optional directory that could hold any RPM packages that do not originate from one of your preconfigured repositories, but which you want to add manually. Place the RPMs in this directory and reference them by <package name="your_package"> in the config.xml file.

root

The root directory contains files, scripts and directories to customize the image after the installation of all packages.

cdboot

The cdboot directory is an optional directory holding all the data needed to create a bootable CD. It includes the isolinux.cfg, isolinux.msg, and isolinux.sh files needed to build an ISO image from a pre-built CD tree. This subdirectory is needed for any image of the type initrd-isoboot.

Tip
Tip: For More Information

Refer to the KIWI package documentation under /usr/share/doc/packages/kiwi/kiwi.pdf for a detailed listing of all configuration files and directories available for KIWI (Section 1.3 The KIWI Image Description).

Example 8.1: An Example config.xml Image Description
<?xml version="1.0" encoding="utf-8"?>
<image name="POS_Image_Graphical4" displayname="POS_Image_Graphical4" schemaversion="5.2">1
  <description type="system">2
    <author>Admin User</author>
    <contact>noemail@example.com</contact>
    <specification>POS image builder software - configuraton for graphical image</specification>
  </description>
  <preferences>3
    <type checkprebuilt="true" boot="netboot/suse-SLES11" fsnocheck="true" filesystem="ext3" compressed="true" image="pxe">
      <pxedeploy server="192.168.100.2" blocksize="4096">
        <partitions device="/dev/sda">
          <partition type="82" number="1" size="5"/>
          <partition type="83" number="2" mountpoint="/" target="true"/>
        </partitions>
      </pxedeploy>
    </type>
    <type boot="isoboot/suse-SLES11" image="iso"/>
    <type boot="oemboot/suse-SLES11" filesystem="ext3" installiso="true" image="oem"/>
    <version>4.0.0</version>
    <packagemanager>zypper</packagemanager>
    <rpm-check-signatures>false</rpm-check-signatures>
    <rpm-force>false</rpm-force>
    <boot-theme>studio</boot-theme>
    <timezone>UTC</timezone>
    <hwclock>localtime</hwclock>
    <defaultdestination>/var/lib/SLEPOS/system/images</defaultdestination>
    <defaultroot>/var/lib/SLEPOS/system/chroot</defaultroot>
  </preferences>
  <users group="root">4
    <user name="root" pwd="$1$YjyhKEyu$WWqPoJ1HtqRIyKqcD1KRa." home="/root" shell="/bin/bash"/>
  </users>
  <packages type="image" patternType="onlyRequired">5
    <opensusePattern name="SLEPOS_Template_Graphical"/>
    <package name="haveged" bootinclude="true"/>
    <package name="posbios" bootinclude="true"/>
    ...
    <package name="java-1_7_0-ibm"/>
    <package name="aaa_base"/>
    <package name="bash"/>
    ...
    <archive name="bootsplash.tar" bootinclude="true"/>
    <archive name="gdm.tar"/>
    <!--begin wireless support6
        <package name="kernel-firmware" bootinclude="true"/>
        <package name="wpa_supplicant" bootinclude="true"/>
        <package name="wireless-tools" bootinclude="true"/>
        <package name="libnl" bootinclude="true"/>
        <package name="grub" bootinclude="true"/>
        <archive name="wlan.tar.gz" bootinclude="true"/>
    end wireless support-->
    <!--begin SUSE Manager support7
        <package name="suse_manager_client_registration" />
    end SUSE Manager support-->
  </packages>
  <packages type="bootstrap">
    <package name="filesystem"/>
    <package name="glibc-locale"/>
  </packages>
  <repository type="rpm-md">8
    <source path="{SLEPOS 11 SP3 i386}"/>
  </repository>
  <repository type="rpm-md">
    <source path="{SLES 11 SP3 Updates i386}"/>
  </repository>
  <repository type="rpm-md">
    <source path="{SLEPOS 11 SP3 Updates i386}"/>
  </repository>
  <repository type="rpm-md">
    <source path="{SLES 11 SP3 i386}"/>
  </repository>
  <!--begin wireless support
        <drivers type="drivers">9
            <file name="drivers/net/wireless/*"/>
            <file name="drivers/net/wireless/*/*"/>
        </drivers>
    end wireless support-->
</image>

1

The image element carries all basic information on the image description file. The name attribute provides the base name of the image, the displayname attribute allows the setup of the boot menu title and schemeversion of the current version of KIWI.

2

The description element is used to provide some basic information on the creator of the image and a basic description of the image's purpose. The author element holds the image author's real name and the contact element a valid e-mail address. specification holds a short description of the image's purpose.

3

The preferences element holds information needed to create the logical extend. The type element determines the type of image to be created. SUSE Linux Enterprise Point of Service supports the following values for type: oem, pxe, and iso. If your config.xml contains more than one type element, you either need to add the primary attribute (with its value set to true) to the type that should be used for the final image, or the first entry is used by default.

defaultdestination and defaultroot are used if KIWI is not called with the destdir option or the root option, respectively.

4

The Users element lists the users belonging to the group specified with the group attribute. At least one user child element must be specified as part of the users element. Multiple users elements may be specified.

SLEPOS image templates contain the root user by default. The default root password is linux.

5

The packages element serves as a container for all the package elements used to designate the packages to be handled by KIWI. There are several types of package sets supported by KIWI: image includes all the packages which make up the image and are used to finish the image installation, boot includes the list of packages needed to create a new operating system root tree, and delete includes all packages marked for deletion and which are not needed in the final image.

6

The section, marked in config.xml by begin/end wireless support, contains the configuration necessary for booting using PXE via wireless networks. It is commented out in the default configuration file of the minimal image. WPA configuration (/etc/wpa_supplicant/wpa_supplicant.conf) is contained in the wlan.tar.gz TAR archive. WPA configuration can be eventually adjusted there.

7

The section, marked in config.xml by begin/end SUSE Manager support, contains the package needed for SUSE Manager integration.

8

The repository element references any package sources used in building this image. Repositories are referenced using repository aliases, for example {SLES 11 SP3 i386}. These aliases are mapped to repository urls via the /etc/kiwi/repoalias file. You also need to specify the type of the repository, in this case rpm-md.

9

This section contains drivers needed for the wireless operation.

8.2.2 Preparing the Image Configuration

To prepare a new image configuration using one of the customized SUSE Linux Enterprise Point of Service templates, proceed as follows:

  1. Create the directory to hold the image description.

    To create a system image of a graphical operating system without a desktop environment, use the following command:

    mkdir /var/lib/SLEPOS/system/graphical-default
  2. Copy the template configuration to the image description directory:

    cp -R /usr/share/kiwi/image/SLEPOS/graphical-3/* \
    /var/lib/SLEPOS/system/graphical-default/
  3. Create an empty directory to hold the final image:

    mkdir /var/lib/SLEPOS/system/image/graphical-default
  4. Adjust the image configuration file config.xml to match your purpose:

    1. Check whether the value of defaultroot points to the proper directory for the chroot environment needed to build the image. In this case: /var/lib/SLEPOS/system/chroot/graphical-default.

    2. Check whether the value of defaultdestination points to the appropriate destination directory to hold the final image. In this case: var/lib/SLEPOS/system/images/graphical-default.

    3. Add the paths to the repositories needed to build your image. If you are building your image from the standard SUSE Linux Enterprise Point of Service package sources, specify /var/lib/SLEPOS/dist/base_distribution.

    4. Add any optional configuration or scripts you need for your particular image as described under Section 8.2.1, “Understanding the KIWI Configuration”.

  5. Check whether config.xml is still well-formed XML to avoid parser problems when running the actual image building commands:

    xmllint --noout /var/lib/SLEPOS/system/graphical-default/config.xml

    If this command does not return any messages, the XML is well-formed and you can proceed with creating the image. If it returns error messages, fix the errors it returned and retry until no more errors occur.

  6. Perform the actual image preparation, but make sure the following requirements are met, before you execute the kiwi command:

    • A chroot directory under /var/lib/SLEPOS/system/chroot/graphical-default must not exist before you start preparing the image. Remove any remainders of earlier image builds.

      Warning
      Warning: Directories Mounted with the --bind Option

      When removing /var/lib/SLEPOS/system/chroot/graphical-default, make sure that no bind mount is done in that directory. These may be left over by a previous preparing process aborted unexpectedly. To check for such leftovers, run the command:

      mount | grep bind

      If you have any bind mount result inside that directory, first unmount it with the command umount <target-directory>.

    • Zypper or YaST must not run while you invoke the image preparation and build commands. These commands use Zypper and will be blocked by other processes requesting the same services.

    cd /var/lib/SLEPOS/system/
    kiwi --prepare ./graphical-default --root ./chroot/graphical-default

8.2.3 Creating the KIWI Image

After the image preparation has finished successfully, proceed with creating the image:

  1. Run the imaging command:

    kiwi --create ./chroot/graphical-default --destdir ./images/graphical-default

    KIWI creates the system image and any additional files needed to deploy the image. Find the result of the imaging process under /var/lib/SLEPOS/system/images/graphical-default.

  2. Check whether the resulting image matches your needs. If not, you may modify the image configuration inside the prepared physical extend by either:

    • editing the files under /var/lib/SLEPOS/system/chroot/graphical-default, or

    • entering the chroot environment with chroot /var/lib/SLEPOS/system/chroot/graphical-default, using the utilities available in the image to edit the configuration and exiting the chroot environment with exit.

    Re-run the imaging command:

    kiwi --create ./chroot/graphical-default --destdir ./images/graphical-default

For more information on the KIWI command and the options available, run the kiwi --help command.

Note
Note: Building SUSE Linux Enterprise 10 Images

For building SUSE Linux Enterprise 10 images, we recommend using a SUSE Linux Enterprise 10 build machine. However, you can also build SUSE Linux Enterprise 10 images with the KIWI version included in SUSE Linux Enterprise 11, if needed. In this case, make sure to add the following option when running the image command

--fs-inodesize 128

This is necessary because the file system tools in SUSE Linux Enterprise 11 use a different inode size than in SUSE Linux Enterprise 10.

8.2.4 Building Customized SUSE Linux Enterprise Point of Service Images

SUSE Linux Enterprise Point of Service supports building various different types of images suitable for different deployment scenarios. To complete some of these images, additional KIWI commands must be executed. The following sections introduce the different image types and their build process.

8.2.4.1 Building Network Boot Images

In environments where the available network infrastructure is suitable to boot SUSE Linux Enterprise Point of Service terminals over the LAN, you can use network boot images and boot clients using PXE. To build network boot images with KIWI, proceed as follows:

  1. Select the pxe image type in config.xml as described in Section 8.2.1, “Understanding the KIWI Configuration”.

  2. Run the --prepare and --create commands of KIWI as described in Section 8.2.3, “Creating the KIWI Image”.

8.2.4.2 Creating Images for Wireless Setup

Boot images used for the wireless setup must have wireless setup enabled. The following lines must be in the config.xml file, in the <packages type="image"...< section:

<!-- begin wireless support -->
                <package name="kernel-firmware" bootinclude="true"/>
                <package name="wpa_supplicant" bootinclude="true"/>
                <package name="wireless-tools" bootinclude="true"/>
                <package name="libnl" bootinclude="true"/>
                <package name="grub" bootinclude="true"/>
                <archive name="wlan.tar.gz" bootinclude="true"/>
<!-- end wireless support -->

Also, the wireless drivers must be enabled in the drivers section of the config.xml file:

<!-- begin wireless support -->
        <drivers type="drivers">
                <file name="drivers/net/wireless/*"/>
                <file name="drivers/net/wireless/*/*"/>
        </drivers>
<!-- end wireless support -->

The necessary lines are already in the provided configuration of the minimal image, but they are commented out. The wireless configuration is contained in the /etc/wpa_supplicant/wpa_supplicant.conf file present in the wlan.tar.gz TAR archive and can be adjusted there.

To create the initial boot image with KIWI, use the kiwi --bootusb initrd command. The image must be of the netboot type. The initrd must be an initrd file with wireless support enabled in the config.xml file. The kernel is expected to be in the same directory and follow the same naming convention. For example:

 cd /var/lib/SLEPOS/system/images/minimal-3.4.0
 kiwi --bootusb initrd-netboot-suse-SLES11.i686-2.1.1.splash.gz

The resulting image can be used for booting from a USB flash drive or it can be preloaded on the hard disk.

Important
Important: Wireless Network Encryption

Make sure to enable a strong encryption method like WPA2 if the terminals are connected to the branch servers over Wi-Fi.

8.2.4.3 Building Bootable CD Images With a System Image

In environments where no suitable network infrastructure is available to boot SUSE Linux Enterprise Point of Service terminals over the LAN, you can use bootable CDs containing system images. To build such image CDs, proceed as follows:

  1. Select the isoboot image type in config.xml as described in Section 8.2.1, “Understanding the KIWI Configuration”.

  2. Run the --prepare and --create commands of KIWI as described in Section 8.2.3, “Creating the KIWI Image”.

  3. Change to the directory containing your image data:

    cd /var/lib/SLEPOS/system/images/image_name
  4. Burn the ISO image to CD using a CD burning application of your choice (k3b or Nautilus, for example).

8.2.4.4 Building Bootable CD Images Without a System Image

If the terminals are not able to boot from network over PXE but network is present, CDs without a system image can be used for booting the client system. The system image is downloaded via the network after the boot. To build such images, proceed as follows:

  1. Select the pxe image type in config.xml as described in Section 8.2.1, “Understanding the KIWI Configuration”.

  2. Run the --prepare and --create commands of KIWI as described in Section 8.2.3, “Creating the KIWI Image”.

  3. Change to the directory containing your image data:

    cd /var/lib/SLEPOS/system/images/image_name
  4. Build the ISO image using the following KIWI command:

    kiwi --bootcd path_to_initrd
  5. Burn the resulting ISO image to CD using a CD burning application of your choice (k3b or Nautilus, for example).

8.2.4.5 Booting Images from USB Flash Drive

The image can be booted from a USB flash drive. In that case it initializes the service partition on the hard disk identified by the DISK variable in the configuration. This way, it is possible to set up a shop faster without the need of having network connections upfront and without the initial PXE boot cycle to fill the system partitions. The resulting partition table should be identical to what would be the outcome of a regular PXE boot/install.

To create an offline USB image on Combo Server, proceed as follows:

  1. Start with a built image. Only boot image is needed, so you can use both the minimal and the graphical image:

    cd /var/lib/SLEPOS/system/images/graphical-3.4.0
  2. Create the bootusb image:

    kiwi --bootusb initrd-netboot-suse-SLES11.i686-2.1.1.splash.gz
  3. Add 1 GB of free space to the image:

    dd if=/dev/zero bs=1M count=1024 >> initrd-netboot-suse-SLES11.i686-2.1.1.splash.raw
  4. Resize the partition (using fdisk delete it and create a new one - it defaults to whole disk):

    fdisk initrd-netboot-suse-SLES11.i686-2.1.1.splash.raw <<EOT
    d
    n
    p
    1
    
    
    w
    EOT
  5. Set up the partition device:

    DEV=/dev/mapper/`kpartx -s -v -a initrd-netboot-suse-SLES11.i686-2.1.1.splash.raw |cut -f 3 -d ' '`
  6. Resize the file system on the partition:

    e2fsck -f $DEV
    resize2fs $DEV
  7. Set the partition label to SRV_SLEPOS_TMPL. This label marks the partition with newest offline configuration:

    tune2fs -L SRV_SLEPOS_TMPL $DEV
  8. Mount the file system:

    mount $DEV /mnt
  9. Install POS_Image-Tools (not part of the default admin.branch server pattern):

    zypper -n in POS_Image-Tools
  10. Use the existing config.mac as a template for offline installation. This creates config.default and the referenced files to the partition:

    posSyncSrvPart --source-config config.00:00:90:FF:90:04 --dest-dir /mnt
  11. Unmount everything:

    umount /mnt
    kpartx -d initrd-netboot-suse-SLES11.i686-2.1.1.splash.raw
  12. The initrd-netboot-suse-SLES11.i686-2.1.1.splash.raw image is now ready.

Alternatively, the KIWI/config.default can be created manually. This is an example:

IMAGE=/dev/sda3;minimal.i686;3.4.0;192.168.124.254;8192
PART=3000;83;/srv/SLEPOS,1000;82;swap,3000;83;/
DISK=/dev/disk/by-id/pci-0000:00:1f.2-scsi-0:0:0:0
POS_KERNEL=linux
POS_INITRD=initrd.gz
POS_KERNEL_PARAMS= panic=60 ramdisk_size=710000 ramdisk_blocksize=4096 vga=0x314 splash=silent console=tty0 console=ttyS0,115200 mac_separator=":"  POS_KERNEL_PARAMS_HASH=db8571ae6dfacaf1
fd24053b74a07aa4

The partition must contain the referenced files, i.e.:

image/minimal.i686-3.4.0
image/minimal.i686-3.4.0.md5
boot/linux
boot/linux.md5
boot/initrd.gz
boot/initrd.md5

It is recommended to specify the DISK device by /dev/disk/by-path/ because it avoids problems with random ordering of sda, sdb. This is important especially for booting from a USB flash drive. /dev/disk/by-path is however hardware dependent, so it cannot be used for a generic image.

8.2.5 Deploying KIWI Images

The deployment process of available KIWI images strongly depends on the type of image built. Detailed information about how each implementation works is provided in Section 1.4 Activating an Image in /usr/share/doc/packages/kiwi/kiwi.pdf.

There are also several real life examples available in this document which guide through the deployment details of all the respective image types. See also Section 1.6 Real-Life Scenarios - A Tutorial in /usr/share/doc/packages/kiwi/kiwi.pdf.