
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
#systemctl disable --now firewalld

echo "add_drivers+=\"virtio_blk virtio_scsi virtio_net virtio_pci virtio_ring virtio\"" >> /etc/dracut.conf
dracut -f /boot/initramfs-`uname -r`.img
lsinitrd /boot/initramfs-`uname -r`.img | grep virtio

yum install -y cloud-init
yum install -y epel-release
yum install -y cloud-utils cloud-utils-growpart
rpm -qa kernel | sed 's/^kernel-//' | xargs -I {} dracut -f /boot/initramfs-{}.img {} 

yum install -y qemu-guest-agent
cat >> /etc/sysconfig/qemu-ga << EOF
TRANSPORT_METHOD="virtio-serial"
DEVPATH="/dev/virtio-ports/org.qemu.guest_agent.0"
LOGFILE="/var/log/qemu-ga/qemu-ga.log"
PIDFILE="/var/run/qemu-ga.pid"
BLACKLIST_RPC=""
FSFREEZE_HOOK_ENABLE=0
EOF
