mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 11:22:27 +00:00 
			
		
		
		
	Moved kit build source files to buildkit rpm
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14826 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -0,0 +1,300 @@ | ||||
| # Kit Build File | ||||
| #  | ||||
| # This file was initially auto-generated by the buildkit CLI command. | ||||
| # To create a new kit, the user should modify this file accordingly. | ||||
| # Refer to the buildkit manpage for further details. | ||||
| # | ||||
|  | ||||
| # kit: This section defines general info for the Kit.  | ||||
| #      There must be exactly one kit section in a kit build file. | ||||
| #  | ||||
| # kit attributes: | ||||
| #    basename        (mandatory) Kit base name. e.g., kit-lsf | ||||
| #    description     (optional)  Kit description. | ||||
| #    version         (mandatory) Kit version. e.g., 1.0 | ||||
| #    ostype          (mandatory) Kit OS type.  Must be Linux. | ||||
| #                      AIX is currently not supported. | ||||
| #    isinternal      (optional)  PCM use only. | ||||
| #                      Indicate if Kit is for internal use. | ||||
| #                      Use 1 for yes, 0 for no. Default: 0 | ||||
| #    kitdeployparams (optional)  Filename containing a list of kit deployment | ||||
| #                       parameters, relative to | ||||
| #                       <Kit Build Directory>/other_files | ||||
| kit: | ||||
|    basename=vacpp | ||||
|    description=VACPP12 for Linux | ||||
|    version=12.1.0.0 | ||||
|    ostype=Linux | ||||
| #   kitdeployparams=sample/kitdeployparams.lst | ||||
|  | ||||
|  | ||||
| # kitrepo: This section defines a Kit Package Repository. | ||||
| #          There must be at least one kitrepo section in a kit build file.   | ||||
| #          If you want to support multiple OSes, you should create a separate | ||||
| #          repo for each OS.  Also, no two repos can be defined with the same  | ||||
| #          OS name, major/minor version and arch. For example, you cannot have | ||||
| #          two repos for RHEL 6.2 ppc64 in the same kit. | ||||
| # | ||||
| # kitrepo attributes: | ||||
| #    kitrepoid          (mandatory) Kit package repository ID. | ||||
| #                         Must be unique within this file. | ||||
| #    osbasename         (mandatory) OS distro base name. e.g., rhels. | ||||
| #    osmajorversion     (mandatory) OS major version. e.g., 6 | ||||
| #    osminorversion     (optional)  OS minor version. | ||||
| #    osarch             (mandatory) OS architecture. e.g., ppc64 | ||||
| #    compat_osbasenames (optional)  Comma-separated list of compatible  | ||||
| #                         OS distro base names. e.g., centos | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=rhels6_ppc64 | ||||
|    osbasename=rhels | ||||
|    osmajorversion=6 | ||||
|    osarch=ppc64 | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=sles11_ppc64 | ||||
|    osbasename=sles | ||||
|    osmajorversion=11 | ||||
|    osarch=ppc64 | ||||
|  | ||||
|  | ||||
| # kitcomponent: This section defines one Kit Component.   | ||||
| #               There can be zero or more kitcomponent sections.  | ||||
| #               If you want to build a component which supports multiple OSes, | ||||
| #               you should create one kitcomponent section for each OS.   | ||||
| #               Also, no two components in a kit can be defined with the same  | ||||
| #               base name.  | ||||
| #               You can define multiple kit components with the same base name | ||||
| #               only if each kit component using this base name meets these  | ||||
| #               requirements: | ||||
| #                 - Each kit component must be defined with the same version | ||||
| #                   and release number | ||||
| #                 - Each kit component must be defined with a unique kitrepoid | ||||
|  | ||||
| # | ||||
| # kitcomponent attributes: | ||||
| #    basename        (mandatory) Kit component base name | ||||
| #    description     (optional)  Kit component description | ||||
| #    version         (mandatory) Kit component version | ||||
| #    release         (mandatory) Kit component release | ||||
| #    serverroles     (mandatory) Comma-separated list of servers that this | ||||
| #                      component can install on. Valid values: | ||||
| #                         mgtnode,servicenode,compute,loginnode,storagenode | ||||
| #    kitrepoid       (mandatory) The ID of the kit package repository this | ||||
| #                      component belongs to | ||||
| #    kitcompdeps     (optional)  Comma-separated list of kit component | ||||
| #                       dependencies.  These kit components can be included in | ||||
| #                       this kit or in other kits. | ||||
| #    ospkgdpes=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)       (optional)  Comma-separated list of OS package dependencies | ||||
| #                       These packages must be shipped with the OS distro. | ||||
| #    kitpkgdeps      (optional)  Comma-separated list of kit package names that | ||||
| #                       will be listed as "REQUIRES" when building this kit | ||||
| #                       component. Each package must be defined in a separate | ||||
| #                       kitpackage section. Each package must be in the same  | ||||
| #                       kitrepo as this kit component. | ||||
| #    non_native_pkgs (optional)  TBD -- NOT SUPPORTED YET! | ||||
| #                       Comma-separated list of non-native package  | ||||
| #                       paths that will be included as files in this kit  | ||||
| #                       component. All filenames are relative to  | ||||
| #                       <Kit Build Directory>/source_packages  | ||||
| #                       Kit component deployment scripts must be specified | ||||
| #                       to manage these files. | ||||
| #   driverpacks      (optional) Comma-separated list of driver package filenames | ||||
| #                       Each driverpack must be defined in a separate kitpackage | ||||
| #                       section. | ||||
| #   exlist           (optional) Exclude list file for stateless image, relative | ||||
| #                       to <Kit Build Directory>/other_files | ||||
| #   Kit component deployment scripts (optional)  Each attribute specifies  | ||||
| #                       script path relative to <Kit Build Directory>/scripts | ||||
| #                       Script attributes: | ||||
| #                         preinstall, postinstall, preuninstall, postuninstall,  | ||||
| #                         preupgrade, postupgrade, postbootscripts | ||||
| kitcomponent: | ||||
|     basename=vacpp_compute | ||||
|     description=VACPP12 for compute nodes | ||||
|     version=12.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdpes=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=vac.cmp >= 12.1.0.0,vac.lib >= 12.1.0.0,vac.lic >= 12.1.0.0,vacpp.cmp >= 12.1.0.0,vacpp.help.pdf >= 12.1.0.0,vacpp.lib >= 12.1.0.0,vacpp.man >= 12.1.0.0,vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0,vacpp.samples >= 12.1.0.0 | ||||
|     exlist=vacpp.exlist | ||||
|     postbootscripts=vacpp_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=vacpp_loginnode | ||||
|     description=VACPP12 for login nodes | ||||
|     version=12.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdpes=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=vac.cmp >= 12.1.0.0,vac.lib >= 12.1.0.0,vac.lic >= 12.1.0.0,vacpp.cmp >= 12.1.0.0,vacpp.help.pdf >= 12.1.0.0,vacpp.lib >= 12.1.0.0,vacpp.man >= 12.1.0.0,vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0,vacpp.samples >= 12.1.0.0 | ||||
|     exlist=vacpp.exlist | ||||
|     postbootscripts=vacpp_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_vacpp_compute | ||||
|     description=Minimal VACPP12 packages for compute nodes | ||||
|     version=12.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdpes=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0 | ||||
|     exlist=vacpp.exlist | ||||
|     postbootscripts=vacpp_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=vacpp_compute | ||||
|     description=VACPP12 for compute nodes | ||||
|     version=12.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdpes=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=vac.cmp >= 12.1.0.0,vac.lib >= 12.1.0.0,vac.lic >= 12.1.0.0,vacpp.cmp >= 12.1.0.0,vacpp.help.pdf >= 12.1.0.0,vacpp.lib >= 12.1.0.0,vacpp.man >= 12.1.0.0,vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0,vacpp.samples >= 12.1.0.0 | ||||
|     exlist=vacpp.exlist | ||||
|     postbootscripts=vacpp_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=vacpp_loginnode | ||||
|     description=VACPP12 for login nodes | ||||
|     version=12.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdpes=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=vac.cmp >= 12.1.0.0,vac.lib >= 12.1.0.0,vac.lic >= 12.1.0.0,vacpp.cmp >= 12.1.0.0,vacpp.help.pdf >= 12.1.0.0,vacpp.lib >= 12.1.0.0,vacpp.man >= 12.1.0.0,vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0,vacpp.samples >= 12.1.0.0 | ||||
|     exlist=vacpp.exlist | ||||
|     postbootscripts=vacpp_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_vacpp_compute | ||||
|     description=Minimal VACPP12 packages for compute nodes | ||||
|     version=12.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdpes=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0 | ||||
|     exlist=vacpp.exlist | ||||
|     postbootscripts=vacpp_license | ||||
|  | ||||
|  | ||||
|  | ||||
| # kitpackage: This section defines one Kit Package, and how to build it. | ||||
| #             There can be zero or more kitpackage sections.   | ||||
| #             All filenames should be relative paths to | ||||
| #                <Kit Build Directory>/source_packages   | ||||
| #             If you want to build a package which can run on multiple OSes,  | ||||
| #             you have two options: | ||||
| #               1. Build a separate package for each OS you want to support.   | ||||
| #                  For this option, you need to define one kitpackage section  | ||||
| #                  per supported OS. | ||||
| #               2. Build one package that can run on multiple OSes.   | ||||
| #                  If you are building an RPM package, you are responsible for  | ||||
| #                  creating an RPM spec file that can run on multiple OSes.   | ||||
| #                  For this option, you need to define one kitpackage section | ||||
| #                  which contains multiple kitrepoid lines. | ||||
| #  | ||||
| # kitpackage attributes: | ||||
| #    filename   (mandatory) Package filename | ||||
| #    kitrepoid  (mandatory) The repo(s) this package belongs to.   | ||||
| #                 If multiple repos are defined, the package will be built for | ||||
| #                 the first repo only. For the other repos, a symlink is created | ||||
| #                 to the package built for the first repo. | ||||
| #   Package build methods (optional)   | ||||
| #                 Define how to build the packages.  | ||||
| #                 If you don't specify a build method, the default behavior is | ||||
| #                 to assume the package is pre-built under  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 All files in this section are relative to  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 There are four methods to build packages. | ||||
| #                   1. Use pre-built RPM package | ||||
| #                       isexternalpkg:  'no'|'0', 'yes'|'1'  (default:  'no')  | ||||
| #                         Indicates whether the RPM package will be added to the | ||||
| #                         the kit tar file now as part of the kit build process, | ||||
| #                         or whether the customer will need to separately | ||||
| #                         obtain the RPM pacakage and add it to the kit tar file | ||||
| #                         using 'buildkit addpkgs' | ||||
| #                       rpm_prebuiltdir: If isexternalpkg=yes, path to directory | ||||
| #                         containing pre-built RPM package | ||||
| #                   2. Build RPM from spec + src dir | ||||
| #                       rpm_spec:   Path to spec file. | ||||
| #                       rpm_srcdir: Path to source directory. | ||||
| #                   3. Build RPM from spec + src tarball | ||||
| #                       rpm_spec:        Path to spec file. | ||||
| #                       rpm_srctarball:  Path to source tarball. | ||||
| #                   4. Build RPM from source RPM | ||||
| #                       rpm_srpm:  Path to source RPM package. | ||||
| kitpackage: | ||||
|     filename=vac.cmp-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vac.lib-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vac.lic-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vacpp.cmp-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vacpp.help.pdf-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vacpp.lib-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vacpp.man-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vacpp.rte-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vacpp.rte.lnk-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vacpp.samples-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
| @@ -0,0 +1,14 @@ | ||||
| ./opt/ibmcmp/msg/* | ||||
| +./opt/ibmcmp/msg/en_US* | ||||
|  | ||||
| ./opt/ibmcmp/vac/*/crt/include* | ||||
| ./opt/ibmcmp/vac/*/include* | ||||
| ./opt/ibmcmp/vac/*/msg/* | ||||
| +./opt/ibmcmp/vac/*/msg/en_US* | ||||
| ./opt/ibmcmp/vac/*/lap/LI_* | ||||
| ./opt/ibmcmp/vac/*/lap/LA_* | ||||
| ./opt/ibmcmp/vac/*/lap/license/*.txt | ||||
|  | ||||
| ./opt/ibmcmp/vacpp/*/include* | ||||
| ./opt/ibmcmp/vacpp/*/msg/* | ||||
| +./opt/ibmcmp/vacpp/*/msg/en_US* | ||||
| @@ -0,0 +1,175 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Image Profile Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during image profile operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitimagevalidatecomps => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|         kitimageimport => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # This kit plugin is passed the name of an image profile. | ||||
|     # We need to determine which kits is used by this | ||||
|     # image profile to decide if this plugin should run or not. | ||||
|  | ||||
|     my $imgprofilename = $request->{arg}->[0]; | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imgprofilename]); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $args = $request->{arg}; | ||||
|  | ||||
|     if($command eq 'kitimagevalidatecomps') { | ||||
|         kitimagevalidatecomps($callback, $args); | ||||
|     } | ||||
|     elsif ($command eq 'kitimageimport') { | ||||
|         kitimageimport($callback, $args); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimagevalidatecomps | ||||
|  | ||||
|      This command is called to validate new changes to an  | ||||
|      image profile's kit component list before the changes  | ||||
|      are committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimagevalidatecomps { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename =  $args->[0]; | ||||
|     my $newcomplist = $args->[1]; | ||||
|     my @newcomplist = (); | ||||
|     if (defined($newcomplist)) { | ||||
|         @newcomplist = split(/,/, $newcomplist); | ||||
|     } | ||||
|     my $newosdistro = $args->[2]; | ||||
|     my $newosdistroupdate = $args->[3]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimagevalidatecomps"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimageimport | ||||
|  | ||||
|     This command is called after changes to an image profile  | ||||
|     have been committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimageimport { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename = $args->[0]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimageimport"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,251 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form  | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Node Management Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during node management operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitnodeadd => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderemove => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodeupdate => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderefresh => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodefinished => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $nodes = $request->{node}; | ||||
|  | ||||
|     # This kit plugin is passed a list of node names. | ||||
|     # We need to determine which kits are used by these | ||||
|     # nodes to decide if this plugin should run or not. | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_nodes($nodes); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Get the nodes using this plugin's kit | ||||
|     $nodes = $kitdata->{$PLUGIN_KITNAME}; | ||||
|  | ||||
|  | ||||
|     if($command eq 'kitnodeadd') { | ||||
|         kitnodeadd($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderemove') { | ||||
|         kitnoderemove($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodeupdate') { | ||||
|         kitnodeupdate($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderefresh') { | ||||
|         kitnoderefresh($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodefinished') { | ||||
|         kitnodefinished($callback); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeadd | ||||
|  | ||||
|     This command is called when one or more nodes are added  | ||||
|     to the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeadd { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeadd"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderemove | ||||
|  | ||||
|     This command is called when one or more nodes are  | ||||
|     removed from the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderemove { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderemove"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeupdate | ||||
|  | ||||
|     This command is called when the configuration of one  | ||||
|     or more nodes are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeupdate { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeupdate"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderefresh | ||||
|  | ||||
|     This command is called when node-related configuration | ||||
|     files are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderefresh { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderefresh"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodefinished | ||||
|  | ||||
|     This command is called at the end of a node management | ||||
|     operation.  | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodefinished { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodefinished"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
| @@ -0,0 +1,21 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| #  | ||||
| # Sample script to accept licenses for the IBM vacpp and xlf compilers | ||||
| # For AIX: | ||||
| #    do nothing, license accepted with installp -Y flag | ||||
| # For Linux: | ||||
| #    Assumes all compiler software has been installed | ||||
|  | ||||
|  | ||||
| OS=`uname` | ||||
| if [ $OS != "AIX" ]; then | ||||
|     vacpp_script=`find /opt/ibmcmp/vacpp -name new_install -print` | ||||
|  | ||||
|    if [ -n "$vacpp_script" ] ; then | ||||
|        echo 1 | $vacpp_script | ||||
|    fi | ||||
|  | ||||
| fi   | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,321 @@ | ||||
| # Kit Build File | ||||
| #  | ||||
| # This file was initially auto-generated by the buildkit CLI command. | ||||
| # To create a new kit, the user should modify this file accordingly. | ||||
| # Refer to the buildkit manpage for further details. | ||||
| # | ||||
|  | ||||
| # kit: This section defines general info for the Kit.  | ||||
| #      There must be exactly one kit section in a kit build file. | ||||
| #  | ||||
| # kit attributes: | ||||
| #    basename        (mandatory) Kit base name. e.g., kit-lsf | ||||
| #    description     (optional)  Kit description. | ||||
| #    version         (mandatory) Kit version. e.g., 1.0 | ||||
| #    ostype          (mandatory) Kit OS type.  Must be Linux. | ||||
| #                      AIX is currently not supported. | ||||
| #    isinternal      (optional)  PCM use only. | ||||
| #                      Indicate if Kit is for internal use. | ||||
| #                      Use 1 for yes, 0 for no. Default: 0 | ||||
| #    kitdeployparams (optional)  Filename containing a list of kit deployment | ||||
| #                       parameters, relative to | ||||
| #                       <Kit Build Directory>/other_files | ||||
| kit: | ||||
|    basename=xlf | ||||
|    description=XLF14 for Linux | ||||
|    version=14.1.0.0 | ||||
|    ostype=Linux | ||||
| #   kitdeployparams=sample/kitdeployparams.lst | ||||
|  | ||||
|  | ||||
| # kitrepo: This section defines a Kit Package Repository. | ||||
| #          There must be at least one kitrepo section in a kit build file.   | ||||
| #          If you want to support multiple OSes, you should create a separate | ||||
| #          repo for each OS.  Also, no two repos can be defined with the same  | ||||
| #          OS name, major/minor version and arch. For example, you cannot have | ||||
| #          two repos for RHEL 6.2 ppc64 in the same kit. | ||||
| # | ||||
| # kitrepo attributes: | ||||
| #    kitrepoid          (mandatory) Kit package repository ID. | ||||
| #                         Must be unique within this file. | ||||
| #    osbasename         (mandatory) OS distro base name. e.g., rhels. | ||||
| #    osmajorversion     (mandatory) OS major version. e.g., 6 | ||||
| #    osminorversion     (optional)  OS minor version. | ||||
| #    osarch             (mandatory) OS architecture. e.g., ppc64 | ||||
| #    compat_osbasenames (optional)  Comma-separated list of compatible  | ||||
| #                         OS distro base names. e.g., centos | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=rhels6_ppc64 | ||||
|    osbasename=rhels | ||||
|    osmajorversion=6 | ||||
|    osarch=ppc64 | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=sles11_ppc64 | ||||
|    osbasename=sles | ||||
|    osmajorversion=11 | ||||
|    osarch=ppc64 | ||||
|  | ||||
|  | ||||
| # kitcomponent: This section defines one Kit Component.   | ||||
| #               There can be zero or more kitcomponent sections.  | ||||
| #               If you want to build a component which supports multiple OSes, | ||||
| #               you should create one kitcomponent section for each OS.   | ||||
| #               Also, no two components in a kit can be defined with the same  | ||||
| #               base name.  | ||||
| #               You can define multiple kit components with the same base name | ||||
| #               only if each kit component using this base name meets these  | ||||
| #               requirements: | ||||
| #                 - Each kit component must be defined with the same version | ||||
| #                   and release number | ||||
| #                 - Each kit component must be defined with a unique kitrepoid | ||||
|  | ||||
| # | ||||
| # kitcomponent attributes: | ||||
| #    basename        (mandatory) Kit component base name | ||||
| #    description     (optional)  Kit component description | ||||
| #    version         (mandatory) Kit component version | ||||
| #    release         (mandatory) Kit component release | ||||
| #    serverroles     (mandatory) Comma-separated list of servers that this | ||||
| #                      component can install on. Valid values: | ||||
| #                         mgtnode,servicenode,compute,loginnode,storagenode | ||||
| #    kitrepoid       (mandatory) The ID of the kit package repository this | ||||
| #                      component belongs to | ||||
| #    kitcompdeps     (optional)  Comma-separated list of kit component | ||||
| #                       dependencies.  These kit components can be included in | ||||
| #                       this kit or in other kits. | ||||
| #    ospkgdeps       (optional)  Comma-separated list of OS package dependencies | ||||
| #                       These packages must be shipped with the OS distro. | ||||
| #    kitpkgdeps      (optional)  Comma-separated list of kit package names that | ||||
| #                       will be listed as "REQUIRES" when building this kit | ||||
| #                       component. Each package must be defined in a separate | ||||
| #                       kitpackage section. Each package must be in the same  | ||||
| #                       kitrepo as this kit component. | ||||
| #    non_native_pkgs (optional)  TBD -- NOT SUPPORTED YET! | ||||
| #                       Comma-separated list of non-native package  | ||||
| #                       paths that will be included as files in this kit  | ||||
| #                       component. All filenames are relative to  | ||||
| #                       <Kit Build Directory>/source_packages  | ||||
| #                       Kit component deployment scripts must be specified | ||||
| #                       to manage these files. | ||||
| #   driverpacks      (optional) Comma-separated list of driver package filenames | ||||
| #                       Each driverpack must be defined in a separate kitpackage | ||||
| #                       section. | ||||
| #   exlist           (optional) Exclude list file for stateless image, relative | ||||
| #                       to <Kit Build Directory>/other_files | ||||
| #   Kit component deployment scripts (optional)  Each attribute specifies  | ||||
| #                       script path relative to <Kit Build Directory>/scripts | ||||
| #                       Script attributes: | ||||
| #                         preinstall, postinstall, preuninstall, postuninstall,  | ||||
| #                         preupgrade, postupgrade, postbootscripts | ||||
| kitcomponent: | ||||
|     basename=xlf_compute | ||||
|     description=XLF14 for compute nodes | ||||
|     version=14.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdeps=libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.lib >= 14.1.0.0,xlf.cmp >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0 | ||||
|     exlist=xlf.exlist | ||||
|     postbootscripts=xlf_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=xlf_loginnode | ||||
|     description=XLF14 for login nodes | ||||
|     version=14.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdeps=libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.lib >= 14.1.0.0,xlf.cmp >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0 | ||||
|     exlist=xlf.exlist | ||||
|     postbootscripts=xlf_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_xlf_compute | ||||
|     description=Minimal XLF14 packages for compute nodes | ||||
|     version=14.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdeps=libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.00 | ||||
|     exlist=xlf.exlist | ||||
|     postbootscripts=xlf_license | ||||
|  | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=xlf_compute | ||||
|     description=XLF14 for compute nodes | ||||
|     version=14.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdeps=libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.lib >= 14.1.0.0,xlf.cmp >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0 | ||||
|     exlist=xlf.exlist | ||||
|     postbootscripts=xlf_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=xlf_loginnode | ||||
|     description=XLF14 for login nodes | ||||
|     version=14.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdeps=libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.lib >= 14.1.0.0,xlf.cmp >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0 | ||||
|     exlist=xlf.exlist | ||||
|     postbootscripts=xlf_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_xlf_compute | ||||
|     description=Minimal XLF14 packages for compute nodes | ||||
|     version=14.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdeps=libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.00 | ||||
|     exlist=xlf.exlist | ||||
|     postbootscripts=xlf_license | ||||
|  | ||||
|  | ||||
| # kitpackage: This section defines one Kit Package, and how to build it. | ||||
| #             There can be zero or more kitpackage sections.   | ||||
| #             All filenames should be relative paths to | ||||
| #                <Kit Build Directory>/source_packages   | ||||
| #             If you want to build a package which can run on multiple OSes,  | ||||
| #             you have two options: | ||||
| #               1. Build a separate package for each OS you want to support.   | ||||
| #                  For this option, you need to define one kitpackage section  | ||||
| #                  per supported OS. | ||||
| #               2. Build one package that can run on multiple OSes.   | ||||
| #                  If you are building an RPM package, you are responsible for  | ||||
| #                  creating an RPM spec file that can run on multiple OSes.   | ||||
| #                  For this option, you need to define one kitpackage section | ||||
| #                  which contains multiple kitrepoid lines. | ||||
| #  | ||||
| # kitpackage attributes: | ||||
| #    filename   (mandatory) Package filename | ||||
| #    kitrepoid  (mandatory) The repo(s) this package belongs to.   | ||||
| #                 If multiple repos are defined, the package will be built for | ||||
| #                 the first repo only. For the other repos, a symlink is created | ||||
| #                 to the package built for the first repo. | ||||
| #   Package build methods (optional)   | ||||
| #                 Define how to build the packages.  | ||||
| #                 If you don't specify a build method, the default behavior is | ||||
| #                 to assume the package is pre-built under  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 All files in this section are relative to  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 There are four methods to build packages. | ||||
| #                   1. Use pre-built RPM package | ||||
| #                       isexternalpkg:  'no'|'0', 'yes'|'1'  (default:  'no')  | ||||
| #                         Indicates whether the RPM package will be added to the | ||||
| #                         the kit tar file now as part of the kit build process, | ||||
| #                         or whether the customer will need to separately | ||||
| #                         obtain the RPM pacakage and add it to the kit tar file | ||||
| #                         using 'buildkit addpkgs' | ||||
| #                       rpm_prebuiltdir: If isexternalpkg=yes, path to directory | ||||
| #                         containing pre-built RPM package | ||||
| #                   2. Build RPM from spec + src dir | ||||
| #                       rpm_spec:   Path to spec file. | ||||
| #                       rpm_srcdir: Path to source directory. | ||||
| #                   3. Build RPM from spec + src tarball | ||||
| #                       rpm_spec:        Path to spec file. | ||||
| #                       rpm_srctarball:  Path to source tarball. | ||||
| #                   4. Build RPM from source RPM | ||||
| #                       rpm_srpm:  Path to source RPM package. | ||||
| kitpackage: | ||||
|     filename=xlf.cmp-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlf.help.pdf-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlf.lib-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlf.lic-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlf.man-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlf.msg.rte-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlf.rte-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlf.rte.lnk-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlf.samples-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlmass.lib-7.1.0.0-120322.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlsmp.lib-3.1.0.0-120315a.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlsmp.msg.rte-3.1.0.0-120315a.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlsmp.rte-3.1.0.0-120315a.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
| @@ -0,0 +1,14 @@ | ||||
| ./opt/ibmcmp/msg/* | ||||
| +./opt/ibmcmp/msg/en_US* | ||||
|  | ||||
| ./opt/ibmcmp/xlmass/*/include* | ||||
| ./opt/ibmcmp/xlsmp/*/include* | ||||
| ./opt/ibmcmp/xlhelp* | ||||
|  | ||||
| ./opt/ibmcmp/xlf/*/include* | ||||
| ./opt/ibmcmp/xlf/*/msg/* | ||||
| +./opt/ibmcmp/xlf/*/msg/en_US* | ||||
| ./opt/ibmcmp/xlf/*/lap/LA_* | ||||
| ./opt/ibmcmp/xlf/*/lap/LI_* | ||||
| ./opt/ibmcmp/xlf/*/lap/license/*.txt | ||||
|  | ||||
| @@ -0,0 +1,175 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Image Profile Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during image profile operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitimagevalidatecomps => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|         kitimageimport => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # This kit plugin is passed the name of an image profile. | ||||
|     # We need to determine which kits is used by this | ||||
|     # image profile to decide if this plugin should run or not. | ||||
|  | ||||
|     my $imgprofilename = $request->{arg}->[0]; | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imgprofilename]); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $args = $request->{arg}; | ||||
|  | ||||
|     if($command eq 'kitimagevalidatecomps') { | ||||
|         kitimagevalidatecomps($callback, $args); | ||||
|     } | ||||
|     elsif ($command eq 'kitimageimport') { | ||||
|         kitimageimport($callback, $args); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimagevalidatecomps | ||||
|  | ||||
|      This command is called to validate new changes to an  | ||||
|      image profile's kit component list before the changes  | ||||
|      are committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimagevalidatecomps { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename =  $args->[0]; | ||||
|     my $newcomplist = $args->[1]; | ||||
|     my @newcomplist = (); | ||||
|     if (defined($newcomplist)) { | ||||
|         @newcomplist = split(/,/, $newcomplist); | ||||
|     } | ||||
|     my $newosdistro = $args->[2]; | ||||
|     my $newosdistroupdate = $args->[3]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimagevalidatecomps"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimageimport | ||||
|  | ||||
|     This command is called after changes to an image profile  | ||||
|     have been committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimageimport { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename = $args->[0]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimageimport"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,251 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form  | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Node Management Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during node management operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitnodeadd => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderemove => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodeupdate => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderefresh => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodefinished => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $nodes = $request->{node}; | ||||
|  | ||||
|     # This kit plugin is passed a list of node names. | ||||
|     # We need to determine which kits are used by these | ||||
|     # nodes to decide if this plugin should run or not. | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_nodes($nodes); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Get the nodes using this plugin's kit | ||||
|     $nodes = $kitdata->{$PLUGIN_KITNAME}; | ||||
|  | ||||
|  | ||||
|     if($command eq 'kitnodeadd') { | ||||
|         kitnodeadd($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderemove') { | ||||
|         kitnoderemove($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodeupdate') { | ||||
|         kitnodeupdate($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderefresh') { | ||||
|         kitnoderefresh($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodefinished') { | ||||
|         kitnodefinished($callback); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeadd | ||||
|  | ||||
|     This command is called when one or more nodes are added  | ||||
|     to the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeadd { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeadd"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderemove | ||||
|  | ||||
|     This command is called when one or more nodes are  | ||||
|     removed from the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderemove { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderemove"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeupdate | ||||
|  | ||||
|     This command is called when the configuration of one  | ||||
|     or more nodes are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeupdate { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeupdate"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderefresh | ||||
|  | ||||
|     This command is called when node-related configuration | ||||
|     files are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderefresh { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderefresh"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodefinished | ||||
|  | ||||
|     This command is called at the end of a node management | ||||
|     operation.  | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodefinished { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodefinished"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
| @@ -0,0 +1,19 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| #  | ||||
| # Sample script to accept licenses for the IBM vacpp and xlf compilers | ||||
| # For Linux: | ||||
| #    Assumes all compiler software has been installed | ||||
|  | ||||
| OS=`uname` | ||||
| if [ $OS != "AIX" ]; then | ||||
|     xlf_script=`find /opt/ibmcmp/xlf -name new_install -print` | ||||
|  | ||||
|     #  Being run from a stateful install postscript or stateless postbootscript. | ||||
|    if [ -n "$xlf_script" ] ; then | ||||
|        echo 1 | $xlf_script | ||||
|     fi | ||||
|  | ||||
| fi   | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,299 @@ | ||||
| # Kit Build File | ||||
| #  | ||||
| # This file was initially auto-generated by the buildkit CLI command. | ||||
| # To create a new kit, the user should modify this file accordingly. | ||||
| # Refer to the buildkit manpage for further details. | ||||
| # | ||||
|  | ||||
| # kit: This section defines general info for the Kit.  | ||||
| #      There must be exactly one kit section in a kit build file. | ||||
| #  | ||||
| # kit attributes: | ||||
| #    basename        (mandatory) Kit base name. e.g., kit-lsf | ||||
| #    description     (optional)  Kit description. | ||||
| #    version         (mandatory) Kit version. e.g., 1.0 | ||||
| #    ostype          (mandatory) Kit OS type.  Must be Linux. | ||||
| #                      AIX is currently not supported. | ||||
| #    isinternal      (optional)  PCM use only. | ||||
| #                      Indicate if Kit is for internal use. | ||||
| #                      Use 1 for yes, 0 for no. Default: 0 | ||||
| #    kitdeployparams (optional)  Filename containing a list of kit deployment | ||||
| #                       parameters, relative to | ||||
| #                       <Kit Build Directory>/other_files | ||||
| kit: | ||||
|    basename=vacpp | ||||
|    description=VACPP12 for Linux | ||||
|    version=12.1.0.0 | ||||
|    ostype=Linux | ||||
| #   kitdeployparams=sample/kitdeployparams.lst | ||||
|  | ||||
|  | ||||
| # kitrepo: This section defines a Kit Package Repository. | ||||
| #          There must be at least one kitrepo section in a kit build file.   | ||||
| #          If you want to support multiple OSes, you should create a separate | ||||
| #          repo for each OS.  Also, no two repos can be defined with the same  | ||||
| #          OS name, major/minor version and arch. For example, you cannot have | ||||
| #          two repos for RHEL 6.2 ppc64 in the same kit. | ||||
| # | ||||
| # kitrepo attributes: | ||||
| #    kitrepoid          (mandatory) Kit package repository ID. | ||||
| #                         Must be unique within this file. | ||||
| #    osbasename         (mandatory) OS distro base name. e.g., rhels. | ||||
| #    osmajorversion     (mandatory) OS major version. e.g., 6 | ||||
| #    osminorversion     (optional)  OS minor version. | ||||
| #    osarch             (mandatory) OS architecture. e.g., ppc64 | ||||
| #    compat_osbasenames (optional)  Comma-separated list of compatible  | ||||
| #                         OS distro base names. e.g., centos | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=rhels6_ppc64 | ||||
|    osbasename=rhels | ||||
|    osmajorversion=6 | ||||
|    osarch=ppc64 | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=sles11_ppc64 | ||||
|    osbasename=sles | ||||
|    osmajorversion=11 | ||||
|    osarch=ppc64 | ||||
|  | ||||
|  | ||||
| # kitcomponent: This section defines one Kit Component.   | ||||
| #               There can be zero or more kitcomponent sections.  | ||||
| #               If you want to build a component which supports multiple OSes, | ||||
| #               you should create one kitcomponent section for each OS.   | ||||
| #               Also, no two components in a kit can be defined with the same  | ||||
| #               base name.  | ||||
| #               You can define multiple kit components with the same base name | ||||
| #               only if each kit component using this base name meets these  | ||||
| #               requirements: | ||||
| #                 - Each kit component must be defined with the same version | ||||
| #                   and release number | ||||
| #                 - Each kit component must be defined with a unique kitrepoid | ||||
|  | ||||
| # | ||||
| # kitcomponent attributes: | ||||
| #    basename        (mandatory) Kit component base name | ||||
| #    description     (optional)  Kit component description | ||||
| #    version         (mandatory) Kit component version | ||||
| #    release         (mandatory) Kit component release | ||||
| #    serverroles     (mandatory) Comma-separated list of servers that this | ||||
| #                      component can install on. Valid values: | ||||
| #                         mgtnode,servicenode,compute,loginnode,storagenode | ||||
| #    kitrepoid       (mandatory) The ID of the kit package repository this | ||||
| #                      component belongs to | ||||
| #    kitcompdeps     (optional)  Comma-separated list of kit component | ||||
| #                       dependencies.  These kit components can be included in | ||||
| #                       this kit or in other kits. | ||||
| #    ospkgdeps       (optional)  Comma-separated list of OS package dependencies | ||||
| #                       These packages must be shipped with the OS distro. | ||||
| #    kitpkgdeps      (optional)  Comma-separated list of kit package names that | ||||
| #                       will be listed as "REQUIRES" when building this kit | ||||
| #                       component. Each package must be defined in a separate | ||||
| #                       kitpackage section. Each package must be in the same  | ||||
| #                       kitrepo as this kit component. | ||||
| #    non_native_pkgs (optional)  TBD -- NOT SUPPORTED YET! | ||||
| #                       Comma-separated list of non-native package  | ||||
| #                       paths that will be included as files in this kit  | ||||
| #                       component. All filenames are relative to  | ||||
| #                       <Kit Build Directory>/source_packages  | ||||
| #                       Kit component deployment scripts must be specified | ||||
| #                       to manage these files. | ||||
| #   driverpacks      (optional) Comma-separated list of driver package filenames | ||||
| #                       Each driverpack must be defined in a separate kitpackage | ||||
| #                       section. | ||||
| #   exlist           (optional) Exclude list file for stateless image, relative | ||||
| #                       to <Kit Build Directory>/other_files | ||||
| #   Kit component deployment scripts (optional)  Each attribute specifies  | ||||
| #                       script path relative to <Kit Build Directory>/scripts | ||||
| #                       Script attributes: | ||||
| #                         preinstall, postinstall, preuninstall, postuninstall,  | ||||
| #                         preupgrade, postupgrade, postbootscripts | ||||
| kitcomponent: | ||||
|     basename=vacpp_compute | ||||
|     description=VACPP12 for compute nodes | ||||
|     version=12.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64) | ||||
|     kitpkgdeps=vac.cmp >= 12.1.0.0,vac.lib >= 12.1.0.0,vac.lic >= 12.1.0.0,vacpp.cmp >= 12.1.0.0,vacpp.help.pdf >= 12.1.0.0,vacpp.lib >= 12.1.0.0,vacpp.man >= 12.1.0.0,vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0,vacpp.samples >= 12.1.0.0 | ||||
|     exlist=vacpp.exlist | ||||
|     postbootscripts=vacpp_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=vacpp_loginnode | ||||
|     description=VACPP12 for login nodes | ||||
|     version=12.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64) | ||||
|     kitpkgdeps=vac.cmp >= 12.1.0.0,vac.lib >= 12.1.0.0,vac.lic >= 12.1.0.0,vacpp.cmp >= 12.1.0.0,vacpp.help.pdf >= 12.1.0.0,vacpp.lib >= 12.1.0.0,vacpp.man >= 12.1.0.0,vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0,vacpp.samples >= 12.1.0.0 | ||||
|     exlist=vacpp.exlist | ||||
|     postbootscripts=vacpp_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_vacpp_compute | ||||
|     description=Minimal VACPP12 packages for compute nodes | ||||
|     version=12.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64) | ||||
|     kitpkgdeps=vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0 | ||||
|     exlist=vacpp.exlist | ||||
|     postbootscripts=vacpp_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=vacpp_compute | ||||
|     description=VACPP12 for compute nodes | ||||
|     version=12.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64) | ||||
|     kitpkgdeps=vac.cmp >= 12.1.0.0,vac.lib >= 12.1.0.0,vac.lic >= 12.1.0.0,vacpp.cmp >= 12.1.0.0,vacpp.help.pdf >= 12.1.0.0,vacpp.lib >= 12.1.0.0,vacpp.man >= 12.1.0.0,vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0,vacpp.samples >= 12.1.0.0 | ||||
|     exlist=vacpp.exlist | ||||
|     postbootscripts=vacpp_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=vacpp_loginnode | ||||
|     description=VACPP12 for login nodes | ||||
|     version=12.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64) | ||||
|     kitpkgdeps=vac.cmp >= 12.1.0.0,vac.lib >= 12.1.0.0,vac.lic >= 12.1.0.0,vacpp.cmp >= 12.1.0.0,vacpp.help.pdf >= 12.1.0.0,vacpp.lib >= 12.1.0.0,vacpp.man >= 12.1.0.0,vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0,vacpp.samples >= 12.1.0.0 | ||||
|     exlist=vacpp.exlist | ||||
|     postbootscripts=vacpp_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_vacpp_compute | ||||
|     description=Minimal VACPP12 packages for compute nodes | ||||
|     version=12.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64) | ||||
|     kitpkgdeps=vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0 | ||||
|     exlist=vacpp.exlist | ||||
|     postbootscripts=vacpp_license | ||||
|  | ||||
|  | ||||
| # kitpackage: This section defines one Kit Package, and how to build it. | ||||
| #             There can be zero or more kitpackage sections.   | ||||
| #             All filenames should be relative paths to | ||||
| #                <Kit Build Directory>/source_packages   | ||||
| #             If you want to build a package which can run on multiple OSes,  | ||||
| #             you have two options: | ||||
| #               1. Build a separate package for each OS you want to support.   | ||||
| #                  For this option, you need to define one kitpackage section  | ||||
| #                  per supported OS. | ||||
| #               2. Build one package that can run on multiple OSes.   | ||||
| #                  If you are building an RPM package, you are responsible for  | ||||
| #                  creating an RPM spec file that can run on multiple OSes.   | ||||
| #                  For this option, you need to define one kitpackage section | ||||
| #                  which contains multiple kitrepoid lines. | ||||
| #  | ||||
| # kitpackage attributes: | ||||
| #    filename   (mandatory) Package filename | ||||
| #    kitrepoid  (mandatory) The repo(s) this package belongs to.   | ||||
| #                 If multiple repos are defined, the package will be built for | ||||
| #                 the first repo only. For the other repos, a symlink is created | ||||
| #                 to the package built for the first repo. | ||||
| #   Package build methods (optional)   | ||||
| #                 Define how to build the packages.  | ||||
| #                 If you don't specify a build method, the default behavior is | ||||
| #                 to assume the package is pre-built under  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 All files in this section are relative to  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 There are four methods to build packages. | ||||
| #                   1. Use pre-built RPM package | ||||
| #                       isexternalpkg:  'no'|'0', 'yes'|'1'  (default:  'no')  | ||||
| #                         Indicates whether the RPM package will be added to the | ||||
| #                         the kit tar file now as part of the kit build process, | ||||
| #                         or whether the customer will need to separately | ||||
| #                         obtain the RPM pacakage and add it to the kit tar file | ||||
| #                         using 'buildkit addpkgs' | ||||
| #                       rpm_prebuiltdir: If isexternalpkg=no, path to directory | ||||
| #                         containing pre-built RPM package | ||||
| #                   2. Build RPM from spec + src dir | ||||
| #                       rpm_spec:   Path to spec file. | ||||
| #                       rpm_srcdir: Path to source directory. | ||||
| #                   3. Build RPM from spec + src tarball | ||||
| #                       rpm_spec:        Path to spec file. | ||||
| #                       rpm_srctarball:  Path to source tarball. | ||||
| #                   4. Build RPM from source RPM | ||||
| #                       rpm_srpm:  Path to source RPM package. | ||||
| kitpackage: | ||||
|     filename=vac.cmp-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vac.lib-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vac.lic-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vacpp.cmp-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vacpp.help.pdf-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vacpp.lib-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vacpp.man-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vacpp.rte-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vacpp.rte.lnk-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=vacpp.samples-12.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
| @@ -0,0 +1,14 @@ | ||||
| ./opt/ibmcmp/msg/* | ||||
| +./opt/ibmcmp/msg/en_US* | ||||
|  | ||||
| ./opt/ibmcmp/vac/*/crt/include* | ||||
| ./opt/ibmcmp/vac/*/include* | ||||
| ./opt/ibmcmp/vac/*/msg/* | ||||
| +./opt/ibmcmp/vac/*/msg/en_US* | ||||
| ./opt/ibmcmp/vac/*/lap/LI_* | ||||
| ./opt/ibmcmp/vac/*/lap/LA_* | ||||
| ./opt/ibmcmp/vac/*/lap/license/*.txt | ||||
|  | ||||
| ./opt/ibmcmp/vacpp/*/include* | ||||
| ./opt/ibmcmp/vacpp/*/msg/* | ||||
| +./opt/ibmcmp/vacpp/*/msg/en_US* | ||||
| @@ -0,0 +1,175 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Image Profile Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during image profile operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitimagevalidatecomps => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|         kitimageimport => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # This kit plugin is passed the name of an image profile. | ||||
|     # We need to determine which kits is used by this | ||||
|     # image profile to decide if this plugin should run or not. | ||||
|  | ||||
|     my $imgprofilename = $request->{arg}->[0]; | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imgprofilename]); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $args = $request->{arg}; | ||||
|  | ||||
|     if($command eq 'kitimagevalidatecomps') { | ||||
|         kitimagevalidatecomps($callback, $args); | ||||
|     } | ||||
|     elsif ($command eq 'kitimageimport') { | ||||
|         kitimageimport($callback, $args); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimagevalidatecomps | ||||
|  | ||||
|      This command is called to validate new changes to an  | ||||
|      image profile's kit component list before the changes  | ||||
|      are committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimagevalidatecomps { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename =  $args->[0]; | ||||
|     my $newcomplist = $args->[1]; | ||||
|     my @newcomplist = (); | ||||
|     if (defined($newcomplist)) { | ||||
|         @newcomplist = split(/,/, $newcomplist); | ||||
|     } | ||||
|     my $newosdistro = $args->[2]; | ||||
|     my $newosdistroupdate = $args->[3]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimagevalidatecomps"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimageimport | ||||
|  | ||||
|     This command is called after changes to an image profile  | ||||
|     have been committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimageimport { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename = $args->[0]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimageimport"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,251 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form  | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Node Management Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during node management operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitnodeadd => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderemove => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodeupdate => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderefresh => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodefinished => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $nodes = $request->{node}; | ||||
|  | ||||
|     # This kit plugin is passed a list of node names. | ||||
|     # We need to determine which kits are used by these | ||||
|     # nodes to decide if this plugin should run or not. | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_nodes($nodes); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Get the nodes using this plugin's kit | ||||
|     $nodes = $kitdata->{$PLUGIN_KITNAME}; | ||||
|  | ||||
|  | ||||
|     if($command eq 'kitnodeadd') { | ||||
|         kitnodeadd($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderemove') { | ||||
|         kitnoderemove($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodeupdate') { | ||||
|         kitnodeupdate($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderefresh') { | ||||
|         kitnoderefresh($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodefinished') { | ||||
|         kitnodefinished($callback); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeadd | ||||
|  | ||||
|     This command is called when one or more nodes are added  | ||||
|     to the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeadd { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeadd"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderemove | ||||
|  | ||||
|     This command is called when one or more nodes are  | ||||
|     removed from the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderemove { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderemove"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeupdate | ||||
|  | ||||
|     This command is called when the configuration of one  | ||||
|     or more nodes are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeupdate { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeupdate"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderefresh | ||||
|  | ||||
|     This command is called when node-related configuration | ||||
|     files are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderefresh { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderefresh"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodefinished | ||||
|  | ||||
|     This command is called at the end of a node management | ||||
|     operation.  | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodefinished { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodefinished"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
| @@ -0,0 +1,21 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| #  | ||||
| # Sample script to accept licenses for the IBM vacpp and xlf compilers | ||||
| # For AIX: | ||||
| #    do nothing, license accepted with installp -Y flag | ||||
| # For Linux: | ||||
| #    Assumes all compiler software has been installed | ||||
|  | ||||
|  | ||||
| OS=`uname` | ||||
| if [ $OS != "AIX" ]; then | ||||
|     vacpp_script=`find /opt/ibmcmp/vacpp -name new_install -print` | ||||
|  | ||||
|    if [ -n "$vacpp_script" ] ; then | ||||
|        echo 1 | $vacpp_script | ||||
|    fi | ||||
|  | ||||
| fi   | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,321 @@ | ||||
| # Kit Build File | ||||
| #  | ||||
| # This file was initially auto-generated by the buildkit CLI command. | ||||
| # To create a new kit, the user should modify this file accordingly. | ||||
| # Refer to the buildkit manpage for further details. | ||||
| # | ||||
|  | ||||
| # kit: This section defines general info for the Kit.  | ||||
| #      There must be exactly one kit section in a kit build file. | ||||
| #  | ||||
| # kit attributes: | ||||
| #    basename        (mandatory) Kit base name. e.g., kit-lsf | ||||
| #    description     (optional)  Kit description. | ||||
| #    version         (mandatory) Kit version. e.g., 1.0 | ||||
| #    ostype          (mandatory) Kit OS type.  Must be Linux. | ||||
| #                      AIX is currently not supported. | ||||
| #    isinternal      (optional)  PCM use only. | ||||
| #                      Indicate if Kit is for internal use. | ||||
| #                      Use 1 for yes, 0 for no. Default: 0 | ||||
| #    kitdeployparams (optional)  Filename containing a list of kit deployment | ||||
| #                       parameters, relative to | ||||
| #                       <Kit Build Directory>/other_files | ||||
| kit: | ||||
|    basename=xlf | ||||
|    description=XLF14 for Linux | ||||
|    version=14.1.0.0 | ||||
|    ostype=Linux | ||||
| #   kitdeployparams=sample/kitdeployparams.lst | ||||
|  | ||||
|  | ||||
| # kitrepo: This section defines a Kit Package Repository. | ||||
| #          There must be at least one kitrepo section in a kit build file.   | ||||
| #          If you want to support multiple OSes, you should create a separate | ||||
| #          repo for each OS.  Also, no two repos can be defined with the same  | ||||
| #          OS name, major/minor version and arch. For example, you cannot have | ||||
| #          two repos for RHEL 6.2 ppc64 in the same kit. | ||||
| # | ||||
| # kitrepo attributes: | ||||
| #    kitrepoid          (mandatory) Kit package repository ID. | ||||
| #                         Must be unique within this file. | ||||
| #    osbasename         (mandatory) OS distro base name. e.g., rhels. | ||||
| #    osmajorversion     (mandatory) OS major version. e.g., 6 | ||||
| #    osminorversion     (optional)  OS minor version. | ||||
| #    osarch             (mandatory) OS architecture. e.g., ppc64 | ||||
| #    compat_osbasenames (optional)  Comma-separated list of compatible  | ||||
| #                         OS distro base names. e.g., centos | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=rhels6_ppc64 | ||||
|    osbasename=rhels | ||||
|    osmajorversion=6 | ||||
|    osarch=ppc64 | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=sles11_ppc64 | ||||
|    osbasename=sles | ||||
|    osmajorversion=11 | ||||
|    osarch=ppc64 | ||||
|  | ||||
|  | ||||
| # kitcomponent: This section defines one Kit Component.   | ||||
| #               There can be zero or more kitcomponent sections.  | ||||
| #               If you want to build a component which supports multiple OSes, | ||||
| #               you should create one kitcomponent section for each OS.   | ||||
| #               Also, no two components in a kit can be defined with the same  | ||||
| #               base name.  | ||||
| #               You can define multiple kit components with the same base name | ||||
| #               only if each kit component using this base name meets these  | ||||
| #               requirements: | ||||
| #                 - Each kit component must be defined with the same version | ||||
| #                   and release number | ||||
| #                 - Each kit component must be defined with a unique kitrepoid | ||||
|  | ||||
| # | ||||
| # kitcomponent attributes: | ||||
| #    basename        (mandatory) Kit component base name | ||||
| #    description     (optional)  Kit component description | ||||
| #    version         (mandatory) Kit component version | ||||
| #    release         (mandatory) Kit component release | ||||
| #    serverroles     (mandatory) Comma-separated list of servers that this | ||||
| #                      component can install on. Valid values: | ||||
| #                         mgtnode,servicenode,compute,loginnode,storagenode | ||||
| #    kitrepoid       (mandatory) The ID of the kit package repository this | ||||
| #                      component belongs to | ||||
| #    kitcompdeps     (optional)  Comma-separated list of kit component | ||||
| #                       dependencies.  These kit components can be included in | ||||
| #                       this kit or in other kits. | ||||
| #    ospkgdeps       (optional)  Comma-separated list of OS package dependencies | ||||
| #                       These packages must be shipped with the OS distro. | ||||
| #    kitpkgdeps      (optional)  Comma-separated list of kit package names that | ||||
| #                       will be listed as "REQUIRES" when building this kit | ||||
| #                       component. Each package must be defined in a separate | ||||
| #                       kitpackage section. Each package must be in the same  | ||||
| #                       kitrepo as this kit component. | ||||
| #    non_native_pkgs (optional)  TBD -- NOT SUPPORTED YET! | ||||
| #                       Comma-separated list of non-native package  | ||||
| #                       paths that will be included as files in this kit  | ||||
| #                       component. All filenames are relative to  | ||||
| #                       <Kit Build Directory>/source_packages  | ||||
| #                       Kit component deployment scripts must be specified | ||||
| #                       to manage these files. | ||||
| #   driverpacks      (optional) Comma-separated list of driver package filenames | ||||
| #                       Each driverpack must be defined in a separate kitpackage | ||||
| #                       section. | ||||
| #   exlist           (optional) Exclude list file for stateless image, relative | ||||
| #                       to <Kit Build Directory>/other_files | ||||
| #   Kit component deployment scripts (optional)  Each attribute specifies  | ||||
| #                       script path relative to <Kit Build Directory>/scripts | ||||
| #                       Script attributes: | ||||
| #                         preinstall, postinstall, preuninstall, postuninstall,  | ||||
| #                         preupgrade, postupgrade, postbootscripts | ||||
| kitcomponent: | ||||
|     basename=xlf_compute | ||||
|     description=XLF14 for compute nodes | ||||
|     version=14.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdeps=libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.lib >= 14.1.0.0,xlf.cmp >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0 | ||||
|     exlist=xlf.exlist | ||||
|     postbootscripts=xlf_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=xlf_loginnode | ||||
|     description=XLF14 for login nodes | ||||
|     version=14.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdeps=libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.lib >= 14.1.0.0,xlf.cmp >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0 | ||||
|     exlist=xlf.exlist | ||||
|     postbootscripts=xlf_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_xlf_compute | ||||
|     description=Minimal XLF14 packages for compute nodes | ||||
|     version=14.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdeps=libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.00 | ||||
|     exlist=xlf.exlist | ||||
|     postbootscripts=xlf_license | ||||
|  | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=xlf_compute | ||||
|     description=XLF14 for compute nodes | ||||
|     version=14.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdeps=libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.lib >= 14.1.0.0,xlf.cmp >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0 | ||||
|     exlist=xlf.exlist | ||||
|     postbootscripts=xlf_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=xlf_loginnode | ||||
|     description=XLF14 for login nodes | ||||
|     version=14.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdeps=libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.lib >= 14.1.0.0,xlf.cmp >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0 | ||||
|     exlist=xlf.exlist | ||||
|     postbootscripts=xlf_license | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_xlf_compute | ||||
|     description=Minimal XLF14 packages for compute nodes | ||||
|     version=14.1.0.0 | ||||
|     release=120323 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdeps=libstdc++.ppc,libstdc++.ppc64,libstdc++-devel.ppc,libstdc++-devel.ppc64 | ||||
|     kitpkgdeps=xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.00 | ||||
|     exlist=xlf.exlist | ||||
|     postbootscripts=xlf_license | ||||
|  | ||||
|  | ||||
| # kitpackage: This section defines one Kit Package, and how to build it. | ||||
| #             There can be zero or more kitpackage sections.   | ||||
| #             All filenames should be relative paths to | ||||
| #                <Kit Build Directory>/source_packages   | ||||
| #             If you want to build a package which can run on multiple OSes,  | ||||
| #             you have two options: | ||||
| #               1. Build a separate package for each OS you want to support.   | ||||
| #                  For this option, you need to define one kitpackage section  | ||||
| #                  per supported OS. | ||||
| #               2. Build one package that can run on multiple OSes.   | ||||
| #                  If you are building an RPM package, you are responsible for  | ||||
| #                  creating an RPM spec file that can run on multiple OSes.   | ||||
| #                  For this option, you need to define one kitpackage section | ||||
| #                  which contains multiple kitrepoid lines. | ||||
| #  | ||||
| # kitpackage attributes: | ||||
| #    filename   (mandatory) Package filename | ||||
| #    kitrepoid  (mandatory) The repo(s) this package belongs to.   | ||||
| #                 If multiple repos are defined, the package will be built for | ||||
| #                 the first repo only. For the other repos, a symlink is created | ||||
| #                 to the package built for the first repo. | ||||
| #   Package build methods (optional)   | ||||
| #                 Define how to build the packages.  | ||||
| #                 If you don't specify a build method, the default behavior is | ||||
| #                 to assume the package is pre-built under  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 All files in this section are relative to  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 There are four methods to build packages. | ||||
| #                   1. Use pre-built RPM package | ||||
| #                       isexternalpkg:  'no'|'0', 'yes'|'1'  (default:  'no')  | ||||
| #                         Indicates whether the RPM package will be added to the | ||||
| #                         the kit tar file now as part of the kit build process, | ||||
| #                         or whether the customer will need to separately | ||||
| #                         obtain the RPM pacakage and add it to the kit tar file | ||||
| #                         using 'buildkit addpkgs' | ||||
| #                       rpm_prebuiltdir: If isexternalpkg=no, path to directory | ||||
| #                         containing pre-built RPM package | ||||
| #                   2. Build RPM from spec + src dir | ||||
| #                       rpm_spec:   Path to spec file. | ||||
| #                       rpm_srcdir: Path to source directory. | ||||
| #                   3. Build RPM from spec + src tarball | ||||
| #                       rpm_spec:        Path to spec file. | ||||
| #                       rpm_srctarball:  Path to source tarball. | ||||
| #                   4. Build RPM from source RPM | ||||
| #                       rpm_srpm:  Path to source RPM package. | ||||
| kitpackage: | ||||
|     filename=xlf.cmp-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlf.help.pdf-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlf.lib-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlf.lic-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlf.man-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlf.msg.rte-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlf.rte-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlf.rte.lnk-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlf.samples-14.1.0.0-120323.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlmass.lib-7.1.0.0-120322.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlsmp.lib-3.1.0.0-120315a.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlsmp.msg.rte-3.1.0.0-120315a.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=xlsmp.rte-3.1.0.0-120315a.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
| @@ -0,0 +1,14 @@ | ||||
| ./opt/ibmcmp/msg/* | ||||
| +./opt/ibmcmp/msg/en_US* | ||||
|  | ||||
| ./opt/ibmcmp/xlmass/*/include* | ||||
| ./opt/ibmcmp/xlsmp/*/include* | ||||
| ./opt/ibmcmp/xlhelp* | ||||
|  | ||||
| ./opt/ibmcmp/xlf/*/include* | ||||
| ./opt/ibmcmp/xlf/*/msg/* | ||||
| +./opt/ibmcmp/xlf/*/msg/en_US* | ||||
| ./opt/ibmcmp/xlf/*/lap/LA_* | ||||
| ./opt/ibmcmp/xlf/*/lap/LI_* | ||||
| ./opt/ibmcmp/xlf/*/lap/license/*.txt | ||||
|  | ||||
| @@ -0,0 +1,175 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Image Profile Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during image profile operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitimagevalidatecomps => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|         kitimageimport => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # This kit plugin is passed the name of an image profile. | ||||
|     # We need to determine which kits is used by this | ||||
|     # image profile to decide if this plugin should run or not. | ||||
|  | ||||
|     my $imgprofilename = $request->{arg}->[0]; | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imgprofilename]); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $args = $request->{arg}; | ||||
|  | ||||
|     if($command eq 'kitimagevalidatecomps') { | ||||
|         kitimagevalidatecomps($callback, $args); | ||||
|     } | ||||
|     elsif ($command eq 'kitimageimport') { | ||||
|         kitimageimport($callback, $args); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimagevalidatecomps | ||||
|  | ||||
|      This command is called to validate new changes to an  | ||||
|      image profile's kit component list before the changes  | ||||
|      are committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimagevalidatecomps { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename =  $args->[0]; | ||||
|     my $newcomplist = $args->[1]; | ||||
|     my @newcomplist = (); | ||||
|     if (defined($newcomplist)) { | ||||
|         @newcomplist = split(/,/, $newcomplist); | ||||
|     } | ||||
|     my $newosdistro = $args->[2]; | ||||
|     my $newosdistroupdate = $args->[3]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimagevalidatecomps"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimageimport | ||||
|  | ||||
|     This command is called after changes to an image profile  | ||||
|     have been committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimageimport { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename = $args->[0]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimageimport"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,251 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form  | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Node Management Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during node management operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitnodeadd => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderemove => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodeupdate => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderefresh => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodefinished => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $nodes = $request->{node}; | ||||
|  | ||||
|     # This kit plugin is passed a list of node names. | ||||
|     # We need to determine which kits are used by these | ||||
|     # nodes to decide if this plugin should run or not. | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_nodes($nodes); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Get the nodes using this plugin's kit | ||||
|     $nodes = $kitdata->{$PLUGIN_KITNAME}; | ||||
|  | ||||
|  | ||||
|     if($command eq 'kitnodeadd') { | ||||
|         kitnodeadd($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderemove') { | ||||
|         kitnoderemove($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodeupdate') { | ||||
|         kitnodeupdate($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderefresh') { | ||||
|         kitnoderefresh($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodefinished') { | ||||
|         kitnodefinished($callback); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeadd | ||||
|  | ||||
|     This command is called when one or more nodes are added  | ||||
|     to the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeadd { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeadd"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderemove | ||||
|  | ||||
|     This command is called when one or more nodes are  | ||||
|     removed from the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderemove { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderemove"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeupdate | ||||
|  | ||||
|     This command is called when the configuration of one  | ||||
|     or more nodes are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeupdate { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeupdate"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderefresh | ||||
|  | ||||
|     This command is called when node-related configuration | ||||
|     files are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderefresh { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderefresh"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodefinished | ||||
|  | ||||
|     This command is called at the end of a node management | ||||
|     operation.  | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodefinished { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodefinished"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
| @@ -0,0 +1,19 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| #  | ||||
| # Sample script to accept licenses for the IBM vacpp and xlf compilers | ||||
| # For Linux: | ||||
| #    Assumes all compiler software has been installed | ||||
|  | ||||
| OS=`uname` | ||||
| if [ $OS != "AIX" ]; then | ||||
|     xlf_script=`find /opt/ibmcmp/xlf -name new_install -print` | ||||
|  | ||||
|     #  Being run from a stateful install postscript or stateless postbootscript. | ||||
|    if [ -n "$xlf_script" ] ; then | ||||
|        echo 1 | $xlf_script | ||||
|     fi | ||||
|  | ||||
| fi   | ||||
|  | ||||
|  | ||||
							
								
								
									
										293
									
								
								xCAT-buildkit/share/xcat/kits/kit_build/essl/essl/buildkit.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										293
									
								
								xCAT-buildkit/share/xcat/kits/kit_build/essl/essl/buildkit.conf
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,293 @@ | ||||
| # Kit Build File | ||||
| #  | ||||
| # This file was initially auto-generated by the buildkit CLI command. | ||||
| # To create a new kit, the user should modify this file accordingly. | ||||
| # Refer to the buildkit manpage for further details. | ||||
| # | ||||
|  | ||||
| # kit: This section defines general info for the Kit.  | ||||
| #      There must be exactly one kit section in a kit build file. | ||||
| #  | ||||
| # kit attributes: | ||||
| #    basename        (mandatory) Kit base name. e.g., kit-lsf | ||||
| #    description     (optional)  Kit description. | ||||
| #    version         (mandatory) Kit version. e.g., 1.0 | ||||
| #    ostype          (mandatory) Kit OS type.  Must be Linux. | ||||
| #                      AIX is currently not supported. | ||||
| #    isinternal      (optional)  PCM use only. | ||||
| #                      Indicate if Kit is for internal use. | ||||
| #                      Use 1 for yes, 0 for no. Default: 0 | ||||
| #    kitdeployparams (optional)  Filename containing a list of kit deployment | ||||
| #                       parameters, relative to | ||||
| #                       <Kit Build Directory>/other_files | ||||
| kit: | ||||
|    basename=essl | ||||
|    description=essl for Linux | ||||
|    version=5.1.1 | ||||
|    ostype=Linux | ||||
|    kitdeployparams=essl.env | ||||
|  | ||||
|  | ||||
| # kitrepo: This section defines a Kit Package Repository. | ||||
| #          There must be at least one kitrepo section in a kit build file.   | ||||
| #          If you want to support multiple OSes, you should create a separate | ||||
| #          repo for each OS.  Also, no two repos can be defined with the same  | ||||
| #          OS name, major/minor version and arch. For example, you cannot have | ||||
| #          two repos for RHEL 6.2 ppc64 in the same kit. | ||||
| # | ||||
| # kitrepo attributes: | ||||
| #    kitrepoid          (mandatory) Kit package repository ID. | ||||
| #                         Must be unique within this file. | ||||
| #    osbasename         (mandatory) OS distro base name. e.g., rhels. | ||||
| #    osmajorversion     (mandatory) OS major version. e.g., 6 | ||||
| #    osminorversion     (optional)  OS minor version. | ||||
| #    osarch             (mandatory) OS architecture. e.g., ppc64 | ||||
| #    compat_osbasenames (optional)  Comma-separated list of compatible  | ||||
| #                         OS distro base names. e.g., centos | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=rhels6_ppc64 | ||||
|    osbasename=rhels | ||||
|    osmajorversion=6 | ||||
|    osarch=ppc64 | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=sles11_ppc64 | ||||
|    osbasename=sles | ||||
|    osmajorversion=11 | ||||
|    osarch=ppc64 | ||||
|  | ||||
|  | ||||
| # kitcomponent: This section defines one Kit Component.   | ||||
| #               There can be zero or more kitcomponent sections.  | ||||
| #               If you want to build a component which supports multiple OSes, | ||||
| #               you should create one kitcomponent section for each OS.   | ||||
| #               Also, no two components in a kit can be defined with the same  | ||||
| #               base name.  | ||||
| #               You can define multiple kit components with the same base name | ||||
| #               only if each kit component using this base name meets these  | ||||
| #               requirements: | ||||
| #                 - Each kit component must be defined with the same version | ||||
| #                   and release number | ||||
| #                 - Each kit component must be defined with a unique kitrepoid | ||||
|  | ||||
| # | ||||
| # kitcomponent attributes: | ||||
| #    basename        (mandatory) Kit component base name | ||||
| #    description     (optional)  Kit component description | ||||
| #    version         (mandatory) Kit component version | ||||
| #    release         (mandatory) Kit component release | ||||
| #    serverroles     (mandatory) Comma-separated list of servers that this | ||||
| #                      component can install on. Valid values: | ||||
| #                         mgtnode,servicenode,compute,loginnode,storagenode | ||||
| #    kitrepoid       (mandatory) The ID of the kit package repository this | ||||
| #                      component belongs to | ||||
| #    kitcompdeps     (optional)  Comma-separated list of kit component | ||||
| #                       dependencies.  These kit components can be included in | ||||
| #                       this kit or in other kits. | ||||
| #    ospkgdeps       (optional)  Comma-separated list of OS package dependencies | ||||
| #                       These packages must be shipped with the OS distro. | ||||
| #    kitpkgdeps      (optional)  Comma-separated list of kit package names that | ||||
| #                       will be listed as "REQUIRES" when building this kit | ||||
| #                       component. Each package must be defined in a separate | ||||
| #                       kitpackage section. Each package must be in the same  | ||||
| #                       kitrepo as this kit component. | ||||
| #    non_native_pkgs (optional)  TBD -- NOT SUPPORTED YET! | ||||
| #                       Comma-separated list of non-native package  | ||||
| #                       paths that will be included as files in this kit  | ||||
| #                       component. All filenames are relative to  | ||||
| #                       <Kit Build Directory>/source_packages  | ||||
| #                       Kit component deployment scripts must be specified | ||||
| #                       to manage these files. | ||||
| #   driverpacks      (optional) Comma-separated list of driver package filenames | ||||
| #                       Each driverpack must be defined in a separate kitpackage | ||||
| #                       section. | ||||
| #   exlist           (optional) Exclude list file for stateless image, relative | ||||
| #                       to <Kit Build Directory>/other_files | ||||
| #   Kit component deployment scripts (optional)  Each attribute specifies  | ||||
| #                       script path relative to <Kit Build Directory>/scripts | ||||
| #                       Script attributes: | ||||
| #                         preinstall, postinstall, preuninstall, postuninstall,  | ||||
| #                         preupgrade, postupgrade, postbootscripts | ||||
| kitcomponent: | ||||
|     basename=essl_compute | ||||
|     description=essl for compute nodes | ||||
|     version=5.1.1 | ||||
|     release=0 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdeps=bc,xorg-x11-libXp-32bit | ||||
|     kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.man >= 5.1.1,essl.msg >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1 | ||||
|     exlist=essl.exlist | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=essl_loginnode | ||||
|     description=essl for login nodes | ||||
|     version=5.1.1 | ||||
|     release=0 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdeps=bc,xorg-x11-libXp-32bit | ||||
|     kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.man >= 5.1.1,essl.msg >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1 | ||||
|     exlist=essl.exlist | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_essl_compute | ||||
|     description=Minimal essl packages for compute nodes | ||||
|     version=5.1.1 | ||||
|     release=0 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdeps=bc,xorg-x11-libXp-32bit | ||||
|     kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1 | ||||
|     exlist=essl.exlist | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=essl_compute | ||||
|     description=essl for compute nodes | ||||
|     version=5.1.1 | ||||
|     release=0 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdeps=bc,xorg-x11-libXp-32bit | ||||
|     kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.man >= 5.1.1,essl.msg >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1 | ||||
|     exlist=essl.exlist | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=essl_loginnode | ||||
|     description=essl for compute nodes | ||||
|     version=5.1.1 | ||||
|     release=0 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdeps=bc,xorg-x11-libXp-32bit | ||||
|     kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.man >= 5.1.1,essl.msg >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1 | ||||
|     exlist=essl.exlist | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_essl_compute | ||||
|     description=Minimal essl packages for compute nodes | ||||
|     version=5.1.1 | ||||
|     release=0 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdeps=bc,xorg-x11-libXp-32bit | ||||
|     kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1 | ||||
|     exlist=essl.exlist | ||||
|  | ||||
|  | ||||
| # kitpackage: This section defines one Kit Package, and how to build it. | ||||
| #             There can be zero or more kitpackage sections.   | ||||
| #             All filenames should be relative paths to | ||||
| #                <Kit Build Directory>/source_packages   | ||||
| #             If you want to build a package which can run on multiple OSes,  | ||||
| #             you have two options: | ||||
| #               1. Build a separate package for each OS you want to support.   | ||||
| #                  For this option, you need to define one kitpackage section  | ||||
| #                  per supported OS. | ||||
| #               2. Build one package that can run on multiple OSes.   | ||||
| #                  If you are building an RPM package, you are responsible for  | ||||
| #                  creating an RPM spec file that can run on multiple OSes.   | ||||
| #                  For this option, you need to define one kitpackage section | ||||
| #                  which contains multiple kitrepoid lines. | ||||
| #  | ||||
| # kitpackage attributes: | ||||
| #    filename   (mandatory) Package filename | ||||
| #    kitrepoid  (mandatory) The repo(s) this package belongs to.   | ||||
| #                 If multiple repos are defined, the package will be built for | ||||
| #                 the first repo only. For the other repos, a symlink is created | ||||
| #                 to the package built for the first repo. | ||||
| #   Package build methods (optional)   | ||||
| #                 Define how to build the packages.  | ||||
| #                 If you don't specify a build method, the default behavior is | ||||
| #                 to assume the package is pre-built under  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 All files in this section are relative to  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 There are four methods to build packages. | ||||
| #                   1. Use pre-built RPM package | ||||
| #                       isexternalpkg:  'no'|'0', 'yes'|'1'  (default:  'no')  | ||||
| #                         Indicates whether the RPM package will be added to the | ||||
| #                         the kit tar file now as part of the kit build process, | ||||
| #                         or whether the customer will need to separately | ||||
| #                         obtain the RPM pacakage and add it to the kit tar file | ||||
| #                         using 'buildkit addpkgs' | ||||
| #                       rpm_prebuiltdir: If isexternalpkg=no, path to directory | ||||
| #                         containing pre-built RPM package | ||||
| #                   2. Build RPM from spec + src dir | ||||
| #                       rpm_spec:   Path to spec file. | ||||
| #                       rpm_srcdir: Path to source directory. | ||||
| #                   3. Build RPM from spec + src tarball | ||||
| #                       rpm_spec:        Path to spec file. | ||||
| #                       rpm_srctarball:  Path to source tarball. | ||||
| #                   4. Build RPM from source RPM | ||||
| #                       rpm_srpm:  Path to source RPM package. | ||||
| kitpackage: | ||||
|     filename=essl.3232.rte-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.3264.rte-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.6464.rte-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.bg.rte-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.common-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.license-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.man-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.msg-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir= | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.rte-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir=  | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.rte.common-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir=  | ||||
| @@ -0,0 +1 @@ | ||||
| #ENV:IBM_ESSL_LICENSE_ACCEPT=yes# | ||||
| @@ -0,0 +1,6 @@ | ||||
| ./opt/ibmmath/essl/*/FFTW3/include* | ||||
| ./opt/ibmmath/essl/*/include* | ||||
| ./opt/ibmmath/essl/*/lap/license/*.txt | ||||
| ./opt/ibmmath/essl/*/lap/LI_* | ||||
| ./opt/ibmmath/essl/*/lap/LA_* | ||||
|  | ||||
| @@ -0,0 +1,175 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Image Profile Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during image profile operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitimagevalidatecomps => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|         kitimageimport => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # This kit plugin is passed the name of an image profile. | ||||
|     # We need to determine which kits is used by this | ||||
|     # image profile to decide if this plugin should run or not. | ||||
|  | ||||
|     my $imgprofilename = $request->{arg}->[0]; | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imgprofilename]); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $args = $request->{arg}; | ||||
|  | ||||
|     if($command eq 'kitimagevalidatecomps') { | ||||
|         kitimagevalidatecomps($callback, $args); | ||||
|     } | ||||
|     elsif ($command eq 'kitimageimport') { | ||||
|         kitimageimport($callback, $args); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimagevalidatecomps | ||||
|  | ||||
|      This command is called to validate new changes to an  | ||||
|      image profile's kit component list before the changes  | ||||
|      are committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimagevalidatecomps { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename =  $args->[0]; | ||||
|     my $newcomplist = $args->[1]; | ||||
|     my @newcomplist = (); | ||||
|     if (defined($newcomplist)) { | ||||
|         @newcomplist = split(/,/, $newcomplist); | ||||
|     } | ||||
|     my $newosdistro = $args->[2]; | ||||
|     my $newosdistroupdate = $args->[3]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimagevalidatecomps"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimageimport | ||||
|  | ||||
|     This command is called after changes to an image profile  | ||||
|     have been committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimageimport { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename = $args->[0]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimageimport"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,251 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form  | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Node Management Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during node management operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitnodeadd => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderemove => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodeupdate => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderefresh => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodefinished => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $nodes = $request->{node}; | ||||
|  | ||||
|     # This kit plugin is passed a list of node names. | ||||
|     # We need to determine which kits are used by these | ||||
|     # nodes to decide if this plugin should run or not. | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_nodes($nodes); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Get the nodes using this plugin's kit | ||||
|     $nodes = $kitdata->{$PLUGIN_KITNAME}; | ||||
|  | ||||
|  | ||||
|     if($command eq 'kitnodeadd') { | ||||
|         kitnodeadd($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderemove') { | ||||
|         kitnoderemove($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodeupdate') { | ||||
|         kitnodeupdate($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderefresh') { | ||||
|         kitnoderefresh($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodefinished') { | ||||
|         kitnodefinished($callback); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeadd | ||||
|  | ||||
|     This command is called when one or more nodes are added  | ||||
|     to the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeadd { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeadd"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderemove | ||||
|  | ||||
|     This command is called when one or more nodes are  | ||||
|     removed from the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderemove { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderemove"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeupdate | ||||
|  | ||||
|     This command is called when the configuration of one  | ||||
|     or more nodes are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeupdate { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeupdate"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderefresh | ||||
|  | ||||
|     This command is called when node-related configuration | ||||
|     files are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderefresh { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderefresh"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodefinished | ||||
|  | ||||
|     This command is called at the end of a node management | ||||
|     operation.  | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodefinished { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodefinished"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
| @@ -0,0 +1,293 @@ | ||||
| # Kit Build File | ||||
| #  | ||||
| # This file was initially auto-generated by the buildkit CLI command. | ||||
| # To create a new kit, the user should modify this file accordingly. | ||||
| # Refer to the buildkit manpage for further details. | ||||
| # | ||||
|  | ||||
| # kit: This section defines general info for the Kit.  | ||||
| #      There must be exactly one kit section in a kit build file. | ||||
| #  | ||||
| # kit attributes: | ||||
| #    basename        (mandatory) Kit base name. e.g., kit-lsf | ||||
| #    description     (optional)  Kit description. | ||||
| #    version         (mandatory) Kit version. e.g., 1.0 | ||||
| #    ostype          (mandatory) Kit OS type.  Must be Linux. | ||||
| #                      AIX is currently not supported. | ||||
| #    isinternal      (optional)  PCM use only. | ||||
| #                      Indicate if Kit is for internal use. | ||||
| #                      Use 1 for yes, 0 for no. Default: 0 | ||||
| #    kitdeployparams (optional)  Filename containing a list of kit deployment | ||||
| #                       parameters, relative to | ||||
| #                       <Kit Build Directory>/other_files | ||||
| kit: | ||||
|    basename=essl | ||||
|    description=essl for Linux | ||||
|    version=5.1.1 | ||||
|    ostype=Linux | ||||
|    kitdeployparams=essl.env | ||||
|  | ||||
|  | ||||
| # kitrepo: This section defines a Kit Package Repository. | ||||
| #          There must be at least one kitrepo section in a kit build file.   | ||||
| #          If you want to support multiple OSes, you should create a separate | ||||
| #          repo for each OS.  Also, no two repos can be defined with the same  | ||||
| #          OS name, major/minor version and arch. For example, you cannot have | ||||
| #          two repos for RHEL 6.2 ppc64 in the same kit. | ||||
| # | ||||
| # kitrepo attributes: | ||||
| #    kitrepoid          (mandatory) Kit package repository ID. | ||||
| #                         Must be unique within this file. | ||||
| #    osbasename         (mandatory) OS distro base name. e.g., rhels. | ||||
| #    osmajorversion     (mandatory) OS major version. e.g., 6 | ||||
| #    osminorversion     (optional)  OS minor version. | ||||
| #    osarch             (mandatory) OS architecture. e.g., ppc64 | ||||
| #    compat_osbasenames (optional)  Comma-separated list of compatible  | ||||
| #                         OS distro base names. e.g., centos | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=rhels6_ppc64 | ||||
|    osbasename=rhels | ||||
|    osmajorversion=6 | ||||
|    osarch=ppc64 | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=sles11_ppc64 | ||||
|    osbasename=sles | ||||
|    osmajorversion=11 | ||||
|    osarch=ppc64 | ||||
|  | ||||
|  | ||||
| # kitcomponent: This section defines one Kit Component.   | ||||
| #               There can be zero or more kitcomponent sections.  | ||||
| #               If you want to build a component which supports multiple OSes, | ||||
| #               you should create one kitcomponent section for each OS.   | ||||
| #               Also, no two components in a kit can be defined with the same  | ||||
| #               base name.  | ||||
| #               You can define multiple kit components with the same base name | ||||
| #               only if each kit component using this base name meets these  | ||||
| #               requirements: | ||||
| #                 - Each kit component must be defined with the same version | ||||
| #                   and release number | ||||
| #                 - Each kit component must be defined with a unique kitrepoid | ||||
|  | ||||
| # | ||||
| # kitcomponent attributes: | ||||
| #    basename        (mandatory) Kit component base name | ||||
| #    description     (optional)  Kit component description | ||||
| #    version         (mandatory) Kit component version | ||||
| #    release         (mandatory) Kit component release | ||||
| #    serverroles     (mandatory) Comma-separated list of servers that this | ||||
| #                      component can install on. Valid values: | ||||
| #                         mgtnode,servicenode,compute,loginnode,storagenode | ||||
| #    kitrepoid       (mandatory) The ID of the kit package repository this | ||||
| #                      component belongs to | ||||
| #    kitcompdeps     (optional)  Comma-separated list of kit component | ||||
| #                       dependencies.  These kit components can be included in | ||||
| #                       this kit or in other kits. | ||||
| #    ospkgdeps       (optional)  Comma-separated list of OS package dependencies | ||||
| #                       These packages must be shipped with the OS distro. | ||||
| #    kitpkgdeps      (optional)  Comma-separated list of kit package names that | ||||
| #                       will be listed as "REQUIRES" when building this kit | ||||
| #                       component. Each package must be defined in a separate | ||||
| #                       kitpackage section. Each package must be in the same  | ||||
| #                       kitrepo as this kit component. | ||||
| #    non_native_pkgs (optional)  TBD -- NOT SUPPORTED YET! | ||||
| #                       Comma-separated list of non-native package  | ||||
| #                       paths that will be included as files in this kit  | ||||
| #                       component. All filenames are relative to  | ||||
| #                       <Kit Build Directory>/source_packages  | ||||
| #                       Kit component deployment scripts must be specified | ||||
| #                       to manage these files. | ||||
| #   driverpacks      (optional) Comma-separated list of driver package filenames | ||||
| #                       Each driverpack must be defined in a separate kitpackage | ||||
| #                       section. | ||||
| #   exlist           (optional) Exclude list file for stateless image, relative | ||||
| #                       to <Kit Build Directory>/other_files | ||||
| #   Kit component deployment scripts (optional)  Each attribute specifies  | ||||
| #                       script path relative to <Kit Build Directory>/scripts | ||||
| #                       Script attributes: | ||||
| #                         preinstall, postinstall, preuninstall, postuninstall,  | ||||
| #                         preupgrade, postupgrade, postbootscripts | ||||
| kitcomponent: | ||||
|     basename=essl_compute | ||||
|     description=essl for compute nodes | ||||
|     version=5.1.1 | ||||
|     release=0 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdeps=bc,xorg-x11-libXp-32bit | ||||
|     kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.man >= 5.1.1,essl.msg >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1 | ||||
|     exlist=essl.exlist | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=essl_loginnode | ||||
|     description=essl for login nodes | ||||
|     version=5.1.1 | ||||
|     release=0 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdeps=bc,xorg-x11-libXp-32bit | ||||
|     kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.man >= 5.1.1,essl.msg >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1 | ||||
|     exlist=essl.exlist | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_essl_compute | ||||
|     description=Minimal essl packages for compute nodes | ||||
|     version=5.1.1 | ||||
|     release=0 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     ospkgdeps=bc,xorg-x11-libXp-32bit | ||||
|     kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1 | ||||
|     exlist=essl.exlist | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=essl_compute | ||||
|     description=essl for compute nodes | ||||
|     version=5.1.1 | ||||
|     release=0 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdeps=bc,xorg-x11-libXp-32bit | ||||
|     kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.man >= 5.1.1,essl.msg >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1 | ||||
|     exlist=essl.exlist | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=essl_loginnode | ||||
|     description=essl for login nodes | ||||
|     version=5.1.1 | ||||
|     release=0 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdeps=bc,xorg-x11-libXp-32bit | ||||
|     kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.man >= 5.1.1,essl.msg >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1 | ||||
|     exlist=essl.exlist | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_essl_compute | ||||
|     description=Minimal essl packages for compute nodes | ||||
|     version=5.1.1 | ||||
|     release=0 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     ospkgdeps=bc,xorg-x11-libXp-32bit | ||||
|     kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1 | ||||
|     exlist=essl.exlist | ||||
|  | ||||
|  | ||||
| # kitpackage: This section defines one Kit Package, and how to build it. | ||||
| #             There can be zero or more kitpackage sections.   | ||||
| #             All filenames should be relative paths to | ||||
| #                <Kit Build Directory>/source_packages   | ||||
| #             If you want to build a package which can run on multiple OSes,  | ||||
| #             you have two options: | ||||
| #               1. Build a separate package for each OS you want to support.   | ||||
| #                  For this option, you need to define one kitpackage section  | ||||
| #                  per supported OS. | ||||
| #               2. Build one package that can run on multiple OSes.   | ||||
| #                  If you are building an RPM package, you are responsible for  | ||||
| #                  creating an RPM spec file that can run on multiple OSes.   | ||||
| #                  For this option, you need to define one kitpackage section | ||||
| #                  which contains multiple kitrepoid lines. | ||||
| #  | ||||
| # kitpackage attributes: | ||||
| #    filename   (mandatory) Package filename | ||||
| #    kitrepoid  (mandatory) The repo(s) this package belongs to.   | ||||
| #                 If multiple repos are defined, the package will be built for | ||||
| #                 the first repo only. For the other repos, a symlink is created | ||||
| #                 to the package built for the first repo. | ||||
| #   Package build methods (optional)   | ||||
| #                 Define how to build the packages.  | ||||
| #                 If you don't specify a build method, the default behavior is | ||||
| #                 to assume the package is pre-built under  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 All files in this section are relative to  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 There are four methods to build packages. | ||||
| #                   1. Use pre-built RPM package | ||||
| #                       isexternalpkg:  'no'|'0', 'yes'|'1'  (default:  'no')  | ||||
| #                         Indicates whether the RPM package will be added to the | ||||
| #                         the kit tar file now as part of the kit build process, | ||||
| #                         or whether the customer will need to separately | ||||
| #                         obtain the RPM pacakage and add it to the kit tar file | ||||
| #                         using 'buildkit addpkgs' | ||||
| #                       rpm_prebuiltdir: If isexternalpkg=yes, path to directory | ||||
| #                         containing pre-built RPM package | ||||
| #                   2. Build RPM from spec + src dir | ||||
| #                       rpm_spec:   Path to spec file. | ||||
| #                       rpm_srcdir: Path to source directory. | ||||
| #                   3. Build RPM from spec + src tarball | ||||
| #                       rpm_spec:        Path to spec file. | ||||
| #                       rpm_srctarball:  Path to source tarball. | ||||
| #                   4. Build RPM from source RPM | ||||
| #                       rpm_srpm:  Path to source RPM package. | ||||
| kitpackage: | ||||
|     filename=essl.3232.rte-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.3264.rte-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.6464.rte-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.bg.rte-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.common-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.license-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.man-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.msg-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|      | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.rte-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|       | ||||
|  | ||||
| kitpackage: | ||||
|     filename=essl.rte.common-5.1.1-0.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=yes | ||||
|       | ||||
| @@ -0,0 +1 @@ | ||||
| #ENV:IBM_ESSL_LICENSE_ACCEPT=yes# | ||||
| @@ -0,0 +1,11 @@ | ||||
| ./opt/ibmmath/essl/*/FFTW3/include* | ||||
| ./opt/ibmmath/essl/*/include* | ||||
| ./opt/ibmmath/essl/*/lap/license/*.txt | ||||
| ./opt/ibmmath/essl/*/lap/LI_* | ||||
| ./opt/ibmmath/essl/*/lap/LA_* | ||||
|  | ||||
| ./opt/ibmmath/pessl/*/lap/LA_* | ||||
| ./opt/ibmmath/pessl/*/lap/LI_* | ||||
| ./opt/ibmmath/pessl/*/lap/*.jar | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,175 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Image Profile Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during image profile operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitimagevalidatecomps => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|         kitimageimport => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # This kit plugin is passed the name of an image profile. | ||||
|     # We need to determine which kits is used by this | ||||
|     # image profile to decide if this plugin should run or not. | ||||
|  | ||||
|     my $imgprofilename = $request->{arg}->[0]; | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imgprofilename]); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $args = $request->{arg}; | ||||
|  | ||||
|     if($command eq 'kitimagevalidatecomps') { | ||||
|         kitimagevalidatecomps($callback, $args); | ||||
|     } | ||||
|     elsif ($command eq 'kitimageimport') { | ||||
|         kitimageimport($callback, $args); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimagevalidatecomps | ||||
|  | ||||
|      This command is called to validate new changes to an  | ||||
|      image profile's kit component list before the changes  | ||||
|      are committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimagevalidatecomps { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename =  $args->[0]; | ||||
|     my $newcomplist = $args->[1]; | ||||
|     my @newcomplist = (); | ||||
|     if (defined($newcomplist)) { | ||||
|         @newcomplist = split(/,/, $newcomplist); | ||||
|     } | ||||
|     my $newosdistro = $args->[2]; | ||||
|     my $newosdistroupdate = $args->[3]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimagevalidatecomps"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimageimport | ||||
|  | ||||
|     This command is called after changes to an image profile  | ||||
|     have been committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimageimport { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename = $args->[0]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimageimport"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,251 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form  | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Node Management Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during node management operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitnodeadd => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderemove => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodeupdate => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderefresh => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodefinished => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $nodes = $request->{node}; | ||||
|  | ||||
|     # This kit plugin is passed a list of node names. | ||||
|     # We need to determine which kits are used by these | ||||
|     # nodes to decide if this plugin should run or not. | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_nodes($nodes); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Get the nodes using this plugin's kit | ||||
|     $nodes = $kitdata->{$PLUGIN_KITNAME}; | ||||
|  | ||||
|  | ||||
|     if($command eq 'kitnodeadd') { | ||||
|         kitnodeadd($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderemove') { | ||||
|         kitnoderemove($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodeupdate') { | ||||
|         kitnodeupdate($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderefresh') { | ||||
|         kitnoderefresh($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodefinished') { | ||||
|         kitnodefinished($callback); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeadd | ||||
|  | ||||
|     This command is called when one or more nodes are added  | ||||
|     to the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeadd { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeadd"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderemove | ||||
|  | ||||
|     This command is called when one or more nodes are  | ||||
|     removed from the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderemove { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderemove"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeupdate | ||||
|  | ||||
|     This command is called when the configuration of one  | ||||
|     or more nodes are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeupdate { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeupdate"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderefresh | ||||
|  | ||||
|     This command is called when node-related configuration | ||||
|     files are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderefresh { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderefresh"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodefinished | ||||
|  | ||||
|     This command is called at the end of a node management | ||||
|     operation.  | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodefinished { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodefinished"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
| @@ -0,0 +1,313 @@ | ||||
| # Kit Build File | ||||
| #  | ||||
| # This file was initially auto-generated by the buildkit CLI command. | ||||
| # To create a new kit, the user should modify this file accordingly. | ||||
| # Refer to the buildkit manpage for further details. | ||||
| # | ||||
|  | ||||
| # kit: This section defines general info for the Kit.  | ||||
| #      There must be exactly one kit section in a kit build file. | ||||
| #  | ||||
| # kit attributes: | ||||
| #    basename        (mandatory) Kit base name. e.g., kit-lsf | ||||
| #    description     (optional)  Kit description. | ||||
| #    version         (mandatory) Kit version. e.g., 1.0 | ||||
| #    ostype          (mandatory) Kit OS type.  Must be Linux. | ||||
| #                      AIX is currently not supported. | ||||
| #    isinternal      (optional)  PCM use only. | ||||
| #                      Indicate if Kit is for internal use. | ||||
| #                      Use 1 for yes, 0 for no. Default: 0 | ||||
| #    kitdeployparams (optional)  Filename containing a list of kit deployment | ||||
| #                       parameters, relative to | ||||
| #                       <Kit Build Directory>/other_files | ||||
| kit: | ||||
|    basename=gpfs | ||||
|    description=General Parallel File System | ||||
|    version=3.5.0 | ||||
|    ostype=Linux | ||||
|    #kitdeployparams= | ||||
|  | ||||
|  | ||||
| # kitrepo: This section defines a Kit Package Repository. | ||||
| #          There must be at least one kitrepo section in a kit build file.   | ||||
| #          If you want to support multiple OSes, you should create a separate | ||||
| #          repo for each OS.  Also, no two repos can be defined with the same  | ||||
| #          OS name, major/minor version and arch. For example, you cannot have | ||||
| #          two repos for RHEL 6.2 ppc64 in the same kit. | ||||
| # | ||||
| # kitrepo attributes: | ||||
| #    kitrepoid          (mandatory) Kit package repository ID. | ||||
| #                         Must be unique within this file. | ||||
| #    osbasename         (mandatory) OS distro base name. e.g., rhels. | ||||
| #    osmajorversion     (mandatory) OS major version. e.g., 6 | ||||
| #    osminorversion     (optional)  OS minor version. | ||||
| #    osarch             (mandatory) OS architecture. e.g., ppc64 | ||||
| #    compat_osbasenames (optional)  Comma-separated list of compatible  | ||||
| #                         OS distro base names. e.g., centos | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=rhels6_ppc64 | ||||
|    osbasename=rhels | ||||
|    osmajorversion=6 | ||||
|    osarch=ppc64 | ||||
|  | ||||
|    #compat_osbasenames= | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=sles11_ppc64 | ||||
|    osbasename=sles | ||||
|    osmajorversion=11 | ||||
|    osarch=ppc64 | ||||
|  | ||||
|  | ||||
| # kitcomponent: This section defines one Kit Component.   | ||||
| #               There can be zero or more kitcomponent sections.  | ||||
| #               If you want to build a component which supports multiple OSes, | ||||
| #               you should create one kitcomponent section for each OS.   | ||||
| #               Also, no two components in a kit can be defined with the same  | ||||
| #               base name.  | ||||
| #               You can define multiple kit components with the same base name | ||||
| #               only if each kit component using this base name meets these  | ||||
| #               requirements: | ||||
| #                 - Each kit component must be defined with the same version | ||||
| #                   and release number | ||||
| #                 - Each kit component must be defined with a unique kitrepoid | ||||
|  | ||||
| # | ||||
| # kitcomponent attributes: | ||||
| #    basename        (mandatory) Kit component base name | ||||
| #    description     (optional)  Kit component description | ||||
| #    version         (mandatory) Kit component version | ||||
| #    release         (mandatory) Kit component release | ||||
| #    serverroles     (mandatory) Comma-separated list of servers that this | ||||
| #                      component can install on. Valid values: | ||||
| #                         mgtnode,servicenode,compute,loginnode,storagenode | ||||
| #    kitrepoid       (mandatory) The ID of the kit package repository this | ||||
| #                      component belongs to | ||||
| #    kitcompdeps     (optional)  Comma-separated list of kit component | ||||
| #                       dependencies.  These kit components can be included in | ||||
| #                       this kit or in other kits. | ||||
| #    ospkgdeps       (optional)  Comma-separated list of OS package dependencies | ||||
| #                       These packages must be shipped with the OS distro. | ||||
| #    kitpkgdeps      (optional)  Comma-separated list of kit package names that | ||||
| #                       will be listed as "REQUIRES" when building this kit | ||||
| #                       component. Each package must be defined in a separate | ||||
| #                       kitpackage section. Each package must be in the same  | ||||
| #                       kitrepo as this kit component. | ||||
| #    non_native_pkgs (optional)  TBD -- NOT SUPPORTED YET! | ||||
| #                       Comma-separated list of non-native package  | ||||
| #                       paths that will be included as files in this kit  | ||||
| #                       component. All filenames are relative to  | ||||
| #                       <Kit Build Directory>/source_packages  | ||||
| #                       Kit component deployment scripts must be specified | ||||
| #                       to manage these files. | ||||
| #   driverpacks      (optional) Comma-separated list of driver package filenames | ||||
| #                       Each driverpack must be defined in a separate kitpackage | ||||
| #                       section. | ||||
| #   exlist           (optional) Exclude list file for stateless image, relative | ||||
| #                       to <Kit Build Directory>/other_files | ||||
| #   Kit component deployment scripts (optional)  Each attribute specifies  | ||||
| #                       script path relative to <Kit Build Directory>/scripts | ||||
| #                       Script attributes: | ||||
| #                         preinstall, postinstall, preuninstall, postuninstall,  | ||||
| #                         preupgrade, postupgrade, postbootscripts | ||||
| kitcomponent: | ||||
|     basename=gpfs_compute | ||||
|     description=GPFS for compute nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.gplbin >= 3.5.0,gpfs.docs >= 3.5.0 | ||||
|     #non_native_pkgs=  | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_gpfs_compute | ||||
|     description=Minimal GPFS for compute nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.gplbin >= 3.5.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=min-gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_loginnode | ||||
|     description=GPFS for login nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.gplbin >= 3.5.0,gpfs.docs >= 3.5.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_storagenode | ||||
|     description=GPFS for storage nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=storagenode | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.gplbin >= 3.5.0,gpfs.docs >= 3.5.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates_storage | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_compute | ||||
|     description=GPFS for compute nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.gplbin >= 3.5.0,gpfs.docs >= 3.5.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_gpfs_compute | ||||
|     description=Minimal GPFS for compute nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.gplbin >= 3.5.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=min-gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_loginnode | ||||
|     description=GPFS for login nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.gplbin >= 3.5.0,gpfs.docs >= 3.5.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_storagenode | ||||
|     description=GPFS for storage nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=storagenode | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.gplbin >= 3.5.0,gpfs.docs >= 3.5.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates_storage | ||||
|  | ||||
|  | ||||
| # kitpackage: This section defines one Kit Package, and how to build it. | ||||
| #             There can be zero or more kitpackage sections.   | ||||
| #             All filenames should be relative paths to | ||||
| #                <Kit Build Directory>/source_packages   | ||||
| #             If you want to build a package which can run on multiple OSes,  | ||||
| #             you have two options: | ||||
| #               1. Build a separate package for each OS you want to support.   | ||||
| #                  For this option, you need to define one kitpackage section  | ||||
| #                  per supported OS. | ||||
| #               2. Build one package that can run on multiple OSes.   | ||||
| #                  If you are building an RPM package, you are responsible for  | ||||
| #                  creating an RPM spec file that can run on multiple OSes.   | ||||
| #                  For this option, you need to define one kitpackage section | ||||
| #                  which contains multiple kitrepoid lines. | ||||
| #  | ||||
| # kitpackage attributes: | ||||
| #    filename   (mandatory) Package filename | ||||
| #    kitrepoid  (mandatory) The repo(s) this package belongs to.   | ||||
| #                 If multiple repos are defined, the package will be built for | ||||
| #                 the first repo only. For the other repos, a symlink is created | ||||
| #                 to the package built for the first repo. | ||||
| #   Package build methods (optional)   | ||||
| #                 Define how to build the packages.  | ||||
| #                 If you don't specify a build method, the default behavior is | ||||
| #                 to assume the package is pre-built under  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 All files in this section are relative to  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 There are four methods to build packages. | ||||
| #                   1. Use pre-built RPM package | ||||
| #                       isexternalpkg:  'no'|'0', 'yes'|'1'  (default:  'no')  | ||||
| #                         Indicates whether the RPM package will be added to the | ||||
| #                         the kit tar file now as part of the kit build process, | ||||
| #                         or whether the customer will need to separately | ||||
| #                         obtain the RPM pacakage and add it to the kit tar file | ||||
| #                         using 'buildkit addpkgs' | ||||
| #                       rpm_prebuiltdir: If isexternalpkg=no, path to directory | ||||
| #                         containing pre-built RPM package | ||||
| #                   2. Build RPM from spec + src dir | ||||
| #                       rpm_spec:   Path to spec file. | ||||
| #                       rpm_srcdir: Path to source directory. | ||||
| #                   3. Build RPM from spec + src tarball | ||||
| #                       rpm_spec:        Path to spec file. | ||||
| #                       rpm_srctarball:  Path to source tarball. | ||||
| #                   4. Build RPM from source RPM | ||||
| #                       rpm_srpm:  Path to source RPM package. | ||||
| kitpackage: | ||||
|     filename=gpfs.base-3.5.0-6.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir=base | ||||
|  | ||||
| kitpackage: | ||||
|     filename=gpfs.gpl-3.5.0-6.noarch.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir=base | ||||
|  | ||||
| kitpackage: | ||||
|     filename=gpfs.docs-3.5.0-6.noarch.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir=base | ||||
|  | ||||
| kitpackage: | ||||
|     filename=gpfs.msg.en_US-3.5.0-6.noarch.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir=base | ||||
|  | ||||
| kitpackage: | ||||
|     filename=gpfs.gplbin-3.5.0-6.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     isexternalpkg=yes | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
| ./usr/lpp/mmfs/include* | ||||
| ./usr/lpp/mmfs/samples* | ||||
|  | ||||
| @@ -0,0 +1,5 @@ | ||||
| # Exclude list for building a minimal diskless image | ||||
|  | ||||
| ./usr/lpp/mmfs/include* | ||||
| ./usr/lpp/mmfs/samples* | ||||
| ./usr/lpp/mmfs/src* | ||||
| @@ -0,0 +1,175 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Image Profile Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during image profile operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitimagevalidatecomps => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|         kitimageimport => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # This kit plugin is passed the name of an image profile. | ||||
|     # We need to determine which kits is used by this | ||||
|     # image profile to decide if this plugin should run or not. | ||||
|  | ||||
|     my $imgprofilename = $request->{arg}->[0]; | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imgprofilename]); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $args = $request->{arg}; | ||||
|  | ||||
|     if($command eq 'kitimagevalidatecomps') { | ||||
|         kitimagevalidatecomps($callback, $args); | ||||
|     } | ||||
|     elsif ($command eq 'kitimageimport') { | ||||
|         kitimageimport($callback, $args); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimagevalidatecomps | ||||
|  | ||||
|      This command is called to validate new changes to an  | ||||
|      image profile's kit component list before the changes  | ||||
|      are committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimagevalidatecomps { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename =  $args->[0]; | ||||
|     my $newcomplist = $args->[1]; | ||||
|     my @newcomplist = (); | ||||
|     if (defined($newcomplist)) { | ||||
|         @newcomplist = split(/,/, $newcomplist); | ||||
|     } | ||||
|     my $newosdistro = $args->[2]; | ||||
|     my $newosdistroupdate = $args->[3]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimagevalidatecomps"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimageimport | ||||
|  | ||||
|     This command is called after changes to an image profile  | ||||
|     have been committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimageimport { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename = $args->[0]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimageimport"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,251 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form  | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Node Management Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during node management operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitnodeadd => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderemove => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodeupdate => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderefresh => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodefinished => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $nodes = $request->{node}; | ||||
|  | ||||
|     # This kit plugin is passed a list of node names. | ||||
|     # We need to determine which kits are used by these | ||||
|     # nodes to decide if this plugin should run or not. | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_nodes($nodes); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Get the nodes using this plugin's kit | ||||
|     $nodes = $kitdata->{$PLUGIN_KITNAME}; | ||||
|  | ||||
|  | ||||
|     if($command eq 'kitnodeadd') { | ||||
|         kitnodeadd($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderemove') { | ||||
|         kitnoderemove($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodeupdate') { | ||||
|         kitnodeupdate($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderefresh') { | ||||
|         kitnoderefresh($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodefinished') { | ||||
|         kitnodefinished($callback); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeadd | ||||
|  | ||||
|     This command is called when one or more nodes are added  | ||||
|     to the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeadd { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeadd"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderemove | ||||
|  | ||||
|     This command is called when one or more nodes are  | ||||
|     removed from the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderemove { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderemove"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeupdate | ||||
|  | ||||
|     This command is called when the configuration of one  | ||||
|     or more nodes are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeupdate { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeupdate"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderefresh | ||||
|  | ||||
|     This command is called when node-related configuration | ||||
|     files are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderefresh { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderefresh"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodefinished | ||||
|  | ||||
|     This command is called at the end of a node management | ||||
|     operation.  | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodefinished { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodefinished"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
| @@ -0,0 +1,15 @@ | ||||
| #!/bin/sh | ||||
| # xCAT postscript to configure GPFS on a stateless node. | ||||
| # Before booting nodes with this postscript, gpfs must be up and configured correctly on the node | ||||
| # pointed to by the -p flag below.  The $MASTER environment variable will be set by xCAT to | ||||
| # the service node or management node of this booting node.  If you want the nodes to get their | ||||
| # GPFS configuration from a different node, replace $MASTER with that IP address. | ||||
| cmd="/usr/lpp/mmfs/bin/mmsdrrestore -p $MASTER -R /usr/bin/scp" | ||||
| $cmd > /dev/null 2>&1 | ||||
| if [[ $? != 0 ]] | ||||
| then | ||||
|         echo "mmsdrrestore failed!" | ||||
|         exit 2 | ||||
| else | ||||
|         echo "mmsdrrestore succeeded" | ||||
|  | ||||
| @@ -0,0 +1,12 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| # Run this script as a postscript on any node (stateless, statefull, | ||||
| #  full-disk install, AIX, Linux) to start the GPFS daemon | ||||
| #  | ||||
|  | ||||
| # If you have any special network dependencies, you may want to add code | ||||
| # to check them first | ||||
|  | ||||
| /usr/lpp/mmfs/bin/mmsdrrestore | ||||
| /usr/lpp/mmfs/bin/mmstartup | ||||
|  | ||||
| @@ -0,0 +1,84 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| #  | ||||
| # Sample script to install and configure GPFS  | ||||
| # For AIX: | ||||
| #    Assumes the GPFS filesets and updates were installed using  | ||||
| #    xCAT bundle files or some other mechanism. This script does not | ||||
| #    install additional software. | ||||
| #    It will do the following: | ||||
| #      - create /var/mmfs/etc/nsddevices that simply returns 0  | ||||
| #      - add GPFS paths to profile | ||||
| # For Linux: | ||||
| #    Assumes the base GPFS rpms were installed with the xCAT 'otherpkgs' | ||||
| #    postscript (stateful install) or with the otherpkgs processing of | ||||
| #    genimage (stateless/statelite install).  This script will install any | ||||
| #    gpfs update rpms that exist on the xCAT management node in the  | ||||
| #    /install/post/gpfs_updates directory. | ||||
| #    This is necessary because the GPFS updates can ONLY be installed | ||||
| #    after the base rpms have been installed, and the update rpms cannot | ||||
| #    exist in any rpm repositories used by xCAT otherpkgs processing | ||||
| #    since they will confuse rpm tools such as zypper and yum. | ||||
| #    This script will also do the following: | ||||
| #      - create /var/mmfs/etc/nsddevices that simply returns 0 | ||||
| #      - add GPFS paths to profile | ||||
|  | ||||
| OS=`uname` | ||||
| INSTALL_DIR='/install' | ||||
| UPDATES_DIR='post/otherpkgs/gpfs_updates' | ||||
|  | ||||
| if [ $OS != "AIX" ]; then | ||||
|     if [ -f "/proc/cmdline" ]; then | ||||
|     #  Being run from a stateful install postscript | ||||
|     #  Copy rpms directly from the xCAT management node and install         | ||||
|         mkdir -p /tmp/gpfs_updates | ||||
|         rm -f -R /tmp/gpfs_updates/* | ||||
|         cd /tmp/gpfs_updates | ||||
| #        wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=3 ftp://$SITEMASTER/$UPDATES_DIR/*.rpm 2> /tmp/wget.log | ||||
|         wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=4 --reject "index.html*"  --no-parent http://$SITEMASTER$INSTALL_DIR/$UPDATES_DIR/ 2> /tmp/wget.log | ||||
|         if [ -n "`ls *.rpm 2> /dev/null`" ] ; then | ||||
|             rpm -Uvh *.rpm | ||||
|         fi | ||||
|         cd / | ||||
|         rm -f -R /tmp/gpfs_updates | ||||
|     fi | ||||
| fi   | ||||
|  | ||||
| # Create an empty nsddevices script for GPFS  | ||||
| # This assumes that the node is NOT an NSD server | ||||
| if [ $OS != "AIX" ]; then | ||||
|     # Create the script on the node | ||||
|     mkdir -p /var/mmfs/etc | ||||
|     echo 'return 0' > /var/mmfs/etc/nsddevices | ||||
|     chmod 744 /var/mmfs/etc/nsddevices | ||||
| fi | ||||
|  | ||||
|  | ||||
| # Add GPFS path to profile | ||||
| if [ $OS != "AIX" ]; then | ||||
|     gpfsprofile=/etc/profile.d/gpfs | ||||
|     if [ ! -f "/proc/cmdline" ]; then | ||||
|        gpfsprofile=$gpfsprofile | ||||
|     fi | ||||
|     if [ ! -e $gpfsprofile.sh ]; then | ||||
|         echo 'export PATH=$PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.sh | ||||
|         echo 'setenv PATH $PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.csh | ||||
|         # Turn off LANG support since we did not install other msg catalogs | ||||
|         echo 'export LC_CTYPE=POSIX' >> $gpfsprofile.sh | ||||
|         echo 'setenv LC_CTYPE POSIX' >> $gpfsprofile.csh | ||||
|         echo 'export LC_ALL=POSIX' >> $gpfsprofile.sh | ||||
|         echo 'setenv LC_ALL POSIX' >> $gpfsprofile.csh | ||||
|         chmod 744 $gpfsprofile.sh | ||||
|         chmod 744 $gpfsprofile.csh | ||||
|     fi | ||||
| fi | ||||
|  | ||||
| # If you are using a shared home directory stored in GPFS, | ||||
| #   create the symbolic link | ||||
| # | ||||
| # GPFSHOME=/gpfs/home | ||||
| # HOMEDIR=/u | ||||
| # ln -s $GPFSHOME $HOMEDIR | ||||
|  | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,84 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| #  | ||||
| # Sample script to install and configure GPFS  | ||||
| # For AIX: | ||||
| #    Assumes the GPFS filesets and updates were installed using  | ||||
| #    xCAT bundle files or some other mechanism. This script does not | ||||
| #    install additional software. | ||||
| #    It will do the following: | ||||
| #      - create /var/mmfs/etc/nsddevices that simply returns 0  | ||||
| #      - add GPFS paths to profile | ||||
| # For Linux: | ||||
| #    Assumes the base GPFS rpms were installed with the xCAT 'otherpkgs' | ||||
| #    postscript (stateful install) or with the otherpkgs processing of | ||||
| #    genimage (stateless/statelite install).  This script will install any | ||||
| #    gpfs update rpms that exist on the xCAT management node in the  | ||||
| #    /install/post/gpfs_updates directory. | ||||
| #    This is necessary because the GPFS updates can ONLY be installed | ||||
| #    after the base rpms have been installed, and the update rpms cannot | ||||
| #    exist in any rpm repositories used by xCAT otherpkgs processing | ||||
| #    since they will confuse rpm tools such as zypper and yum. | ||||
| #    This script will also do the following: | ||||
| #      - create /var/mmfs/etc/nsddevices that simply returns 0 | ||||
| #      - add GPFS paths to profile | ||||
|  | ||||
| OS=`uname` | ||||
| INSTALL_DIR='/install' | ||||
| UPDATES_DIR='post/otherpkgs/gpfs_updates' | ||||
|  | ||||
| if [ $OS != "AIX" ]; then | ||||
|     if [ -f "/proc/cmdline" ]; then | ||||
|     #  Being run from a stateful install postscript | ||||
|     #  Copy rpms directly from the xCAT management node and install         | ||||
|         mkdir -p /tmp/gpfs_updates | ||||
|         rm -f -R /tmp/gpfs_updates/* | ||||
|         cd /tmp/gpfs_updates | ||||
| #        wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=3 ftp://$SITEMASTER/$UPDATES_DIR/*.rpm 2> /tmp/wget.log | ||||
|         wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=4 --reject "index.html*"  --no-parent http://$SITEMASTER$INSTALL_DIR/$UPDATES_DIR/ 2> /tmp/wget.log | ||||
|         if [ -n "`ls *.rpm 2> /dev/null`" ] ; then | ||||
|             rpm -Uvh *.rpm | ||||
|         fi | ||||
|         cd / | ||||
|         rm -f -R /tmp/gpfs_updates | ||||
|     fi | ||||
| fi   | ||||
|  | ||||
| ## Create an empty nsddevices script for GPFS  | ||||
| ## This assumes that the node is NOT an NSD server | ||||
| #if [ $OS != "AIX" ]; then | ||||
| #    # Create the script on the node | ||||
| #    mkdir -p /var/mmfs/etc | ||||
| #    echo 'return 0' > /var/mmfs/etc/nsddevices | ||||
| #    chmod 744 /var/mmfs/etc/nsddevices | ||||
| #fi | ||||
|  | ||||
|  | ||||
| # Add GPFS path to profile | ||||
| if [ $OS != "AIX" ]; then | ||||
|     gpfsprofile=/etc/profile.d/gpfs | ||||
|     if [ ! -f "/proc/cmdline" ]; then | ||||
|        gpfsprofile=$gpfsprofile | ||||
|     fi | ||||
|     if [ ! -e $gpfsprofile.sh ]; then | ||||
|         echo 'export PATH=$PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.sh | ||||
|         echo 'setenv PATH $PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.csh | ||||
|         # Turn off LANG support since we did not install other msg catalogs | ||||
|         echo 'export LC_CTYPE=POSIX' >> $gpfsprofile.sh | ||||
|         echo 'setenv LC_CTYPE POSIX' >> $gpfsprofile.csh | ||||
|         echo 'export LC_ALL=POSIX' >> $gpfsprofile.sh | ||||
|         echo 'setenv LC_ALL POSIX' >> $gpfsprofile.csh | ||||
|         chmod 744 $gpfsprofile.sh | ||||
|         chmod 744 $gpfsprofile.csh | ||||
|     fi | ||||
| fi | ||||
|  | ||||
| # If you are using a shared home directory stored in GPFS, | ||||
| #   create the symbolic link | ||||
| # | ||||
| # GPFSHOME=/gpfs/home | ||||
| # HOMEDIR=/u | ||||
| # ln -s $GPFSHOME $HOMEDIR | ||||
|  | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 post script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
| #!/bin/sh | ||||
| echo "running sample-comp1 postboot script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 postun script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 postup script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 pre script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 preun script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 preup script" | ||||
|  | ||||
| @@ -0,0 +1,313 @@ | ||||
| # Kit Build File | ||||
| #  | ||||
| # This file was initially auto-generated by the buildkit CLI command. | ||||
| # To create a new kit, the user should modify this file accordingly. | ||||
| # Refer to the buildkit manpage for further details. | ||||
| # | ||||
|  | ||||
| # kit: This section defines general info for the Kit.  | ||||
| #      There must be exactly one kit section in a kit build file. | ||||
| #  | ||||
| # kit attributes: | ||||
| #    basename        (mandatory) Kit base name. e.g., kit-lsf | ||||
| #    description     (optional)  Kit description. | ||||
| #    version         (mandatory) Kit version. e.g., 1.0 | ||||
| #    ostype          (mandatory) Kit OS type.  Must be Linux. | ||||
| #                      AIX is currently not supported. | ||||
| #    isinternal      (optional)  PCM use only. | ||||
| #                      Indicate if Kit is for internal use. | ||||
| #                      Use 1 for yes, 0 for no. Default: 0 | ||||
| #    kitdeployparams (optional)  Filename containing a list of kit deployment | ||||
| #                       parameters, relative to | ||||
| #                       <Kit Build Directory>/other_files | ||||
| kit: | ||||
|    basename=gpfs | ||||
|    description=General Parallel File System | ||||
|    version=3.5.0 | ||||
|    ostype=Linux | ||||
|    #kitdeployparams= | ||||
|  | ||||
|  | ||||
| # kitrepo: This section defines a Kit Package Repository. | ||||
| #          There must be at least one kitrepo section in a kit build file.   | ||||
| #          If you want to support multiple OSes, you should create a separate | ||||
| #          repo for each OS.  Also, no two repos can be defined with the same  | ||||
| #          OS name, major/minor version and arch. For example, you cannot have | ||||
| #          two repos for RHEL 6.2 x86_64 in the same kit. | ||||
| # | ||||
| # kitrepo attributes: | ||||
| #    kitrepoid          (mandatory) Kit package repository ID. | ||||
| #                         Must be unique within this file. | ||||
| #    osbasename         (mandatory) OS distro base name. e.g., rhels. | ||||
| #    osmajorversion     (mandatory) OS major version. e.g., 6 | ||||
| #    osminorversion     (optional)  OS minor version. | ||||
| #    osarch             (mandatory) OS architecture. e.g., x86_64 | ||||
| #    compat_osbasenames (optional)  Comma-separated list of compatible  | ||||
| #                         OS distro base names. e.g., centos | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=rhels6_x86_64 | ||||
|    osbasename=rhels | ||||
|    osmajorversion=6 | ||||
|    osarch=x86_64 | ||||
|  | ||||
|    #compat_osbasenames= | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=sles11_x86_64 | ||||
|    osbasename=sles | ||||
|    osmajorversion=11 | ||||
|    osarch=x86_64 | ||||
|  | ||||
|  | ||||
| # kitcomponent: This section defines one Kit Component.   | ||||
| #               There can be zero or more kitcomponent sections.  | ||||
| #               If you want to build a component which supports multiple OSes, | ||||
| #               you should create one kitcomponent section for each OS.   | ||||
| #               Also, no two components in a kit can be defined with the same  | ||||
| #               base name.  | ||||
| #               You can define multiple kit components with the same base name | ||||
| #               only if each kit component using this base name meets these  | ||||
| #               requirements: | ||||
| #                 - Each kit component must be defined with the same version | ||||
| #                   and release number | ||||
| #                 - Each kit component must be defined with a unique kitrepoid | ||||
|  | ||||
| # | ||||
| # kitcomponent attributes: | ||||
| #    basename        (mandatory) Kit component base name | ||||
| #    description     (optional)  Kit component description | ||||
| #    version         (mandatory) Kit component version | ||||
| #    release         (mandatory) Kit component release | ||||
| #    serverroles     (mandatory) Comma-separated list of servers that this | ||||
| #                      component can install on. Valid values: | ||||
| #                         mgtnode,servicenode,compute,loginnode,storagenode | ||||
| #    kitrepoid       (mandatory) The ID of the kit package repository this | ||||
| #                      component belongs to | ||||
| #    kitcompdeps     (optional)  Comma-separated list of kit component | ||||
| #                       dependencies.  These kit components can be included in | ||||
| #                       this kit or in other kits. | ||||
| #    ospkgdeps       (optional)  Comma-separated list of OS package dependencies | ||||
| #                       These packages must be shipped with the OS distro. | ||||
| #    kitpkgdeps      (optional)  Comma-separated list of kit package names that | ||||
| #                       will be listed as "REQUIRES" when building this kit | ||||
| #                       component. Each package must be defined in a separate | ||||
| #                       kitpackage section. Each package must be in the same  | ||||
| #                       kitrepo as this kit component. | ||||
| #    non_native_pkgs (optional)  TBD -- NOT SUPPORTED YET! | ||||
| #                       Comma-separated list of non-native package  | ||||
| #                       paths that will be included as files in this kit  | ||||
| #                       component. All filenames are relative to  | ||||
| #                       <Kit Build Directory>/source_packages  | ||||
| #                       Kit component deployment scripts must be specified | ||||
| #                       to manage these files. | ||||
| #   driverpacks      (optional) Comma-separated list of driver package filenames | ||||
| #                       Each driverpack must be defined in a separate kitpackage | ||||
| #                       section. | ||||
| #   exlist           (optional) Exclude list file for stateless image, relative | ||||
| #                       to <Kit Build Directory>/other_files | ||||
| #   Kit component deployment scripts (optional)  Each attribute specifies  | ||||
| #                       script path relative to <Kit Build Directory>/scripts | ||||
| #                       Script attributes: | ||||
| #                         preinstall, postinstall, preuninstall, postuninstall,  | ||||
| #                         preupgrade, postupgrade, postbootscripts | ||||
| kitcomponent: | ||||
|     basename=gpfs_compute | ||||
|     description=GPFS for compute nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_x86_64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.4.0,gpfs.gpl >= 3.4.0,gpfs.msg.en_US >= 3.4.0,gpfs.gplbin >= 3.4.0,gpfs.docs >= 3.4.0 | ||||
|     #non_native_pkgs=  | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_gpfs_compute | ||||
|     description=Minimal GPFS for compute nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_x86_64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.4.0,gpfs.gpl >= 3.4.0,gpfs.msg.en_US >= 3.4.0,gpfs.gplbin >= 3.4.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=min-gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_loginnode | ||||
|     description=GPFS for login nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=rhels6_x86_64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.4.0,gpfs.gpl >= 3.4.0,gpfs.msg.en_US >= 3.4.0,gpfs.gplbin >= 3.4.0,gpfs.docs >= 3.4.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_storagenode | ||||
|     description=GPFS for storage nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=storagenode | ||||
|     kitrepoid=rhels6_x86_64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.4.0,gpfs.gpl >= 3.4.0,gpfs.msg.en_US >= 3.4.0,gpfs.gplbin >= 3.4.0,gpfs.docs >= 3.4.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates_storage | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_compute | ||||
|     description=GPFS for compute nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_x86_64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.4.0,gpfs.gpl >= 3.4.0,gpfs.msg.en_US >= 3.4.0,gpfs.gplbin >= 3.4.0,gpfs.docs >= 3.4.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_gpfs_compute | ||||
|     description=Minimal GPFS for compute nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_x86_64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.4.0,gpfs.gpl >= 3.4.0,gpfs.msg.en_US >= 3.4.0,gpfs.gplbin >= 3.4.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=min-gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_loginnode | ||||
|     description=GPFS for login nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=sles11_x86_64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.4.0,gpfs.gpl >= 3.4.0,gpfs.msg.en_US >= 3.4.0,gpfs.gplbin >= 3.4.0,gpfs.docs >= 3.4.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_storagenode | ||||
|     description=GPFS for storage nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=storagenode | ||||
|     kitrepoid=sles11_x86_64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.4.0,gpfs.gpl >= 3.4.0,gpfs.msg.en_US >= 3.4.0,gpfs.gplbin >= 3.4.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=min-gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates_storage | ||||
|  | ||||
|  | ||||
| # kitpackage: This section defines one Kit Package, and how to build it. | ||||
| #             There can be zero or more kitpackage sections.   | ||||
| #             All filenames should be relative paths to | ||||
| #                <Kit Build Directory>/source_packages   | ||||
| #             If you want to build a package which can run on multiple OSes,  | ||||
| #             you have two options: | ||||
| #               1. Build a separate package for each OS you want to support.   | ||||
| #                  For this option, you need to define one kitpackage section  | ||||
| #                  per supported OS. | ||||
| #               2. Build one package that can run on multiple OSes.   | ||||
| #                  If you are building an RPM package, you are responsible for  | ||||
| #                  creating an RPM spec file that can run on multiple OSes.   | ||||
| #                  For this option, you need to define one kitpackage section | ||||
| #                  which contains multiple kitrepoid lines. | ||||
| #  | ||||
| # kitpackage attributes: | ||||
| #    filename   (mandatory) Package filename | ||||
| #    kitrepoid  (mandatory) The repo(s) this package belongs to.   | ||||
| #                 If multiple repos are defined, the package will be built for | ||||
| #                 the first repo only. For the other repos, a symlink is created | ||||
| #                 to the package built for the first repo. | ||||
| #   Package build methods (optional)   | ||||
| #                 Define how to build the packages.  | ||||
| #                 If you don't specify a build method, the default behavior is | ||||
| #                 to assume the package is pre-built under  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 All files in this section are relative to  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 There are four methods to build packages. | ||||
| #                   1. Use pre-built RPM package | ||||
| #                       isexternalpkg:  'no'|'0', 'yes'|'1'  (default:  'no')  | ||||
| #                         Indicates whether the RPM package will be added to the | ||||
| #                         the kit tar file now as part of the kit build process, | ||||
| #                         or whether the customer will need to separately | ||||
| #                         obtain the RPM pacakage and add it to the kit tar file | ||||
| #                         using 'buildkit addpkgs' | ||||
| #                       rpm_prebuiltdir: If isexternalpkg=no, path to directory | ||||
| #                         containing pre-built RPM package | ||||
| #                   2. Build RPM from spec + src dir | ||||
| #                       rpm_spec:   Path to spec file. | ||||
| #                       rpm_srcdir: Path to source directory. | ||||
| #                   3. Build RPM from spec + src tarball | ||||
| #                       rpm_spec:        Path to spec file. | ||||
| #                       rpm_srctarball:  Path to source tarball. | ||||
| #                   4. Build RPM from source RPM | ||||
| #                       rpm_srpm:  Path to source RPM package. | ||||
| kitpackage: | ||||
|     filename=gpfs.base-3.5.0-6.x86_64.rpm | ||||
|     kitrepoid=rhels6_x86_64,sles11_x86_64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir=base | ||||
|  | ||||
| kitpackage: | ||||
|     filename=gpfs.gpl-3.5.0-6.noarch.rpm | ||||
|     kitrepoid=rhels6_x86_64,sles11_x86_64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir=base | ||||
|  | ||||
| kitpackage: | ||||
|     filename=gpfs.docs-3.5.0-6.noarch.rpm | ||||
|     kitrepoid=rhels6_x86_64,sles11_x86_64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir=base | ||||
|  | ||||
| kitpackage: | ||||
|     filename=gpfs.msg.en_US-3.5.0-6.noarch.rpm | ||||
|     kitrepoid=rhels6_x86_64,sles11_x86_64 | ||||
|     # Method 1: Use pre-built RPM package | ||||
|     isexternalpkg=no | ||||
|     rpm_prebuiltdir=base | ||||
|  | ||||
| kitpackage: | ||||
|     filename=gpfs.gplbin-3.5.0-6.x86_64.rpm | ||||
|     kitrepoid=rhels6_x86_64,sles11_x86_64 | ||||
|     isexternalpkg=yes | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
| ./usr/lpp/mmfs/include* | ||||
| ./usr/lpp/mmfs/samples* | ||||
|  | ||||
| @@ -0,0 +1,5 @@ | ||||
| # Exclude list for building a minimal diskless image | ||||
|  | ||||
| ./usr/lpp/mmfs/include* | ||||
| ./usr/lpp/mmfs/samples* | ||||
| ./usr/lpp/mmfs/src* | ||||
| @@ -0,0 +1,175 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Image Profile Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during image profile operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitimagevalidatecomps => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|         kitimageimport => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # This kit plugin is passed the name of an image profile. | ||||
|     # We need to determine which kits is used by this | ||||
|     # image profile to decide if this plugin should run or not. | ||||
|  | ||||
|     my $imgprofilename = $request->{arg}->[0]; | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imgprofilename]); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $args = $request->{arg}; | ||||
|  | ||||
|     if($command eq 'kitimagevalidatecomps') { | ||||
|         kitimagevalidatecomps($callback, $args); | ||||
|     } | ||||
|     elsif ($command eq 'kitimageimport') { | ||||
|         kitimageimport($callback, $args); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimagevalidatecomps | ||||
|  | ||||
|      This command is called to validate new changes to an  | ||||
|      image profile's kit component list before the changes  | ||||
|      are committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimagevalidatecomps { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename =  $args->[0]; | ||||
|     my $newcomplist = $args->[1]; | ||||
|     my @newcomplist = (); | ||||
|     if (defined($newcomplist)) { | ||||
|         @newcomplist = split(/,/, $newcomplist); | ||||
|     } | ||||
|     my $newosdistro = $args->[2]; | ||||
|     my $newosdistroupdate = $args->[3]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimagevalidatecomps"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimageimport | ||||
|  | ||||
|     This command is called after changes to an image profile  | ||||
|     have been committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimageimport { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename = $args->[0]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimageimport"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,251 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form  | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Node Management Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during node management operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitnodeadd => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderemove => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodeupdate => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderefresh => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodefinished => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $nodes = $request->{node}; | ||||
|  | ||||
|     # This kit plugin is passed a list of node names. | ||||
|     # We need to determine which kits are used by these | ||||
|     # nodes to decide if this plugin should run or not. | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_nodes($nodes); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Get the nodes using this plugin's kit | ||||
|     $nodes = $kitdata->{$PLUGIN_KITNAME}; | ||||
|  | ||||
|  | ||||
|     if($command eq 'kitnodeadd') { | ||||
|         kitnodeadd($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderemove') { | ||||
|         kitnoderemove($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodeupdate') { | ||||
|         kitnodeupdate($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderefresh') { | ||||
|         kitnoderefresh($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodefinished') { | ||||
|         kitnodefinished($callback); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeadd | ||||
|  | ||||
|     This command is called when one or more nodes are added  | ||||
|     to the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeadd { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeadd"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderemove | ||||
|  | ||||
|     This command is called when one or more nodes are  | ||||
|     removed from the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderemove { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderemove"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeupdate | ||||
|  | ||||
|     This command is called when the configuration of one  | ||||
|     or more nodes are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeupdate { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeupdate"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderefresh | ||||
|  | ||||
|     This command is called when node-related configuration | ||||
|     files are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderefresh { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderefresh"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodefinished | ||||
|  | ||||
|     This command is called at the end of a node management | ||||
|     operation.  | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodefinished { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodefinished"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
| @@ -0,0 +1,15 @@ | ||||
| #!/bin/sh | ||||
| # xCAT postscript to configure GPFS on a stateless node. | ||||
| # Before booting nodes with this postscript, gpfs must be up and configured correctly on the node | ||||
| # pointed to by the -p flag below.  The $MASTER environment variable will be set by xCAT to | ||||
| # the service node or management node of this booting node.  If you want the nodes to get their | ||||
| # GPFS configuration from a different node, replace $MASTER with that IP address. | ||||
| cmd="/usr/lpp/mmfs/bin/mmsdrrestore -p $MASTER -R /usr/bin/scp" | ||||
| $cmd > /dev/null 2>&1 | ||||
| if [[ $? != 0 ]] | ||||
| then | ||||
|         echo "mmsdrrestore failed!" | ||||
|         exit 2 | ||||
| else | ||||
|         echo "mmsdrrestore succeeded" | ||||
|  | ||||
| @@ -0,0 +1,12 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| # Run this script as a postscript on any node (stateless, statefull, | ||||
| #  full-disk install, AIX, Linux) to start the GPFS daemon | ||||
| #  | ||||
|  | ||||
| # If you have any special network dependencies, you may want to add code | ||||
| # to check them first | ||||
|  | ||||
| /usr/lpp/mmfs/bin/mmsdrrestore | ||||
| /usr/lpp/mmfs/bin/mmstartup | ||||
|  | ||||
| @@ -0,0 +1,84 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| #  | ||||
| # Sample script to install and configure GPFS  | ||||
| # For AIX: | ||||
| #    Assumes the GPFS filesets and updates were installed using  | ||||
| #    xCAT bundle files or some other mechanism. This script does not | ||||
| #    install additional software. | ||||
| #    It will do the following: | ||||
| #      - create /var/mmfs/etc/nsddevices that simply returns 0  | ||||
| #      - add GPFS paths to profile | ||||
| # For Linux: | ||||
| #    Assumes the base GPFS rpms were installed with the xCAT 'otherpkgs' | ||||
| #    postscript (stateful install) or with the otherpkgs processing of | ||||
| #    genimage (stateless/statelite install).  This script will install any | ||||
| #    gpfs update rpms that exist on the xCAT management node in the  | ||||
| #    /install/post/gpfs_updates directory. | ||||
| #    This is necessary because the GPFS updates can ONLY be installed | ||||
| #    after the base rpms have been installed, and the update rpms cannot | ||||
| #    exist in any rpm repositories used by xCAT otherpkgs processing | ||||
| #    since they will confuse rpm tools such as zypper and yum. | ||||
| #    This script will also do the following: | ||||
| #      - create /var/mmfs/etc/nsddevices that simply returns 0 | ||||
| #      - add GPFS paths to profile | ||||
|  | ||||
| OS=`uname` | ||||
| INSTALL_DIR='/install' | ||||
| UPDATES_DIR='post/otherpkgs/gpfs_updates' | ||||
|  | ||||
| if [ $OS != "AIX" ]; then | ||||
|     if [ -f "/proc/cmdline" ]; then | ||||
|     #  Being run from a stateful install postscript | ||||
|     #  Copy rpms directly from the xCAT management node and install         | ||||
|         mkdir -p /tmp/gpfs_updates | ||||
|         rm -f -R /tmp/gpfs_updates/* | ||||
|         cd /tmp/gpfs_updates | ||||
| #        wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=3 ftp://$SITEMASTER/$UPDATES_DIR/*.rpm 2> /tmp/wget.log | ||||
|         wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=4 --reject "index.html*"  --no-parent http://$SITEMASTER$INSTALL_DIR/$UPDATES_DIR/ 2> /tmp/wget.log | ||||
|         if [ -n "`ls *.rpm 2> /dev/null`" ] ; then | ||||
|             rpm -Uvh *.rpm | ||||
|         fi | ||||
|         cd / | ||||
|         rm -f -R /tmp/gpfs_updates | ||||
|     fi | ||||
| fi   | ||||
|  | ||||
| # Create an empty nsddevices script for GPFS  | ||||
| # This assumes that the node is NOT an NSD server | ||||
| if [ $OS != "AIX" ]; then | ||||
|     # Create the script on the node | ||||
|     mkdir -p /var/mmfs/etc | ||||
|     echo 'return 0' > /var/mmfs/etc/nsddevices | ||||
|     chmod 744 /var/mmfs/etc/nsddevices | ||||
| fi | ||||
|  | ||||
|  | ||||
| # Add GPFS path to profile | ||||
| if [ $OS != "AIX" ]; then | ||||
|     gpfsprofile=/etc/profile.d/gpfs | ||||
|     if [ ! -f "/proc/cmdline" ]; then | ||||
|        gpfsprofile=$gpfsprofile | ||||
|     fi | ||||
|     if [ ! -e $gpfsprofile.sh ]; then | ||||
|         echo 'export PATH=$PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.sh | ||||
|         echo 'setenv PATH $PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.csh | ||||
|         # Turn off LANG support since we did not install other msg catalogs | ||||
|         echo 'export LC_CTYPE=POSIX' >> $gpfsprofile.sh | ||||
|         echo 'setenv LC_CTYPE POSIX' >> $gpfsprofile.csh | ||||
|         echo 'export LC_ALL=POSIX' >> $gpfsprofile.sh | ||||
|         echo 'setenv LC_ALL POSIX' >> $gpfsprofile.csh | ||||
|         chmod 744 $gpfsprofile.sh | ||||
|         chmod 744 $gpfsprofile.csh | ||||
|     fi | ||||
| fi | ||||
|  | ||||
| # If you are using a shared home directory stored in GPFS, | ||||
| #   create the symbolic link | ||||
| # | ||||
| # GPFSHOME=/gpfs/home | ||||
| # HOMEDIR=/u | ||||
| # ln -s $GPFSHOME $HOMEDIR | ||||
|  | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,84 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| #  | ||||
| # Sample script to install and configure GPFS  | ||||
| # For AIX: | ||||
| #    Assumes the GPFS filesets and updates were installed using  | ||||
| #    xCAT bundle files or some other mechanism. This script does not | ||||
| #    install additional software. | ||||
| #    It will do the following: | ||||
| #      - create /var/mmfs/etc/nsddevices that simply returns 0  | ||||
| #      - add GPFS paths to profile | ||||
| # For Linux: | ||||
| #    Assumes the base GPFS rpms were installed with the xCAT 'otherpkgs' | ||||
| #    postscript (stateful install) or with the otherpkgs processing of | ||||
| #    genimage (stateless/statelite install).  This script will install any | ||||
| #    gpfs update rpms that exist on the xCAT management node in the  | ||||
| #    /install/post/gpfs_updates directory. | ||||
| #    This is necessary because the GPFS updates can ONLY be installed | ||||
| #    after the base rpms have been installed, and the update rpms cannot | ||||
| #    exist in any rpm repositories used by xCAT otherpkgs processing | ||||
| #    since they will confuse rpm tools such as zypper and yum. | ||||
| #    This script will also do the following: | ||||
| #      - create /var/mmfs/etc/nsddevices that simply returns 0 | ||||
| #      - add GPFS paths to profile | ||||
|  | ||||
| OS=`uname` | ||||
| INSTALL_DIR='/install' | ||||
| UPDATES_DIR='post/otherpkgs/gpfs_updates' | ||||
|  | ||||
| if [ $OS != "AIX" ]; then | ||||
|     if [ -f "/proc/cmdline" ]; then | ||||
|     #  Being run from a stateful install postscript | ||||
|     #  Copy rpms directly from the xCAT management node and install         | ||||
|         mkdir -p /tmp/gpfs_updates | ||||
|         rm -f -R /tmp/gpfs_updates/* | ||||
|         cd /tmp/gpfs_updates | ||||
| #        wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=3 ftp://$SITEMASTER/$UPDATES_DIR/*.rpm 2> /tmp/wget.log | ||||
|         wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=4 --reject "index.html*"  --no-parent http://$SITEMASTER$INSTALL_DIR/$UPDATES_DIR/ 2> /tmp/wget.log | ||||
|         if [ -n "`ls *.rpm 2> /dev/null`" ] ; then | ||||
|             rpm -Uvh *.rpm | ||||
|         fi | ||||
|         cd / | ||||
|         rm -f -R /tmp/gpfs_updates | ||||
|     fi | ||||
| fi   | ||||
|  | ||||
| ## Create an empty nsddevices script for GPFS  | ||||
| ## This assumes that the node is NOT an NSD server | ||||
| #if [ $OS != "AIX" ]; then | ||||
| #    # Create the script on the node | ||||
| #    mkdir -p /var/mmfs/etc | ||||
| #    echo 'return 0' > /var/mmfs/etc/nsddevices | ||||
| #    chmod 744 /var/mmfs/etc/nsddevices | ||||
| #fi | ||||
|  | ||||
|  | ||||
| # Add GPFS path to profile | ||||
| if [ $OS != "AIX" ]; then | ||||
|     gpfsprofile=/etc/profile.d/gpfs | ||||
|     if [ ! -f "/proc/cmdline" ]; then | ||||
|        gpfsprofile=$gpfsprofile | ||||
|     fi | ||||
|     if [ ! -e $gpfsprofile.sh ]; then | ||||
|         echo 'export PATH=$PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.sh | ||||
|         echo 'setenv PATH $PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.csh | ||||
|         # Turn off LANG support since we did not install other msg catalogs | ||||
|         echo 'export LC_CTYPE=POSIX' >> $gpfsprofile.sh | ||||
|         echo 'setenv LC_CTYPE POSIX' >> $gpfsprofile.csh | ||||
|         echo 'export LC_ALL=POSIX' >> $gpfsprofile.sh | ||||
|         echo 'setenv LC_ALL POSIX' >> $gpfsprofile.csh | ||||
|         chmod 744 $gpfsprofile.sh | ||||
|         chmod 744 $gpfsprofile.csh | ||||
|     fi | ||||
| fi | ||||
|  | ||||
| # If you are using a shared home directory stored in GPFS, | ||||
| #   create the symbolic link | ||||
| # | ||||
| # GPFSHOME=/gpfs/home | ||||
| # HOMEDIR=/u | ||||
| # ln -s $GPFSHOME $HOMEDIR | ||||
|  | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 post script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
| #!/bin/sh | ||||
| echo "running sample-comp1 postboot script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 postun script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 postup script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 pre script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 preun script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 preup script" | ||||
|  | ||||
| @@ -0,0 +1,305 @@ | ||||
| # Kit Build File | ||||
| #  | ||||
| # This file was initially auto-generated by the buildkit CLI command. | ||||
| # To create a new kit, the user should modify this file accordingly. | ||||
| # Refer to the buildkit manpage for further details. | ||||
| # | ||||
|  | ||||
| # kit: This section defines general info for the Kit.  | ||||
| #      There must be exactly one kit section in a kit build file. | ||||
| #  | ||||
| # kit attributes: | ||||
| #    basename        (mandatory) Kit base name. e.g., kit-lsf | ||||
| #    description     (optional)  Kit description. | ||||
| #    version         (mandatory) Kit version. e.g., 1.0 | ||||
| #    ostype          (mandatory) Kit OS type.  Must be Linux. | ||||
| #                      AIX is currently not supported. | ||||
| #    isinternal      (optional)  PCM use only. | ||||
| #                      Indicate if Kit is for internal use. | ||||
| #                      Use 1 for yes, 0 for no. Default: 0 | ||||
| #    kitdeployparams (optional)  Filename containing a list of kit deployment | ||||
| #                       parameters, relative to | ||||
| #                       <Kit Build Directory>/other_files | ||||
| kit: | ||||
|    basename=gpfs | ||||
|    description=General Parallel File System | ||||
|    version=3.5.0 | ||||
|    ostype=Linux | ||||
|    #kitdeployparams= | ||||
|  | ||||
|  | ||||
| # kitrepo: This section defines a Kit Package Repository. | ||||
| #          There must be at least one kitrepo section in a kit build file.   | ||||
| #          If you want to support multiple OSes, you should create a separate | ||||
| #          repo for each OS.  Also, no two repos can be defined with the same  | ||||
| #          OS name, major/minor version and arch. For example, you cannot have | ||||
| #          two repos for RHEL 6.2 ppc64 in the same kit. | ||||
| # | ||||
| # kitrepo attributes: | ||||
| #    kitrepoid          (mandatory) Kit package repository ID. | ||||
| #                         Must be unique within this file. | ||||
| #    osbasename         (mandatory) OS distro base name. e.g., rhels. | ||||
| #    osmajorversion     (mandatory) OS major version. e.g., 6 | ||||
| #    osminorversion     (optional)  OS minor version. | ||||
| #    osarch             (mandatory) OS architecture. e.g., ppc64 | ||||
| #    compat_osbasenames (optional)  Comma-separated list of compatible  | ||||
| #                         OS distro base names. e.g., centos | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=rhels6_ppc64 | ||||
|    osbasename=rhels | ||||
|    osmajorversion=6 | ||||
|    osarch=ppc64 | ||||
|  | ||||
|    #compat_osbasenames= | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=sles11_ppc64 | ||||
|    osbasename=sles | ||||
|    osmajorversion=11 | ||||
|    osarch=ppc64 | ||||
|  | ||||
|  | ||||
| # kitcomponent: This section defines one Kit Component.   | ||||
| #               There can be zero or more kitcomponent sections.  | ||||
| #               If you want to build a component which supports multiple OSes, | ||||
| #               you should create one kitcomponent section for each OS.   | ||||
| #               Also, no two components in a kit can be defined with the same  | ||||
| #               base name.  | ||||
| #               You can define multiple kit components with the same base name | ||||
| #               only if each kit component using this base name meets these  | ||||
| #               requirements: | ||||
| #                 - Each kit component must be defined with the same version | ||||
| #                   and release number | ||||
| #                 - Each kit component must be defined with a unique kitrepoid | ||||
|  | ||||
| # | ||||
| # kitcomponent attributes: | ||||
| #    basename        (mandatory) Kit component base name | ||||
| #    description     (optional)  Kit component description | ||||
| #    version         (mandatory) Kit component version | ||||
| #    release         (mandatory) Kit component release | ||||
| #    serverroles     (mandatory) Comma-separated list of servers that this | ||||
| #                      component can install on. Valid values: | ||||
| #                         mgtnode,servicenode,compute,loginnode,storagenode | ||||
| #    kitrepoid       (mandatory) The ID of the kit package repository this | ||||
| #                      component belongs to | ||||
| #    kitcompdeps     (optional)  Comma-separated list of kit component | ||||
| #                       dependencies.  These kit components can be included in | ||||
| #                       this kit or in other kits. | ||||
| #    ospkgdeps       (optional)  Comma-separated list of OS package dependencies | ||||
| #                       These packages must be shipped with the OS distro. | ||||
| #    kitpkgdeps      (optional)  Comma-separated list of kit package names that | ||||
| #                       will be listed as "REQUIRES" when building this kit | ||||
| #                       component. Each package must be defined in a separate | ||||
| #                       kitpackage section. Each package must be in the same  | ||||
| #                       kitrepo as this kit component. | ||||
| #    non_native_pkgs (optional)  TBD -- NOT SUPPORTED YET! | ||||
| #                       Comma-separated list of non-native package  | ||||
| #                       paths that will be included as files in this kit  | ||||
| #                       component. All filenames are relative to  | ||||
| #                       <Kit Build Directory>/source_packages  | ||||
| #                       Kit component deployment scripts must be specified | ||||
| #                       to manage these files. | ||||
| #   driverpacks      (optional) Comma-separated list of driver package filenames | ||||
| #                       Each driverpack must be defined in a separate kitpackage | ||||
| #                       section. | ||||
| #   exlist           (optional) Exclude list file for stateless image, relative | ||||
| #                       to <Kit Build Directory>/other_files | ||||
| #   Kit component deployment scripts (optional)  Each attribute specifies  | ||||
| #                       script path relative to <Kit Build Directory>/scripts | ||||
| #                       Script attributes: | ||||
| #                         preinstall, postinstall, preuninstall, postuninstall,  | ||||
| #                         preupgrade, postupgrade, postbootscripts | ||||
| kitcomponent: | ||||
|     basename=gpfs_compute | ||||
|     description=GPFS for compute nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.4.0,gpfs.gpl >= 3.4.0,gpfs.msg.en_US >= 3.4.0,gpfs.gplbin >= 3.4.0,gpfs.docs >= 3.4.0 | ||||
|     #non_native_pkgs=  | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_gpfs_compute | ||||
|     description=Minimal GPFS for compute nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.4.0,gpfs.gpl >= 3.4.0,gpfs.msg.en_US >= 3.4.0,gpfs.gplbin >= 3.4.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=min-gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_loginnode | ||||
|     description=GPFS for login nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.4.0,gpfs.gpl >= 3.4.0,gpfs.msg.en_US >= 3.4.0,gpfs.gplbin >= 3.4.0,gpfs.docs >= 3.4.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_storagenode | ||||
|     description=GPFS for storage nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=storagenode | ||||
|     kitrepoid=rhels6_ppc64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.gplbin >= 3.5.0,gpfs.docs >= 3.5.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates_storage | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_compute | ||||
|     description=GPFS for compute nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.4.0,gpfs.gpl >= 3.4.0,gpfs.msg.en_US >= 3.4.0,gpfs.gplbin >= 3.4.0,gpfs.docs >= 3.4.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_gpfs_compute | ||||
|     description=Minimal GPFS for compute nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.4.0,gpfs.gpl >= 3.4.0,gpfs.msg.en_US >= 3.4.0,gpfs.gplbin >= 3.4.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=min-gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_loginnode | ||||
|     description=GPFS for login nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.4.0,gpfs.gpl >= 3.4.0,gpfs.msg.en_US >= 3.4.0,gpfs.gplbin >= 3.4.0,gpfs.docs >= 3.4.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_storagenode | ||||
|     description=GPFS for storage nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=storagenode | ||||
|     kitrepoid=sles11_ppc64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.gplbin >= 3.5.0,gpfs.docs >= 3.5.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates_storage | ||||
|  | ||||
| # kitpackage: This section defines one Kit Package, and how to build it. | ||||
| #             There can be zero or more kitpackage sections.   | ||||
| #             All filenames should be relative paths to | ||||
| #                <Kit Build Directory>/source_packages   | ||||
| #             If you want to build a package which can run on multiple OSes,  | ||||
| #             you have two options: | ||||
| #               1. Build a separate package for each OS you want to support.   | ||||
| #                  For this option, you need to define one kitpackage section  | ||||
| #                  per supported OS. | ||||
| #               2. Build one package that can run on multiple OSes.   | ||||
| #                  If you are building an RPM package, you are responsible for  | ||||
| #                  creating an RPM spec file that can run on multiple OSes.   | ||||
| #                  For this option, you need to define one kitpackage section | ||||
| #                  which contains multiple kitrepoid lines. | ||||
| #  | ||||
| # kitpackage attributes: | ||||
| #    filename   (mandatory) Package filename | ||||
| #    kitrepoid  (mandatory) The repo(s) this package belongs to.   | ||||
| #                 If multiple repos are defined, the package will be built for | ||||
| #                 the first repo only. For the other repos, a symlink is created | ||||
| #                 to the package built for the first repo. | ||||
| #   Package build methods (optional)   | ||||
| #                 Define how to build the packages.  | ||||
| #                 If you don't specify a build method, the default behavior is | ||||
| #                 to assume the package is pre-built under  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 All files in this section are relative to  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 There are four methods to build packages. | ||||
| #                   1. Use pre-built RPM package | ||||
| #                       isexternalpkg:  'no'|'0', 'yes'|'1'  (default:  'no')  | ||||
| #                         Indicates whether the RPM package will be added to the | ||||
| #                         the kit tar file now as part of the kit build process, | ||||
| #                         or whether the customer will need to separately | ||||
| #                         obtain the RPM pacakage and add it to the kit tar file | ||||
| #                         using 'buildkit addpkgs' | ||||
| #                       rpm_prebuiltdir: If isexternalpkg=no, path to directory | ||||
| #                         containing pre-built RPM package | ||||
| #                   2. Build RPM from spec + src dir | ||||
| #                       rpm_spec:   Path to spec file. | ||||
| #                       rpm_srcdir: Path to source directory. | ||||
| #                   3. Build RPM from spec + src tarball | ||||
| #                       rpm_spec:        Path to spec file. | ||||
| #                       rpm_srctarball:  Path to source tarball. | ||||
| #                   4. Build RPM from source RPM | ||||
| #                       rpm_srpm:  Path to source RPM package. | ||||
| kitpackage: | ||||
|     filename=gpfs.base-3.5.0-6.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     isexternalpkg=yes | ||||
|  | ||||
| kitpackage: | ||||
|     filename=gpfs.gpl-3.5.0-6.noarch.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     isexternalpkg=yes | ||||
|  | ||||
| kitpackage: | ||||
|     filename=gpfs.docs-3.5.0-6.noarch.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     isexternalpkg=yes | ||||
|  | ||||
| kitpackage: | ||||
|     filename=gpfs.msg.en_US-3.5.0-6.noarch.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     isexternalpkg=yes | ||||
|  | ||||
| kitpackage: | ||||
|     filename=gpfs.gplbin-3.5.0-6.ppc64.rpm | ||||
|     kitrepoid=rhels6_ppc64,sles11_ppc64 | ||||
|     isexternalpkg=yes | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
| ./usr/lpp/mmfs/include* | ||||
| ./usr/lpp/mmfs/samples* | ||||
|  | ||||
| @@ -0,0 +1,5 @@ | ||||
| # Exclude list for building a minimal diskless image | ||||
|  | ||||
| ./usr/lpp/mmfs/include* | ||||
| ./usr/lpp/mmfs/samples* | ||||
| ./usr/lpp/mmfs/src* | ||||
| @@ -0,0 +1,175 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Image Profile Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during image profile operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitimagevalidatecomps => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|         kitimageimport => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # This kit plugin is passed the name of an image profile. | ||||
|     # We need to determine which kits is used by this | ||||
|     # image profile to decide if this plugin should run or not. | ||||
|  | ||||
|     my $imgprofilename = $request->{arg}->[0]; | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imgprofilename]); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $args = $request->{arg}; | ||||
|  | ||||
|     if($command eq 'kitimagevalidatecomps') { | ||||
|         kitimagevalidatecomps($callback, $args); | ||||
|     } | ||||
|     elsif ($command eq 'kitimageimport') { | ||||
|         kitimageimport($callback, $args); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimagevalidatecomps | ||||
|  | ||||
|      This command is called to validate new changes to an  | ||||
|      image profile's kit component list before the changes  | ||||
|      are committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimagevalidatecomps { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename =  $args->[0]; | ||||
|     my $newcomplist = $args->[1]; | ||||
|     my @newcomplist = (); | ||||
|     if (defined($newcomplist)) { | ||||
|         @newcomplist = split(/,/, $newcomplist); | ||||
|     } | ||||
|     my $newosdistro = $args->[2]; | ||||
|     my $newosdistroupdate = $args->[3]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimagevalidatecomps"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimageimport | ||||
|  | ||||
|     This command is called after changes to an image profile  | ||||
|     have been committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimageimport { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename = $args->[0]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimageimport"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,251 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form  | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Node Management Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during node management operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitnodeadd => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderemove => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodeupdate => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderefresh => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodefinished => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $nodes = $request->{node}; | ||||
|  | ||||
|     # This kit plugin is passed a list of node names. | ||||
|     # We need to determine which kits are used by these | ||||
|     # nodes to decide if this plugin should run or not. | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_nodes($nodes); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Get the nodes using this plugin's kit | ||||
|     $nodes = $kitdata->{$PLUGIN_KITNAME}; | ||||
|  | ||||
|  | ||||
|     if($command eq 'kitnodeadd') { | ||||
|         kitnodeadd($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderemove') { | ||||
|         kitnoderemove($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodeupdate') { | ||||
|         kitnodeupdate($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderefresh') { | ||||
|         kitnoderefresh($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodefinished') { | ||||
|         kitnodefinished($callback); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeadd | ||||
|  | ||||
|     This command is called when one or more nodes are added  | ||||
|     to the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeadd { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeadd"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderemove | ||||
|  | ||||
|     This command is called when one or more nodes are  | ||||
|     removed from the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderemove { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderemove"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeupdate | ||||
|  | ||||
|     This command is called when the configuration of one  | ||||
|     or more nodes are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeupdate { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeupdate"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderefresh | ||||
|  | ||||
|     This command is called when node-related configuration | ||||
|     files are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderefresh { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderefresh"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodefinished | ||||
|  | ||||
|     This command is called at the end of a node management | ||||
|     operation.  | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodefinished { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodefinished"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
| @@ -0,0 +1,15 @@ | ||||
| #!/bin/sh | ||||
| # xCAT postscript to configure GPFS on a stateless node. | ||||
| # Before booting nodes with this postscript, gpfs must be up and configured correctly on the node | ||||
| # pointed to by the -p flag below.  The $MASTER environment variable will be set by xCAT to | ||||
| # the service node or management node of this booting node.  If you want the nodes to get their | ||||
| # GPFS configuration from a different node, replace $MASTER with that IP address. | ||||
| cmd="/usr/lpp/mmfs/bin/mmsdrrestore -p $MASTER -R /usr/bin/scp" | ||||
| $cmd > /dev/null 2>&1 | ||||
| if [[ $? != 0 ]] | ||||
| then | ||||
|         echo "mmsdrrestore failed!" | ||||
|         exit 2 | ||||
| else | ||||
|         echo "mmsdrrestore succeeded" | ||||
|  | ||||
| @@ -0,0 +1,12 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| # Run this script as a postscript on any node (stateless, statefull, | ||||
| #  full-disk install, AIX, Linux) to start the GPFS daemon | ||||
| #  | ||||
|  | ||||
| # If you have any special network dependencies, you may want to add code | ||||
| # to check them first | ||||
|  | ||||
| /usr/lpp/mmfs/bin/mmsdrrestore | ||||
| /usr/lpp/mmfs/bin/mmstartup | ||||
|  | ||||
| @@ -0,0 +1,84 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| #  | ||||
| # Sample script to install and configure GPFS  | ||||
| # For AIX: | ||||
| #    Assumes the GPFS filesets and updates were installed using  | ||||
| #    xCAT bundle files or some other mechanism. This script does not | ||||
| #    install additional software. | ||||
| #    It will do the following: | ||||
| #      - create /var/mmfs/etc/nsddevices that simply returns 0  | ||||
| #      - add GPFS paths to profile | ||||
| # For Linux: | ||||
| #    Assumes the base GPFS rpms were installed with the xCAT 'otherpkgs' | ||||
| #    postscript (stateful install) or with the otherpkgs processing of | ||||
| #    genimage (stateless/statelite install).  This script will install any | ||||
| #    gpfs update rpms that exist on the xCAT management node in the  | ||||
| #    /install/post/gpfs_updates directory. | ||||
| #    This is necessary because the GPFS updates can ONLY be installed | ||||
| #    after the base rpms have been installed, and the update rpms cannot | ||||
| #    exist in any rpm repositories used by xCAT otherpkgs processing | ||||
| #    since they will confuse rpm tools such as zypper and yum. | ||||
| #    This script will also do the following: | ||||
| #      - create /var/mmfs/etc/nsddevices that simply returns 0 | ||||
| #      - add GPFS paths to profile | ||||
|  | ||||
| OS=`uname` | ||||
| INSTALL_DIR='/install' | ||||
| UPDATES_DIR='post/otherpkgs/gpfs_updates' | ||||
|  | ||||
| if [ $OS != "AIX" ]; then | ||||
|     if [ -f "/proc/cmdline" ]; then | ||||
|     #  Being run from a stateful install postscript | ||||
|     #  Copy rpms directly from the xCAT management node and install         | ||||
|         mkdir -p /tmp/gpfs_updates | ||||
|         rm -f -R /tmp/gpfs_updates/* | ||||
|         cd /tmp/gpfs_updates | ||||
| #        wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=3 ftp://$SITEMASTER/$UPDATES_DIR/*.rpm 2> /tmp/wget.log | ||||
|         wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=4 --reject "index.html*"  --no-parent http://$SITEMASTER$INSTALL_DIR/$UPDATES_DIR/ 2> /tmp/wget.log | ||||
|         if [ -n "`ls *.rpm 2> /dev/null`" ] ; then | ||||
|             rpm -Uvh *.rpm | ||||
|         fi | ||||
|         cd / | ||||
|         rm -f -R /tmp/gpfs_updates | ||||
|     fi | ||||
| fi   | ||||
|  | ||||
| # Create an empty nsddevices script for GPFS  | ||||
| # This assumes that the node is NOT an NSD server | ||||
| if [ $OS != "AIX" ]; then | ||||
|     # Create the script on the node | ||||
|     mkdir -p /var/mmfs/etc | ||||
|     echo 'return 0' > /var/mmfs/etc/nsddevices | ||||
|     chmod 744 /var/mmfs/etc/nsddevices | ||||
| fi | ||||
|  | ||||
|  | ||||
| # Add GPFS path to profile | ||||
| if [ $OS != "AIX" ]; then | ||||
|     gpfsprofile=/etc/profile.d/gpfs | ||||
|     if [ ! -f "/proc/cmdline" ]; then | ||||
|        gpfsprofile=$gpfsprofile | ||||
|     fi | ||||
|     if [ ! -e $gpfsprofile.sh ]; then | ||||
|         echo 'export PATH=$PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.sh | ||||
|         echo 'setenv PATH $PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.csh | ||||
|         # Turn off LANG support since we did not install other msg catalogs | ||||
|         echo 'export LC_CTYPE=POSIX' >> $gpfsprofile.sh | ||||
|         echo 'setenv LC_CTYPE POSIX' >> $gpfsprofile.csh | ||||
|         echo 'export LC_ALL=POSIX' >> $gpfsprofile.sh | ||||
|         echo 'setenv LC_ALL POSIX' >> $gpfsprofile.csh | ||||
|         chmod 744 $gpfsprofile.sh | ||||
|         chmod 744 $gpfsprofile.csh | ||||
|     fi | ||||
| fi | ||||
|  | ||||
| # If you are using a shared home directory stored in GPFS, | ||||
| #   create the symbolic link | ||||
| # | ||||
| # GPFSHOME=/gpfs/home | ||||
| # HOMEDIR=/u | ||||
| # ln -s $GPFSHOME $HOMEDIR | ||||
|  | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,84 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| #  | ||||
| # Sample script to install and configure GPFS  | ||||
| # For AIX: | ||||
| #    Assumes the GPFS filesets and updates were installed using  | ||||
| #    xCAT bundle files or some other mechanism. This script does not | ||||
| #    install additional software. | ||||
| #    It will do the following: | ||||
| #      - create /var/mmfs/etc/nsddevices that simply returns 0  | ||||
| #      - add GPFS paths to profile | ||||
| # For Linux: | ||||
| #    Assumes the base GPFS rpms were installed with the xCAT 'otherpkgs' | ||||
| #    postscript (stateful install) or with the otherpkgs processing of | ||||
| #    genimage (stateless/statelite install).  This script will install any | ||||
| #    gpfs update rpms that exist on the xCAT management node in the  | ||||
| #    /install/post/gpfs_updates directory. | ||||
| #    This is necessary because the GPFS updates can ONLY be installed | ||||
| #    after the base rpms have been installed, and the update rpms cannot | ||||
| #    exist in any rpm repositories used by xCAT otherpkgs processing | ||||
| #    since they will confuse rpm tools such as zypper and yum. | ||||
| #    This script will also do the following: | ||||
| #      - create /var/mmfs/etc/nsddevices that simply returns 0 | ||||
| #      - add GPFS paths to profile | ||||
|  | ||||
| OS=`uname` | ||||
| INSTALL_DIR='/install' | ||||
| UPDATES_DIR='post/otherpkgs/gpfs_updates' | ||||
|  | ||||
| if [ $OS != "AIX" ]; then | ||||
|     if [ -f "/proc/cmdline" ]; then | ||||
|     #  Being run from a stateful install postscript | ||||
|     #  Copy rpms directly from the xCAT management node and install         | ||||
|         mkdir -p /tmp/gpfs_updates | ||||
|         rm -f -R /tmp/gpfs_updates/* | ||||
|         cd /tmp/gpfs_updates | ||||
| #        wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=3 ftp://$SITEMASTER/$UPDATES_DIR/*.rpm 2> /tmp/wget.log | ||||
|         wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=4 --reject "index.html*"  --no-parent http://$SITEMASTER$INSTALL_DIR/$UPDATES_DIR/ 2> /tmp/wget.log | ||||
|         if [ -n "`ls *.rpm 2> /dev/null`" ] ; then | ||||
|             rpm -Uvh *.rpm | ||||
|         fi | ||||
|         cd / | ||||
|         rm -f -R /tmp/gpfs_updates | ||||
|     fi | ||||
| fi   | ||||
|  | ||||
| ## Create an empty nsddevices script for GPFS  | ||||
| ## This assumes that the node is NOT an NSD server | ||||
| #if [ $OS != "AIX" ]; then | ||||
| #    # Create the script on the node | ||||
| #    mkdir -p /var/mmfs/etc | ||||
| #    echo 'return 0' > /var/mmfs/etc/nsddevices | ||||
| #    chmod 744 /var/mmfs/etc/nsddevices | ||||
| #fi | ||||
|  | ||||
|  | ||||
| # Add GPFS path to profile | ||||
| if [ $OS != "AIX" ]; then | ||||
|     gpfsprofile=/etc/profile.d/gpfs | ||||
|     if [ ! -f "/proc/cmdline" ]; then | ||||
|        gpfsprofile=$gpfsprofile | ||||
|     fi | ||||
|     if [ ! -e $gpfsprofile.sh ]; then | ||||
|         echo 'export PATH=$PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.sh | ||||
|         echo 'setenv PATH $PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.csh | ||||
|         # Turn off LANG support since we did not install other msg catalogs | ||||
|         echo 'export LC_CTYPE=POSIX' >> $gpfsprofile.sh | ||||
|         echo 'setenv LC_CTYPE POSIX' >> $gpfsprofile.csh | ||||
|         echo 'export LC_ALL=POSIX' >> $gpfsprofile.sh | ||||
|         echo 'setenv LC_ALL POSIX' >> $gpfsprofile.csh | ||||
|         chmod 744 $gpfsprofile.sh | ||||
|         chmod 744 $gpfsprofile.csh | ||||
|     fi | ||||
| fi | ||||
|  | ||||
| # If you are using a shared home directory stored in GPFS, | ||||
| #   create the symbolic link | ||||
| # | ||||
| # GPFSHOME=/gpfs/home | ||||
| # HOMEDIR=/u | ||||
| # ln -s $GPFSHOME $HOMEDIR | ||||
|  | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 post script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
| #!/bin/sh | ||||
| echo "running sample-comp1 postboot script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 postun script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 postup script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 pre script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 preun script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 preup script" | ||||
|  | ||||
| @@ -0,0 +1,305 @@ | ||||
| # Kit Build File | ||||
| #  | ||||
| # This file was initially auto-generated by the buildkit CLI command. | ||||
| # To create a new kit, the user should modify this file accordingly. | ||||
| # Refer to the buildkit manpage for further details. | ||||
| # | ||||
|  | ||||
| # kit: This section defines general info for the Kit.  | ||||
| #      There must be exactly one kit section in a kit build file. | ||||
| #  | ||||
| # kit attributes: | ||||
| #    basename        (mandatory) Kit base name. e.g., kit-lsf | ||||
| #    description     (optional)  Kit description. | ||||
| #    version         (mandatory) Kit version. e.g., 1.0 | ||||
| #    ostype          (mandatory) Kit OS type.  Must be Linux. | ||||
| #                      AIX is currently not supported. | ||||
| #    isinternal      (optional)  PCM use only. | ||||
| #                      Indicate if Kit is for internal use. | ||||
| #                      Use 1 for yes, 0 for no. Default: 0 | ||||
| #    kitdeployparams (optional)  Filename containing a list of kit deployment | ||||
| #                       parameters, relative to | ||||
| #                       <Kit Build Directory>/other_files | ||||
| kit: | ||||
|    basename=gpfs | ||||
|    description=General Parallel File System | ||||
|    version=3.5.0 | ||||
|    ostype=Linux | ||||
|    #kitdeployparams= | ||||
|  | ||||
|  | ||||
| # kitrepo: This section defines a Kit Package Repository. | ||||
| #          There must be at least one kitrepo section in a kit build file.   | ||||
| #          If you want to support multiple OSes, you should create a separate | ||||
| #          repo for each OS.  Also, no two repos can be defined with the same  | ||||
| #          OS name, major/minor version and arch. For example, you cannot have | ||||
| #          two repos for RHEL 6.2 x86_64 in the same kit. | ||||
| # | ||||
| # kitrepo attributes: | ||||
| #    kitrepoid          (mandatory) Kit package repository ID. | ||||
| #                         Must be unique within this file. | ||||
| #    osbasename         (mandatory) OS distro base name. e.g., rhels. | ||||
| #    osmajorversion     (mandatory) OS major version. e.g., 6 | ||||
| #    osminorversion     (optional)  OS minor version. | ||||
| #    osarch             (mandatory) OS architecture. e.g., x86_64 | ||||
| #    compat_osbasenames (optional)  Comma-separated list of compatible  | ||||
| #                         OS distro base names. e.g., centos | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=rhels6_x86_64 | ||||
|    osbasename=rhels | ||||
|    osmajorversion=6 | ||||
|    osarch=x86_64 | ||||
|  | ||||
|    #compat_osbasenames= | ||||
|  | ||||
| kitrepo: | ||||
|    kitrepoid=sles11_x86_64 | ||||
|    osbasename=sles | ||||
|    osmajorversion=11 | ||||
|    osarch=x86_64 | ||||
|  | ||||
|  | ||||
| # kitcomponent: This section defines one Kit Component.   | ||||
| #               There can be zero or more kitcomponent sections.  | ||||
| #               If you want to build a component which supports multiple OSes, | ||||
| #               you should create one kitcomponent section for each OS.   | ||||
| #               Also, no two components in a kit can be defined with the same  | ||||
| #               base name.  | ||||
| #               You can define multiple kit components with the same base name | ||||
| #               only if each kit component using this base name meets these  | ||||
| #               requirements: | ||||
| #                 - Each kit component must be defined with the same version | ||||
| #                   and release number | ||||
| #                 - Each kit component must be defined with a unique kitrepoid | ||||
|  | ||||
| # | ||||
| # kitcomponent attributes: | ||||
| #    basename        (mandatory) Kit component base name | ||||
| #    description     (optional)  Kit component description | ||||
| #    version         (mandatory) Kit component version | ||||
| #    release         (mandatory) Kit component release | ||||
| #    serverroles     (mandatory) Comma-separated list of servers that this | ||||
| #                      component can install on. Valid values: | ||||
| #                         mgtnode,servicenode,compute,loginnode,storagenode | ||||
| #    kitrepoid       (mandatory) The ID of the kit package repository this | ||||
| #                      component belongs to | ||||
| #    kitcompdeps     (optional)  Comma-separated list of kit component | ||||
| #                       dependencies.  These kit components can be included in | ||||
| #                       this kit or in other kits. | ||||
| #    ospkgdeps       (optional)  Comma-separated list of OS package dependencies | ||||
| #                       These packages must be shipped with the OS distro. | ||||
| #    kitpkgdeps      (optional)  Comma-separated list of kit package names that | ||||
| #                       will be listed as "REQUIRES" when building this kit | ||||
| #                       component. Each package must be defined in a separate | ||||
| #                       kitpackage section. Each package must be in the same  | ||||
| #                       kitrepo as this kit component. | ||||
| #    non_native_pkgs (optional)  TBD -- NOT SUPPORTED YET! | ||||
| #                       Comma-separated list of non-native package  | ||||
| #                       paths that will be included as files in this kit  | ||||
| #                       component. All filenames are relative to  | ||||
| #                       <Kit Build Directory>/source_packages  | ||||
| #                       Kit component deployment scripts must be specified | ||||
| #                       to manage these files. | ||||
| #   driverpacks      (optional) Comma-separated list of driver package filenames | ||||
| #                       Each driverpack must be defined in a separate kitpackage | ||||
| #                       section. | ||||
| #   exlist           (optional) Exclude list file for stateless image, relative | ||||
| #                       to <Kit Build Directory>/other_files | ||||
| #   Kit component deployment scripts (optional)  Each attribute specifies  | ||||
| #                       script path relative to <Kit Build Directory>/scripts | ||||
| #                       Script attributes: | ||||
| #                         preinstall, postinstall, preuninstall, postuninstall,  | ||||
| #                         preupgrade, postupgrade, postbootscripts | ||||
| kitcomponent: | ||||
|     basename=gpfs_compute | ||||
|     description=GPFS for compute nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_x86_64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.gplbin >= 3.5.0,gpfs.docs >= 3.5.0 | ||||
|     #non_native_pkgs=  | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_gpfs_compute | ||||
|     description=Minimal GPFS for compute nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=compute | ||||
|     kitrepoid=rhels6_x86_64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.gplbin >= 3.5.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=min-gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_loginnode | ||||
|     description=GPFS for login nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=rhels6_x86_64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.gplbin >= 3.5.0,gpfs.docs >= 3.5.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_storagenode | ||||
|     description=GPFS for storage nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=storagenode | ||||
|     kitrepoid=rhels6_x86_64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.4.0,gpfs.gpl >= 3.4.0,gpfs.msg.en_US >= 3.4.0,gpfs.gplbin >= 3.4.0,gpfs.docs >= 3.4.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates_storage | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_compute | ||||
|     description=GPFS for compute nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_x86_64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.gplbin >= 3.5.0,gpfs.docs >= 3.5.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=min_gpfs_compute | ||||
|     description=Minimal GPFS for compute nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=compute | ||||
|     kitrepoid=sles11_x86_64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.gplbin >= 3.5.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=min-gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_loginnode | ||||
|     description=GPFS for login nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=loginnode | ||||
|     kitrepoid=sles11_x86_64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.gplbin >= 3.5.0,gpfs.docs >= 3.5.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates | ||||
|  | ||||
| kitcomponent: | ||||
|     basename=gpfs_storagenode | ||||
|     description=GPFS for storage nodes | ||||
|     version=3.5.0 | ||||
|     release=s009 | ||||
|     serverroles=storagenode | ||||
|     kitrepoid=sles11_x86_64 | ||||
|     #kitcompdeps= | ||||
|     #ospkgdeps= | ||||
|     kitpkgdeps=gpfs.base >= 3.4.0,gpfs.gpl >= 3.4.0,gpfs.msg.en_US >= 3.4.0,gpfs.gplbin >= 3.4.0 | ||||
|     #non_native_pkgs= | ||||
|     #driverpacks= | ||||
|     exlist=min-gpfs.exlist | ||||
|     postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_updates_storage | ||||
|  | ||||
|  | ||||
| # kitpackage: This section defines one Kit Package, and how to build it. | ||||
| #             There can be zero or more kitpackage sections.   | ||||
| #             All filenames should be relative paths to | ||||
| #                <Kit Build Directory>/source_packages   | ||||
| #             If you want to build a package which can run on multiple OSes,  | ||||
| #             you have two options: | ||||
| #               1. Build a separate package for each OS you want to support.   | ||||
| #                  For this option, you need to define one kitpackage section  | ||||
| #                  per supported OS. | ||||
| #               2. Build one package that can run on multiple OSes.   | ||||
| #                  If you are building an RPM package, you are responsible for  | ||||
| #                  creating an RPM spec file that can run on multiple OSes.   | ||||
| #                  For this option, you need to define one kitpackage section | ||||
| #                  which contains multiple kitrepoid lines. | ||||
| #  | ||||
| # kitpackage attributes: | ||||
| #    filename   (mandatory) Package filename | ||||
| #    kitrepoid  (mandatory) The repo(s) this package belongs to.   | ||||
| #                 If multiple repos are defined, the package will be built for | ||||
| #                 the first repo only. For the other repos, a symlink is created | ||||
| #                 to the package built for the first repo. | ||||
| #   Package build methods (optional)   | ||||
| #                 Define how to build the packages.  | ||||
| #                 If you don't specify a build method, the default behavior is | ||||
| #                 to assume the package is pre-built under  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 All files in this section are relative to  | ||||
| #                   <Kit Build Directory>/source_packages | ||||
| #                 There are four methods to build packages. | ||||
| #                   1. Use pre-built RPM package | ||||
| #                       isexternalpkg:  'no'|'0', 'yes'|'1'  (default:  'no')  | ||||
| #                         Indicates whether the RPM package will be added to the | ||||
| #                         the kit tar file now as part of the kit build process, | ||||
| #                         or whether the customer will need to separately | ||||
| #                         obtain the RPM pacakage and add it to the kit tar file | ||||
| #                         using 'buildkit addpkgs' | ||||
| #                       rpm_prebuiltdir: If isexternalpkg=no, path to directory | ||||
| #                         containing pre-built RPM package | ||||
| #                   2. Build RPM from spec + src dir | ||||
| #                       rpm_spec:   Path to spec file. | ||||
| #                       rpm_srcdir: Path to source directory. | ||||
| #                   3. Build RPM from spec + src tarball | ||||
| #                       rpm_spec:        Path to spec file. | ||||
| #                       rpm_srctarball:  Path to source tarball. | ||||
| #                   4. Build RPM from source RPM | ||||
| #                       rpm_srpm:  Path to source RPM package. | ||||
| kitpackage: | ||||
|     filename=gpfs.base-3.5.0-6.x86_64.rpm | ||||
|     kitrepoid=rhels6_x86_64,sles11_x86_64 | ||||
|     isexternalpkg=yes | ||||
|  | ||||
| kitpackage: | ||||
|     filename=gpfs.gpl-3.5.0-6.noarch.rpm | ||||
|     kitrepoid=rhels6_x86_64,sles11_x86_64 | ||||
|     isexternalpkg=yes | ||||
|  | ||||
| kitpackage: | ||||
|     filename=gpfs.docs-3.5.0-6.noarch.rpm | ||||
|     kitrepoid=rhels6_x86_64,sles11_x86_64 | ||||
|     isexternalpkg=yes | ||||
|  | ||||
| kitpackage: | ||||
|     filename=gpfs.msg.en_US-3.5.0-6.noarch.rpm | ||||
|     kitrepoid=rhels6_x86_64,sles11_x86_64 | ||||
|     isexternalpkg=yes | ||||
|  | ||||
| kitpackage: | ||||
|     filename=gpfs.gplbin-3.5.0-6.x86_64.rpm | ||||
|     kitrepoid=rhels6_x86_64,sles11_x86_64 | ||||
|     isexternalpkg=yes | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
| ./usr/lpp/mmfs/include* | ||||
| ./usr/lpp/mmfs/samples* | ||||
|  | ||||
| @@ -0,0 +1,5 @@ | ||||
| # Exclude list for building a minimal diskless image | ||||
|  | ||||
| ./usr/lpp/mmfs/include* | ||||
| ./usr/lpp/mmfs/samples* | ||||
| ./usr/lpp/mmfs/src* | ||||
| @@ -0,0 +1,175 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Image Profile Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during image profile operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitimagevalidatecomps => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|         kitimageimport => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # This kit plugin is passed the name of an image profile. | ||||
|     # We need to determine which kits is used by this | ||||
|     # image profile to decide if this plugin should run or not. | ||||
|  | ||||
|     my $imgprofilename = $request->{arg}->[0]; | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imgprofilename]); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $args = $request->{arg}; | ||||
|  | ||||
|     if($command eq 'kitimagevalidatecomps') { | ||||
|         kitimagevalidatecomps($callback, $args); | ||||
|     } | ||||
|     elsif ($command eq 'kitimageimport') { | ||||
|         kitimageimport($callback, $args); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimagevalidatecomps | ||||
|  | ||||
|      This command is called to validate new changes to an  | ||||
|      image profile's kit component list before the changes  | ||||
|      are committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimagevalidatecomps { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename =  $args->[0]; | ||||
|     my $newcomplist = $args->[1]; | ||||
|     my @newcomplist = (); | ||||
|     if (defined($newcomplist)) { | ||||
|         @newcomplist = split(/,/, $newcomplist); | ||||
|     } | ||||
|     my $newosdistro = $args->[2]; | ||||
|     my $newosdistroupdate = $args->[3]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimagevalidatecomps"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitimageimport | ||||
|  | ||||
|     This command is called after changes to an image profile  | ||||
|     have been committed. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitimageimport { | ||||
|     my $callback = shift; | ||||
|     my $args = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $imgprofilename = $args->[0]; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitimageimport"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,251 @@ | ||||
| package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt; | ||||
|  | ||||
| use strict; | ||||
| use warnings; | ||||
|  | ||||
| require xCAT::Utils; | ||||
| require xCAT::Table; | ||||
| require xCAT::KitPluginUtils; | ||||
|  | ||||
| # buildkit Processing | ||||
| #   In order to avoid collisions with other plugins, the package | ||||
| #   name for this plugin must contain the full kit name. | ||||
| #   The buildkit buildtar command will copy this file from your plugins | ||||
| #   directory to the the kit build directory, renaming the file with the | ||||
| #   correct kit name.  All strings in this file of the form  | ||||
| #      <<<buildkit_WILL_INSERT_kitname_HERE>>> | ||||
| #   will be replaced with the full kit name.  In order for buildkit to | ||||
| #   correctly edit this file, do not remove these strings. | ||||
|  | ||||
| # Global Variables | ||||
|  | ||||
| # This is the full name of the kit which this plugin belongs  | ||||
| # to. The kit name is used by some code in process_request()  | ||||
| # to determine if the plugin should run.  When you are testing  | ||||
| # your plugin the kit name should be set to "TESTMODE" to  | ||||
| # bypass the plugin check in process_request(). | ||||
|  | ||||
| our ($PLUGIN_KITNAME); | ||||
| #$PLUGIN_KITNAME = "TESTMODE"; | ||||
| $PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>"; | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head1 | ||||
|  | ||||
|     Node Management Kit Plugin | ||||
|     This plugin contains commands to run custom actions  | ||||
|     during node management operations. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  handled_commands | ||||
|  | ||||
|     Return list of kit plugin commands handled by this plugin | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub handled_commands { | ||||
|     return { | ||||
|         kitnodeadd => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderemove => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodeupdate => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnoderefresh => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|         kitnodefinished => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt', | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  process_request | ||||
|  | ||||
|     Process the kit plugin command. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub process_request { | ||||
|     my $request = shift; | ||||
|     my $callback = shift; | ||||
|  | ||||
|     # Name of command and node list | ||||
|     my $command = $request->{command}->[0]; | ||||
|     my $nodes = $request->{node}; | ||||
|  | ||||
|     # This kit plugin is passed a list of node names. | ||||
|     # We need to determine which kits are used by these | ||||
|     # nodes to decide if this plugin should run or not. | ||||
|  | ||||
|     my $kitdata = $request->{kitdata}; | ||||
|     if (! defined($kitdata)) { | ||||
|         $kitdata = xCAT::KitPluginUtils->get_kits_used_by_nodes($nodes); | ||||
|         $request->{kitdata} = $kitdata; | ||||
|     } | ||||
|  | ||||
|     if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # Get the nodes using this plugin's kit | ||||
|     $nodes = $kitdata->{$PLUGIN_KITNAME}; | ||||
|  | ||||
|  | ||||
|     if($command eq 'kitnodeadd') { | ||||
|         kitnodeadd($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderemove') { | ||||
|         kitnoderemove($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodeupdate') { | ||||
|         kitnodeupdate($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnoderefresh') { | ||||
|         kitnoderefresh($callback, $nodes); | ||||
|     } | ||||
|     elsif ($command eq 'kitnodefinished') { | ||||
|         kitnodefinished($callback); | ||||
|  | ||||
|     } else { | ||||
|         my $rsp; | ||||
|         $rsp->{data}->[0] = "Command is not supported"; | ||||
|         xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeadd | ||||
|  | ||||
|     This command is called when one or more nodes are added  | ||||
|     to the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeadd { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeadd"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderemove | ||||
|  | ||||
|     This command is called when one or more nodes are  | ||||
|     removed from the cluster. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderemove { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderemove"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodeupdate | ||||
|  | ||||
|     This command is called when the configuration of one  | ||||
|     or more nodes are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodeupdate { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodeupdate"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnoderefresh | ||||
|  | ||||
|     This command is called when node-related configuration | ||||
|     files are updated. | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnoderefresh { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     # Parameters | ||||
|     my $nodes = shift; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnoderefresh"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| =head3  kitnodefinished | ||||
|  | ||||
|     This command is called at the end of a node management | ||||
|     operation.  | ||||
|  | ||||
| =cut | ||||
|  | ||||
| #------------------------------------------------------- | ||||
|  | ||||
| sub kitnodefinished { | ||||
|     my $callback = shift; | ||||
|     my $rsp; | ||||
|  | ||||
|     $rsp->{data}->[0] = "Running kitnodefinished"; | ||||
|     xCAT::MsgUtils->message("I", $rsp, $callback); | ||||
|  | ||||
|     # TODO | ||||
|     # ... ADD YOUR CODE HERE | ||||
| } | ||||
|  | ||||
| @@ -0,0 +1,15 @@ | ||||
| #!/bin/sh | ||||
| # xCAT postscript to configure GPFS on a stateless node. | ||||
| # Before booting nodes with this postscript, gpfs must be up and configured correctly on the node | ||||
| # pointed to by the -p flag below.  The $MASTER environment variable will be set by xCAT to | ||||
| # the service node or management node of this booting node.  If you want the nodes to get their | ||||
| # GPFS configuration from a different node, replace $MASTER with that IP address. | ||||
| cmd="/usr/lpp/mmfs/bin/mmsdrrestore -p $MASTER -R /usr/bin/scp" | ||||
| $cmd > /dev/null 2>&1 | ||||
| if [[ $? != 0 ]] | ||||
| then | ||||
|         echo "mmsdrrestore failed!" | ||||
|         exit 2 | ||||
| else | ||||
|         echo "mmsdrrestore succeeded" | ||||
|  | ||||
| @@ -0,0 +1,12 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| # Run this script as a postscript on any node (stateless, statefull, | ||||
| #  full-disk install, AIX, Linux) to start the GPFS daemon | ||||
| #  | ||||
|  | ||||
| # If you have any special network dependencies, you may want to add code | ||||
| # to check them first | ||||
|  | ||||
| /usr/lpp/mmfs/bin/mmsdrrestore | ||||
| /usr/lpp/mmfs/bin/mmstartup | ||||
|  | ||||
| @@ -0,0 +1,84 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| #  | ||||
| # Sample script to install and configure GPFS  | ||||
| # For AIX: | ||||
| #    Assumes the GPFS filesets and updates were installed using  | ||||
| #    xCAT bundle files or some other mechanism. This script does not | ||||
| #    install additional software. | ||||
| #    It will do the following: | ||||
| #      - create /var/mmfs/etc/nsddevices that simply returns 0  | ||||
| #      - add GPFS paths to profile | ||||
| # For Linux: | ||||
| #    Assumes the base GPFS rpms were installed with the xCAT 'otherpkgs' | ||||
| #    postscript (stateful install) or with the otherpkgs processing of | ||||
| #    genimage (stateless/statelite install).  This script will install any | ||||
| #    gpfs update rpms that exist on the xCAT management node in the  | ||||
| #    /install/post/gpfs_updates directory. | ||||
| #    This is necessary because the GPFS updates can ONLY be installed | ||||
| #    after the base rpms have been installed, and the update rpms cannot | ||||
| #    exist in any rpm repositories used by xCAT otherpkgs processing | ||||
| #    since they will confuse rpm tools such as zypper and yum. | ||||
| #    This script will also do the following: | ||||
| #      - create /var/mmfs/etc/nsddevices that simply returns 0 | ||||
| #      - add GPFS paths to profile | ||||
|  | ||||
| OS=`uname` | ||||
| INSTALL_DIR='/install' | ||||
| UPDATES_DIR='post/otherpkgs/gpfs_updates' | ||||
|  | ||||
| if [ $OS != "AIX" ]; then | ||||
|     if [ -f "/proc/cmdline" ]; then | ||||
|     #  Being run from a stateful install postscript | ||||
|     #  Copy rpms directly from the xCAT management node and install         | ||||
|         mkdir -p /tmp/gpfs_updates | ||||
|         rm -f -R /tmp/gpfs_updates/* | ||||
|         cd /tmp/gpfs_updates | ||||
| #        wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=3 ftp://$SITEMASTER/$UPDATES_DIR/*.rpm 2> /tmp/wget.log | ||||
|         wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=4 --reject "index.html*"  --no-parent http://$SITEMASTER$INSTALL_DIR/$UPDATES_DIR/ 2> /tmp/wget.log | ||||
|         if [ -n "`ls *.rpm 2> /dev/null`" ] ; then | ||||
|             rpm -Uvh *.rpm | ||||
|         fi | ||||
|         cd / | ||||
|         rm -f -R /tmp/gpfs_updates | ||||
|     fi | ||||
| fi   | ||||
|  | ||||
| # Create an empty nsddevices script for GPFS  | ||||
| # This assumes that the node is NOT an NSD server | ||||
| if [ $OS != "AIX" ]; then | ||||
|     # Create the script on the node | ||||
|     mkdir -p /var/mmfs/etc | ||||
|     echo 'return 0' > /var/mmfs/etc/nsddevices | ||||
|     chmod 744 /var/mmfs/etc/nsddevices | ||||
| fi | ||||
|  | ||||
|  | ||||
| # Add GPFS path to profile | ||||
| if [ $OS != "AIX" ]; then | ||||
|     gpfsprofile=/etc/profile.d/gpfs | ||||
|     if [ ! -f "/proc/cmdline" ]; then | ||||
|        gpfsprofile=$gpfsprofile | ||||
|     fi | ||||
|     if [ ! -e $gpfsprofile.sh ]; then | ||||
|         echo 'export PATH=$PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.sh | ||||
|         echo 'setenv PATH $PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.csh | ||||
|         # Turn off LANG support since we did not install other msg catalogs | ||||
|         echo 'export LC_CTYPE=POSIX' >> $gpfsprofile.sh | ||||
|         echo 'setenv LC_CTYPE POSIX' >> $gpfsprofile.csh | ||||
|         echo 'export LC_ALL=POSIX' >> $gpfsprofile.sh | ||||
|         echo 'setenv LC_ALL POSIX' >> $gpfsprofile.csh | ||||
|         chmod 744 $gpfsprofile.sh | ||||
|         chmod 744 $gpfsprofile.csh | ||||
|     fi | ||||
| fi | ||||
|  | ||||
| # If you are using a shared home directory stored in GPFS, | ||||
| #   create the symbolic link | ||||
| # | ||||
| # GPFSHOME=/gpfs/home | ||||
| # HOMEDIR=/u | ||||
| # ln -s $GPFSHOME $HOMEDIR | ||||
|  | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,84 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| #  | ||||
| # Sample script to install and configure GPFS  | ||||
| # For AIX: | ||||
| #    Assumes the GPFS filesets and updates were installed using  | ||||
| #    xCAT bundle files or some other mechanism. This script does not | ||||
| #    install additional software. | ||||
| #    It will do the following: | ||||
| #      - create /var/mmfs/etc/nsddevices that simply returns 0  | ||||
| #      - add GPFS paths to profile | ||||
| # For Linux: | ||||
| #    Assumes the base GPFS rpms were installed with the xCAT 'otherpkgs' | ||||
| #    postscript (stateful install) or with the otherpkgs processing of | ||||
| #    genimage (stateless/statelite install).  This script will install any | ||||
| #    gpfs update rpms that exist on the xCAT management node in the  | ||||
| #    /install/post/gpfs_updates directory. | ||||
| #    This is necessary because the GPFS updates can ONLY be installed | ||||
| #    after the base rpms have been installed, and the update rpms cannot | ||||
| #    exist in any rpm repositories used by xCAT otherpkgs processing | ||||
| #    since they will confuse rpm tools such as zypper and yum. | ||||
| #    This script will also do the following: | ||||
| #      - create /var/mmfs/etc/nsddevices that simply returns 0 | ||||
| #      - add GPFS paths to profile | ||||
|  | ||||
| OS=`uname` | ||||
| INSTALL_DIR='/install' | ||||
| UPDATES_DIR='post/otherpkgs/gpfs_updates' | ||||
|  | ||||
| if [ $OS != "AIX" ]; then | ||||
|     if [ -f "/proc/cmdline" ]; then | ||||
|     #  Being run from a stateful install postscript | ||||
|     #  Copy rpms directly from the xCAT management node and install         | ||||
|         mkdir -p /tmp/gpfs_updates | ||||
|         rm -f -R /tmp/gpfs_updates/* | ||||
|         cd /tmp/gpfs_updates | ||||
| #        wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=3 ftp://$SITEMASTER/$UPDATES_DIR/*.rpm 2> /tmp/wget.log | ||||
|         wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=4 --reject "index.html*"  --no-parent http://$SITEMASTER$INSTALL_DIR/$UPDATES_DIR/ 2> /tmp/wget.log | ||||
|         if [ -n "`ls *.rpm 2> /dev/null`" ] ; then | ||||
|             rpm -Uvh *.rpm | ||||
|         fi | ||||
|         cd / | ||||
|         rm -f -R /tmp/gpfs_updates | ||||
|     fi | ||||
| fi   | ||||
|  | ||||
| ## Create an empty nsddevices script for GPFS  | ||||
| ## This assumes that the node is NOT an NSD server | ||||
| #if [ $OS != "AIX" ]; then | ||||
| #    # Create the script on the node | ||||
| #    mkdir -p /var/mmfs/etc | ||||
| #    echo 'return 0' > /var/mmfs/etc/nsddevices | ||||
| #    chmod 744 /var/mmfs/etc/nsddevices | ||||
| #fi | ||||
|  | ||||
|  | ||||
| # Add GPFS path to profile | ||||
| if [ $OS != "AIX" ]; then | ||||
|     gpfsprofile=/etc/profile.d/gpfs | ||||
|     if [ ! -f "/proc/cmdline" ]; then | ||||
|        gpfsprofile=$gpfsprofile | ||||
|     fi | ||||
|     if [ ! -e $gpfsprofile.sh ]; then | ||||
|         echo 'export PATH=$PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.sh | ||||
|         echo 'setenv PATH $PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.csh | ||||
|         # Turn off LANG support since we did not install other msg catalogs | ||||
|         echo 'export LC_CTYPE=POSIX' >> $gpfsprofile.sh | ||||
|         echo 'setenv LC_CTYPE POSIX' >> $gpfsprofile.csh | ||||
|         echo 'export LC_ALL=POSIX' >> $gpfsprofile.sh | ||||
|         echo 'setenv LC_ALL POSIX' >> $gpfsprofile.csh | ||||
|         chmod 744 $gpfsprofile.sh | ||||
|         chmod 744 $gpfsprofile.csh | ||||
|     fi | ||||
| fi | ||||
|  | ||||
| # If you are using a shared home directory stored in GPFS, | ||||
| #   create the symbolic link | ||||
| # | ||||
| # GPFSHOME=/gpfs/home | ||||
| # HOMEDIR=/u | ||||
| # ln -s $GPFSHOME $HOMEDIR | ||||
|  | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 post script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
| #!/bin/sh | ||||
| echo "running sample-comp1 postboot script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 postun script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 postup script" | ||||
|  | ||||
| @@ -0,0 +1,3 @@ | ||||
|  | ||||
| echo "running sample-comp1 pre script" | ||||
|  | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user