Merge "Revert "use /system/bin/sh for new vendor partition"" into main am: 44890f9e52

Original change: https://android-review.googlesource.com/c/platform/bionic/+/2967125

Change-Id: I9c32037ef8076875c4c72dbd6cf47fab41e9ffa2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jernej Virag 2024-02-16 10:49:56 +00:00 committed by Automerger Merge Worker
commit 2b11b65adc

View file

@ -29,10 +29,8 @@
#include "private/__bionic_get_shell_path.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/cdefs.h>
#include <sys/system_properties.h>
#include <unistd.h>
#define VENDOR_PREFIX "/vendor/"
@ -42,15 +40,6 @@ static const char* init_sh_path() {
// For the host Bionic, use the standard /bin/sh
return "/bin/sh";
#else
// Since 202404, we use /system/bin/sh for all domains.
char vendor_api_level[PROP_VALUE_MAX];
if (__system_property_get("ro.board.api_level", vendor_api_level) > 0) {
int api_level = atoi(vendor_api_level);
if (api_level >= 202404) {
return "/system/bin/sh";
}
}
// To keep the old behavior for devices under GRF.
// Look for /system or /vendor prefix.
char exe_path[strlen(VENDOR_PREFIX)];
ssize_t len = readlink("/proc/self/exe", exe_path, sizeof(exe_path));