標籤:kickstart
[[email protected] ~]# mount /dev/cdrom /mnt[[email protected] ~]# yum install -y httpd createrepo[[email protected] ~]# mkdir /var/www/html/CentOS-7.1-x86_64[[email protected] ~]# cp -a /mnt/* /var/www/html/CentOS-7.1-x86_64/createrepo -pdo /var/www/html/CentOS-7.1-x86_64/ /var/www/html/CentOS-7.1-x86_64/createrepo -g `ls /var/www/html/CentOS-7.1-x86_64/repodata/*-comps.xml` /var/www/html/CentOS-7.1-x86_64/[[email protected] ~]# yum install -y tftp-server dhcp xinetd[[email protected] ~]# vim /etc/xinetd.d/tftpdisable = no [[email protected] ~]# cd /usr/share/doc/dhcp-4.1.1/[[email protected] dhcp-4.1.1]# cp dhcpd.conf.sample /etc/dhcp/dhcpd.conf[[email protected] dhcp-4.1.1]# vim /etc/dhcp/dhcpd.confsubnet 10.0.0.0 netmask 255.255.255.0 { range dynamic-bootp 10.0.0.100 10.0.0.200; option subnet-mask 255.255.255.0; next-server 10.0.0.7; filename "pxelinux.0";}[[email protected] dhcp-4.1.1]# /etc/init.d/dhcpd start[[email protected] dhcp-4.1.1]# /etc/init.d/httpd start[[email protected] dhcp-4.1.1]# /etc/init.d/xinetd start[[email protected] ~]# rz -y #放置Kickstart檔案[[email protected] ~]# curl --head [[email protected] ~]# yum install -y syslinux[[email protected] ~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/[[email protected] ~]# cp /mnt/isolinux/* /var/lib/tftpboot/[[email protected] ~]# mkdir /var/lib/tftpboot/pxelinux.cfg[[email protected] ~]# cd /var/lib/tftpboot/pxelinux.cfg/[[email protected] pxelinux.cfg]# cp /mnt/isolinux/isolinux.cfg default[[email protected] pxelinux.cfg]# vim defaultlabel ks menu label ^AUTO Install CentOS 7 kernel vmlinuz append initrd=initrd.img ks=http://10.0.0.7/CentOS-7.1-x86_64/CentOS-7.1-x86_64.cfg[[email protected] pxelinux.cfg]# openssl passwd -1 -salt ‘123456‘ ‘123456‘$1$123456$wOSEtcyiP2N/IfIl15W6Z0 [[email protected] CentOS-7.1-x86_64]# vim /var/www/html/CentOS-7.1-x86_64/CentOS-7.1-x86_64.cfg #url --url=$treeurl --url=http://10.0.0.7/CentOS-7.1-x86_64rootpw --iscrypted $1$123456$wOSEtcyiP2N/IfIl15W6Z0
本文出自 “萬越天的架構師之路” 部落格,請務必保留此出處http://wanyuetian.blog.51cto.com/3984643/1717842
kickstart實現開機自動安裝CentOS 7.1 X86_64