3. 配置kickstart,准备相关文件
[root@blog01 ~]# yum install system-config-kickstart -y
[root@blog01 ~]# mkdir /tftpboot
[root@blog01 ~]# mkdir /tftpboot/pxelinux.cfg
[root@blog01 ~]# cp /usr/share/syslinux/pxelinux.0 /tftpboot/
[root@blog01 ~]# cp /media/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
[root@blog01 ~]# cp /media/images/pxeboot/initrd.img /tftpboot/
[root@blog01 ~]# cp /media/images/pxeboot/vmlinuz /tftpboot/
[root@blog01 ~]# chmod 644 /tftpboot/pxelinux.cfg/default
[root@blog01 ~]#cat /tftpboot/pxelinux.cfg/default //查看如下信息,添加ks.cfg位置
label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img ks=ftp://10.196.28.43/pub/ks.cfg
4.生成ks.cfg文件
[root@blog01 ~]# system-config-kickstart
具体步骤在此不具体说明,贴出最终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="ftp://10.196.28.43/pub"
# Root password
rootpw --iscrypted $1$eTN.ZnVf$Kprjai3Hzn.qEbSnepP5R/
# System authorization information
auth --useshadow --passalgo=sha512
# Use text mode install
text
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 --isUtc Asia/Shanghai
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype="ext4" --size=400
part swap --fstype="swap" --size=12000
part / --asprimary --fstype="ext4" --grow --size=1
%packages
@base
@client-mgmt-tools
@core
@debugging
@basic-desktop
@desktop-debugging
@desktop-platform
@directory-client
@fonts
@general-desktop
@graphical-admin-tools
@input-methods
@internet-browser
@java-platform
@legacy-x
@network-file-system-client
@perl-runtime
@print-client
@remote-desktop-clients
@server-platform
@server-policy
@virtualization
@virtualization-client
@virtualization-platform
@virtualization-tools
@x11
pax
python-dmidecode
oddjob
wodim
sgpio
genisoimage
mtools
abrt-gui
certmonger
pam_krb5
krb5-workstation
libXmu
perl-DBD-SQLite
qemu-kvm-tools
qemu-guest-agent
libvirt-snmp
fence-virtd-serial
fence-virtd-multicast
libvirt-java
libvirt-cim
fence-virtd-libvirt
libvirt-qmf
perl-Sys-Virt
libguestfs-java
virt-v2v
libguestfs-tools
%end
[root@SJC42KVM01 ~]#
[root@SJC42KVM01 ~]# cat /var/ftp/pub/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="ftp://10.196.28.43/pub"
# Root password
rootpw --iscrypted $1$eTN.ZnVf$Kprjai3Hzn.qEbSnepP5R/
# System authorization information
auth --useshadow --passalgo=sha512
# Use text mode install
text
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 --isUtc Asia/Shanghai
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype="ext4" --size=400
part swap --fstype="swap" --size=12000
part / --asprimary --fstype="ext4" --grow --size=1
%packages
@base
@client-mgmt-tools
@core
@debugging
@basic-desktop
@desktop-debugging
@desktop-platform
@directory-client
@fonts
@general-desktop
@graphical-admin-tools
@input-methods
@internet-browser
@java-platform
@legacy-x
@network-file-system-client
@perl-runtime
@print-client
@remote-desktop-clients
@server-platform
@server-policy
@virtualization
@virtualization-client
@virtualization-platform
@virtualization-tools
@x11
pax
python-dmidecode
oddjob
wodim
sgpio
genisoimage
mtools
abrt-gui
certmonger
pam_krb5
krb5-workstation
libXmu
perl-DBD-SQLite
qemu-kvm-tools
qemu-guest-agent
libvirt-snmp
fence-virtd-serial
fence-virtd-multicast
libvirt-java
libvirt-cim
fence-virtd-libvirt
libvirt-qmf
perl-Sys-Virt
libguestfs-java
virt-v2v
libguestfs-tools
%end
拷贝kc.cfg至/var/ftp/pub目录中
[root@blog01 ~ ]# cp ks.cfg /var/ftp/pub/ks.cfg
[root@blog01 ~ ]# rsync -avP /media/ /var/ftp/pub/