Modifying ZENworks Imaging Resource Files

From time to time you might want to modify an imaging distribution by adding your own files. These can be additional programs, scripts, data files, or updated Linux drivers.

You can use the following methods to update imaging resource files:

The following sections provide various methods for modifying imaging resource files in the initrd or root file systems:


Adding Files to an Imaging Boot CD

If you have files to add to an imaging boot CD so they can be available for use when you get to the actual imaging process (such as scripts, but normally not driver modules), you can copy the files to the /addfiles directory on the imaging CD. This is an easy way to insert your script or other files into the distribution without modifying the initrd or root file systems. However, these files are not available during the boot and module loading phases.

The imaging boot CD has a directory named /addfiles where you can add files. They should be placed below this directory in their proper directory names. They are then available in this directory structure during the imaging process.

An example of how you can add files:

  1. If you want to execute your own script instead of the normal imaging process, create a script file named myscript.s and place it on the boot CD. For example, /addfiles/bin/myscript.s.

    IMPORTANT:  The script file must have proper LF line terminators that Linux requires, not the DOS CR and LF end-of-line characters. In other words, you cannot use Notepad.exe to create the script; you must use a text editor compatible with Linux or UNIX, such as TextPad.

  2. To place the following line in the settings.txt file, enter:

    export IMGCMD=/bin/myscript.s

    When imaging is run, it runs /bin/myscript.s instead of using the normal img auto command.


Adding Files to the Initrd or Root File Systems

This is the preferred method for updating imaging resource files, and must be performed in a Linux environment.

Before performing the procedure given below, make sure you have created backup copies of any files you plan to change. If you want to change the files on an imaging CD, you need an ISO editor or some other process for extracting and replacing the file in the bootcd.iso image file.

IMPORTANT:  When updating or adding files and Linux drivers in the initrd or root file systems, document the changes you make. When you receive updated resource files from Novell, they do not contain your customized changes. If the kernel version has changed with the newer resource files from Novell, previously added drivers must be updated either by obtaining a new version from the manufacturer or recompiling the driver using the correct Linux kernel version source.

You can use the following procedure for the root file system by simply replacing "initrd" with "root" in the steps. However, Linux drivers should always be placed in the initrd file system, not the root file system.

To modify the initrd or root file system:

  1. Using a Linux machine, create a working directory and change to that directory.

  2. To copy initrd from the PXE server or the boot CD to the new working directory:

    • For PXE, copy \tftp\boot\initrd to the Linux workstation's working directory.
    • For the CD, extract initrd from the \boot\loader directory on the boot CD, then copy the extracted initrd to the Linux workstation's working directory.
  3. To rename initrd to initrd.gz, enter:

    mv initrd initrd.gz

  4. To unzip the initrd.gz file, enter:

    gunzip initrd.gz

  5. To create another working directory for use as a mount point in the subsequent steps, enter:

    mkdir work

  6. To mount the initrd file system to the /work directory, enter:

    mount -o loop initrd work

  7. To copy your files or updated driver to the mounted initrd file system, enter:

    cp /your_path/module.ko work/lib/modules/2.6.5-override-default/initrd

    where your_path is the path to the module.ko file and module is the name of the module.

    Other files to be included in the initrd file system should be copied to the appropriate directory.

  8. To unmount the initrd file system, enter:

    umount work

  9. To zip the new initrd file, enter:

    gzip -v9c initrd > initrd.gz

  10. To rename initrd.gz back to initrd, enter:

    mv initrd.gz initrd

  11. To copy the file back:

    • For PXE, copy the updated initrd to the \tftp\boot directory on the PXE server.
    • For the CD, copy the updated initrd to the \boot\loader directory on the boot CD.