My F31 kickstart install is failing with:
DNF error: Error in POSTIN scriptlet in rpm package flatpak-selinux
This is because flapak-selinux installs a SELinux module in %post:
which sources /etc/selinux/config. It is failing because /etc/selinux/config
does not exist and /bin/sh exits with failure (/bin/bash does not
This was reported earlier here:
and the suggestion made to add:
since selinux-policy owns /etc/selinux/config. However, selinux-policy
creates /etc/selinux/config in its own %post, and Requires(post) only
guarantees that the package's contents are installed, not that its scripts are
So, what's the best way to fix this? We need /etc/selinux/policy to be
present and populated with SELINUXTYPE=targeted for the selinux policy modules
to be installed properly.
if [ ! -s /etc/selinux/config ]; then
# New install so we will default to targeted policy
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
# SELINUXTYPE= can take one of these three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are
# mls - Multi Level Security protection.
" > /etc/selinux/config
ln -sf ../selinux/config /etc/sysconfig/selinux
restorecon /etc/selinux/config 2> /dev/null || :
But can't this be achieved simply with:
New installs would get the default config, but otherwise you would get a
However, I realize that nothing is particularly simple about SELinux so there
are probably things I'm not aware of that prevent this.
PS - the else code seems to be a no-op.
Manager of NWRA Technical Systems 720-772-5637
NWRA, Boulder/CoRA Office FAX: 303-415-9702
3380 Mitchell Lane orion(a)nwra.com
Boulder, CO 80301 https://www.nwra.com/