aboutsummaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorMike Kasick <mike@kasick.org>2012-01-26 16:05:56 -0500
committerMike Kasick <mike@kasick.org>2012-01-26 16:05:56 -0500
commit059db9bfb6ba2104aded621c8d309298cc89fa82 (patch)
tree687987ae945e560a14aa48bed5c337299347dd34 /etc
parente510810c71b5d4eb4d779c0db2d131d2b1b556af (diff)
downloadbootable_recovery-059db9bfb6ba2104aded621c8d309298cc89fa82.zip
bootable_recovery-059db9bfb6ba2104aded621c8d309298cc89fa82.tar.gz
bootable_recovery-059db9bfb6ba2104aded621c8d309298cc89fa82.tar.bz2
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
Diffstat (limited to 'etc')
-rw-r--r--etc/init.rc6
1 files 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