# 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 CentOS 7 # 大标题 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 check menu label Test this ^media & install CentOS 7 menu default # menu default表示开机时光标一开始默认停留在此label上 kernel vmlinuz append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rd.live.check quiet
menu separator # insert an empty line
# utilities submenu # 子菜单项的设置方法 menu begin ^Troubleshooting menu title Troubleshooting
label vesa menu indent count 5 menu label Install CentOS 7 in ^basic graphics mode text help Try this option out if you're having trouble installing CentOS 7. endtext kernel vmlinuz append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 xdriver=vesa nomodeset quiet
label rescue menu indent count 5 menu label ^Rescue a CentOS system text help If the system will not boot, this lets you access files and edit config files to try to get it booting again. endtext kernel vmlinuz append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rescue quiet
label memtest menu label Run a ^memory test text help If your system is having issues, a problem with your system's memory may be the cause. Use this utility to see if the memory is working correctly. endtext kernel memtest
menu separator # insert an empty line
label local menu label Boot from ^local drive localboot 0xffff
menu separator # insert an empty line menu separator # insert an empty line
label returntomain menu label Return to ^main menu menu exit
menu clear menu background splash.png menu title CentOS 7 menu menu vshift 8 menu rows 18 menu margin 8 #menu hidden menu helpmsgrow 15 menu tabmsgrow 13
menu color border * #00000000 #00000000 none menu color sel 0 #ffffffff #00000000 none menu color title 0 #ff7ba3d0 #00000000 none menu color tabmsg 0 #ff3a6496 #00000000 none menu color unsel 0 #84b8ffff #00000000 none menu color hotsel 0 #84b8ffff #00000000 none menu color hotkey 0 #ffffffff #00000000 none menu color help 0 #ffffffff #00000000 none menu color scrollbar 0 #ffffffff #ff355594 none menu color timeout 0 #ffffffff #00000000 none menu color timeout_msg 0 #ffffffff #00000000 none menu color cmdmark 0 #84b8ffff #00000000 none menu color cmdline 0 #ffffffff #00000000 none
label linux menu label ^Install CentOS 7.2 through pxe menu default kernel "./CentOS7.2/vmlinuz" append initrd="./CentOS7.2/initrd.img" inst.stage2=ftp://172.16.10.10 quiet net.ifnames=0 biosdevname=0
[root@xuexi ~]# cp -a ~/anaconda-ks.cfg /var/ftp/pub/ks.cfg [root@xuexi ~]# chmod +r /var/ftp/pub/ks.cfg # 必须要保证ks.cfg是全局可读的 [root@xuexi ~]# cat anaconda-ks.cfg #version=DEVEL # System authorization information auth --enableshadow --passalgo=sha512 # Install OS instead of upgrade install # Use network installation url --url="ftp://172.16.10.10" #url --url="http://192.168.100.53/cblr/links/CentOS7.2-x86_64" #nfs --server=172.16.10.10 --dir=/install # Use text mode install text # Firewall configuration firewall --disabled firstboot --disable ignoredisk --only-use=sda # Keyboard layouts # old format: keyboard us # new format: keyboard --vckeymap=us --xlayouts='us' # System language lang en_US.UTF-8
# Network information network --onboot=yes --bootproto=dhcp --device=eth0 --noipv6 network --hostname=node1.xuexi.com # Reboot after installation reboot # Root password rootpw --iscrypted $6$KIPkwGVYqtjHln80$quxmkE5MKKA2LyzLOAc/s3FWH/jX76sObq6hqwOsEBoeMc/wIrzGG4xm72lkXwLeOfRLS/sl5vdajY9j34D4J. # SELinux configuration selinux --disabled # Do not configure the X Window System skipx # System timezone timezone Asia/Shanghai # System bootloader configuration bootloader --append="quiet crashkernel=auto" --location=mbr --boot-drive=sda # Clear the Master Boot Record zerombr # Partition clearing information clearpart --all --initlabel # Disk partitioning information part /boot --asprimary --fstype="xfs" --size=250 part swap --fstype="swap" --size=2000 part / --asprimary --fstype="xfs" --grow --size=5000
vim /tftpboot/pxelinux.cfg/default label linux menu label ^Install CentOS 7.2 through pxe menu default kernel "./CentOS7.2/vmlinuz" append initrd="./CentOS7.2/initrd.img" inst.stage2=ftp://172.16.10.10 ks=ftp://172.16.10.10/pub/ks.cfg quiet net.ifnames=0 biosdevname=0