User:Djflux/r8-min-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 @^minimal-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
 * 4) This kickstart file will install a Rocky Linux 8 minimal environment on
 * 5) any machine. It is specifically designed to install git so that the admin
 * 6) may git clone meza and start a monolith installation on the machine.
 * 7) Use this version if you have the ability to edit your localhost hosts file
 * 8) (/etc/hosts on Linux/macOS, C:\Windows\System32\drivers\etc\hosts on
 * 9) Windows machines). You must have administrator/root/elevated priveleges on
 * 10) your machine to edit the hosts file. If you cannot edit your local hosts
 * 11) file, consider using the r8-ks-vbox-gui.cfg to build a self-contained
 * 12) Linux VM so you can access "localhost" within the VM.
 * 13) This file is specifically designed for virtual machines running on
 * 14) VirtualBox virtualization software. During the kickstart pre-installation
 * 15) phase the script will determine the most current stable version of
 * 16) VirtualBox and then prompt the admin to input which version of VirtualBox is
 * 17) hosting this VM. Pressing ENTER at the prompt will default to using the most
 * 18) recent stable version of VB and download and install/compile the VB Guest
 * 19) Additions.
 * 1) hosting this VM. Pressing ENTER at the prompt will default to using the most
 * 2) recent stable version of VB and download and install/compile the VB Guest
 * 3) Additions.
 * 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