rancher / elemental-toolkit

:snowflake: The toolkit to build, ship and maintain cloud-init driven Linux derivatives based on container images
https://rancher.github.io/elemental-toolkit/docs/
Apache License 2.0
288 stars 49 forks source link

SELinux relabel on boot #2074

Closed frelon closed 3 months ago

frelon commented 3 months ago

In this commit we add selinux support to the mount command.

During mount we put a list of persistent+ephemeral directories in /run/systemd/extra-relabel.d/elemental.layout in order to make systemd relabel the directories before loading the policy.

We also try to chroot into the new sysroot and run setfiles using a find wrapper to set on deepest files first.

Signed-off-by: Fredrik Lönnegren fredrik.lonnegren@suse.com