基於centos4.3的linux發行版製作過程

來源:互聯網
上載者:User

【基於centos4.3的linux發行版製作過程】
http://www.chinaunix.net 作者:thatday  發表於:2009-01-19 13:43:53
【發表評論】【查看原文】【Linux討論區】【關閉】

[color=Green][size=4]以前研究的東西了,最近看到網上有很多人為了製作自己的發行版,苦苦掙紮而不得其道,所以把自己的筆記拿出來與大家一起分享![/size][/color]

[color=Blue]註:其中路徑/data/disk是我的製作光碟片路徑,各位可以根據自己的環境進行修改。[/color]

=======================================================

基本過程:

定製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.lss > 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.gif | ppmtolss16 > 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包內的檔案 

:em18:
上面這些步驟,是經過實踐之後的筆記,所以一般都能夠成功,還有一些細節部分,如comps.xml的修改,文法,就不多介紹了。

如果發現有什麼問題,歡迎跟帖。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.