platform: imx6q
os: Android5.1
branch: l5.1.1_2.1.0-ga
原生source code是无法通过adb进入recovery mode的,提示如下log。
exec "/system/bin/sh": No such file or directory.
因为recovery下system fs是没有挂载的,可以通过下面修改使用/sbin/sh来进入adb shell.
1. 修改 android/system/core/adb/services.c
kris@PT-server:~/myandroid/system/core$ git diff
diff --git a/adb/services.c b/adb/services.c
index 21b08dc..9f18553 100644
--- a/adb/services.c
+++ b/adb/services.c
@@ -301,8 +301,10 @@ static int create_subproc_raw(const char *cmd, const char *arg0, const char *arg
#if ADB_HOST
#define SHELL_COMMAND "/bin/sh"
+#define SHELL_COMMAND1 "/bin/sh"
#else
#define SHELL_COMMAND "/system/bin/sh"
+#define SHELL_COMMAND1 "/sbin/sh"
#endif