2008年8月9日星期六

基于centos4.3的linux发行版制作过程

基本过程:
定制RPM包
修改 comps.xml
重编comps.rpm
重新生成hdlist
建立pkglist
利用buildinstall处理安装程序
利用mkisofs制作安装映象
------------------------------------------------
母系统是centos4.3,为了软件最新,先升级自己的系统相关软件
rpm --import
http://mirror.be10.com/centos/4.3/os/i386/RPM-GPG-KEY-centos4
rpm --import /usr/share/doc/centos-release-4/RPM-GPG-KEY >> /dev/null
yum -y update
以下为制作安装光盘必须的包
yum install pump-devel gtk2-devel booty bogl-devel bogl-bterm elfutils-devel beecrypt-devel dietlibc
yum install anaconda anaconda-runtime busybox-anaconda
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
anaconda i386 10.1.1.37-1.centos4.2 base 4.3 M
anaconda-runtime i386 10.1.1.37-1.centos4.2 base 526 k
busybox-anaconda i386 1.00.rc1-5 base 177 k
Installing for dependencies:
anaconda-help noarch 10.1.0-1.centos4 base 800 k
bogl i386 0.1.18-4 base 93 k
booty i386 0.44.3-1 base 85 k
pyparted i386 1.6.8-2 base 22 k
检查RPM包依赖关系
cd /data/disk/EServer/RPMS
mkdir /tmp/testdb
rpm --initdb --dbpath /tmp/testdb
rpm --test --dbpath /tmp/testdb -Uvh *.rpm
以下是具体步骤:
1.设置python的系统环境变量
export PYTHONPATH=/usr/lib/anaconda
export PATH="$PATH:/usr/lib/anaconda-runtime"
2.更新光盘的文件树
genhdlist --productpath=EServer /data/disk
3.生成下一步需要的pkgfile文件
pkgorder --product EServer /data/disk/ EServer > /data/pkgfile
4.编译生成光盘引导文件和图形安装界面镜像
buildinstall --pkgorder /data/pkgfile
--version "1.2"
--product "EServer"
--release "Beta"
--prodpath EServer /data/disk
5.制作 ISO
mkisofs -r -T -J -V "EServer 1.2" -b isolinux/isolinux.bin
-c isolinux/boot.cat -no-emul-boot -boot-load-size 4
-boot-info-table -x "lost+found"
-o /data/EServer.iso /data/disk
文件isolinux/boot.cat 会由mkisofs 程序随后产生
----------------------------------------------------
为光盘生成md5验证值
implantisomd5 /data/EServer.iso
Inserting md5sum into iso image...
md5 = b49c693f83c23d7e746dfe0f81a56016
Setting supported flag to 0
如果想将图形界面修改成个性化的界面,需要修改stage2.img(光盘引导镜像,如果硬盘安装,需要修改其他img文件……)
附注:
anaconda资源修改:
mkdir /data/anaconda
mount -o loop /data/disk/EServer/base/stage2.img /data/anaconda
cd /data/anaconda
tar -cvf /data/stage2.tar .
mkdir /data/stage2
cd /data/stage2
tar -xvf /data/stage2.tar
chmod +w -R ../stage2
#-----------修改资源-----------------#
.....
....
#重新打包img镜像
cd /data
mkcramfs stage2/ stage2.img.new
cp /data/stage2.img.new /data/disk/EServer/base/stage2.img
光盘启动画面修改:
yum -y install syslinux
The graphic is in a somewhat odd format, called LSS16. As the name indicates, it is limited to 16 colors. To edit the graphic, first convert it to a PPM:
lss16toppm splash.ppm
Next, edit the file using The Gimp. Save the resulting file as an indexed gif with no more than 14 colors (plus black and white, for a total of 16). Then, convert the file to a pnm/ppm:
giftopnm splash.lss
cp splash.lss /data/disk/isolinux/splash.lss
yum install gcc xorg-x11-devel
编译gif2lss-0.4.tar.gz
保证光盘里面rpm目录下有以下包,这些包是图形化界面制作所必须的,没有他们,buildinstall将会报错。
anaconda
anaconda-runtime
anaconda-help
anaconda-product
busybox
busybox-anaconda
memtest86+
fonts-xorg-base
xorg-x11
joe
kernel*
附注:
rpm -qpi #显示rpm包的信息
rpm -Uvh #安装rpm包
rpm -qpl #列rpm包内的文件

没有评论: