yum -y install createrepo mkisofs anaconda-runtime
yum -y install rsync
mkdir /yousm/CentOS6.2 #创建镜像目录
mount /dev/cdrom /mnt #挂载现有的安装系统盘
/usr/bin/rsync -a --exclude=Packages/--exclude=repodata/ /mnt/ /yousm/CentOS6.2 #同步镜像的基本文件(rsync可以复制隐藏文件)
mkdir /yousm/CentOS6.2/Packages
mkdir /yousm/CentOS6.2/repodata
awk ‘/Installing/{print $2}‘ install.log|sed ‘s/^[0-9]*://g‘ >/root/packages.list #将系统的安装包写入packages.list
for fileRpm in `cat packages.list`; do cp –r /mnt/Packages/$fileRpm*/yousm/CentOS6.2 /Packages ; done #复制系统安装包
cp /mnt/repodata/*-minimal-i386.xml /yousm/CentOS6.2/repodata/minimal-i386.xml
cd /yousm/CentOS6.2
createrepo -g repodata/minimal-i386.xml ./
declare -x discinfo=`head -1 .discinfo`
createrepo -u"media://$discinfo" -grepodata/ebdb6ed3f5842c0d6445a25f41e51d724f5768798d417e6353ff6a4a6ae52024-minimal-i386.xml.
cp isolinux.cfg /yousm/CentOS6.2/isolinux/
mkdir /yousm/CenytOS6.2/ks
cp ks.cfg /yousm/CentOS6.2/ks/
ks.cfg文件见附件
mkisofs -o CentOS-6.2_X86.iso -bisolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4-boot-info-table -R -J -v -T /yousm/CentOS6.2/
/usr/bin/implantisomd5./CentOS-6.2_X86.iso
本文出自 “游王子” 博客,请务必保留此出处http://youprince.blog.51cto.com/9272426/1874646
原文地址:http://youprince.blog.51cto.com/9272426/1874646