From 97abb0700a727305c6d321d059bf4e8156e90755 Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Mon, 4 Jul 2022 18:04:27 -0400 Subject: [PATCH] grow genclo disk, reqpart on vagrant --- ...-Container.ks => Rocky-8-Container-Base.ks | 3 +- Rocky-8-Container-Minimal.ks | 96 +++++++++++++++++++ Rocky-8-EC2.ks | 2 +- Rocky-8-GenericCloud.ks | 2 +- ...4-Vagrant.ks => Rocky-8-Vagrant-Libvirt.ks | 3 +- ...Vagrant-VBox.ks => Rocky-8-Vagrant-Vbox.ks | 1 + 6 files changed, 101 insertions(+), 6 deletions(-) rename Rocky-8-Container.ks => Rocky-8-Container-Base.ks (96%) create mode 100644 Rocky-8-Container-Minimal.ks rename Rocky-8-x86_64-Vagrant.ks => Rocky-8-Vagrant-Libvirt.ks (96%) rename Rocky-8-x86_64-Vagrant-VBox.ks => Rocky-8-Vagrant-Vbox.ks (99%) diff --git a/Rocky-8-Container.ks b/Rocky-8-Container-Base.ks similarity index 96% rename from Rocky-8-Container.ks rename to Rocky-8-Container-Base.ks index 68ff174..ce19054 100644 --- a/Rocky-8-Container.ks +++ b/Rocky-8-Container-Base.ks @@ -4,8 +4,7 @@ # Basic setup information -url --url https://dl.rockylinux.org/stg/rocky/8/BaseOS/$basearch/os/ - +text bootloader --disable firewall --disabled network --bootproto=dhcp --device=link --activate --onboot=on diff --git a/Rocky-8-Container-Minimal.ks b/Rocky-8-Container-Minimal.ks new file mode 100644 index 0000000..ce19054 --- /dev/null +++ b/Rocky-8-Container-Minimal.ks @@ -0,0 +1,96 @@ +# 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 + +text +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 +binutils +coreutils-single +glibc-minimal-langpack +hostname +iputils +less +rocky-release +rootfiles +tar +vim-minimal +yum + +-brotli +-dosfstools +-kexec-tools +-e2fsprogs +-firewalld +-fuse-libs +-gettext* +-gnupg2-smime +-grub\* +-iptables +-kernel +-libss +-os-prober* +-pinentry +-qemu-guest-agent +-shared-mime-info +-trousers +-xfsprogs +-xkeyboard-config +%end + +%post --erroronfail --log=/root/anaconda-post.log +# container customizations inside the chroot + +# Stay compatible +echo 'container' > /etc/dnf/vars/infra + +#Generate installtime file record +/bin/date +%Y%m%d_%H%M > /etc/BUILDTIME + +# Limit languages to help reduce size. +LANG="en_US" +echo "%_install_langs $LANG" > /etc/rpm/macros.image-language-conf + +# https://bugzilla.redhat.com/show_bug.cgi?id=1727489 +echo 'LANG="C.UTF-8"' > /etc/locale.conf + +# systemd fixes +:> /etc/machine-id +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/.* || true + +%end diff --git a/Rocky-8-EC2.ks b/Rocky-8-EC2.ks index f523100..8d4b6fc 100644 --- a/Rocky-8-EC2.ks +++ b/Rocky-8-EC2.ks @@ -19,7 +19,7 @@ bootloader --append="console=ttyS0,115200n8 no_timer_check crashkernel=auto net. zerombr clearpart --all --initlabel reqpart -part / --fstype="xfs" --ondisk=vda --size=7950 +part / --fstype="xfs" --ondisk=vda --size=8000 --grow %pre --erroronfail /usr/sbin/parted -s /dev/vda mklabel gpt diff --git a/Rocky-8-GenericCloud.ks b/Rocky-8-GenericCloud.ks index b1bee4f..8383114 100644 --- a/Rocky-8-GenericCloud.ks +++ b/Rocky-8-GenericCloud.ks @@ -20,7 +20,7 @@ bootloader --append="console=ttyS0,115200n8 no_timer_check crashkernel=auto net. zerombr clearpart --all --initlabel reqpart -part / --fstype="xfs" --ondisk=vda --size=8000 +part / --fstype="xfs" --ondisk=vda --size=8000 --grow %post --erroronfail passwd -d root diff --git a/Rocky-8-x86_64-Vagrant.ks b/Rocky-8-Vagrant-Libvirt.ks similarity index 96% rename from Rocky-8-x86_64-Vagrant.ks rename to Rocky-8-Vagrant-Libvirt.ks index a33e238..5e651b8 100644 --- a/Rocky-8-x86_64-Vagrant.ks +++ b/Rocky-8-Vagrant-Libvirt.ks @@ -1,5 +1,3 @@ -url --url=http://dl.rockylinux.org/pub/rocky/8/BaseOS/x86_64/os -repo --name=AppStream --baseurl=http://dl.rockylinux.org/pub/rocky/8/AppStream/x86_64/os text keyboard --vckeymap us lang en_US @@ -14,6 +12,7 @@ services --enabled=vmtoolsd bootloader --timeout=1 --append="no_timer_check console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 elevator=noop" zerombr clearpart --all --initlabel +reqpart part / --fstype=xfs --asprimary --size=1024 --grow user --name=vagrant --plaintext --password=vagrant diff --git a/Rocky-8-x86_64-Vagrant-VBox.ks b/Rocky-8-Vagrant-Vbox.ks similarity index 99% rename from Rocky-8-x86_64-Vagrant-VBox.ks rename to Rocky-8-Vagrant-Vbox.ks index 942d534..94ad14f 100644 --- a/Rocky-8-x86_64-Vagrant-VBox.ks +++ b/Rocky-8-Vagrant-Vbox.ks @@ -14,6 +14,7 @@ services --enabled=vmtoolsd bootloader --timeout=1 --append="no_timer_check console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 elevator=noop" zerombr clearpart --all --initlabel +reqpart part / --fstype=xfs --asprimary --size=1024 --grow user --name=vagrant --plaintext --password=vagrant