#version=F26
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# Root password
rootpw --iscrypted --lock thereisnopasswordanditslocked
# Use network installation
url --url="http://build.openanolis.cn/kojifiles/output/nightly/anolis-23-20230325.3/compose/BaseOS/aarch64/os/"
# System language
lang en_US.UTF-8
# Firewall configuration
firewall --disabled
repo --name="koji-override-0" --baseurl=http://build.openanolis.cn/kojifiles/output/nightly/anolis-23-20230325.3/compose/BaseOS/aarch64/os/
repo --name="koji-override-1" --baseurl=http://build.openanolis.cn/kojifiles/output/nightly/anolis-23-20230325.3/compose/AppStream/aarch64/os/
# Shutdown after installation
shutdown
user --groups=sudo --name=anuser --password=$6$aMtlG.QNJ4krunUE$qJADOFr9H9f89Dt8icdmJ50U4w/nV4CL6mwvY2JptN6kAkzsHR0AAowEZ/SGvhrsAxHYiyxC4xBoOSOvsq7yq1 --iscrypted
# Network information
network  --bootproto=dhcp --device=link --nameserver=192.168.122.1 --activate
network  --bootproto=dhcp --hostname=localhost.localdomain
# System timezone
timezone America/New_York --isUtc
# Use text mode install
text
firstboot --disable
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
# System services
services --enabled="chronyd"
# System bootloader configuration
bootloader --location=mbr --boot-drive=vda
reqpart
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part / --asprimary --fstype="ext4" --grow --ondisk=vda --size=10240 --mkfsoptions="-O ^64bit,^metadata_csum"

%post
mkdir -p /etc/dracut.conf.d
echo 'add_drivers+=" nvme "' >>/etc/dracut.conf.d/nvme.conf
mkinitrd -f \
            --with=nvme --preload=nvme \
            /boot/initramfs-$($KERNEL_VERSION).img $(KERNEL_VERSION)

sed -i '/^root/ a\anuser    ALL=(ALL)       ALL'  /etc/sudoers
sed -i 's/PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config
%end

%addon com_redhat_kdump --enable --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
%packages --ignoremissing
@base
@core
curl
gcc
grub2-efi-x64
grub2-pc
grubby
kernel-5.10.134
shim
ssh
sysstat
wget
-kernel-5.17.0
-python3-perf-5.17.0

%end
