Advertisement
Guest User

Untitled

a guest
Jul 19th, 2023
59
0
67 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. diff --git a/init/init.cpp b/init/init.cpp
  2. index 9377f0743..e66ef9e3e 100644
  3. --- a/init/init.cpp
  4. +++ b/init/init.cpp
  5. @@ -795,6 +795,10 @@ int SecondStageMain(int argc, char** argv) {
  6. if (!SetupMountNamespaces()) {
  7. PLOG(FATAL) << "SetupMountNamespaces failed";
  8. }
  9. +#else
  10. + if (!SetupFlattenedApexes()) {
  11. + LOG(INFO) << "SetupFlattenedApexes failed";
  12. + }
  13. #endif
  14.  
  15. InitializeSubcontext();
  16. diff --git a/init/mount_namespace.cpp b/init/mount_namespace.cpp
  17. index 3875adac3..fabf319e3 100644
  18. --- a/init/mount_namespace.cpp
  19. +++ b/init/mount_namespace.cpp
  20. @@ -300,11 +300,16 @@ bool SetupMountNamespaces() {
  21. return success;
  22. }
  23.  
  24. +bool SetupFlattenedApexes() {
  25. + return ActivateFlattenedApexesIfPossible();
  26. +}
  27. +
  28. bool SwitchToDefaultMountNamespace() {
  29. if (IsRecoveryMode()) {
  30. // we don't have multiple namespaces in recovery mode
  31. return true;
  32. }
  33. +#ifdef DISABLED_FOR_HYBRIS_SUPPORT
  34. if (default_ns_id != GetMountNamespaceId()) {
  35. if (setns(default_ns_fd.get(), CLONE_NEWNS) == -1) {
  36. PLOG(ERROR) << "Failed to switch back to the default mount namespace.";
  37. @@ -318,6 +323,12 @@ bool SwitchToDefaultMountNamespace() {
  38. }
  39.  
  40. LOG(INFO) << "Switched to default mount namespace";
  41. +#else
  42. + if (auto result = MountLinkerConfigForDefaultNamespace(); !result.ok()) {
  43. + LOG(ERROR) << result.error();
  44. + return false;
  45. + }
  46. +#endif
  47. return true;
  48. }
  49.  
  50. diff --git a/init/mount_namespace.h b/init/mount_namespace.h
  51. index c41a449f3..d72736e4d 100644
  52. --- a/init/mount_namespace.h
  53. +++ b/init/mount_namespace.h
  54. @@ -22,6 +22,7 @@ namespace init {
  55. bool SetupMountNamespaces();
  56. bool SwitchToDefaultMountNamespace();
  57. bool SwitchToBootstrapMountNamespaceIfNeeded();
  58. +bool SetupFlattenedApexes();
  59.  
  60. } // namespace init
  61. } // namespace android
  62. diff --git a/rootdir/init.rc b/rootdir/init.rc
  63. index ef388a63d..da44c1b4d 100644
  64. --- a/rootdir/init.rc
  65. +++ b/rootdir/init.rc
  66. @@ -1048,8 +1048,8 @@ service ueventd /system/bin/ueventd
  67. class core
  68. critical
  69. seclabel u:r:ueventd:s0
  70. - shutdown critical
  71. #Not used by Mer
  72. +# shutdown critical
  73. disabled
  74.  
  75. service console /system/bin/sh
  76.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement