User:Djflux/r8-min-kickstart

lang en_US keyboard us timezone America/New_York --isUtc rootpw password reboot text 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 skipx firstboot --disable %packages @core git vim-enhanced net-tools bzip2 elfutils-libelf-devel gcc kernel-devel kernel-headers make perl tar %end
 * 1) platform x86_64
 * 1) Needed for compiling VirtualBox Guest Additions

%pre iotty=`tty` exec > $iotty 2> $iotty clear VB_CURR=`curl -s http://download.virtualbox.org/virtualbox/LATEST-STABLE.TXT`

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/tmp/vbox-guest-install.log cp /tmp/vbox_version.txt /mnt/sysimage/tmp/vbox_version.txt cp /tmp/vbox_guest.sh /mnt/sysimage/tmp/vbox_guest.sh chroot /mnt/sysimage sh /tmp/vbox_guest.sh %end