centos7.1的ISO一键安装之/isolinux/isolinux.cfg 和 ks.cfg文件配置说明

一、isolinux.cfg

default vesamenu.c32
timeout 600              超时等待时间


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 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 linux
  menu label ^Install CentOS 7
  kernel vmlinuz
  append initrd=initrd.img ks=cdrom:/isolinux/ks.cfg     ks.cfg文件目录路径


label check
  menu label Test this ^media & install CentOS 7
  menu default
  kernel vmlinuz
  append initrd=initrd.img initrd=initrd.img ks=cdrom:/isolinux/ks.cfg   ks.cfg文件目录路径


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 end


二.  ks.cfg

#version=RHEL7
# System authorization information
auth --enableshadow --passalgo=sha512


# Use CDROM installation media
cdrom
# Use graphical install
graphical
# Run the Setup Agent on first boot  启动顺序
firstboot --enable
ignoredisk --only-use=sda     默认启动sda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'  
# System language
lang en_US.UTF-8 --addsupport=zh_CN.UTF-8


# Network information
network  --bootproto=dhcp --device=eth0 --onboot=yes --ipv6=auto
network  --hostname=colasoft.localdomain
# Root password
rootpw --iscrypted $1$P44UUcRo$UViUztGX43DbZAqpTYH6i1     root密码
# System timezone
timezone Asia/Shanghai --isUtc --nontp
# System bootloader configuration
bootloader --location=mbr --boot-drive=sda    默认sda启动
autopart --type=lvm
# Partition clearing information
clearpart --all --initlabel --drives=sda    
# SELinux configuration  
selinux --disabled


%packages    安装方式:不选择最小化安装,默认安装配置核心和core模块
@core
@base
#kexec-tools


%end


%post --log=/root/ks-post.log     post为需要执行的shell脚本
mount /dev/cdrom /mnt && cd /mnt/Packages
echo "mount has done">>/root/ks-post.log
cp -rp lrzsz-0.12.20-36.el7.x86_64.rpm iptables-services-1.4.21-13.el7.x86_64.rpm myinit_centOS7.sh csrass-*.rpm dependency.tar.gz setup_csrass.sh setup_pre.sh /root
echo "cp has done">>/root/ks-post.log
cd /root/
rpm -ivh lrzsz-0.12.20-36.el7.x86_64.rpm
echo "rpm lrzsz has done">>/root/ks-post.log
chmod +x myinit_centOS7.sh
sh myinit_centOS7.sh
echo "myinit  has done">>/root/ks-post.log
sleep 3
sh setup_pre.sh
echo "setup_pre has done">>/root/ks-post.log
sleep 10
eject
reboot
echo "reboot has done">>/root/ks-post.log
%end

%addon com_redhat_kdump --enable --reserve-mb='auto'

%end
reboot

  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值