|
| 1 | +KVM_TEST_MEDIUM |
| 2 | +GRAPHICAL_OR_TEXT |
| 3 | +poweroff |
| 4 | +lang en_US.UTF-8 |
| 5 | +keyboard us |
| 6 | +network --onboot yes --device eth0 --bootproto dhcp |
| 7 | +rootpw --plaintext 123456 |
| 8 | +firstboot --disable |
| 9 | +user --name=test --password=123456 |
| 10 | +# Disable firewalld, as pkg may not be installed in the bootable image |
| 11 | +firewall --disabled |
| 12 | +selinux --enforcing |
| 13 | +timezone --utc America/New_York |
| 14 | +bootloader --location=mbr --append="console=tty0 console=ttyS0,115200" |
| 15 | +zerombr |
| 16 | +KVM_TEST_LOGGING |
| 17 | +clearpart --all --initlabel |
| 18 | +autopart |
| 19 | +xconfig --startxonboot |
| 20 | +# Additional repositories could be specified in 'kickstart_extra_repos' parameter |
| 21 | +KVM_TEST_REPOS |
| 22 | + |
| 23 | +ostreecontainer --url BOOTC_IMAGE |
| 24 | + |
| 25 | +%post |
| 26 | +# Output to all consoles defined in /proc/consoles, use "major:minor" as |
| 27 | +# device names are unreliable on some platforms |
| 28 | +# https://bugzilla.redhat.com/show_bug.cgi?id=1351968 |
| 29 | +function ECHO { for TTY in `cat /proc/consoles | grep -v ttyS0 | awk '{print $NF}'`; do source "/sys/dev/char/$TTY/uevent" && echo "$*" > /dev/$DEVNAME; done } |
| 30 | +ECHO "OS install is completed" |
| 31 | +case $(arch) in |
| 32 | + "x86_64") |
| 33 | + arg="console=tty0 console=ttyS0" |
| 34 | + ;; |
| 35 | + "s390x") |
| 36 | + arg="console=hvc0 console=ttyS0" |
| 37 | + ;; |
| 38 | + "ppc64le") |
| 39 | + arg="console=hvc0 console=ttyS0" |
| 40 | + ;; |
| 41 | + "aarch64") |
| 42 | + arg="console=ttyAMA0 console=ttyS0" |
| 43 | + ;; |
| 44 | +esac |
| 45 | +ECHO "remove rhgb quiet by grubby and add kernel console parameters" |
| 46 | +grubby --remove-args="rhgb quiet" --args="$arg" --update-kernel=$(grubby --default-kernel) |
| 47 | +ECHO "dhclient" |
| 48 | +dhclient |
| 49 | +ECHO "systemctl enable sshd" |
| 50 | +sed -i "s/^#PermitRootLogin .*/PermitRootLogin yes/g" /etc/ssh/sshd_config |
| 51 | +systemctl enable sshd |
| 52 | +ECHO "iptables -F" |
| 53 | +iptables -F |
| 54 | +ECHO "systemctl enable NetworkManager" |
| 55 | +systemctl enable NetworkManager.service |
| 56 | +ECHO "Disable lock cdrom udev rules" |
| 57 | +sed -i "/--lock-media/s/^/#/" /usr/lib/udev/rules.d/60-cdrom_id.rules 2>/dev/null>&1 |
| 58 | +#Workaround for graphical boot as anaconda seems to always instert skipx |
| 59 | +systemctl set-default graphical.target |
| 60 | +cat > '/etc/gdm/custom.conf' << EOF |
| 61 | +[daemon] |
| 62 | +AutomaticLogin=test |
| 63 | +AutomaticLoginEnable=True |
| 64 | +EOF |
| 65 | +cat >> '/etc/sudoers' << EOF |
| 66 | +test ALL = NOPASSWD: /sbin/shutdown -r now,/sbin/shutdown -h now |
| 67 | +EOF |
| 68 | +cat >> '/home/test/.bashrc' << EOF |
| 69 | +alias shutdown='sudo shutdown' |
| 70 | +EOF |
| 71 | +ECHO 'Post set up finished' |
| 72 | +%end |
0 commit comments