cd /tmp/iso/isolinux
#修改
引导,注意ks=部分
vi isolinux.
CFg
label linux
menu label ^Install or upgrade an existing
System
menu default
kernel v
MLinuz
ap
PEnd
initrd=in
ITrd.
img ks=
CDROM:/isolinux/ks.cfg
#手动增加Kickstart配置文件
vi ks.cfg</p>
<p> #Kickstart file automat
ically generated by anaconda.
#version=DEVEL
#Install OS instead of upgrade
#表示是安装,而不是升级
install
#Use text mode install
#文本方式安装
text
#Use network installation
#使用网络安装
#url --url=ftp://ip/centos
#Local installation Use
cdrOM installation media
#使用光盘安装
cd
rom #Installation Number
configuration
#如果是
redhat的系统,会要求输入key,这里配置为跳过,如果不配置安装时会停在那里要求用户输入key
#key –skip
#System language
#语言环境
#lang en_US.UTF-8
lang zh_CN.UTF-8
#System keyboard
#键盘类型
keyboard us
#Network information
#网络配置
#network --device eth0 --boot
PRoto dhcp --onboot yes
#Root password
#root密码
rootpw chinaums
#Firewall configuration
#禁用
防火墙
firewall --disabled
#SELinux configuration
#禁用selinux
selinux --disabled
#Run the
SETUP Agent on
First boot
#禁用第一次启动时设置系统的向导
firstboot --disable
#System authorization information
#用户认证配置,useshadow表示使用本地认证,--passalgo表示密码加密算法
authconfig --enableshadow --passalgo=sha
512 #System timezone
#设置时区为上海
timezone -
-isUtc Asia/Shangh
ai #System bootloader configuration
#指明bootloader的安装位置,指明驱动器的排序,指明操作系统安装完成之后,向内核传递的参数
bootloader --location=
mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
#Clear the Master Boot Record
#清除M
br引导记录
zerombr yes
#Partition clearing information
#清除硬盘上的所有数据
clearpart --all --initlabel
#
disk partitioning information
#自定义分区
#创建一个200M大小的分区挂载/boot类型为ext4
part /boot --fstype=ext4 -
-size=200 --ondisk=sda
#创建一个20000M大小的SWAP分区
part swap --size=20000 --ondisk=sda
#创建/目录
part / --fstype=ext4 --grow --size=1 --ondisk=sda
#
reboot after installation
#设置完成之后重启
reboot --eject
#This packages is for CentOS 6.4
#为CentOS 6.4定制的
软件包 %packages
@base
@core
@chinese-support
#增加安装后运行脚本
%post
#config service
#自定义服务
service NetworkManager stop
chkconfig NetworkManager off
#eject cdrom
#安装完成弹出光碟
#eject
#reboot
#执行完毕后重启
#reboot -f
#结束自动化部署
%end
cd /tmp/iso
createrepo -g repodata/*comps.
XMl .
mkisofs -o /tmp/CentOS-6.4_64_auto.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info
-table -joliet-long -R -J -v -T /tmp/iso/