65.2 Understanding Device Boot Processes in a ZENworks Imaging Environment

The following provides a high-level overview of a Linux boot process and how ZENworks 7 imaging affects it:

  1. A boot loader program loads the Linux kernel and initrd (initial RAM drive) into memory.

    The SLES-based imaging distribution uses isolinux as the boot loader for imaging CDs, a modified pxelinux for booting using PXE, or linld.com when using a single diskette with the CD. If you have a ZENworks partition installed, it uses the grub program to boot alternately between the ZENworks partition and the installed operating system.

    The following provides the current paths and filenames and a historical comparison:

    Files

    ZENworks 6.5 SP1 and Earlier

    ZENworks 7 NetWare and Windows Servers 1

    ZENworks 7 Linux Servers 2

    Preboot Loader

    Does the following:

    • Loads DOS

    • Runs loadlin

    CD boot: isolinux

    PXE boot: loadlin.dnx

    CD boot: isolinux

    PXE boot: /srv/tftp/pxelinux.0

    Linux Kernel Name

    CD boot: kernel

    PXE boot: linux.1

    Diskette: kernel.zen

    CD boot: \boot\loader\linux

    PXE boot: \tftp\boot\linux

    CD boot: /boot/loader/linux

    PXE boot: /srv/tftp/boot/linux

    Initrd Filename

    CD boot: initrd.gz

    PXE boot: linux.2

    Diskette: initrd (on the second diskette)

    CD boot: \boot\loader\initrd

    PXE boot: \tftp\boot\initrd

    CD boot: /boot/loader/initrd

    PXE boot: /srv/tftp/boot/initrd

    1 The same as ZENworks 6.5 SP2.

    2 The same as ZENworks 7 Linux Management.

  2. The Linux kernel starts running, does some device driver setup, then mounts the initrd file system.

    Regardless of which boot loader method is used, the main purpose is to set up the initrd file as a RAM drive, load the Linux kernel into memory, then turn control over to it with an indication to the Linux kernel of where to find initrd.

  3. The Linux kernel turns control over to linuxrc for performing initial hardware detection. When finished, control is returned to the Linux kernel.

    NOTE:ZENworks 6.5 SP1 and earlier imaging contains a linuxrc script file that performs some initial setup, but not the hardware detection.

  4. The Linux kernel starts a background process (/sbin/init).

    After control is passed to the linuxrc program, control is never returned to the Linux kernel or passed on to the init process.

    NOTE:ZENworks 6.5 SP1 and earlier use the init process to perform the imaging. All ZENworks imaging processing is performed within the linuxrc process. For this reason, some of the standard processes you are familiar with do not work or exist in ZENworks 7 imaging.

    For example, the halt and reboot commands are different. In a fully-installed Linux system, reboot actually performs an init 6 call. Because init is not running during the ZENworks 7 imaging process, an init 6 call cannot be made. Therfore, reboot has been aliased to reboot -r, which forces a reboot without trying to call init.

    Most other commands do run from the bash prompt, because bash is running.

For more information on linuxrc and zenworks.s, review the following sections:

65.2.1 linuxrc

When control is turned over to linuxrc, there are several processes it performs to get the system ready for the imaging process. Linuxrc is initially configured from the /linuxrc.config file, which is located in the initrd file system. Additional configuration information for linuxrc can be placed in the /info file (located in the initrd file system), but ZENworks does not normally use this information.

Linuxrc also loads a root file system, which is combined with the initrd file system that is set up by the boot loader. The root file system is located on an imaging CD as the file /boot/root. For PXE booting, the root file system is stored on the ZENworks Imaging server as:

  • NetWare/Windows servers: \tftp\boot\root

  • Linux servers: /srv/tftp/boot/root

Linuxrc attempts to locate and load the settings.txt file, either on the root of the imaging CD, or on the ZENworks Imaging server in the TFTP directory. From settings.txt, linuxrc reads and processes any parameters that pertain to itself, then copies settings.txt to the root (/) of the file system.

65.2.2 zenworks.s

A normal SUSE installation for SUSE Linux or SLES boots to a small distribution to perform a YaST installation. ZENworks Imaging boots with the same installation system, but instead of starting a YaST installation, it starts the ZENworks Imaging process. Control is turned over to the ZENworks script /bin/zenworks.s, which is the main script file for ZENworks imaging processing. The script performs a certain number of setup tasks, then gives control to the appropriate script for the selected imaging process. For more information on the imaging process, see Section 56.1, Understanding Desktop Management Preboot Services.

One of the setup tasks is to apply any update files. When booting from a CD, zenworks.s copies the /addfiles directory structure to the Linux file system. For more information, see Section 65.4.1, Adding Files to an Imaging Boot CD.

65.2.3 Forcing a Reboot in an Imaging Script

If you are using a script to image a device, in order for the device to reboot properly during the init process, you need to include the reboot -f command in this script. The -f switch forces a reboot, even if init cannot be found.

Using reboot without a switch, or even using shutdown -h now, causes errors in rebooting.