From eb59b5651ac4875c78085a8b329edaaced008fff Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Mon, 4 Jul 2022 17:28:40 -0400 Subject: [PATCH] fix kickstarts --- ...-Container.ks => Rocky-9-Container-Base.ks | 3 +- Rocky-9-Container-Minimal.ks | 97 +++++++++++++++++++ Rocky-9-EC2.ks | 1 - ...4-Vagrant.ks => Rocky-9-Vagrant-Libvirt.ks | 2 - ...Vagrant-VBox.ks => Rocky-9-Vagrant-Vbox.ks | 2 - 5 files changed, 98 insertions(+), 7 deletions(-) rename Rocky-9-Container.ks => Rocky-9-Container-Base.ks (96%) create mode 100644 Rocky-9-Container-Minimal.ks rename Rocky-9-x86_64-Vagrant.ks => Rocky-9-Vagrant-Libvirt.ks (96%) rename Rocky-9-x86_64-Vagrant-VBox.ks => Rocky-9-Vagrant-Vbox.ks (96%) diff --git a/Rocky-9-Container.ks b/Rocky-9-Container-Base.ks similarity index 96% rename from Rocky-9-Container.ks rename to Rocky-9-Container-Base.ks index e613089..ce19054 100644 --- a/Rocky-9-Container.ks +++ b/Rocky-9-Container-Base.ks @@ -4,8 +4,7 @@ # Basic setup information -url --url https://dl.rockylinux.org/stg/rocky/9/BaseOS/$basearch/os/ - +text bootloader --disable firewall --disabled network --bootproto=dhcp --device=link --activate --onboot=on diff --git a/Rocky-9-Container-Minimal.ks b/Rocky-9-Container-Minimal.ks new file mode 100644 index 0000000..f0a50cb --- /dev/null +++ b/Rocky-9-Container-Minimal.ks @@ -0,0 +1,97 @@ +# This is a minimal Rocky kickstart designed for docker. +# It will not produce a bootable system +# To use this kickstart, run make + +# Basic setup information + +bootloader --disable +firewall --disabled +network --bootproto=dhcp --device=link --activate --onboot=on +rootpw --lock --iscrypted locked +selinux --disabled +shutdown + +keyboard us +lang en_US.UTF-8 +timezone --isUtc --nontp UTC + +# Disk setup +zerombr +clearpart --all --initlabel +autopart --noboot --nohome --noswap --nolvm --fstype=ext4 + +# Package setup +%packages --ignoremissing --excludedocs --instLangs=en --nocore --excludeWeakdeps +bash +coreutils-single +glibc-minimal-langpack +microdnf +rocky-release + +-brotli +-dosfstools +-e2fsprogs +-firewalld +-fuse-libs +-gettext* +-gnupg2-smime +-grub\* +-hostname +-iptables +-iputils +-kernel +-kexec-tools +-less +-libss +-os-prober* +-pinentry +-qemu-guest-agent +-rootfiles +-shared-mime-info +-tar +-trousers +-vim-minimal +-xfsprogs +-xkeyboard-config +-yum +%end + +%post --erroronfail --log=/root/anaconda-post.log +# container customizations inside the chroot + + +rpm --rebuilddb + +/bin/date +%Y-%m-%d_%H:%M:%S > /etc/BUILDTIME + +echo 'container' > /etc/dnf/vars/infra + +LANG="en_US" +echo '%_install_langs en_US.UTF-8' > /etc/rpm/macros.image-language-conf +echo 'LANG="C.UTF-8"' > /etc/locale.conf + +rm -f /var/lib/dnf/history.* +rm -fr "/var/log/*" "/tmp/*" "/tmp/.*" + +for dir in $(ls -d "/usr/share/{locale,i18n}/*" | grep -v 'en_US\|all_languages\|locale\.alias'); do rm -fr $dir; done + +# systemd fixes +umount /run +systemd-tmpfiles --create --boot + +# mask mounts and login bits +systemctl mask \ + console-getty.service \ + dev-hugepages.mount \ + getty.target \ + sys-fs-fuse-connections.mount \ + systemd-logind.service \ + systemd-remount-fs.service + +# Cleanup the image +rm -f /etc/udev/hwdb.bin +rm -rf /usr/lib/udev/hwdb.d/ \ + /boot /var/lib/dnf/history.* \ + /tmp/* /tmp/.* + +%end diff --git a/Rocky-9-EC2.ks b/Rocky-9-EC2.ks index 73c680c..9ca516e 100644 --- a/Rocky-9-EC2.ks +++ b/Rocky-9-EC2.ks @@ -170,7 +170,6 @@ cloud-init cloud-utils-growpart NetworkManager dracut-config-generic -dracut-norescue firewalld gdisk grub2 diff --git a/Rocky-9-x86_64-Vagrant.ks b/Rocky-9-Vagrant-Libvirt.ks similarity index 96% rename from Rocky-9-x86_64-Vagrant.ks rename to Rocky-9-Vagrant-Libvirt.ks index 1b5eab4..058c195 100644 --- a/Rocky-9-x86_64-Vagrant.ks +++ b/Rocky-9-Vagrant-Libvirt.ks @@ -1,5 +1,3 @@ -url --url=http://dl.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os -repo --name=AppStream --baseurl=http://dl.rockylinux.org/pub/rocky/9/AppStream/x86_64/os text keyboard --vckeymap us lang en_US diff --git a/Rocky-9-x86_64-Vagrant-VBox.ks b/Rocky-9-Vagrant-Vbox.ks similarity index 96% rename from Rocky-9-x86_64-Vagrant-VBox.ks rename to Rocky-9-Vagrant-Vbox.ks index f6d55fb..4a1be0b 100644 --- a/Rocky-9-x86_64-Vagrant-VBox.ks +++ b/Rocky-9-Vagrant-Vbox.ks @@ -1,5 +1,3 @@ -url --url=http://dl.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os -repo --name=AppStream --baseurl=http://dl.rockylinux.org/pub/rocky/9/AppStream/x86_64/os text keyboard --vckeymap us lang en_US