2.4 Automated Installation

This section on automated installation comprises several different types of installation that enable you to roll out highly customized installations to a great number of machines. Not all of the scenarios are completely hands-off (not requiring any physical access to the machines), but all of them involve customization of the machine's configuration, software selection, or even the installation procedure itself.

IMPORTANT:Before considering mass deployment of NLD using any of the following techniques (imaging, firstboot, or control.xml), make sure the roll-out is done to machines of a similar or even identical type and setup. Make sure the amount of disk space and RAM is identical and that the same type of disk is used on all target machines. Otherwise you might end up with unusable installations.

2.4.1 Imaging

Imaging is the process of installing a default configuration on a workstation, taking a “snapshot” of that workstation, and then duplicating the configuration on other workstations.

Considerations

Before you start, consider the following issues:

  • Are the master machine and the targets of an identical hardware configuration? If not, this approach isn't suitable for installing NLD in this particular setup.
  • Be aware of the fact that some aspects of the targets’ configuration need to be changed manually, especially if you didn’t use DHCP network configuration on the master machine. Cloning machines using static network setup would result in conflicting IP addresses and a nonfunctional networking environment.
  • Do not consider imaging using this method on machines with multiple disks. The approach is not suited for complex multidisk environments.
  • To what degree would you like to customize the installation?

    Simple imaging just clones the system's basic configuration. If you are aiming for customized cloning of the desktop environment, consider the Customizing Novell Linux Desktop.

Prerequisites

You need the following items to be able to do imaging:

  • An installed, pristine NLD machine to act as master machine.
  • The original NLD installation CD1 or DVD.
  • An NFS server in the same network as the master and target machines with enough disk space to hold the master machine's disk image.
  • A fully functional network configuration on any machine involved in this setup.
  • A copy of your partition table to determine which disk and which partition need to be imaged. In a system with several disks, always image the one holding the root partition with all the system configuration data.
  • Determine the type of disk used on the master machine. The first SCSI disk would be referred to as /dev/sda whereas the first (E)IDE disk would be referred to as /dev/hda.

    Make sure the target’s hard disk is at least of the same size as the master machine’s disk. Otherwise, the image would be incomplete, vital functionality could be missing, and the system would be unusable.

Simple Imaging

Simple imaging is used to just clone the basic system configuration of the master to any target machine you want.

  1. Boot the master machine from the original installation media (NLD CD1 or DVD).

  2. Select the Rescue System option to boot into the rescue mode of NLD.

  3. Type root to log in.

    A password isn't required at this point.

  4. Select the language settings to be used in the rescue system.

  5. Configure the network in the rescue system to be able to connect to the NFS server.

    1. Configure the IP address and netmask, then activate the interface by entering

      ifconfig eth0 ip_address netmask some_netmask up

      Replace ip_address and some_netmask with values that fit your network setup.

    2. Configure routing (if necessary) by entering

      route add default gw ip_address_gateway

      Replace ip_address_gateway with a gateway address that matches your requirements.

  6. Mount an NFS exported directory from the NFS server to the /mnt directory on the master machine to hold the disk image by entering

    mount ip_nfs_server:exported_dir /mnt

    Replace ip_nfs_server and exported_dir with the actual values in your setup.

  7. Create an image of your hard disk and store it on the NFS mounted directory by entering

    dd if=/dev/hda of=/mnt/image.bin bs=16k

    In the above command, the first (E)IDE disk is imaged. Adjust the command to the requirements of your machine's setup. If you need to image a SCSI disk, use /dev/sda instead.

  8. Boot the target machine from the original installation media (NLD CD1 or DVD).

  9. Select the Rescue System option to boot into the rescue mode of NLD.

  10. Type root to log in.

    A password isn't required at this point.

  11. Select the language settings to be used in the rescue system.

  12. Configure the network in the rescue system to be able to connect to the NFS server.

    1. Configure the IP address and netmask, then activate the interface by entering

      ifconfig eth0 ip_address netmask some_netmask up

      Replace ip_address and some_netmask with values that fit your network setup.

    2. Configure routing (if necessary) by entering

      route add default gw ip_address_gateway

      Replace ip_address_gateway with a gateway address that matches your requirements.

  13. Mount an NFS exported directory from the NFS server to the /mnt directory on the target machine by entering

    mount ip_nfs_server:exported_dir /mnt

    Replace ip_nfs_server and exported_dir with the actual values in your setup.

  14. To avoid swapping while transferring the image onto the target’s hard disk, identify the swap device currently in use and disable swapping for this device by entering

    swapon -s swappoff /dev/output_of_swapon

  15. Enter the following to transfer the disk image from the NFS mounted partition in the rescue system to the disk of the target system:

    dd if=/mnt/image.bin of=/dev/hda bs=16k

    Make sure you adjust the disk type used to the disk setup in the target machine (see Step 7).

  16. Remove the boot (installation) media from the CD-ROM drive, then reboot the target machine.

