Matt Mower | 556411f | 2013-02-17 16:52:44 -0600 | [diff] [blame] | 1 | import /init.recovery.${ro.hardware}.rc |
| 2 | |
Colin Cross | dd6a041 | 2010-05-14 13:42:20 -0700 | [diff] [blame] | 3 | on early-init |
| 4 | start ueventd |
Todd Poynor | 2f2c988 | 2013-06-04 13:11:44 -0700 | [diff] [blame] | 5 | start healthd |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 6 | |
| 7 | on init |
Doug Zongker | 55d6542 | 2014-01-14 09:50:35 -0800 | [diff] [blame] | 8 | export PATH /sbin:/system/bin |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 9 | export LD_LIBRARY_PATH .:/sbin |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 10 | export ANDROID_ROOT /system |
| 11 | export ANDROID_DATA /data |
| 12 | export EXTERNAL_STORAGE /sdcard |
| 13 | |
Matt Mower | 556411f | 2013-02-17 16:52:44 -0600 | [diff] [blame] | 14 | mkdir /boot |
| 15 | mkdir /recovery |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 16 | mkdir /system |
| 17 | mkdir /data |
| 18 | mkdir /cache |
Doug Zongker | 55d6542 | 2014-01-14 09:50:35 -0800 | [diff] [blame] | 19 | mount tmpfs tmpfs /tmp |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 20 | |
Matt Mower | 556411f | 2013-02-17 16:52:44 -0600 | [diff] [blame] | 21 | chown root shell /tmp |
| 22 | chmod 0775 /tmp |
| 23 | |
Benoit Goby | 689e06b | 2014-02-19 17:41:02 -0800 | [diff] [blame] | 24 | on fs |
| 25 | mkdir /dev/usb-ffs 0770 shell shell |
| 26 | mkdir /dev/usb-ffs/adb 0770 shell shell |
| 27 | mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 |
| 28 | |
Matt Mower | 556411f | 2013-02-17 16:52:44 -0600 | [diff] [blame] | 29 | write /sys/class/android_usb/android0/enable 0 |
| 30 | write /sys/class/android_usb/android0/idVendor 18D1 |
bigbiff bigbiff | c7eee6f | 2014-09-02 18:59:01 -0400 | [diff] [blame] | 31 | write /sys/class/android_usb/android0/idProduct D002 |
Benoit Goby | 689e06b | 2014-02-19 17:41:02 -0800 | [diff] [blame] | 32 | write /sys/class/android_usb/android0/f_ffs/aliases adb |
Matt Mower | 556411f | 2013-02-17 16:52:44 -0600 | [diff] [blame] | 33 | write /sys/class/android_usb/android0/functions adb |
| 34 | write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer} |
| 35 | write /sys/class/android_usb/android0/iProduct ${ro.product.model} |
| 36 | write /sys/class/android_usb/android0/iSerial ${ro.serialno} |
| 37 | |
| 38 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 39 | on boot |
| 40 | |
| 41 | ifup lo |
| 42 | hostname localhost |
| 43 | domainname localdomain |
| 44 | |
| 45 | class_start default |
| 46 | |
Doug Zongker | 77ea71d | 2013-08-30 12:20:16 -0700 | [diff] [blame] | 47 | on property:sys.powerctl=* |
| 48 | powerctl ${sys.powerctl} |
| 49 | |
Jason Riordan | 26ff4c0 | 2014-01-16 22:44:15 -0500 | [diff] [blame] | 50 | on property:sys.storage.ums_enabled=1 |
| 51 | write /sys/class/android_usb/android0/enable 0 |
| 52 | write /sys/class/android_usb/android0/functions adb,mass_storage |
| 53 | write /sys/class/android_usb/android0/enable 1 |
| 54 | |
| 55 | on property:sys.storage.ums_enabled=0 |
| 56 | write /sys/class/android_usb/android0/enable 0 |
| 57 | write /sys/class/android_usb/android0/functions adb |
| 58 | write /sys/class/android_usb/android0/enable ${service.adb.root} |
| 59 | |
bigbiff bigbiff | c7eee6f | 2014-09-02 18:59:01 -0400 | [diff] [blame] | 60 | on property:sys.usb.config=none |
| 61 | stop adbd |
| 62 | write /sys/class/android_usb/android0/enable 0 |
| 63 | write /sys/class/android_usb/android0/bDeviceClass 0 |
| 64 | |
| 65 | on property:sys.usb.config=mtp,adb |
| 66 | stop adbd |
| 67 | write /sys/class/android_usb/android0/enable 0 |
| 68 | write /sys/class/android_usb/android0/functions mtp,adb |
| 69 | write /sys/class/android_usb/android0/enable 1 |
| 70 | start adbd |
| 71 | |
| 72 | on property:sys.usb.config=adb |
| 73 | stop adbd |
| 74 | write /sys/class/android_usb/android0/enable 0 |
| 75 | write /sys/class/android_usb/android0/functions adb |
| 76 | write /sys/class/android_usb/android0/enable ${service.adb.root} |
| 77 | start adbd |
| 78 | |
Colin Cross | dd6a041 | 2010-05-14 13:42:20 -0700 | [diff] [blame] | 79 | service ueventd /sbin/ueventd |
| 80 | critical |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 81 | |
Todd Poynor | 2f2c988 | 2013-06-04 13:11:44 -0700 | [diff] [blame] | 82 | service healthd /sbin/healthd -n |
| 83 | critical |
| 84 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 85 | service recovery /sbin/recovery |
| 86 | |
| 87 | service adbd /sbin/adbd recovery |
Kenny Root | ecc76ba | 2010-06-28 09:01:22 -0700 | [diff] [blame] | 88 | disabled |
Doug Zongker | cc2958f | 2013-09-11 13:24:32 -0700 | [diff] [blame] | 89 | socket adbd stream 660 system system |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 90 | |
Mike Lockwood | 718a2f7 | 2011-06-29 10:22:04 -0400 | [diff] [blame] | 91 | # Always start adbd on userdebug and eng builds |
| 92 | on property:ro.debuggable=1 |
Dees_Troy | 0cd4cc2 | 2013-06-09 20:56:38 +0000 | [diff] [blame] | 93 | #write /sys/class/android_usb/android0/enable 1 |
| 94 | #start adbd |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 95 | setprop service.adb.root 1 |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 96 | |
Mike Lockwood | 718a2f7 | 2011-06-29 10:22:04 -0400 | [diff] [blame] | 97 | # Restart adbd so it can run as root |
Doug Zongker | fb04b87 | 2011-06-23 15:30:34 -0700 | [diff] [blame] | 98 | on property:service.adb.root=1 |
| 99 | write /sys/class/android_usb/android0/enable 0 |
| 100 | restart adbd |
Benoit Goby | 689e06b | 2014-02-19 17:41:02 -0800 | [diff] [blame] | 101 | write /sys/class/android_usb/android0/enable 1 |