I have few noob questions about the system/bin and system/xbin directory in Android M.

First, what is the file inside this two directories?

Next, in system/bin, the is some file looks like

-rwxr-xr-x root     shell      117136 2008-12-31 11:30 test-platform
lrwxr-xr-x root     shell             2008-12-31 11:30 time -> toybox
lrwxr-xr-x root     shell             2008-12-31 11:30 timeout -> toybox
lrwxr-xr-x root     shell             2008-12-31 11:30 umount -> toybox

I know toybox is the app like busybox, a collection of unix command, but what does the -> means here?

Third, I am getting the error /system/bin/sh: busybox: not found, is this shows that busybox is not installed? I thought toybox already serving the same function as busybox?

Appreciate if anyone could clarify my questions, thanks!

  1. the -> indicates this is a symbolic link. That's how Busybox (and similar apps) work, so other processes can refer to them by the "full fledged name" of the component they need to call.
  2. There are different "busyboxes". The original Busybox has a binary called busybox – yours has a binary called toybox. That won't matter if one of those symlinks is addressed – but if some process tries to call busybox directly, it of course cannot find it if it's not there. To work around that, you could create another symlink to toybox: ln -s /system/bin/toybox /system/bin/busybox (in order to do that you need root and mount the /system partition read/write).
  • still fail to get busybox after symbolic link created. /system/bin/sh: busybox: not found – Jeff Pang Nov 17 '17 at 8:12
  • Where do you get those errors? What are you doing? Hard to tell how to fix what one doesn't know existing. You might rather need to fix the script causing those errors. Btw: If busybox is still "not found", did creating the link succeed at all? What does which busybox give, and what does ls -l /system/bin | grep busybox show? – Izzy Nov 17 '17 at 10:08
  • I have tried which busybox which give nothing on terminal. ls -l /system/bin | grep busybox return busybox -> system/bin/toybox which means symbolic link created successfully? TQ – Jeff Pang Nov 19 '17 at 5:42
  • That's strange. Yes, it seems the symlink was created correctly but busybox is still not found. Can you verify that /system/bin is in your PATH (echo $PATH)? I guess the easiest way would be installing a proper busybox on your device (just checked: mine has both toybox AND busybox as well). Due to the nature of both working (they check how they're called to decide what they're to do – so Toybox might get confused when called as busybox). – Izzy Nov 19 '17 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.