Advanced Imaging

For more advanced imaging features, use a third-party, commercial package such as Symantec* Ghost*.

Customizing Novell Linux Desktop

NLD offers several methods for customizing the NLD installation you roll out to the target machines. You can customize NLD with regard to the following aspects:

  • Hardware configuration (if rolled out to a set of identical machines)
  • Disk use and partitioning (if rolled out to a set of identical machines)
  • Default settings for new users
  • Desktop look-and-feel
  • Standard applications
Customizing NLD Using YaST

Most of the default system settings (like hardware configuration, partitioning and device setup) can be done using YaST. For more information, see Section A.0, Using YaST to Configure the Novell Linux Desktop.

WARNING:Make sure both the master and target machine share the same hardware setup. Exporting partitioning schemes, graphics settings, or other hardware configurations to machines that don't match the setup or the master machine might break the installation and render the systems unusable.

Initial Environment

When the home directory for a new user is created, it is initialized with files from the /etc/skel directory. As system administrator, you can create files in /etc/skel that provide a default environment for users. For example, you might create a /etc/skel/.profile file that sets the EDITOR environment variable to a text editor that is easy for new users to use.

However, it is usually best to keep /etc/skel as small as possible, because it is difficult to update existing users’ files. For example, if the name of the friendly editor changes, all existing users would have to edit their .profile file. You could try to do it automatically, with a script, but that is almost certainly going to break someone’s file.

Whenever possible, it is best to put global configuration into global files, such as /etc/profile. This way, it is possible to update without breaking users’ personal settings.

Customizing GNOME

The GNOME desktop configuration is done via a centralized repository that can be edited using the gconf editor tool that comes with the GNOME desktop. gconf allows you to customize the following aspects of your desktop:

  • Desktop theming (window themes, background images, number of virtual desktops)
  • Panel configuration (allow or disallow certain configuration options)
  • Menu options available in any GNOME/Gtk-based application and on the desktop
  • User actions (log out, lock screen, launch command)

For more information, see Section E.0, GNOME Configuration for Administrators.

Customizing KDE

The kiosk framework of KDE allows you to customize almost any aspect of your desktop. The KDE desktop comes with the kiosk configuration tool offering a graphical interface to all the different configuration tasks. It allows you to customize the following aspects of your desktop:

  • Desktop theming
  • Panel configuration
  • Menu options in any Qt application and on the desktop
  • User actions
  • Internet use (disallow certain URLs in Konqueror)

For more information, see Section F.0, KDE Configuration for Administrators.

2.4.2 Firstboot Configuration

The YaST firstboot utility (YaST Initial System Configuration), which runs after the installation is completed, lets you configure NLD before creation of the install image so that on the first boot after configuration, users are guided through a series of steps that allow for easier configuration of their desktops.

IMPORTANT:Because this scenario involves imaging, the concerns and constraints of this technique mentioned in Imaging also apply to this approach.

Considerations

Consider using firstboot if you want to

  • Customize the installation experience for the users or administrators that will be using NLD.
  • Make sure all installations proceed in the same way, which makes maintaining these systems much easier compared to maintaining a lot of different types of machines and installation patterns.
  • Use imaging and have a similar software pattern and configuration rolled out to a large number of similar machines.

Prerequisites

Before using firstboot, make sure the following items are provided and taken care of:

  • A master machine where NLD can be installed
  • Target machines of the same (or at least a very similar) hardware configuration as the master machine (hard drives, peripherals, graphics, and sound devices)
  • A machine acting as the NFS server to hold and distribute the image
  • The NLD installation media (CDs or DVD)
  • A working network environment for the master, target, and NFS server machines (including a name service)

Procedures

A typical firstboot process can be split into three subtasks:

Preparing the Master Machine

