Loading init/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ cc_library_static { "ueventd_parser.cpp", "util.cpp", ], whole_static_libs: ["libcap"], whole_static_libs: ["libcap", "com.android.sysprop.apex"], header_libs: ["bootimg_headers"], proto: { type: "lite", Loading init/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ LOCAL_STATIC_LIBRARIES := \ libselinux \ libcap \ libgsi \ libcom.android.sysprop.apex \ LOCAL_SANITIZE := signed-integer-overflow # First stage init is weird: it may start without stdout/stderr, and no /proc. Loading init/mount_namespace.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <string> #include <vector> #include <ApexProperties.sysprop.h> #include <android-base/file.h> #include <android-base/logging.h> #include <android-base/properties.h> Loading Loading @@ -132,9 +133,9 @@ static bool BindMountBionic(const std::string& linker_source, const std::string& return true; } static bool IsBionicUpdatable() { static bool result = android::base::GetBoolProperty("ro.apex.IsBionicUpdatable", false); return result; static bool IsApexUpdatable() { static bool updatable = android::sysprop::ApexProperties::updatable().value_or(false); return updatable; } static android::base::unique_fd bootstrap_ns_fd; Loading Loading @@ -187,7 +188,7 @@ bool SetupMountNamespaces() { // bind-mounted. In the namespace for post-apexd processes, the bionic from // the runtime APEX is bind-mounted. bool success = true; if (IsBionicUpdatable() && !IsRecoveryMode()) { if (IsApexUpdatable() && !IsRecoveryMode()) { // Creating a new namespace by cloning, saving, and switching back to // the original namespace. if (unshare(CLONE_NEWNS) == -1) { Loading Loading @@ -244,7 +245,7 @@ bool SetupRuntimeBionic() { return true; } // Bind-mount bionic from the runtime APEX since it is now available. Note // that in case of IsBionicUpdatable() == false, these mounts are over the // that in case of IsApexUpdatable() == false, these mounts are over the // existing existing bind mounts for the bootstrap bionic, which effectively // becomes hidden. if (!BindMountBionic(kRuntimeLinkerPath, kRuntimeBionicLibsDir, kLinkerMountPoint, Loading @@ -264,7 +265,7 @@ bool SwitchToBootstrapMountNamespaceIfNeeded() { return true; } if (bootstrap_ns_id != GetMountNamespaceId() && bootstrap_ns_fd.get() != -1 && IsBionicUpdatable()) { IsApexUpdatable()) { if (setns(bootstrap_ns_fd.get(), CLONE_NEWNS) == -1) { PLOG(ERROR) << "Failed to switch to bootstrap mount namespace."; return false; Loading Loading
init/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ cc_library_static { "ueventd_parser.cpp", "util.cpp", ], whole_static_libs: ["libcap"], whole_static_libs: ["libcap", "com.android.sysprop.apex"], header_libs: ["bootimg_headers"], proto: { type: "lite", Loading
init/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ LOCAL_STATIC_LIBRARIES := \ libselinux \ libcap \ libgsi \ libcom.android.sysprop.apex \ LOCAL_SANITIZE := signed-integer-overflow # First stage init is weird: it may start without stdout/stderr, and no /proc. Loading
init/mount_namespace.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <string> #include <vector> #include <ApexProperties.sysprop.h> #include <android-base/file.h> #include <android-base/logging.h> #include <android-base/properties.h> Loading Loading @@ -132,9 +133,9 @@ static bool BindMountBionic(const std::string& linker_source, const std::string& return true; } static bool IsBionicUpdatable() { static bool result = android::base::GetBoolProperty("ro.apex.IsBionicUpdatable", false); return result; static bool IsApexUpdatable() { static bool updatable = android::sysprop::ApexProperties::updatable().value_or(false); return updatable; } static android::base::unique_fd bootstrap_ns_fd; Loading Loading @@ -187,7 +188,7 @@ bool SetupMountNamespaces() { // bind-mounted. In the namespace for post-apexd processes, the bionic from // the runtime APEX is bind-mounted. bool success = true; if (IsBionicUpdatable() && !IsRecoveryMode()) { if (IsApexUpdatable() && !IsRecoveryMode()) { // Creating a new namespace by cloning, saving, and switching back to // the original namespace. if (unshare(CLONE_NEWNS) == -1) { Loading Loading @@ -244,7 +245,7 @@ bool SetupRuntimeBionic() { return true; } // Bind-mount bionic from the runtime APEX since it is now available. Note // that in case of IsBionicUpdatable() == false, these mounts are over the // that in case of IsApexUpdatable() == false, these mounts are over the // existing existing bind mounts for the bootstrap bionic, which effectively // becomes hidden. if (!BindMountBionic(kRuntimeLinkerPath, kRuntimeBionicLibsDir, kLinkerMountPoint, Loading @@ -264,7 +265,7 @@ bool SwitchToBootstrapMountNamespaceIfNeeded() { return true; } if (bootstrap_ns_id != GetMountNamespaceId() && bootstrap_ns_fd.get() != -1 && IsBionicUpdatable()) { IsApexUpdatable()) { if (setns(bootstrap_ns_fd.get(), CLONE_NEWNS) == -1) { PLOG(ERROR) << "Failed to switch to bootstrap mount namespace."; return false; Loading