lang en_US keyboard us network --bootproto=dhcp timezone Europe/Zurich --isUtc rootpw $1$UXuLNNvG$VoUMFsaF/tCpey2cFg7qK. --iscrypted poweroff bootloader --append="crashkernel=auto console=ttyS0 console=tty0" zerombr clearpart --all --initlabel autopart text auth --passalgo=sha512 --useshadow selinux --enforcing firewall --enabled --ssh skipx firstboot --disable %packages gdisk python2-pyasn1 net-tools cloud-utils-growpart %end %post --nochroot --log=/mnt/sysimage/root/ks-post.log cat < /mnt/sysimage/etc/sysconfig/network NETWORKING=yes HOSTNAME=localhost.localdomain EOF cat < /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ONBOOT=yes BOOTPROTO=dhcp TYPE=Ethernet USERCTL=no PEERDNS=yes IPV6INIT=no NM_CONTROLLED=no EOF sed -i s/^.*swap.*swap.*$// /mnt/sysimage/etc/fstab rpm -ivh --root /mnt/sysimage http://mirror.centos.org/centos/7/extras/x86_64/Packages/WALinuxAgent-2.2.38-2.el7_7.noarch.rpm --nosignature sed -i 's/# AutoUpdate.Enabled=n/AutoUpdate.Enabled=y/g' /mnt/sysimage/etc/waagent.conf sed -i 's/ResourceDisk.EnableSwap=n/ResourceDisk.EnableSwap=y/g' /mnt/sysimage/etc/waagent.conf sed -i 's/ResourceDisk.SwapSizeMB=0/ResourceDisk.SwapSizeMB=2048/g' /mnt/sysimage/etc/waagent.conf echo 'add_drivers+=" hv_vmbus hv_netvsc hv_storvsc "'>> /mnt/sysimage/etc/dracut.conf chroot /mnt/sysimage dracut -f -v chroot /mnt/sysimage chkconfig waagent on echo -n "Getty fixes" # although we want console output going to the serial console, we don't # actually have the opportunity to login there. FIX. # we don't really need to auto-spawn _any_ gettys. sed -i 's/^#NAutoVTs=.*/NAutoVTs=0/' /mnt/sysimage/etc/systemd/logind.conf sed -i 's/^#ReserveVT=.*/ReserveVT=0/' /mnt/sysimage/etc/systemd/logind.conf %end