From b8c88fe043db15780637e6c09921fa5c9298d281 Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Nov 05 2019 20:32:08 +0000 Subject: 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