The master machine needs to be installed and configured before you can enable firstboot and start the imaging process.

  1. Install NLD on a master machine, making sure that you install the firstboot package.

    Firstboot is disabled by default. The YaST firstboot package is not part of any software selection and has to be installed individually. During the NLD installation, on the Installation Settings screen, click Software > Detailed Selection, and then search for and install the yast2-firstboot package.

  2. As root, create a file called /etc/reconfig_system by entering

    touch /etc/reconfig_system

  3. Enable the firstboot service either by using the YaST runlevel editor or by entering the following at the command line as root:

    insserv firstboot

Imaging the Master Machine's Hard Disk

To export the master machine's configuration, you need to image its hard disk and export this image to the targets.

  1. Boot the master machine from the original installation media (NLD CD1 or DVD).

  2. Select the Rescue System option to boot into the rescue mode of NLD.

  3. Enter root to log in.

    A password isn't required at this point.

  4. Select the language settings to be used in the rescue system.

  5. Configure the network in the rescue system to be able to connect to the NFS server.

    1. Configure the IP address and netmask, then and activate the interface by entering

      ifconfig eth0 ip_address netmask some_netmask up

      Replace ip_address and some_netmask with values that fit your network setup.

    2. Configure routing (if necessary) by entering

      route add default gw ip_address_gateway

      Replace ip_address_gateway with a gateway address that matches your requirements.

  6. Mount an NFS exported directory from the NFS server to the /mnt directory on the master machine to hold the disk image by entering

    mount ip_nfs_server:exported_dir /mnt

    Replace ip_nfs_server and exported_dir with the actual values in your setup.

  7. Create an image of your hard disk and store it on the NFS mounted directory by entering

    dd if=/dev/hda of=/mnt/image.bin bs=16k

    In the above command, the first (E)IDE disk is imaged. Adjust this command to the requirements of your machine's setup. If you need to image a SCSI disk, use /dev/sda instead.

  8. Boot the target machine from the original installation media (NLD CD1 or DVD).

  9. Select the Rescue System option to boot into the rescue mode of NLD.

  10. Enter root to log in.

    A password isn't required at this point.

  11. Select the language settings to be used in the rescue system.

  12. Configure the network in the rescue system to be able to connect to the NFS server.

    1. Configure the IP address and netmask, then activate the interface by entering

      ifconfig eth0 ip_address netmask some_netmask up

      Replace ip_address and some_netmask with values that fit your network setup.

    2. Configure routing (if necessary) by entering

      route add default gw ip_address_gateway

      Replace ip_address_gateway with a gateway address that matches your requirements.

  13. Mount an NFS exported directory from the NFS server to the /mnt directory on the target machine by entering

    mount ip_nfs_server:exported_dir /mnt

    Replace ip_nfs_server and exported_dir with values matching your actual setup.

  14. To avoid swapping while transferring the image onto the target’s hard disk, identify the swap device currently in use and disable swapping for this device by entering

    swapon -s swappoff /dev/output_of_swapon

  15. Enter the following to transfer the disk image from the NFS-mounted partition in the rescue system to the disk of the target system:

    dd if=/mnt/image.bin of=/dev/hda bs=16k

    Make sure you adjust the disk type used to the disk setup in the target machine (see Step 7).

  16. Remove the boot (installation) media from the CD-ROM drive, then reboot the target machine.

Configuring the Target Machine

After the master machine's configuration has been cloned to the target's hard disk and the target is booted for the first time, firstboot starts and then the user or system administrator needs to complete some final configuration steps.

NOTE:The Post Configuration Utility (firstboot) expects the X Window System to be configured. If it isn’t, firstboot automatically starts in text mode.

  1. Acknowledge the License Agreement.

  2. Set the date and time to match with your setup.

  3. Set the machine's root password.

  4. Create user logins.

  5. Finish the configuration and exit firstboot.

During firstboot, two additional dialogs are displayed (for writing the data and running SuSEconfig) which require no user interaction. For more information on SuSEconfig, see “Section 11.6, SuSEconfig and /etc/sysconfig” in the SUSE LINUX Enterprise Server 9 Administration and Installation Guide.

Customizing YaST Firstboot

The user's experience of YaST and YaST firstboot can be customized to a certain extent. You can set certain actions to be taken in certain situations, add scripts to be executed to further adjust the target machine's configuration, and customize the messages passed on to the user.

The configuration file for firstboot is located in /etc/sysconfig/firstboot. The following variables can be used to further customize the firstboot process.

Table 2-5 Firstboot Configuration File Variables

Variable

Description

SCRIPT_DIR="/usr/share/firstboot/scripts"

Specifies the path where all scripts used by firstboot are located. If you want to add your own scripts to further customize the system, store them at the given location or specify another.

FIRSTBOOT_WELCOME_FILE=""

Specifies the location of your own customized version of the YaST welcome message. If left empty, the NLD default welcome message is displayed.

FIRSTBOOT_LICENSE_FILE="/var/lib/YaST2/info.txt"

Provides the license text, or EULA (End User License Agreement), of the product being installed. The default text is taken from the /var/lib/YaST2/info.txt file. If you need to use a custom license agreement, create a text file containing the custom license and specify its location here.

FIRSTBOOT_FINISH_FILE=""

Specifies the location of your own customized version of the YaST finish message. If left empty, the NLD default finish message is displayed.

NOTE:If the referenced files in welcome, license, and finish messages are in plain text, they are shown as such automatically. If they contain any markup language, they are formatted as rich text.

SHOW_Y2CC_CHECKBOX="no"

Determines whether the Start Control Center option should be displayed as part of the finish screen in firstboot. The default value of SHOW_Y2CC_CHECKBOX is set to NO because further user interaction with the system configuration is not desired.

LICENSE_REFUSAL_ACTION="halt"

Specifies which action should be taken if the user does not acknowledge the license agreement. Possible values are halt (the system is halted), continue (continue with firstboot system configuration), and abort (abort the firstboot process and boot into the cloned installation). Because you need all NLD users to formally agree to the license agreement, your default setting should be halt.

2.4.3 Create Custom Installations Using the control.xml File

The product configuration file (control.xml) lets you customize the installation by making it possible to enable and disable features of the final installed product during installation. It controls the workflow a user sees during installation.

Besides workflow configuration, other system variables are configurable and can be predefined by the system administrator, including software selection and environment settings such as language, time zone, and keyboard. Any configuration here overrides default variables provided with Novell Linux Desktop.

The idea of having a predefined installation workflow and predefined system settings is the middle ground between manual installation and automated installation.

Considerations

Before you start using the control.xml file as a tool to install your clients, consider the following:

  • Determine which types of hardware are involved. Different types of hardware need to be addressed differently by any kind of automized installation routine.
  • Be aware of the fact that using the control.xml file for installation only represents a semiautomated approach to installation. User or administrator interaction is still required to some degree.
  • If a completely hands-off installation method with no user interaction whatsoever is called for, consider using AutoYaST as described in Section C.0, Automatic Linux Installation and Configuration Using AutoYaST or imaging as described in Imaging.

    Using AutoYaST, multiple systems sharing the same environment and similar (but not necessarily identical) hardware performing similar tasks can easily be installed in parallel and in a short time.

Scope of the Control.xml File

The product configuration file is provided in text on the installation media and defines the following settings needed during installation:

Table 2-6 Supported Configuration Options

Option

Description

Workflow

Replaces the static workflow list with a configurable list using the product configuration file. Entire sections of the workflow can be skipped.

For example, if the IT department wants to force French installations in Quebec, Canada, you can set the language variable in the configuration file so that the Language dialog is skipped during the installation. If the IT department wants to recommend settings but still give the users the ability to change the default settings, the Language dialog could still be shown but with French preselected.

If none of the above options is used, the default settings are shown.

For more information, see Workflows.

Proposals

Are also configurable. For example, certain products would skip some proposals. On the proposal screen, the preconfigured settings can be shown with the possibility of changing them or with inactive links if the configuration is to be forced.

For more information, see Proposals.

System Variables

Lets the users define system variables such as language, keyboard, time zone, window manager, and display manager. The defined variables are used as defaults in the respective dialogs.

For more information, see Installation and Product Variables.

Package Selections and Additional Individual Packages

Defines what base package selection and add-on selections should be used for the installation. Also provides the possibility of defining a list of additional packages. All packages and selections can be selected, depending on the architecture, using a special architecture attribute in the configuration file.

For more information, see Software.

Partitioning

Integrates flexible partitioning into the configuration file instead of the separate file currently used.

For more information, see Partitioning.

Scripting and Hooks

Defines hooks and special slots where the user can execute scripts. For example, scripts can be executed at the very beginning of the installation (after processing the configuration file), in the installation system before the initial boot, in the chroot-ed environment after initial boot, and before/after every step in the workflow. The scripting languages supported during installation are Shell and Perl.

