From 7a2420af46be71b9db6fb410247b1a5e4c7c78ba Mon Sep 17 00:00:00 2001 From: Demi Marie Obenour Date: Sat, 4 Feb 2023 22:14:13 -0500 Subject: [PATCH] Only include SELinux when the SELinux flavor is used This avoids pulling in unnecessary dependencies, fixes the R4.1 build, and allows using SELinux on CentOS Stream later. --- template_rpm/09_cleanup.sh | 3 +-- template_rpm/packages_fedora_minimal.list | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/template_rpm/09_cleanup.sh b/template_rpm/09_cleanup.sh index 8322977..5e84f28 100755 --- a/template_rpm/09_cleanup.sh +++ b/template_rpm/09_cleanup.sh @@ -51,8 +51,7 @@ fi truncate --no-create --size=0 "${INSTALL_DIR}"/var/log/dnf.* -if [[ "$DIST_NAME" = 'fedora' ]] && [[ "$DIST_VER" -ge 37 ]] && - chroot -- "$INSTALL_DIR" rpm -qv qubes-core-agent-selinux; then +if containsFlavor selinux; then sed -i -- 's/^SELINUX=\(disabled\|enforcing\)/SELINUX=permissive/' "$INSTALL_DIR/etc/selinux/config" unshare --mount -- chroot -- "$INSTALL_DIR" /bin/sh -euc 'mount --bind -- / /mnt umask 0755 diff --git a/template_rpm/packages_fedora_minimal.list b/template_rpm/packages_fedora_minimal.list index 27e8f33..50c8be9 100644 --- a/template_rpm/packages_fedora_minimal.list +++ b/template_rpm/packages_fedora_minimal.list @@ -1,7 +1,6 @@ xterm tar haveged -selinux-policy-targeted sudo --exclude=kdegames --exclude=firstboot