# Kickstart
通过编辑引导装载程序配置启动 Kickstart 安装
打开 PXE 服务器中的引导装载程序配置文件,并在合适的行中添加 inst.ks= 引导选项。该文件的名称及句法取决于您系统的架构和硬件:
在使用 BIOS 的 AMD64 和 Intel 64 系统中,该文件名称可以是 default,也可以是根据您的系统 IP 地址命名。因此,请在安装条目的 append 行中添加 inst.ks= 选项。该配置文件中 append 行示例类似如下:append initrd=initrd.img inst.ks=http://192.168.184.129/mnt/archive/RHEL-7/7.x/Server/x86_64/kickstarts/ks.cfg
在使用 GRUB2 引导装载程序(使用 UEFI 的 AMD64 和 Intel 64 系统,以及 IBM Power Systems Server)中,该文件名可能是 grub.cfg。在这个文件安装条目的 kernel 行添加 inst.ks= 选项。该配置文件 kernel 行示例如下:
kernel vmlinuz inst.ks=http://192.168.184.129/mnt/archive/RHEL-7/7.x/Server/x86_64/kickstarts/ks.cfg
# 语法参考
#version=DEVEL | |
# 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 | |
# Keyboard layouts | |
keyboard --vckeymap=us --xlayouts='us' | |
# System language | |
lang en_US.UTF-8 | |
# Network information | |
network --bootproto=static --device=ens33 --gateway=192.168.184.2 --ip=192.168.184.139 --nameserver=192.168.184.2 --netmask=255.255.255.0 --ipv6=auto --activate | |
network --hostname=rhel7.localdomain | |
repo --name="Server-HighAvailability" --baseurl=file:///run/install/repo/addons/HighAvailability | |
repo --name="Server-ResilientStorage" --baseurl=file:///run/install/repo/addons/ResilientStorage | |
# Root password | |
rootpw --iscrypted $6$40.EhuRQPJ6OltGD$tYEcqbMNDwOmIMMpXhGMyVax5Sw9vyl7znesBaWr/H/pWkmG5qHXCmMHfT9VZSWtHCqinkE5ibO8ZVOzqpmvI0 | |
# System services | |
services --disabled="chronyd" | |
# System timezone | |
timezone Asia/Shanghai --isUtc --nontp | |
# System bootloader configuration | |
bootloader --location=mbr --boot-drive=sda | |
autopart --type=lvm | |
# Partition clearing information | |
clearpart --none --initlabel | |
%packages | |
@^minimal | |
@core | |
%end | |
%addon com_redhat_kdump --disable --reserve-mb='auto' | |
%end | |
%anaconda | |
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty | |
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok | |
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty | |
%end |
rootpw --iscrypted 的加密密码可由 python 生成
# python -c 'import crypt; print(crypt.crypt("My Password"))' |
# 验证 Kickstart 文件
生成定制 kickstart 文件时,请在使用该文件进行安装前确认其是否有效。
# yum install pykickstart |
安装该软件包后,可以很使用以下命令验证 Kickstart 文件:
~$ ksvalidator /path/to/kickstart.ks |