From 059db9bfb6ba2104aded621c8d309298cc89fa82 Mon Sep 17 00:00:00 2001 From: Mike Kasick Date: Thu, 26 Jan 2012 16:05:56 -0500 Subject: [PATCH] Always run adbd as root in recovery. At present, invoking "adb shell" while in recovery results in: - exec '/system/bin/sh' failed: No such file or directory (2) - "adb shell" should invoke /sbin/sh, but cannot as /sbin and /sbin/recovery lack other-user execute permission. Invoking "adb root" to restart adbd as root _does_ work, however this behavior may not be intuitive to users who encounter the above error. The solution implemented here is to always run adbd as root in recovery, so it has permission to run /sbin/sh. Furthemore, user shells in recovery are not particularly useful and "su" doesn't exist, thus "adb root" is likely to be invoked anyways. Change-Id: Iaaa25090e85d970e9a076fef068f5fae8202ab0b --- etc/init.rc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etc/init.rc b/etc/init.rc index 0c76fb7..832b864 100644 --- a/etc/init.rc +++ b/etc/init.rc @@ -36,16 +36,18 @@ service adbd /sbin/adbd recovery disabled # Always start adbd on userdebug and eng builds +# In recovery, always run adbd as root. on property:ro.debuggable=1 write /sys/class/android_usb/android0/enable 0 write /sys/class/android_usb/android0/idVendor 18D1 write /sys/class/android_usb/android0/idProduct D001 write /sys/class/android_usb/android0/functions adb - write /sys/class/android_usb/android0/enable 1 + #write /sys/class/android_usb/android0/enable 1 write /sys/class/android_usb/android0/iManufacturer $ro.product.manufacturer write /sys/class/android_usb/android0/iProduct $ro.product.model write /sys/class/android_usb/android0/iSerial $ro.serialno - start adbd + #start adbd + setprop service.adb.root 1 # Restart adbd so it can run as root on property:service.adb.root=1