Install Flatpak in an isolated transaction
Copy the SELinux store before installing Flatpak to avoid overlayfs rename failures, then verify the compiled policy includes its helper label.
This commit is contained in:
1 parent
1174a84b28
commit
9275d2c4a4
1 file changed
+14
-7
+14
-7
@@ -58,15 +58,22 @@ RUN dnf install -y --refresh --setopt=tsflags=nodocs \
|
|||||||
gstreamer1-vaapi \
|
gstreamer1-vaapi \
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
&& (dnf remove -y alacritty waybar gnome-software gnome-software-rpm-ostree gnome-system-monitor showtime decibels snapshot PackageKit PackageKit-gstreamer-plugin PackageKit-command-not-found toolbox || true) \
|
&& (dnf remove -y alacritty waybar gnome-software gnome-software-rpm-ostree gnome-system-monitor showtime decibels snapshot PackageKit PackageKit-gstreamer-plugin PackageKit-command-not-found toolbox || true) \
|
||||||
&& dnf install -y flatpak \
|
|
||||||
&& dnf reinstall -y flatpak-selinux \
|
|
||||||
&& dnf clean all
|
&& dnf clean all
|
||||||
|
|
||||||
#Verifie que la politique SELinux connait bien le label du helper flatpak. Sans ce
|
#Flatpak : installe seul, dans sa propre couche (comme avant le passage a GNOME), pour
|
||||||
#module (paquet flatpak-selinux), le binaire reste "unlabeled_t", systemd refuse
|
#que le scriptlet de flatpak-selinux (qui enregistre le module SELinux) tourne dans une
|
||||||
#de l'executer (203/EXEC) et /usr etant en lecture seule au runtime, l'image serait
|
#petite transaction isolee. Le store SELinux est d'abord recopie dans la couche courante :
|
||||||
#inutilisable pour flatpak. Mieux vaut un build qui echoue qu'une image cassee.
|
#sur overlayfs, libsemanage renomme des repertoires de la couche d'origine, ce qui peut
|
||||||
RUN matchpathcon /usr/libexec/flatpak-system-helper | grep -q flatpak_helper_exec_t
|
#echouer ("Directory not empty") et faire annuler la transaction sans erreur bloquante.
|
||||||
|
RUN cp -a /etc/selinux/targeted /tmp/selinux-store \
|
||||||
|
&& rm -rf /etc/selinux/targeted \
|
||||||
|
&& mv /tmp/selinux-store /etc/selinux/targeted
|
||||||
|
RUN dnf install -y flatpak && dnf clean all
|
||||||
|
|
||||||
|
#Garde-fou : /usr est en lecture seule sur le systeme deploye, un helper flatpak mal
|
||||||
|
#etiquete (unlabeled_t) ne peut donc pas etre repare apres coup. On verifie que la
|
||||||
|
#politique COMPILEE connait bien le type, sinon le build echoue.
|
||||||
|
RUN grep -qa flatpak_helper_exec_t /etc/selinux/targeted/policy/policy.*
|
||||||
|
|
||||||
#Configuration de GDM : clavier FR (GNOME Initial Setup cree le premier compte au boot)
|
#Configuration de GDM : clavier FR (GNOME Initial Setup cree le premier compte au boot)
|
||||||
COPY config/xorg-keyboard.conf /etc/X11/xorg.conf.d/00-keyboard.conf
|
COPY config/xorg-keyboard.conf /etc/X11/xorg.conf.d/00-keyboard.conf
|
||||||
|
|||||||
Reference in new issue
Block a user