实验步骤
ks文件内容
#version=RHEL8
#ignorediska--only-use=vda
# Partition clearing information
#clearpart --none --initlabel
clearpart --all --initlabel ##把sda硬盘的所有内容删掉
# Use graphical install
#graphical ##安装过程开启图形
text ##安装过程不开图形
# Use CDROM installation media
#cdrom
url --url="http://172.25.254.250/rhel8.2" ##系统安装资源
# 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=ens3 --onboot=off --ipv6=auto --no-activate
network --bootproto=dhcp --onboot=on --ipv6=auto --no-activate ##网卡设定
network --hostname=westoslinux.westos.org ##主机名设定
#repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
repo --name="AppStream" --baseurl=http://172.25.254.250/rhel8.2/AppStream ##软件安装资源
# Root password
rootpw --iscrypted $6$zG/VOV5ipdlpG7g1$D8HNdxYK7MpKDD6475WQKYaAx7sSgdxXaRUbL7cjZq2riEwm.FSNQgc.27baOQStDht8tXmtWNlOvk7mEQ6oX1
# Run the Setup Agent on first boot
#firstboot --enable
firstboot --disable ##首次启动初始化禁止
# Do not configure the X Window System
skipx ##安装完成后开机不启动图形
# System services
services --disabled="chronyd" ##在开机时开启或关闭的服务
# System timezone
timezone Asia/Shanghai --isUtc --nontp ##系统时区,启用utc计时方式,不其同ntp时间同步
reboot ##开机自动重启
#user --name=westos --password=$6$YAe.8sw6vifDVnKA$3Og7IGTQft5nntRNgMLm0SFntVgYeF/0rU5ui54uKdAAlPv0YI3knIR41Zwvlcjli4j4vVpGVyN2YOzsLsFS91 --iscrypted --gecos="westos"
# Disk partitioning information
part / --fstype="xfs" --size=1 --grow ##让/分区使用全部空闲磁盘空间
part swap --fstype="swap" --size=500 ##swap分区大小为500M
part /boot --fstype="xfs" --size=1024 ##/boot分区大小为1024M%packages
@base ##安装软件组base
gcc%end
%post ##系统安装后自动执行的脚本
touch /mnt/file{1..10}
%end



