本文链接:http://blog.csdn.net/kongxx/article/details/44086779
生成Kit文件结构
首先使用buildkit工具来生成一个Kit,比如这里我们假定我们的Kit名字叫helloworld
buildkit create helloworld
helloworld/ ├── buildkit.conf ├── docs │ └── index.html ├── other_files │ └── sample │ ├── exclude.lst │ └── kitdeployparams.lst ├── plugins │ └── sample │ ├── imageprofile.pm │ └── nodemgmt.pm ├── scripts │ └── sample │ ├── genimage_post.sh │ ├── postboot.sh │ ├── post.sh │ ├── postun.sh │ ├── postup.sh │ ├── pre.sh │ ├── preun.sh │ └── preup.sh └── source_packages └── sample ├── pkg1 │ └── pkg1-1-1.noarch.rpm ├── pkg2 │ ├── pkg2 │ │ ├── cfg │ │ │ └── pkg2.cfg │ │ └── files │ │ ├── pkg2.file1 │ │ └── pkg2.file2 │ └── pkg2.spec ├── pkg3 │ ├── pkg3.spec │ └── pkg3.tar.gz └── pkg4 └── pkg4-1-1.src.rpm
编辑buildkit.conf文件,这个文件还是比较容易理解的,里面注释也比较详细,其中主要定义了kit,kitrepo,kitcomponent和kitpackage等。
但是配置文件中有一个属性compat_osbasenames需要特别注意一下,如果目标机器都是rh的机器,可以忽略,但是如果是centos的话,需要修改这个属性的定义
compat_osbasenames=centos
使用下面的命令打包,结果会在helloworld目录下生成一个helloworld-1.0-1.tar.bz2文件
cd ~/helloworld buildkit buildrepo all buildkit buildtar
添加Kit
首先在xCAT环境下可以使用 lskit 来查看已添加的Kit和KitComponent,比如
lskit lskit helloworld-1.0-1 lsdef -t kit -l helloworld-1.0-1 lskitcomp
addkit helloworld-1.0-1.tar.bz2
rmkit helloworld-1.0-1
lsdef -t osimage
chkkitcomp -i centos6.6-x86_64-install-compute helloworld_compute-1.0-1-rh-6.6-x86_64
addkitcomp -a -i centos6.6-x86_64-install-compute helloworld_compute-1.0-1-rh-6.6-x86_64
rmkitcomp -i centos6.6-x86_64-install-compute helloworld_compute-1.0-1-rh-6.6-x86_64
chdef <nodelist> provmethod=<osimage> updatenode <nodelist> 比如 chdef <nodelist> provmethod=centos6.6-x86_64-install-compute updatenode <nodelist>
参考
http://sourceforge.net/p/xcat/wiki/Building_Software_Kits
http://sourceforge.net/p/xcat/wiki/Using_Software_Kits_in_OS_Images
原文:http://blog.csdn.net/kongxx/article/details/44086779