#mount /dev/cdrom /media
#vim /etc.yum.repo.d/local.repo
[Server]
name=andy_f
baseurl=file:///media/Server
enabled=1
gpgcheck=0
#yum -y install tftp dhcp vsftpd system-config-kickstart
#cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
#vim /etc/dhcpd.conf 内容如下,当然也可以根据自己的需要灵活修改
subnet 192.168.0.0 netmask 255.255.255.0 { option routers 192.168.0.1; option subnet-mask 255.255.255.0; filename "pxelinux.0"; next-server 192.168.0.20; option time-offset -18000; # Eastern Standard Time range dynamic-bootp 192.168.0.128 192.168.0.254; default-lease-time 21600; max-lease-time 43200; }
#vim /etc/xinetd.d/tftp 内容如下
service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot disable = no per_source = 11 cps = 100 2 flags = IPv4 }
#mkdir /tftpboot/pxelinux.cfg
#cp /media/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
#cp /media/images/pxeboot/initrd.img /tftpboot/
cp /media/images/pxeboot/vmlinuz /tftpboot/
cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
default linux prompt 1 timeout 6 label linux kernel vmlinuz append initrd=initrd.img ks=ftp://192.168.0.7/ks.cfg ##ks=是指定kickstart安装时用到的配置文件将配置这个文件
#system-config-kickstart ##执行之后会出现一个图型配置界面如下图
#cp /root/ks.cfg /var/ftp
#platform=x86, AMD64, 或 Intel EM64T # System authorization information auth --useshadow --enablemd5 # System bootloader configuration bootloader --location=mbr # Partition clearing information clearpart --none # Use graphical install graphical # Firewall configuration firewall --enabled --ssh # Run the Setup Agent on first boot firstboot --disable # System keyboard keyboard us # System language lang en_US # Installation logging level logging --level=info # Use network installation url --url=ftp://192.168.0.20/cdrom #Root password rootpw --iscrypted $1$7BdbytrC$92utPD7glx6K5dqd35.cb1 # SELinux configuration selinux --enforcing # System timezone timezone Asia/Shanghai # Install OS instead of upgrade install # X Window System configuration information xconfig --defaultdesktop=GNOME --depth=8 --resolution=640x480 --startxonboot # Disk partitioning information part swap --bytes-per-inode=4096 --fstype="swap" --size=2048
part /boot --bytes-per-inode=4096 --fstype="ext3" --size=200
part / --bytes-per-inode=4096 --fstype="ext3" --grow --size=1 %packages @dialup @base @admin-tools @base-x @openfabrics-enterprise-distribution @system-tools @gnome-desktop @sound-and-video @legacy-software-development @graphical-internet @text-internet @editors @ruby @java @office
#mkdir /var/ftp/cdrom
#mount /dev/cdrom /var/ftp/cdrom
#service dhcpd restart
#service xinetd restart
#service vsftpd restart
chkconfig dhcpd on
#chkconfig vsftpd on