7 KICKSTART 自动安装配置
修改default为
default ks
prompt 1
timeout 600
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label linux
kernel vmlinuz
append initrd=initrd.img
label text
kernel vmlinuz
append initrd=initrd.img text
label ks
kernel vmlinuz
append initrd=initrd.img ks=nfs:192.168.15.101:/iso/ks.cfg ksdevice=eth0 devfs=nomount ramdisk_size=8192
label local
localboot 1
label memtest86
kernel memtest
append –
注:default后面要与下面的label保持一致(default ks label ks 这样才能跳转到ks进行安装)
如default中所写,我们要在/iso下放置一个ks.cfg。读取此配置文件进行安装,每台已经安装好的机器都会在主目录下生成anaconda-ks.cfg文件
复制/root下的anaconda-ks.cfg文件到/tftpboot并改名为ks.cfg
#cp /root/anaconda-ks.cfg /tftpboot/ks.cfg
增加一条nfs --server=192.168.15.101 --dir=/iso 来找到系统安装文件
#cp /root/anaconda-ks.cfg /tftpboot/ ks.cfg
-- 示例:
# Kickstart file automatically generated by anaconda.
install
nfs --server=192.168.15.101 --dir=/iso/
lang zh_CN.UTF-8
keyboard us
xconfig --startxonboot
network --device eth0 --bootproto dhcp
rootpw --iscrypted $1$.Lf0F3Gj$isEVQBryBQYgWy23DhwXA1
firewall --enabled --port=22:tcp
authconfig --enableshadow --enablemd5
selinux --enforcing
timezone --utc Asia/Shanghai
bootloader --location=mbr --driveorder=sda --append="rhgb quiet"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
#clearpart --linux --drives=sda
autopart
clearpart --all --drives=sda --initlabel
part /boot --fstype ext3 --size=100 --ondisk=sda
part pv.2 --size=0 --grow --ondisk=sda
volgroup VolGroup00 --pesize=32768 pv.2
logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow
logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=1024 --grow --maxsize=2048
%packages
@base
@chinese-support
@core
@dialup
@editors
@gnome-desktop
@games
@graphical-internet
@graphics
@office
@printing
@sound-and-video
@text-internet
@base-x
keyutils
trousers
fipscheck
device-mapper-multipath
libsane-hpaio
xorg-x11-server-Xnest
8 定制安装
[root@Install ~]# init 5
[root@Install ~]# yum install system-config-kickstart
[root@Install ~]# system-config-kickstart
如上在主目录会生成一个安装配置文件:ks.cfg,然后将此文件cp到/iso中,便可引导安装!
文件cp到/iso中,便可引导安装!
示例:
#platform=x86, AMD64, ?.Intel EM64T
# System authorization information
auth --useshadow --enablemd5
# System bootloader configuration
bootloader --location=mbr --password=root123
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Use text mode install
text
# Firewall configuration
firewall --enabled --http --ssh --telnet
# 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 NFS installation media
nfs --server=192.168.15.101 --dir=/iso
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
#Root password
rootpw --iscrypted $1$X7s0JJZR$Gm0e9DISLIWaaOmu4wmwe.
# SELinux configuration
selinux --enforcing
# System timezone
timezone America/New_York
# Install OS instead of upgrade
install
# X Window System configuration information
xconfig --defaultdesktop=GNOME --depth=8 --resolution=640x480
# Disk partitioning information
part /boot --bytes-per-inode=4096 --fstype="ext3" --size=500
part swap --bytes-per-inode=4096 --fstype="swap" --size=1000
part / --bytes-per-inode=4096 --fstype="ext3" --grow --size=1
%packages
@kde-desktop
@java-development
@gnome-desktop
@chinese-support
9 参考资料
https://www.ibm.com/developerworks/cn/linux/l-tip-prompt/l-pex/
http://hi.baidu.com/dongfangmn/blog/item/047b1c17c22ff604c83d6d79.html
http://cqfish.blog.51cto.com/622299/155550