kickstart配置文件默認(rèn)名稱為ks.cfg是一個無人值守安裝操作系統(tǒng)時配置文件,其中定義了系統(tǒng)的鏡像地址、安裝方式、分區(qū)等等蛔翅。只要系統(tǒng)在獲取到此文件后就按照文件的配置的方式進(jìn)行系統(tǒng)的安裝,對于批量安裝操作系統(tǒng)來說是非常有用的位谋。這里只介紹配置文件山析,如何通過此文件進(jìn)行自動化安裝在另一篇文章中介紹。
一掏父、ks.cfg文件詳解
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# 關(guān)閉防火墻
# Firewall configuration
firewall --disabled
# 指定每次都為全新安裝笋轨,默認(rèn)選項
# Install OS instead of upgrade
install
#指定裝樹(鏡像的路徑),支持ftp協(xié)議赊淑、http協(xié)議
# Use network installation
url --url="http://172.16.0.1/centos6/"
url --url="ftp://172.16.0.1/centos6/" #指定裝樹(鏡像的路徑)
# root 的密碼爵政,經(jīng)過加密后的密碼
# Root password
rootpw --iscrypted $6$dGARWYghrvhD9W7P$4af2uw8A4tHvNLe2F6bDrk0J69dt.uYoV4SneKG4kzIsc/nF3JpfnuHg7D5lVE.jxC3p6.K29FCjwtom9VXWf.
# 定義用戶的默認(rèn)認(rèn)證加密方式
# System authorization information
auth --useshadow --passalgo=sha512
# 安裝方式,text為命令行界面安裝
# Use text mode install
text
firstboot --disable
# 設(shè)定鍵盤的布局
# System keyboard
keyboard us
# 操作系統(tǒng)語言
# System language
lang en_US
# 關(guān)閉SELinux
# SELinux configuration
selinux --disabled
# 安裝時的日志記錄路徑陶缺,日志記錄等級
# Installation logging level
logging --level=info --host=172.16.0.1
# 安裝完畢后重啟
# Reboot after installation
reboot
# 設(shè)置時區(qū)钾挟,時間
# System timezone
timezone Asia/Shanghai
# bootloader相關(guān)參數(shù)的設(shè)定
# System bootloader configuration
bootloader --append="rhgb crashkernel=auto quiet" --location=mbr --driveorder="sda"
# 清除MBR分區(qū)表
# Clear the Master Boot Record
zerombr
# 清除磁盤上的數(shù)據(jù)。舊磁盤可能會有其他數(shù)據(jù)謹(jǐn)慎操作饱岸。
# Partition clearing information
clearpart --all
# 對磁盤進(jìn)行分區(qū)
# Disk partitioning information
part /boot --fstype="ext4" --size=200
part pv.008 --size=61440
volgroup vg0 --pesize=8192 pv.008
logvol / --fstype=ext4 --name=root --vgname=vg0 --size=20480
logvol swap --name=swap --vgname=vg0 --size=2048
logvol /usr --fstype=ext4 --name=usr --vgname=vg0 --size=10240
logvol /var --fstype=ext4 --name=var --vgname=vg0 --size=20480
# 安裝完畢后指定的代碼掺出,可以將一些需要初始化定義的腳本寫在這里。
# %post 開始苫费、%end結(jié)束
%post
..........
%end
# 需要安裝的軟件包汤锨,安裝前要確認(rèn)安裝源重定義的鏡像存在此軟件包。%packages開始 %end結(jié)束
%packages
@base
@basic-desktop
@chinese-support
@client-mgmt-tools
@core
@desktop-platform
@fonts
@general-desktop
@graphical-admin-tools
@legacy-x
@network-file-system-client
@perl-runtime
@remote-desktop-clients
@x11
func
lftp
ibus-table-cangjie
ibus-table-erbi
ibus-table-wubi
puppet
%end