For more information, see Hooks.

Implementation

The control file is implemented in simple, structured XML syntax, which so far has been used for automated installation. The XML structure used can be mapped easily to YaST data structures, and all data types available in YaST are supported for easy data access and manipulation.

The primary use of the control file is to configure the workflow of the installation. It lets you predefine a certain setup, but it also defines product installation features and other product-related variables.

NOTE:The control file is not an optional tool to help customize installation. It is required during installation, and installation can fail or lead to unexpected results without the file. YaST provides a general default control file which is always available in the system. The general and product-independent control files are installed by the YaST-installation package in /usr/share/YaST/control/control.xml.

During installation, linuxrc searches for the a file named control.xml on the installation medium (for example, CD, NFS, or FTP), copies the file to the installation system, and makes the file available to YaST. YaST then starts and looks for the control file in the following three locations before starting with the installation workflow:

Table 2-7 Control File Locations

Location

Description

/control.xml

Usually found in the top directory after it has been copied by linuxrc during the initial installation phase.

/var/lib/YaST/control.xml

After reading the file, and before the second installation phase, the control file is copied from the top directory to this location.

/var/lib/YaST/control.xml.

/usr/share/YaST/control/control.xml

The location where YaST-installation installs the file in all products. The file is the same on all products.

One of the main reasons for using the control file is to let non-YaST developers change the installation behavior and customize various settings without the need to change YaST packages.

Configuration

This section contains information on the following:

Workflows

Using the control file, you can define multiple workflows for different modes and installation stages. The element workflows in the control file evaluates to a list of workflows.

Beside defining which YaST clients should be executed during installation, the workflow configuration also lets you specify the wizard steps and how they should appear during a graphical installation.

A workflow list element is a map with the following elements:

Table 2-8 Workflow List Elements

Element

Description

label

Label of the workflow as it appears on the left side of the wizard. For example, Base Installation.

defaults

Default arguments to the clients. This is a map element.

stage

Defines the stage or phase of installation. Possible values are initial (for the initial), stage, and continue (for the workflow of the installation after reboot).

mode

Defines installation mode. Several modes are available; the most important are the following:

  • installation
  • update
  • autoinst

modules

The actual workflow. A list of elements describing the order in which the installation should proceed.

A module element is a map with the following configuration options

  • name: Name of the module. All installation clients and modules have a unified prefix (inst_), which can be omitted here. For example, if the YaST file for the module is called inst_test, then the name in the control file is test.

  • label: Label of the module in the step dialog. This is an optional element. If it is not set, the label of the previous module is used.

  • arguments: Arguments for the module is a comma-separated list which can accept Boolean operators and symbols.

The following is a typical installation workflow:

<workflows config:type=”list”>
        <workflow>
            <!-- ’label’ is what the user will see -->
            <label>Base Installation</label>
            <!-- default settings for all modules -->
            <defaults>
                <!-- arguments for the clients -->
                <arguments>false,false</arguments>
                <!-- allowed architectures “all”, “i386”, “i386,ia64,x86_64”  -->
                <archs>all</archs>
            </defaults>
            <stage>initial</stage>
            <mode>installation,update</mode>
            <modules  config:type=”list”>
                <module>
                    <name>info</name>
                    <arguments>false,true</arguments>
                </module>
                <module>
                    <name>proposal</name>
                    <arguments>true,true,`ini</arguments>
                    <label>Installation Settings</label>
                </module>
                <module>
                    <name>do_resize</name>
                    <update config:type=”boolean”>false</update>
                    <archs>i386,x86_64,ia64</archs>
                    <label>Perform Installation</label>
                </module>
                <module>
                    <name>prepdisk</name>
                    <!-- Multiple modules with the same ’label’ will be
                         collapsed to one single user-visible step.
                         The step is considered finished when the last module
                         with the same ’label’ is finished.  -->
                    <label>Perform Installation</label>
                </module>
                <module>
                    <name>kickoff</name>
                    <label>Perform Installation</label>
                </module>
                <module>
                    <name>rpmcopy</name>
                    <label>Perform Installation</label>
                </module>
                <module>
                    <name>finish</name>
                    <label>Perform Installation</label>
                </module>
            </modules>
        </workflow>
Proposals

Part of the installation workflows are proposal screens, which consist of groups of related configuration settings (for example, Network, Hardware, and the initial Installation proposal).

You can add or modify a proposal, which we do not recommended because of configuration dependencies, by using the control file:

<proposal>
      <type>network</type>
      <stage>continue,normal</stage>
      <proposal_modules config:type=”list”>
           		<proposal_module>lan</proposal_module>
           		<proposal_module>dsl</proposal_module>
           		<proposal_module>isdn</proposal_module>
           		<proposal_module>modem</proposal_module>
           		<proposal_module>proxy</proposal_module>
	 	<proposal_module>remote</proposal_module>
       </proposal_modules>
</proposal>

The proposal in the above example is displayed in the so-called continue mode, which is the second phase of the installation. The proposal consists of different configuration options which are controlled using a special API.

NOTE:Proposal names and captions are fixed and cannot be changed. It is not possible to create a special proposal screen. Instead, you should use the available screens: network and hardware.

In the workflow, the proposals are called as any workflow step with an additional argument identifying the proposal screen to be started (`net for network, and `hw for hardware proposals). The following example shows how the network proposal is called as a workflow step:

<module>
    <label>Network</label>
    <name>proposal</name>
    <arguments>true,true,`net</arguments>
