forked from coreos/fedora-coreos-config
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
overlay/15fcos: fix selinux labels in /boot and /sysroot
/boot/efi and /sysroot dir and subfiles are unlabeled_t since 40.20240504.3.0. This is likely due to a missing step in the OSBuild pipeline as this started with coreos/fedora-coreos-tracker#1653. This should be removed after the next barrier release, if the newly produced images are fixed. See coreos/fedora-coreos-tracker#1771 And coreos/fedora-coreos-tracker#1772
- Loading branch information
1 parent
bb1c249
commit ed706a5
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
overlay.d/15fcos/usr/lib/systemd/system/coreos-fix-selinux-labels.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Remove after the next barrier release | ||
|
||
[Unit] | ||
Description=Fix incorrect selinux labels under /boot and /sysroot | ||
Documentation=https://github.com/coreos/fedora-coreos-tracker/issues/1771 | ||
Documentation=https://github.com/coreos/fedora-coreos-tracker/issues/1772 | ||
|
||
[Service] | ||
Type=oneshot | ||
#ExecStartPre=/usr/bin/mount -o remount,rw /boot | ||
#ExecStartPre=/usr/bin/mount -o remount,rw /sysroot | ||
#ExecStart=/usr/sbin/restorecon -R /boot | ||
ExecStart=/usr/libexec/coreos-fix-labels | ||
RemainAfterExit=yes | ||
MountFlags=slave | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/bash | ||
|
||
echo "Remounting /boot as rw" | ||
/usr/bin/mount -o remount,rw /boot | ||
|
||
echo "Restoring SELinux labels" | ||
/usr/sbin/restorecon -R /boot | ||
|
||
|
||
/usr/bin/mount -o remount,rw /sysroot | ||
/usr/bin/chcon -t root_t -R /sysroot |