yum -y install system-config-kickstart
system-config-kickstart
mv ks.cfg /var/www/html/
cat /var/www/html/ks.cfg
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url="http://172.168.0.2/centos6"
repo --name="CentOS" --baseurl=http://172.168.0.2/centos6 --cost=100
# Root password
rootpw --iscrypted $1$10KAJR0t$WqUKt8fRa24FDPnHZxRTZ1
# System authorization information
auth --useshadow --passalgo=sha512
# Use graphical install
graphical
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone Asia/Shanghai
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --append="crashkernel=auto rhgb quiet" --location=mbr --driveorder="sda"
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype="ext4" --size=200
part swap --size=4000
part / --fstype="ext4" --grow --size=200
%packages
@core
%end
六、修改
1
2
3
4
5
6
vim /var/lib/tftpboot/pxelinux.cfg/default
label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append ks=http://172.168.0.2/ks.cfg initrd=initrd.img