</module>
Installation and Product Variables

It is possible to define some installation variables and force them in the proposal. The user can still change them, however.

The following variables can be set:

  • Timezone (timezone)
  • Language (language)
  • Keyboard (keyboard)
  • Auto Login (enable_autologin)

    Auto Login is not recommended for multiuser environments and server installations.

The following example shows all options listed above:

	<globals>
        <enable_autologin config:type=”boolean”>true<enable_autologin>
        <language>de_DE</language>
        <timezone>Canada/Eastern</timezone>
	</globals>
Software

Use this section in the control file to change the software proposal during installation.

An example software section could look like the following:

<software>	 		
<delete_old_packages config:type=”boolean”>false</delete_old_packages>
    <selection_type config:type=”auto”>auto</selection_type>
</software>  

By default, the software proposal is generated depending on the available space in the system. If enough space is available, a fairly large number of packages and add-on package groups are automatically selected. This behavior is controlled by the selection_type element in the control file.

The default value for selection_type is auto. To force a selection (which a user cannot change), use the fixed value.

If you want a fixed software selection, the fixed selection name must be specified in the control file. This selection must be a base selection. To specify the name of the base selection to be forced, use the base_selection element.

The list of base selections can be found on the first CD of the product in the suse/setup/descr directory or by using the following command over the NLD-9 repository of your network installation source:

for i in `grep -l baseconf CD1/suse/setup/descr/* `; do 
      basename $i .sel; 
done

The above command generates the following output:

Gnome
Kde

which matches the base selections in NLD.

Additionally, you can configure package updates using the following options:

delete_old_packages
Does not delete old RPMs when updating.
only_update_selected
Updates only packages already installed or upgraded (also installs new packages with new functionality).

You can also use the software_proposal element to switch from desktop-based proposals to the normal behavior of software proposals in YaST. Setting the value to desktop makes YaST show a dialog with desktops to select from (KDE or GNOME). If this element is not defined, default behavior is assumed.

Adding Custom Software

You can also add additional software by creating custom software selections according to the procedure described in Software and pulling them in via the software proposal described in Software.

To add a custom selection to your installation scope, proceed as follows:

  1. Prepare an add-on selection containing the additional software you want to include in the installation of NLD according to the procedure outlined in Custom Package Selections.

  2. Add the selection to the control file.

    The software section of your control file should now read as follows.:

    <software>
    <selection_type config:type=”symbol”>fixed</selection_type>
    <addons config:type=”list”>
    <addon>mysel</addon>
    </addons>
    <base>Minimal</base>
    ...
    </software>
    

    The addons property encloses any additional selections you want to add. Just list any selection here, again enclosed by addon, and replace mysel with the actual name of your custom selection. The standard NLD selections you want to make are enclosed by the base element. A list of packages is added by the following code:

    <software>
    <selection_type config:type=”symbol”>fixed</selection_type>
    ...
    <packages config:type=”list”>
    <package>package1</package>
    <package>package2</package>
    ...
    </packages>
    </software>
    

    Replace package1 and package2 with package names matching your needs.

Partitioning

If present, the partition proposal is based on the data provided in the control file.

Algorithm for Space Allocation

