Disable selinux for all flavors (#1022)

because in order to support selinux, we need to do more than just enable
it in the cmdline.

Fixes https://github.com/kairos-io/kairos/issues/2802

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This commit is contained in:
Dimitris Karakasilis
2024-08-28 09:29:40 +03:00
committed by GitHub
parent 8693ab1602
commit 9a729607cf
3 changed files with 18 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
packages:
- name: "kairos-overlay-files"
category: "static"
version: "1.1.46"
version: "1.1.47"

View File

@@ -1,14 +1,18 @@
function setSelinux {
source (loop0)/etc/os-release
set baseSelinuxCmd=""
if test $KAIROS_FAMILY == "rhel" -o test $ID == "opensuse-tumbleweed" -o test $ID == "opensuse-leap"; then
# Disable selinux for all distros. Supporting selinux requires more than
# just enabling it like this.
set baseSelinuxCmd="selinux=0"
else
# if not in recovery
if [ -z "$recoverylabel" ];then
set baseSelinuxCmd="security=selinux selinux=1"
fi
fi
#if test $KAIROS_FAMILY == "rhel" -o test $ID == "opensuse-tumbleweed" -o test $ID == "opensuse-leap"; then
# set baseSelinuxCmd="selinux=0"
#else
# # if not in recovery
# if [ -z "$recoverylabel" ];then
# set baseSelinuxCmd="security=selinux selinux=1"
# fi
#fi
}
function setExtraConsole {

View File

@@ -4,6 +4,10 @@ stages:
- name: "Relabelling"
if: |
cat /proc/cmdline | grep "selinux=1"
# NOTE: restorecon below is labeling all the files recursively, which may
# delay booting significantly (we had users reporting 30-minute delays)
# When we support selinux, consider whether we need to run it on every boot
# or not.
commands:
- |
load_policy -i