disable = no
安装syslinux引导加载程序
[root@wch ~]# tar zxf syslinux-6.02.tar.gz
复制dhcpd.conf中指定的"pxelinux.0"文件到tftp共享服务目录下
[root@wch ~]# find syslinux-6.02/ -name "pxelinux.0" -exec cp {} /var/lib/tftpboot/ \;
复制syslinux菜单项到tftp共享服务目录下
[root@wch ~]# cp syslinux-6.02/bios/com32/menu/menu.c32 /var/lib/tftpboot/
[root@wch ~]# cp syslinux-6.02/bios/com32/menu/vesamenu.c32 /var/lib/tftpboot/
[root@wch ~]# cp syslinux-6.02/bios/com32/cmenu/libmenu/libmenu.c32 /var/lib/tftpboot/
[root@wch ~]# cp syslinux-6.02/bios/com32/libutil/libutil.c32 /var/lib/tftpboot/
[root@wch ~]# cp syslinux-6.02/bios/com32/lib/libcom32.c32 /var/lib/tftpboot/
[root@wch ~]# cp syslinux-6.02/bios/com32/elflink/ldlinux/ldlinux.c32 /var/lib/tftpboot/
安装vsftpd服务
[root@wch ~]# yum install vsftpd
[root@wch ~]# mkdir /var/ftp/pub/rhel
[root@wch ~]# mkdir /var/ftp/pub/centos
[root@wch ~]# mkdir /var/ftp/pub/winserver
将镜像挂载到vsftp服务共享目录下
[root@wch ~]# mount centos-6.2-x86_64.iso /var/ftp/pub/centos/ -o loop
[root@wch ~]# mount rhel-6.0-x86_64.iso /var/ftp/pub/rhel/ -o loop
[root@wch ~]# mount win2008R2.iso /var/ftp/pub/winserver/ -o loop
复制系统的安装引导文件"initrd.img","vmlinuz"到tftp服务共享目录下
[root@wch ~]# mkdir /var/lib/tftpboot/centos
[root@wch ~]# mkdir /var/lib/tftpboot/rhel
[root@wch ~]# mkdir /var/lib/tftpboot/winserver
[root@wch ~]# cp /var/ftp/pub/centos/images/pxeboot/initrd.img /var/lib/tftpboot/centos/
[root@wch ~]# cp /var/ftp/pub/centos/images/pxeboot/vmlinuz /var/lib/tftpboot/centos/
[root@wch ~]# cp /var/ftp/pub/rhel/images/pxeboot/initrd.img /var/lib/tftpboot/rhel/
[root@wch ~]# cp /var/ftp/pub/rhel/images/pxeboot/vmlinuz /var/lib/tftpboot/rhel/
菜单页面背景(像素:640x480)
[root@wch ~]# mv ap.jpg /var/lib/tftpboot/
[root@wch ~]# vim /var/lib/tftpboot/pxelinux.cfg/defualt
UI vesamenu.c32
TIMEOUT 600
MENU BACKGROUND ap.jpg
MENU TITL this is wch pxe install test!
label centos
menu defualt
menu label install a new cenos6.2 system
kernel centos/vmlinuz
append initrd=centos/initrd.img ks=ftp://192.168.168.250/pub/centos.cfg
label rhel
menu label install a new redhat6.0 system
kernel rhel/vmlinuz
append initrd=rhel/initrd.img ks=ftp://192.168.168.250/pub/rhel.cfg
对特定机子通过MAC地址绑定指定不同的菜单页面
例:mac地址为00:0c:29:62:e2:70
[root@wch pxelinux.cfg]# cp default 01-00-0c-29-62-e2-70 (特别注意:要在mac地址前以"01"开头,并且mac地址的链接符都改成"-")
修改“01-00-0c-29-62-e2-70”文件配置,该机子就会读入到此菜单
kickstart自动化脚本文件
[root@wch ~]# vim /var/ftp/pub/centos.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://192.168.168.250/pub/centos/"
# Root password
rootpw --iscrypted $1$6VdFpf9D$bkU4Zx0awWmSupS.RKPfO1 #如果不使用加密就直接跟密码:“rootpw password”
# 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 --enforcing
# 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 / --fstype="ext4" --size=70000 #分区部分
part swap --fstype="swap" --size=2048
%packages
@base
@network-file-system-client
%end