User:Djflux/r8-vbox-kickstart

lang en_US keyboard us timezone America/New_York --isUtc rootpw abc123 reboot url --url=https://ord.mirror.rackspace.com/rocky/8/BaseOS/x86_64/os bootloader --append="rhgb quiet crashkernel=auto" zerombr clearpart --all --initlabel autopart auth --passalgo=sha512 --useshadow selinux --enforcing firewall --enabled --http --ssh firstboot --disable %packages @^workstation-product-environment @network-tools git vim-enhanced net-tools bzip2 elfutils-libelf-devel gcc kernel-devel kernel-headers make perl tar %end
 * 1) Add inst.ks=https://www.mediawiki.org/w/index.php?title=User:Djflux/r8-vbox-kickstart&action=raw to the boot statement
 * 2) See https://github.com/pykickstart/pykickstart/blob/master/docs/kickstart-docs.rst for kickstart documentation
 * 3) Use this Kickstart File for testing Meza version: https://github.com/djflux/meza/tree/rhel8-35.x
 * 1) platform x86_64
 * 1) Needed for compiling VirtualBox Guest Additions

%pre iotty=`tty` exec > $iotty 2> $iotty VB_CURR=`curl -s http://download.virtualbox.org/virtualbox/LATEST-STABLE.TXT` echo echo echo -n "Enter your version of VirtualBox (press ENTER for latest version: ${VB_CURR}): " read USER_VB

if [ ! "x"${USER_VB} == "x" ]; then VBOX_VERSION=${USER_VB} else VBOX_VERSION=${VB_CURR} fi

echo -n $VBOX_VERSION > /tmp/vbox_version.txt

cat >> /tmp/vbox_guest.sh << EOF VBOX_VERSION=`cat /tmp/vbox_version.txt`

cd /tmp curl -O http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
 * 1) Change to temp directory and download VboxGuestAdditions

mkdir -p /mnt/vbox mount -o loop,ro VBoxGuestAdditions_$VBOX_VERSION.iso /mnt/vbox sh /mnt/vbox/VBoxLinuxAdditions.run
 * 1) Mount and run iso

umount /mnt/vbox rm /tmp/VBoxGuestAdditions_$VBOX_VERSION.iso EOF
 * 1) Cleanup

%end

%post --nochroot --log=/mnt/sysimage/var/log/ks-post.log cat >> /mnt/sysimage/etc/profile.d/mystuff.sh << EOF alias dir='ls --color -la | more' alias cls=clear alias vi=vim

export PS1="[\u@\h \w]\\\\$ " EOF

cp /tmp/vbox_guest.sh /mnt/sysimage/tmp/vbox_guest.sh chroot /mnt/sysimage /bin/sh /tmp/vbox_guest.sh %end