yum -y install tftp tftp-server xinetd
\cp -f /kylin_iso/isolinux/* /var/lib/tftpboot/
\cp -f /kylin_iso/images/pxeboot/* /var/lib/tftpboot/
mkdir /var/lib/tftpboot/pxelinux.cfg
cat >/var/lib/tftpboot/pxelinux.cfg/default<<EOF
default vesamenu.c32
timeout 100
display boot.msg
# Clear the screen when exiting the menu, instead of leaving the menu displayed.
# For vesamenu, this means the graphical background is still displayed without
# the menu itself for as long as the screen remains in graphics mode.
menu clear
menu background splash.png
menu title Kylin Linux Advanced Server V10
menu vshift 8
menu rows 18
menu margin 8
#menu hidden
menu helpmsgrow 15
menu tabmsgrow 13
# Border Area
menu color border * #00000000 #00000000 none
# Selected item
menu color sel 0 #ffffffff #00000000 none
# Title bar
menu color title 0 #ff7ba3d0 #00000000 none
# Press [Tab] message
menu color tabmsg 0 #ff3a6496 #00000000 none
# Unselected menu item
menu color unsel 0 #84b8ffff #00000000 none
# Selected hotkey
menu color hotsel 0 #84b8ffff #00000000 none
# Unselected hotkey
menu color hotkey 0 #ffffffff #00000000 none
# Help text
menu color help 0 #ffffffff #00000000 none
# A scrollbar of some type? Not sure.
menu color scrollbar 0 #ffffffff #ff355594 none
# Timeout msg
menu color timeout 0 #ffffffff #00000000 none
menu color timeout_msg 0 #ffffffff #00000000 none
# Command prompt text
menu color cmdmark 0 #84b8ffff #00000000 none
menu color cmdline 0 #ffffffff #00000000 none
# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message.
menu tabmsg Press Tab for full configuration options on menu items.
menu separator # insert an empty line
menu separator # insert an empty line
label http
menu label ^Install Kylin Linux Advanced Server V10 HTTP
menu default
kernel vmlinuz
append initrd=initrd.img ro inst.geoloc=0 console=ttyAMA0 console=tty0 rd.iscsi.waitnet=0 ip=dhcp inst.repo=http://172.28.28.20/kylin inst.ks=http://172.28.28.20/ks/kylin-ks.cfg rd.debug rd.udev.debug systemd.log_level=debug
menu end
EOF
\cp -f /kylin_iso/Packages/syslinux-nonlinux-* /tmp
rm -rf /tmp/usr
cd /tmp
rpm2cpio /tmp/syslinux-nonlinux-* | cpio -idm --quiet
\cp -f /tmp/usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
chmod -R 755 /var/lib/tftpboot/