简体   繁体   中英

/system/bin/sh is missing in Android recovery mode

I get the following message in Android recovery mode adb when I try to shell:

exec '/system/bin/sh' failed: No such file or directory (2)

However, I have a sh in /sbin. I tried to recompile adb but am not up to the task. I need to use adb v1.0.31. I was wondering if anyone has had a similar problem and has recompiled adb to look for sh in /sbin. If so I would greatly appreciate a copy of the adb program.

The Android file system in the recovery context is extremely limited in some cases. Most files are removed, including the interpreter:

/system/bin/linker64

or

/system/bin/linker

Without the interpreter you cannot run sh, which is linked against it. Run this in your Linux PC where you compile your AOSP (out folder) to find out:

/system/bin$ readelf -d --program-headers sh
...
[Requesting program interpreter: /system/bin/linker64]
...
0x0000000000000001 (NEEDED)             Shared library: [libc++.so]
0x0000000000000001 (NEEDED)             Shared library: [libdl.so]
0x0000000000000001 (NEEDED)             Shared library: [libc.so]

When sh is run it will look for /system/bin/linker, but it won't find it and say that the file does not exist.

If you need adb support in the recovery mode, you have to copy the interpreter in the recovery file system and all the other shared libraries (/system/lib) or binaries that depend on it.

I'd rather look for a different solution for your needs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM