制作自动安装光盘,制作好后除了硬盘分区其他都不用设置,和以前装的系统一样
先使用安装光盘按要求安装一个系统,登录系统进行操作
which createrepo > /dev/null 2>&1 || yum -y install createrepo
which mkisofs > /dev/null 2>&1 || yum -y install mkisofs
mkdir -p /pxe/isoroot
mount /dev/cdrom /pxe/isoroot
mkdir /home/isoroot
rsync -r /pxe/isoroot/ --exclude "centos/" /home/isoroot/
cd /home/isoroot
mkdir centos
cd centos
cat /root/install.log|awk '{print $2}'|sed 's/^[0-9]*://g'|while read file;do
\cp /pxe/isoroot/centos/$file.rpm . 2>> /tmp/cprmp.tmp
if [ "$?" -eq '0' ];then
echo copy $file.rpm
fi
done
cd /home/isoroot
createrepo -g repodata/comps.xml .
sed -i 's#append .*initrd=initrd.img#append initrd=initrd.img ramdisk_size=8192 ks=cdrom:/isolinux/ks.cfg#1' isolinux/isolinux.cfg
\cp /root/anaconda-ks.cfg isolinux/ks.cfg
mkisofs -r -j -t -r -l -d -allow-multidot -allow-leading-dots -no-bak -o /home/centos-$(cat /etc/redhat-release|awk '{print $3}')-$(uname -i)-your.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .
阅读(1078) | 评论(0) | 转发(0) |