Space allocation on a disk happens in the following order:

  1. All partitions get the size allocated that is determined by the size parameter of the partition description.
  2. If a disk cannot hold the sum of these sizes, this disk is not considered for installation.
  3. If all demands by the size parameter are fulfilled and there is still space available on the disk, the partitions which have a percent parameter specified are increased until the size demanded by percent is fulfilled.
  4. If there is still available space on the disk (this normally happens only if the sum of all percent values is below 100), all partitions specified with a size of 0 are enlarged as far as possible.
  5. If a maxsize is specified for a partition, all enlargement are done only up to the specified maxsize.

If more than one of the available disks are eligible to hold a certain partition set, the disk is selected as follows:

  1. If there is a partition allocated on that disk that has its size specified by percent or size=0 keywords and does not have a maxsize value set, the desired size for this partition is considered to be unlimited.
  2. If a partition group contains a partition with an unlimited desired size, the disk that maximizes the partition size for the unlimited partitions is selected.
  3. If all partitions in a partition group are limited in size, the smallest disk that can hold the desired sizes of all partitions is selected for that partition group.

If there are multiple partition groups:

  1. The partition group with the lowest number (which means the highest priority) gets assigned its disk first.
  2. The partition group with the next priority gets assigned the optimal disk from the as-yet-unassigned disks.
Configuration Options

The following elements are global to all disks and partitions:

Table 2-9 Configuration Elements

Element

Description

disk

Specifies which partitions should be placed on which disks if multiple disks are present in the system. All partitions with the same disk value are placed on the same disk. The value after the keyword determines the priority of the partition group. Lower numbers mean higher priority. If there are not enough disks in the system, a partition group with lower priority is assigned to a separate disk before a partition group with higher priority. A partition without the disk keyword is implicitly assigned the highest priority of 0.

Example: <disk>2<disk>

formatopt

Describes the options given to the format command. Multiple options must be separated by spaces. There must not be a space between an option letter and an option value. This entry is optional.

Example: <formatopt>reiser<formatopt>

fstopt

Describes the options written to /etc/fstab. Multiple options must be separated by commas (,). This entry is optional.

Example: <fstopt>acl,user_xattr<fstopt>

fsys

Describes the file system type created on this partition. Possible types are reiser, ext2, ext3, xfs, vfat, jfs, and swap. If no type is given for a partition, reiserfs is used.

Example: <fsys>reiser</fsys>

id

Enables creation of partitions with partition IDs other than 0x83 (for normal file system partitions) or 0x82 (for swap partitions). This make it possible to create LVM or MD partitions on a disk.

Example: <id>0x8E<id>

increasable

After determining the optimal disk usage, the partition can be increased if there is unallocated space in the same gap available. If this keyword is set, the partition can grow larger than specified by the maxsize and percent parameters. This keyword is intended to avoid having unallocated space on a disk after partitioning (if possible).

Values: true|false

Default: false

Example: <increasable config:type=”boolean”>true<increasable>

keep_partition_fsys

Partitions that contain file systems in the list are not deleted even if prefer_remove is set to true.

Values: Comma-separated list of reiser, xfs, fat, vfat, ext2, ext3, jfs, ntfs, swap

Default: Empty list

keep_partition_id

Partitions that have a partition ID that is contained in the list are not deleted even if prefer_remove is set to true.

Values: Comma-separated list of possible partition IDs

Default: Empty list

keep_partition_num

Partitions that have a partition number that is contained in the list are not deleted even if prefer_remove is set to true.

To configure individual partitions and disks, a list element is used with its items describing how the partitions should be created and configured.

