Reland "Set the log callback earlier for showing system property set denials"

PropertyInit loads the build.prop files and set the system properties.
Set the SELinux log callback before that to show the avc denials for debugging.

Test: $ make init_system
      Push this module and ensure system property set denials are shown during boot
Bug: 185920634
Bug: 211547922
Change-Id: If9f34d469d3da2ebdfe64bb611de85a3ca37e000
This commit is contained in:
Alex Hong 2022-12-20 22:08:43 +08:00
parent 1946945ac0
commit 057b94215a
1 changed files with 2 additions and 1 deletions

View File

@ -952,6 +952,8 @@ int SecondStageMain(int argc, char** argv) {
InitKernelLogging(argv);
LOG(INFO) << "init second stage started!";
SelinuxSetupKernelLogging();
// Update $PATH in the case the second stage init is newer than first stage init, where it is
// first set.
if (setenv("PATH", _PATH_DEFPATH, 1) != 0) {
@ -1012,7 +1014,6 @@ int SecondStageMain(int argc, char** argv) {
MountExtraFilesystems();
// Now set up SELinux for second stage.
SelinuxSetupKernelLogging();
SelabelInitialize();
SelinuxRestoreContext();