Skip to content

Commit

Permalink
Make sure / is writable when migrating to /etc/selinux/.autorelabel
Browse files Browse the repository at this point in the history
  • Loading branch information
Vogtinator committed Sep 26, 2024
1 parent c38fc68 commit bf37e10
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions selinux/98selinux-microos/selinux-microos-relabel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ rd_microos_relabel()
return $ret
}

if test -e "$NEWROOT"/.autorelabel -a "$NEWROOT"/.autorelabel -nt "$NEWROOT"/etc/selinux/.relabelled ; then
cp -a "$NEWROOT"/.autorelabel "$NEWROOT"/etc/selinux/.autorelabel
if [ -e "$NEWROOT"/.autorelabel ] && [ "$NEWROOT"/.autorelabel -nt "$NEWROOT"/etc/selinux/.relabelled ]; then
mount -o remount,rw "$NEWROOT" || return 1
cp -a "$NEWROOT"/.autorelabel "$NEWROOT"/etc/selinux/.autorelabel || return 1
rm -f "$NEWROOT"/.autorelabel 2>/dev/null
fi

Expand Down

0 comments on commit bf37e10

Please sign in to comment.