From 431fa10f223d08caf829be51c08bdc7ae3cc3a97 Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Nov 01 2019 13:33:38 +0000 Subject: [PATCH 1/5] initial addition of CentOS-8-Minimal --- diff --git a/CentOS-8-Minimal.ks b/CentOS-8-Minimal.ks new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/CentOS-8-Minimal.ks From 9d489cd1543865b33691b47ed85aee8a79c85d84 Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Nov 01 2019 13:34:32 +0000 Subject: [PATCH 2/5] Rough attempt at making a kickstart using parts from fedora 28 kickstarts --- diff --git a/CentOS-8-Minimal.ks b/CentOS-8-Minimal.ks index e69de29..82c93df 100644 --- a/CentOS-8-Minimal.ks +++ b/CentOS-8-Minimal.ks @@ -0,0 +1,79 @@ +# This is a minimal CentOS kickstart designed for and ISO. +# To use this kickstart, run the following command +# +# README: Todo put in how to make this. + +#version=RHEL8 +install +text +# License Agreement +eula --agreed +# Keyboard +keyboard --vckeymap=us --xlayouts='us' +# System language +lang en_US.UTF-8 +# System timezone (No NTP since maybe no network) +timezone --isUtc --nontp Etc/UTC --nontp +# System authorization information +auth --enableshadow --passalgo=sha512 +# Root password +rootpw --lock --iscrypted locked +# Selinux Policy +selinux --enforcing +# System Firewall +firewall --enabled --service=mdns +# Service Setup +services --enabled=sshd,NetworkManager,chronyd,initial-setup + + +# Repositories +repo --name="BaseOS" --baseurl=http://mirror.centos.org/centos-8/8/BaseOS/x86_64/kickstart/ +repo --name="AppStream" --baseurl=http://mirror.centos.org/centos-8/8/AppStream/x86_64/kickstart/ +repo --name="PowerTools" --baseurl=http://mirror.centos.org/centos-8/8/PowerTools/x86_64/kickstart/ + +# Disk layout +zerombr +clearpart --all --initlabel --disklabel=msdos +autopart +bootloader --timeout=10 +# Network Layout +network --bootproto=dhcp --device=link --activate + +# Setup firstboot +firstboot --reconfig + +# Shutodown versus reboot on install +shutdown + +%packages +@core +%end + +%post + +rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial +echo "Packages within this disk image" +rpm -qa | tee /root/RPM-LIST +# Note that running rpm recreates the rpm db files which aren't needed or wanted +rm -f /var/lib/rpm/__db* + + +# remove random seed, the newly installed instance should make it's own +rm -f /var/lib/systemd/random-seed + +# The enp1s0 interface is a left over from the imagefactory install, clean this up +rm -f /etc/sysconfig/network-scripts/ifcfg-enp1s0 + +dnf -y remove dracut-config-generic + +# Remove machine-id on pre generated images +rm -f /etc/machine-id +touch /etc/machine-id + +# setup systemd to boot to the right runlevel +echo -n "Setting default runlevel to multiuser text mode" +rm -f /etc/systemd/system/default.target +ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target +echo . + +%end From b8c88fe043db15780637e6c09921fa5c9298d281 Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Nov 05 2019 20:32:08 +0000 Subject: [PATCH 3/5] Add items to the minimal which allow it to boot into anaconda --- diff --git a/CentOS-8-Minimal.ks b/CentOS-8-Minimal.ks index 82c93df..d092a06 100644 --- a/CentOS-8-Minimal.ks +++ b/CentOS-8-Minimal.ks @@ -4,8 +4,7 @@ # README: Todo put in how to make this. #version=RHEL8 -install -text + # License Agreement eula --agreed # Keyboard @@ -18,24 +17,29 @@ timezone --isUtc --nontp Etc/UTC --nontp auth --enableshadow --passalgo=sha512 # Root password rootpw --lock --iscrypted locked + # Selinux Policy selinux --enforcing # System Firewall firewall --enabled --service=mdns # Service Setup -services --enabled=sshd,NetworkManager,chronyd,initial-setup +services --enabled=sshd,NetworkManager # Repositories -repo --name="BaseOS" --baseurl=http://mirror.centos.org/centos-8/8/BaseOS/x86_64/kickstart/ +url --url=http://mirror.centos.org/centos-8/8/BaseOS/x86_64/kickstart/ repo --name="AppStream" --baseurl=http://mirror.centos.org/centos-8/8/AppStream/x86_64/kickstart/ repo --name="PowerTools" --baseurl=http://mirror.centos.org/centos-8/8/PowerTools/x86_64/kickstart/ + # Disk layout zerombr clearpart --all --initlabel --disklabel=msdos -autopart -bootloader --timeout=10 +# Disk partitioning information +part / --fstype="ext4" --size=1700 +part swap --size=512 +# Set up bootloader +bootloader --timeout=10 --location=mbr # Network Layout network --bootproto=dhcp --device=link --activate @@ -47,33 +51,69 @@ shutdown %packages @core +# Below is taken from RHEL-minimal ks in lorax. +kernel + +# Make sure that DNF doesn't pull in debug kernel to satisfy kmod() +# requires dracut needs these included +kernel-modules +kernel-modules-extra + +dracut-live +dracut-network +grub2 +grub2-efi +memtest86+ +shim +syslinux +tar +centos-logos +anaconda-tui +tmux + %end %post +# enable tmpfs for /tmp +systemctl enable tmp.mount + +# make it so that we don't do writing to the overlay for things which +# are just tmpdirs/caches +# note https://bugzilla.redhat.com/show_bug.cgi?id=1135475 +cat >> /etc/fstab << EOF +vartmp /var/tmp tmpfs defaults 0 0 +EOF + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial echo "Packages within this disk image" rpm -qa | tee /root/RPM-LIST # Note that running rpm recreates the rpm db files which aren't needed or wanted rm -f /var/lib/rpm/__db* - # remove random seed, the newly installed instance should make it's own rm -f /var/lib/systemd/random-seed -# The enp1s0 interface is a left over from the imagefactory install, clean this up -rm -f /etc/sysconfig/network-scripts/ifcfg-enp1s0 - -dnf -y remove dracut-config-generic - # Remove machine-id on pre generated images rm -f /etc/machine-id touch /etc/machine-id +# go ahead and pre-make the man -k cache (#455968) +/usr/bin/mandb + +# make sure there aren't core files lying around +rm -f /core* + +# Remove the rescue kernel and image to save space +# Installation will recreate these on the target +rm -f /boot/*-rescue* + # setup systemd to boot to the right runlevel -echo -n "Setting default runlevel to multiuser text mode" +echo -n "Setting default runlevel to anaconda text mode" rm -f /etc/systemd/system/default.target -ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target +ln -s /lib/systemd/system/anaconda.target /etc/systemd/system/default.target echo . + + %end From d9a3268b5378c398b87457ea89635160f14f71c7 Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Nov 27 2019 19:42:04 +0000 Subject: [PATCH 4/5] add in items from TrevorH minimal system --- diff --git a/CentOS-8-Minimal.ks b/CentOS-8-Minimal.ks index d092a06..d4d10d4 100644 --- a/CentOS-8-Minimal.ks +++ b/CentOS-8-Minimal.ks @@ -50,7 +50,7 @@ firstboot --reconfig shutdown %packages -@core +@^minimal-environment # Below is taken from RHEL-minimal ks in lorax. kernel @@ -58,6 +58,7 @@ kernel # requires dracut needs these included kernel-modules kernel-modules-extra +glibc-minimal-langpack dracut-live dracut-network @@ -70,6 +71,7 @@ tar centos-logos anaconda-tui tmux +-glibc-langpack-en %end @@ -114,6 +116,14 @@ rm -f /etc/systemd/system/default.target ln -s /lib/systemd/system/anaconda.target /etc/systemd/system/default.target echo . +%end + +%addon com_redhat_kdump --disable --reserve-mb='auto' +%end +%anaconda +pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty +pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok +pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty %end From 87fe1e730dfea63de6ba8bb79954165bf0cb6ff2 Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Nov 27 2019 19:50:09 +0000 Subject: [PATCH 5/5] reorganize the packages. add in uefi packages. comment out repos as pungi puts them in. --- diff --git a/CentOS-8-Minimal.ks b/CentOS-8-Minimal.ks index d4d10d4..5d5c378 100644 --- a/CentOS-8-Minimal.ks +++ b/CentOS-8-Minimal.ks @@ -26,10 +26,10 @@ firewall --enabled --service=mdns services --enabled=sshd,NetworkManager -# Repositories -url --url=http://mirror.centos.org/centos-8/8/BaseOS/x86_64/kickstart/ -repo --name="AppStream" --baseurl=http://mirror.centos.org/centos-8/8/AppStream/x86_64/kickstart/ -repo --name="PowerTools" --baseurl=http://mirror.centos.org/centos-8/8/PowerTools/x86_64/kickstart/ +# Repositories get injected by pungi. This is for if you are trying to do this yourself +# url --url=http://mirror.centos.org/centos-8/8/BaseOS/x86_64/kickstart/ +# repo --name="AppStream" --baseurl=http://mirror.centos.org/centos-8/8/AppStream/x86_64/kickstart/ +# repo --name="PowerTools" --baseurl=http://mirror.centos.org/centos-8/8/PowerTools/x86_64/kickstart/ # Disk layout @@ -60,17 +60,29 @@ kernel-modules kernel-modules-extra glibc-minimal-langpack +# Needed for live image dracut-live dracut-network + +anaconda-tui +centos-logos +dbxtool.x86_64 +dosfstools.x86_64 +efi-filesystem.noarch +efibootmgr.x86_64 +efivar-libs.x86_64 +efivar.x86_64 grub2 grub2-efi +grub2-efi-x64.x86_64 memtest86+ +mokutil.x86_64 shim +shim-x64.x86_64 syslinux tar -centos-logos -anaconda-tui tmux + -glibc-langpack-en %end