From c812d3d34f9948b84f13e43dc5cc6e7f65e68cb8 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Wed, 16 Sep 2020 12:24:38 +0200 Subject: [PATCH] Add Fedora-ELN base container image kickstart. It seems we will need different set of packages Fedora-ELN base container image and therefore we need new kickstart file for it. Signed-off-by: Jan Kaluza --- fedora-eln-container-base.ks | 59 ++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 fedora-eln-container-base.ks diff --git a/fedora-eln-container-base.ks b/fedora-eln-container-base.ks new file mode 100644 index 0000000..6a9a544 --- /dev/null +++ b/fedora-eln-container-base.ks @@ -0,0 +1,59 @@ +# See fedora-container-common.ks for details on how to hack on container image kickstarts +# This base is a standard Fedora-ELN image with python3 and dnf + +%include fedora-container-common.ks + +%packages --excludedocs --instLangs=en --nocore --excludeWeakdeps +rootfiles +# https://communityblog.fedoraproject.org/modularity-dead-long-live-modularity/ +fedora-repos-modular +tar # https://bugzilla.redhat.com/show_bug.cgi?id=1409920 +vim-minimal +dnf +yum # DNF compatibility with yum +sssd-client +sudo +-glibc-langpack-en +-cracklib-dicts +-langpacks-en +%end + +%post --erroronfail --log=/root/anaconda-post.log +# remove some extraneous files +rm -rf /var/cache/dnf/* +rm -rf /tmp/* + +# https://pagure.io/atomic-wg/issue/308 +printf "tsflags=nodocs\n" >>/etc/dnf/dnf.conf + + +# https://bugzilla.redhat.com/show_bug.cgi?id=1343138 +# Fix /run/lock breakage since it's not tmpfs in docker +# This unmounts /run (tmpfs) and then recreates the files +# in the /run directory on the root filesystem of the container +# +# We ignore the return code of the systemd-tmpfiles command because +# at this point we have already removed the /etc/machine-id and all +# tmpfiles lines with %m in them will fail and cause a bad return +# code. Example failure: +# [/usr/lib/tmpfiles.d/systemd.conf:26] Failed to replace specifiers: /run/log/journal/%m +# +umount /run +rm /run/nologin # https://pagure.io/atomic-wg/issue/316 + +# Final pruning +rm -rfv /var/cache/* /var/log/* /tmp/* + +%end + +%post --nochroot --erroronfail --log=/mnt/sysimage/root/anaconda-post-nochroot.log +set -eux + +# See: https://bugzilla.redhat.com/show_bug.cgi?id=1051816 +# NOTE: run this in nochroot because "find" does not exist in chroot +KEEPLANG=en_US +for dir in locale i18n; do + find /mnt/sysimage/usr/share/${dir} -mindepth 1 -maxdepth 1 -type d -not \( -name "${KEEPLANG}" -o -name POSIX \) -exec rm -rfv {} + +done + +%end