Lots of improvements everywhere

This commit is contained in:
Greg Hellings
2023-08-03 14:44:02 -05:00
parent 0a3832d2c4
commit bb63ff7534
44 changed files with 388 additions and 249 deletions
+10 -11
View File
@@ -1,19 +1,18 @@
%include /tmp/packer_ks/centos-stream/CentOS-8-Stream-x86_64-Vagrant.ks
url --mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=x86_64&repo=BaseOS&infra=stock
repo --name=AppStream --mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=x86_64&repo=AppStream&infra=stock
%include /tmp/packer_ks/centos-upstream/CentOS-8-Stream-x86_64-Vagrant.ks
network --bootproto=dhcp --activate
reboot
%pre --interpreter /bin/bash --log /tmp/greg
# This gets us the upstream kickstarter files
cmdline=$(cat /proc/cmdline)
ks=$(printf "${cmdline}" | sed -E -e 's/.*inst\.ks=([^ ]*).*/\1/')
mkdir -p /tmp/packer_ks
cd /tmp/packer_ks
# 3 levels up!
wget -m -nH "$(dirname "$(dirname "$(dirname "${ks}")")")"
set -ex
# This allows us to support virtualbox
mkdir /tmp/sr1
mount /dev/sr1 /tmp/sr1
cp -r /tmp/sr1/http /tmp/packer_ks
if [ ! -e /dev/vda ]; then
sed -i -e 's/drives=vda/drives=sda/' -e 's/ondisk=vda/ondisk=sda/' -e 's/shutdown/reboot/' /tmp/packer_ks/centos-upstream/*
sed -i -e 's/drives=vda/drives=sda/' -e 's/ondisk=vda/ondisk=sda/' /tmp/packer_ks/centos-stream/*
fi
%end