标签:core author str upgrade set mode hang timezone device
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Install OS instead of upgrade
install
# Keyboard layouts
keyboard ‘us‘
# Root password
rootpw --iscrypted $1$EiFvVQ4F$qqs0b7kObABUEMCd0uKbM.
# System language
lang en_US.UTF-8
# Firewall configuration
firewall --disabled
# System authorization information
auth --useshadow --passalgo=sha512
# Use CDROM installation media
cdrom
# Use text mode install
text
firstboot --disable
# SELinux configuration
selinux --disabled
# Network information
network --bootproto=dhcp --device=ens32 --onboot=yes
# Reboot after installation
reboot
# System timezone
timezone Asia/Shanghai
# System bootloader configuration
bootloader --append="selinux=0" --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype="xfs" --size=500
part / --fstype="xfs" --size=51200
part /data --fstype="xfs" --size=30720
part /app --fstype="xfs" --size=20480
part swap --fstype="swap" --size=2048
%post
################################
# reset74.sh
################################
# Step1. configure temporary yum repo
mount /dev/sr0 /mnt
rm -f /etc/yum.repos.d/*.repo
cat > /etc/yum.repos.d/base.repo << EOF
[development]
name=CentOS7.4 DVD
baseurl=file:///mnt/
gpgkey=file:///mnt/RPM-GPG-KEY-CentOS-7
EOF
yum clean all
yum repolist
# Step2. install packages
yum install -y vim lrzsz autofs ntp tree
# Step3. configure autofs service (available on startup)
systemctl enable autofs
systemctl start autofs
umount /mnt
# Step4. configure ntpd service (available on startup)
ntpdate 172.20.0.1
cat >> /etc/ntp.conf << EOF
server 172.20.0.1
EOF
systemctl enable ntpd
systemctl start ntpd
# Step5. modefy local yum repo
cat > /etc/yum.repos.d/base.repo << EOF
[development]
name=CentOS7.4 DVD
baseurl=file:///misc/cd/
gpgkey=file:///misc/cd/RPM-GPG-KEY-CentOS-7
EOF
yum clean all
yum repolist
# Step6. configure prompt format
echo "PS1=‘\[\e[1;36m\][\u@\h \W]\\$\[\e[0m\]‘" > /etc/profile.d/env.sh
source /etc/profile.d/env.sh
# Step7. configure localhost name
hname=CentOS74.magedu.com
cat > /etc/hostname<<EOF
`echo ${hname}`
EOF
cat >> /etc/hosts << EOF
`echo -e "127.0.0.1\t${hname}"`
EOF
# Step8. configure alias
cat >> ~/.bashrc << EOF
alias cdnet="cd /etc/sysconfig/network-scripts/;pwd"
alias vie0="vim /etc/sysconfig/network-scripts/ifcfg-ens33"
alias rn="systemctl restart network;ip a|grep -A2 ‘2:‘"
EOF
source ~/.bashrc
# Step9. configure sshd access arguments
sed -r -i ‘s/(GSSAPIAuthentication )yes/\1no/‘ /etc/ssh/sshd_config
sed -i ‘s/#UseDNS yes/UseDNS no/‘ /etc/ssh/sshd_config
systemctl restart sshd
# Step10. configure CLI windows-size : 800x600x16bits
sed -r -i ‘s@^(GRUB_CMDLINE_LINUX=).*@\1"selinux=0 rhgb vga=0x314"@‘ /etc/default/grub
grub2-mkconfig > /boot/grub2/grub.cfg
# Step11. disable NetworkManager on startup
systemctl disable NetworkManager
%end
%packages
@^minimal
@core
@development
%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
标签:core author str upgrade set mode hang timezone device
原文地址:https://www.cnblogs.com/GymUManAlvin/p/9125031.html