Broken busybox can cause DHCP timeouts on Android

Apparently, when your Android device’s busybox installation gets broken for whatever reason, this doesn’t cause your phone to come to a screeching, grinding halt. The breakage is much more subtle.

For me, the only symptoms were:

  • the standard busybox installers available on Android market couldn’t install busybox (this may not be related, who knows!)
  • wifi stopped working - the phone couldn’t connect to the AP

I thought maybe there was interference, so even though the signal strength was classified as “excellent” maybe it wasn’t really, and that’s why it couldn’t connect. Well, standing beside the AP didn’t help.

The phone didn’t give any error messages when connecting failed, it just went into a loop of trying to connect again (or, sometimes, it gave up). So, I checked with aLogCat for errors, and saw the DHCP lease request go out, and then time out, apparently with no response. So, I looked at the router. No misconfiguration, and other devices could connect OK.┬áMaking no progress, I gave up for the day.

I finally found just one helpful post suggesting that a broken busybox install can make wifi stop working – not stop working altogether, just make it look like the DHCP request timed out. The poster also reports that Titanium Backup didn’t list installed applications, but I didn’t observe that error. Well, reinstalling busybox manually fixed all ills.

Installing busybox manually

Now, download the right busybox binary for your phone – for me, I knew the processor was ARM, so I guessed that “busybox-armv6l” would work (and it did). If there’s an easy way to know which one to pick, I haven’t found it. Good luck!

Now, boot the phone into recovery mode. Once the phone reboots, go into “mounts and storage” and mount both /sdcard and /system.

Push the binary you downloaded onto the sdcard partition:

adb push ~/Downloads/busybox-armv6l /sdcard/busybox

Now, open a shell to move it into place and install it:

$ adb shell
# cp /sdcard/busybox /system/bin/busybox
# chmod +x /system/bin/busybox
# /system/bin/busybox --install /system/bin

You might want to install it into /system/xbin instead or in addition to /system/bin.

Now, reboot, and you’re finished.