You are here: Advanced Concepts > Creating DynaCenter Software Components > Sample Linux Components > Creating a Component to Install a Specific Kernel

Creating a Component to Install a Specific Kernel

This component adds the 2.6.18 kernel and its associated files to a CentOS 5.6 image during the deploy process.

Use Case

Some servers use a network mounted kernel so, when you capture that server image, the image contains no kernel. This component installs a kernel into an image that has no kernel when the image is deployed into a datacenter environment.

Prerequisite

The target server must have access to a yum repository so that the component can initiate the installation of the kernel package and resolve any dependencies the kernel package might have.

Create the Component

As a root user on the MWS, complete the following procedure:

  1. Create a component working directory.

    Example: mkdir /root/components

  2. In the components directory, create the directory structure for this component.

    Example: mkdir -p centos5-2.6.18/root

  3. In the centos5-2.6.18 directory, create a shell-compatible postprovision script to yum install the 2.6.18 kernel.
  4. In the centos5-2.6.18 directory, type the following command to change the owner and group associated with the script:
    chown root:root postprovision
  5. In the centos5-2.6.18 directory, type the following command to change the access permissions of the script:
    chmod 0500 postprovision
  6. In the components directory, type the following command to create the component archive:
    msa --name='centos5-2.6.18' \
    --desc='yum install kernel-2.6.18' \
    --ostype='CentOS_Linux-5_*_*-x86_64' \
    centos5-2.6.18
    

    Where:

    Options--nameComponent name; if not specified, the pathname is used
    --descHelpful description for the component
    --ostype

    Operating system of the component and the image it will be applied to

    Note: Each component must have the same os-type as the image that will use it or the deploy will not complete successfully. The dccmd list ostypes command lists valid operating system types. The format supports wildcards; however, it is always best to select the most specific value possible.

    Argument--pathnameComponent directory where the component control files should be placed
  7. In the components directory, type the following command to convert the archive into a component:

    rinstallsnapshot \
    --description='yum install kernel-2.6.18' \
    --ostype='CentOS_Linux-5_*_*-x86_64' \
    centos5-2.6.18 \
    centos5-2.6.18.tar \
    default
    

    Where:

    Options --description Helpful description for the component
    --os-type

    Operating system of the component and the image it will be applied to

    Note: Each component must have the same os-type as the image that will use it or the deploy will not complete successfully.

    Arguments name Descriptive name for the software component
    source Component archive used for the component
    repository

    Repository that will hold the component

    Note: This should always be default.

  8. Add the component statement to the deploy profile that will be used with the image deploy task.

    Example:  

    #Deploy my component
    component centos5-2.6.18
    

 

© Copyright Racemi Incorporated 2017. All rights reserved.