Kickstart-Server ip:192.168.137.188 关闭 selinux setenforce 0 关闭防火墙 service iptables stop 安装 dhcp 1.配置 dhcp 服务器 yum install dhcp 修改 dhcpd.conf 文件 vim /etc/dhcp/dhcpd.conf ddns-update-style interim; ignore client-updates; allow booting; allow bootp; subnet 192.168.137.0 netmask 255.255.255.0 { option routers 192.168.137.254; option subnet-mask 255.255.255.0; option time-offset -18000; range dynamic-bootp 192.168.137.100 192.168.137.120; next-server 192.168.137.210; filename "pxelinux.0"; #host ns { #hardware ethernet 00:0C:29:C8:12:84; #fixed-address 192.168.137.12;} } service dhcpd restart 重启 dhcp 服务器 2. 修改 xinetd 配置文件 yum install httpd yum install tftp-sever tftp* yum install xinetd yum install syslinux 开机自动启动服务 chkconfig httpd on chkconfig xinetd on chkconfig dhcpd on 修改 xinetd 配置文件 vim /etc/xinetd.d/tftp disable = no 只需修改此项 disable 值改为 no 启动各服务 service xinetd restart service httpd restart 发布光盘镜像 mount /dev/cdrom /mnt mkdir /var/www/html/iso cp -r /mnt/* /var/www/html/iso/ cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/ cp /var/www/html/iso/images/pxeboot/vmlinuz /var/lib/tftpboot/ cp /var/www/html/iso/images/pxeboot/initrd.img /var/lib/tftpboot/ cp /var/www/html/iso/isolinux/boot.msg /var/lib/tftpboot/ cp /var/www/html/iso/isolinux/vesamenu.c32 /var/lib/tftpboot/ cp /var/www/html/iso/isolinux/splash.jpg /var/lib/tftpboot/ mkdir /var/lib/tftpboot/pxelinux.cfg cp /var/www/html/iso/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default chmod +w /var/lib/tftpboot/pxelinux.cfg/default vim /var/lib/tftpboot/pxelinux.cfg/default 修改 default 文件 default linux #prompt 1 timeout 60 display boot.msg menu background splash.jpg menu title Welcome to CentOS 6.5! menu color border 0 #ffffffff #00000000 menu color sel 7 #ffffffff #ff000000 menu color title 0 #ffffffff #00000000 menu color tabmsg 0 #ffffffff #00000000 menu color unsel 0 #ffffffff #00000000 menu color hotsel 0 #ff000000 #ffffffff menu color hotkey 7 #ffffffff #ff000000 menu color scrollbar 0 #ffffffff #00000000 label linux menu label ^Install or upgrade an existing system menu default kernel vmlinuz append initrd=initrd.img ks=http://192.168.137.188/test/ks.cfg label vesa menu label Install system with ^basic video driver kernel vmlinuz append initrd=initrd.img xdriver=vesa nomodeset label rescue menu label ^Rescue installed system kernel vmlinuz append initrd=initrd.img rescue label local menu label Boot from ^local drive localboot 0xffff label memtest86 menu label ^Memory test kernel memtest append - 其实只需修改 append 这行 指定 ks 文件路径。然后 default 后面改成 linux cp /root/anaconda-ks.cfg /var/www/html/test/ks.cfg chmod 777 /var/www/html/test/ks.cfg vim /var/www/html/test/ks.cfg # Kickstart file automatically generated by anaconda. install text url --url http://192.168.137.188/iso lang en_US.UTF-8 keyboard us network --onboot no --device eth0 --bootproto dhcp --noipv6 rootpw jf.com firewall --disabled authconfig --enableshadow --passalgo=sha512 selinux --disabled timezone Asia/Shanghai bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet" clearpart --all --initlabel zerombr yes part /boot --fstype=ext4 --size=200 part / --fstype=ext4 --size=20000 part /data --fstype=ext4 --size=20000 part swap --size=2000 %packages @core @server-policy @workstation-policy %end reboot 注意:url --url http://192.168.137.188/iso 这里指向的是 iso 下面的文件,不可写成 ks.cfg 路径。 (我就是这里错了) 不放心可以把服务重启一遍。 service xinetd restart service httpd restart service httpd restart
本文出自 “kattall_linux” 博客,请务必保留此出处http://kattall.blog.51cto.com/5176161/1678708
原文地址:http://kattall.blog.51cto.com/5176161/1678708