From af2754943727f9c6b8e5e22394dc08ad07fde527 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Thu, 19 Jan 2017 22:36:54 -0500 Subject: [PATCH] docker-min: move /usr/share/{locale,i18n} to %post nochroot find does not exist in the minimal image chroot so we'll have to run it from outside. --- fedora-docker-base-minimal.ks | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/fedora-docker-base-minimal.ks b/fedora-docker-base-minimal.ks index 4431d0a..e6c349b 100644 --- a/fedora-docker-base-minimal.ks +++ b/fedora-docker-base-minimal.ks @@ -70,11 +70,6 @@ touch /etc/machine-id # remove some random help txt files rm usr/share/gnupg/help*.txt -f -# See: https://bugzilla.redhat.com/show_bug.cgi?id=1051816 -KEEPLANG=en_US -for dir in locale i18n; do - find usr/share/${dir} -mindepth 1 -maxdepth 1 -type d -not \( -name "${KEEPLANG}" -o -name POSIX \) -exec rm -rf {} + -done # Pruning random things rm usr/lib/rpm/rpm.daily @@ -88,3 +83,15 @@ ln usr/bin/ln usr/sbin/sln rm -rf 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 -rf {} + +done + +%end