IMPORTANT:If there is a space or an equal sign (=) contained in an option value, the value has to be surrounded by double quotes ("). Values that describe sizes can be followed by the letter K (kilobytes), M (megabytes), or G (gigabytes).

Values: Comma-separated list of possible partition numbers

Default: Empty list

label

If the file system can have a label, the value of the label is set to this value.

Example: <label>emil<label>

maxsize

Limits the maximum amount of space that is allocated to a certain partition. This keyword is useful only in conjunction with a size specification by the percent keyword or by an entry of size=0.

Example: <maxsize>4G<maxsize>

mount

Describes the mount point of the partition. For a swap partition, the special value swap has to be used.

Example: <mount>swap</mount>

percent

Determines that a partition should be allocated a certain percentage of the available space for installation on a disk.

Example: <percent>30<percent>

prefer_remove

Values: true|false

Default: true

If set to false, the partition suggestion tries to use gaps on the disks or reuse existing partitions. If set to true, the partition suggestion prefers to remove existing partitions.

remove_special_partitions

If set to false, YaST does not remove some special partitions (for example, 0x12 Compaq diagnostics, 0xde Dell Utility) if they exist on the disk, even if prefer_remove is set to true. If set to true, YaST removes even those special partitions.

WARNING:Some machines are not bootable when these partitions are removed, so be careful when setting this to true.

Values: true|false

Default: false

size

Determines the minimum size for a partition. A size value of 0 means that YaST should try to make the partition as large as possible after all other demands regarding partition size are fulfilled. The special value of auto can be given for the /boot and swap partitions. If auto is set, YaST computes a suitable partition size by itself.

Example: <size>2G<size>

Examples of Flexible Partitioning

In the example below, if the machine has three disks, each of the partition groups is put on a separate disk. So one disk holds /var; another disk holds /home; and another disk holds /, /usr, and /opt.

          <partitions config:type=”list”>
            <partition>
                <disk config:type=”integer”>3</disk>
                <mount>/var</mount>
                <percent config:type=”integer”>100</percent>               
            </partition>
            <partition>
                <disk config:type=”integer”>2</disk>                                
                <mount>/</mount>
                <size>1G</size>
            </partition>
            <partition>
                <disk config:type=”integer”>2</disk>                                
                <mount>/usr</mount>
                <size>2G</size>
            </partition>
            <partition>
                <disk config:type=”integer”>2</disk>                                
                <mount>/opt</mount>
                <size>2G</size>
            </partition>
           <partition>
                <disk config:type=”integer”>1</disk>
                <mount>/home</mount>
                <percent config:type=”integer”>100</percent>               
            </partition>       
       </partitions>

If the machine has only two disks, then /home is on a separate disk (because it has lower priority than the other partition groups) and /, /usr, /opt, and /var share the other disk. If there is only one disk in the system, all partitions are on that disk.

A more complete example with other options is shown below:

      <partitioning>        
        <partitions config:type=”list”>
            <partition>
                <disk config:type=”integer”>2</disk>
                <mount>swap</mount>
                <size>auto</size>
            </partition>
            <partition>
                <disk config:type=”integer”>1</disk>
                <fstopt>defaults</fstopt>
                <fsys>reiser</fsys>
                <increasable config:type=”boolean”>true</increasable>
                <mount>/</mount>
                <size>2gb</size>
            </partition>
            <partition>
                <disk config:type=”integer”>2</disk>
                <fstopt>defaults,data=writeback,noatime</fstopt>
                <fsys>reiser</fsys>
                <increasable config:type=”boolean”>true</increasable>
                <mount>/var</mount>
                <pct config:type=”integer”>100</pct>
                <size>2gb</size>
            </partition>
        </partitions>
        <prefer_remove config:type=”boolean”>true</prefer_remove>
        <remove_special_partitions config:type=”boolean”>false
      </remove_special_partitions>
    </partitioning>
Hooks

It is possible to add hooks before and after any workflow step for further customization of the installed system and to perform nonstandard tasks during installation.

Two additional elements define custom script hooks:

prescript
Executes before the module is called.
postscript
Executes after the module is called.

Both script types accept two elements: the interpreter used (Shell or Perl) and the source of the scripts (which is embedded in the XML file using CDATA sections to avoid confusion with the XML syntax). The following example shows how scripts can be embedded in the control file:

                <module>
                    <name>info</name>
                    <arguments>false,true</arguments>
                    <prescript>
                        <interpreter>shell</interpreter>
                        <source>
<![CDATA[#!/bin/sh
touch /tmp/tux
echo anas > /tmp/anas
]]>
                        </source>
                    </prescript>
                </module>

An Example Installation Scenario Using a Control.xml File

The following example should outline the basic procedure to install one or multiple targets with a predefined installation scope using a control.xml file.

The example assumes the following items are present in your environment and correctly set up:

To proceed with the installation, do the following:

  1. Boot the target machines either using a physical boot medium or via the network.

    If using boot media, make sure the location of the network installation source is passed on to the installation routines. See Using Custom Boot Options.

    YaST starts up and pulls in the control.xml file from the installation server, then the installation proceeds as outlined in the control.xml file.

  2. Make the settings the custom workflow requires you to, then complete the installation.

HINT:Because this procedure closely resembles a standard network installation, any of the techniques mentioned in Remote Installation can be used to remotely control the installation procedure.