登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

杨树叶子的博客

 
 
 

日志

 
 
 
 

CactiUsers : CactiEZRemaster  

2006-12-13 08:56:36|  分类: cacti |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
This documenation will show you how to "remaster" theCactiEZ CD, in order to add your own packages(or otherwise customize it for you organization), and then reburnthe CD.

First, I would like to point out, that this documentation is basedoff a ton of google searches in order to find the rightinformation. I could not find any concise place that contains morethan one or two bits of information, and most of it not directed atthe CentOS distribution. There is actually a lotmore than this that is required if you happen to want to start fromscratch off the base CentOS CDs, I just have happened to do most ofthe work for you already.

In the process of creating and testing the CD's that I created, Ican say that it is definitely so much faster and easier to use avirtual server application, such as VMWare, to test the CDinstallation, than actually using a real machine.

I definitely don't mind you using this information, or theCactiEZ CD as your base, but I would like toask that if you want to help improve the CD (within reasonofcourse) then let me know so that I can incorporate the changesinto the official CD, instead of having to have multiple forksrunning around. This makes it easier on you, and on me when havingto support these installs.



This documentation is based off of a host machine already runningCactiEZ, so if you are not using it, you mayrequire additional RPMs.



We will start off by installing these packages, and alldependecies.
anaconda-runtime
mkisofs
anaconda

Use this command to make it easy on yourself.
yuminstall anaconda-runtime mkisofs anaconda



Next, you want to either mountthe ISO using these commands
mkdir/media/cdrom
mount /dev/cdrom/media/cdrom
(Skip this step if you plan on using another way to get the CDfiles on the server)



For this tutorial, we will place the files in a directory in rootcalled
/CD

Copy the files either remotely via SCP (using WinSCP), or from the mounted CD with thiscommand.
mkdir/CD
cp -R /media/cdrom/* /CD

The copy command for some odd reason creates files calledTRANS.TBL in every directory that it copied to, so we willget rid of those now.
find/CD -name TRANS.TBL -exec rm {} \;

Now unmount the CDRom if you had mounted it
umount /media/cdrom



Now we create these scripts, Iput them in /root/

makeiso.sh
#!/bin/bash
exportPYTHONPATH=/usr/lib/anaconda
/usr/lib/anaconda-runtime/genhdlist/CD/
/usr/lib/anaconda-runtime/pkgorder /CD i686 >/CD/CentOS/base/pkgorder
/usr/lib/anaconda-runtime/genhdlist --withnumbers--fileorder /CD/CentOS/base/pkgorder--hdlist /CD/CentOS/base/hdlist/CD
find /CD -name TRANS.TBL-exec rm {} \;
mkisofs -r -T -J -V "CactiEZ" -bisolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot-boot-load-size 4 -boot-info-table -v -o /root/Cacti.iso/CD

testrpms.sh
#!/bin/bash
cd /CD/CentOS/RPMS
mkdir/tmp/testdb
rpm --initdb --dbpath /tmp/testdb
rpm --test --dbpath /tmp/testdb -Uvh*.rpm
rm -fr /tmp/testdb

You will want to make both of these scripts executable by runningthese commands
chmod+x /root/makeiso.sh
chmod +x /root/testrpms.sh

testrpms.sh is used for when you add RPM packages to theCD. It will test all the packages to ensure that there are nodependecy problems. This is exceedingly useful, as you don't haveto wait until after you created the CD and tried to install it, tofind out you are missing a package. Upon running the script, it issafe to ignore any warning, such as
warning: apr-0.9.4-24.5.c4.1.i386.rpm: V3 DSA signature:NOKEY, key ID 443e1821
as these just mean that you do not have a GPG key for the package,but it will install successfully without it. If you see this
Preparing... # # # # # # # # # #[100%]
then it means there are no dependecies problems, so you are nowable to create the CD.

makeiso.sh is the script that does the actual CD creating.We create the list of packages, and the proper order they should beinstalled in, and then we creat the ISO image. The script aswritten will place the ISO in /root directory.

Now you can make modifications to the /CD directory, and easilytest the CD and recreate the ISO.



The most important file that you will deal with isks.cfg which will be directly in the /CD/directory. This file is the "automation" script which tells theinstaller what to do. Here you specify what packages to install,the root password, and all the commands to run after theinstallation if complete.

The two important areas in this script are marked by
%post--nochroot
and
%post

Everything after the %post --nochroot is not using the "normal"base root that you are accustomed to. Instead the physical harddrives are mounted. You can access the normal root here
/mnt/sysimage
Generally here we mount the CD-Rom and do any work we have to dowith it (like copying all the files off), before changing to the"normal" root.

Now when we switch to %post all the paths are exactly as theywill be on your new install. Here we can do most anything we want,such as starting services (MySQL must be started inorder to importdatabases!), removing services we don't want, changing directorypermissions, setting up the cron jobs, etc... It is important tonote, that most of these items can also be done in the --nochroot enviroment,but I find it easier this way, as I believe so will you.

An important directory on the CD is
/CD/CentOS/RPMS
This is the directory where you will place any RPMs that you wantinstalled. You can also remove old RPMs that aren't needed anymore(for instance if you add upgraded RPMs) or if you decide to removefeatures (be sure to remove the listing for the RPMs inks.cfg orelse your install will fail!).
  评论这张
 
阅读(136)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018