kickstart ks.cfg auto part自动分区

#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Install OS instead of upgrade
install
# Use network installation
url --url="http://10.10.47.150:8060//centos/7"
# License agreement
eula --agreed
# 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 zh_CN.UTF-8

# Network information
network  --bootproto=dhcp --device=ens1f0 --onboot=off --ipv6=auto --activate
network  --bootproto=dhcp --hostname=10.10.30.32
# Reboot after installation
reboot
# Root password
rootpw --plaintext bocloud2020
# System services
services --disabled="chronyd"
# System timezone
timezone Asia/Shanghai --nontp
# X Window System configuration information
xconfig  --startxonboot
# System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
autopart --type=lvm
# Partition clearing information
clearpart --none --initlabel

%post
(
echo `pwd`
wget http://10.10.47.150:8060/net_info.sh -O net_info.sh
chmod +x ./net_info.sh
./net_info.sh "5f291d3961fb0a244777268b" "http://10.10.47.150:9090/api/current/nodes/"
cd /etc/sysconfig/network-scripts
files=`ls ifcfg-*`
for i in $files
do
  if [ `grep "ONBOOT" $i|wc -l` -eq 0 ];then
    echo "ONBOOT=yes" >> $i
  else
    sed -i 's/ONBOOT=.*/ONBOOT=yes/g' $i
  fi
done
systemctl restart network
for retry in $(seq 1 5);
do
    echo "http://10.10.47.150:9090/api/current/notification?nodeId=5f291d3961fb0a244777268b"
    /usr/bin/curl -X POST -H 'Content-Type:application/json' http://10.10.47.150:9090/api/current/notification?nodeId=5f291d3961fb0a244777268b
    if [ $? -eq 0 ]; then
        echo "Post Notification succeeded"
    else
        echo "Post Notification failed"
    fi
    sleep 3
done;
) 2>&1 >>/root/install-post-sh.log
EOF
%end

%packages --excludedocs --nobase
@^minimal
@core
@development
curl
dmidecode
kexec-tools
kexec-tools
lshw
wget

%end

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

%end

 

你可能感兴趣的:(OS,kickstart,ks.kfg,自动分区)