blob: 8b797662c1166cf8601a4df220dc516195f7c694 [file] [log] [blame]
Matt Mower556411f2013-02-17 16:52:44 -06001import /init.recovery.${ro.hardware}.rc
2
Colin Crossdd6a0412010-05-14 13:42:20 -07003on early-init
4 start ueventd
Todd Poynor2f2c9882013-06-04 13:11:44 -07005 start healthd
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -08006
7on init
Doug Zongker55d65422014-01-14 09:50:35 -08008 export PATH /sbin:/system/bin
Dees_Troy51a0e822012-09-05 15:24:24 -04009 export LD_LIBRARY_PATH .:/sbin
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080010 export ANDROID_ROOT /system
11 export ANDROID_DATA /data
12 export EXTERNAL_STORAGE /sdcard
13
Matt Mower556411f2013-02-17 16:52:44 -060014 mkdir /boot
15 mkdir /recovery
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080016 mkdir /system
17 mkdir /data
18 mkdir /cache
Doug Zongker55d65422014-01-14 09:50:35 -080019 mount tmpfs tmpfs /tmp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080020
Matt Mower556411f2013-02-17 16:52:44 -060021 chown root shell /tmp
22 chmod 0775 /tmp
23
Benoit Goby689e06b2014-02-19 17:41:02 -080024on 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 Mower556411f2013-02-17 16:52:44 -060029 write /sys/class/android_usb/android0/enable 0
30 write /sys/class/android_usb/android0/idVendor 18D1
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -040031 write /sys/class/android_usb/android0/idProduct D002
Benoit Goby689e06b2014-02-19 17:41:02 -080032 write /sys/class/android_usb/android0/f_ffs/aliases adb
Matt Mower556411f2013-02-17 16:52:44 -060033 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 Projectc24a8e62009-03-03 19:28:42 -080039on boot
40
41 ifup lo
42 hostname localhost
43 domainname localdomain
44
45 class_start default
46
Doug Zongker77ea71d2013-08-30 12:20:16 -070047on property:sys.powerctl=*
48 powerctl ${sys.powerctl}
49
Jason Riordan26ff4c02014-01-16 22:44:15 -050050on 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
55on 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 bigbiffc7eee6f2014-09-02 18:59:01 -040060on 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
65on 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
72on 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 Crossdd6a0412010-05-14 13:42:20 -070079service ueventd /sbin/ueventd
80 critical
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080081
Todd Poynor2f2c9882013-06-04 13:11:44 -070082service healthd /sbin/healthd -n
83 critical
84
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080085service recovery /sbin/recovery
86
87service adbd /sbin/adbd recovery
Kenny Rootecc76ba2010-06-28 09:01:22 -070088 disabled
Doug Zongkercc2958f2013-09-11 13:24:32 -070089 socket adbd stream 660 system system
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080090
Mike Lockwood718a2f72011-06-29 10:22:04 -040091# Always start adbd on userdebug and eng builds
92on property:ro.debuggable=1
Dees_Troy0cd4cc22013-06-09 20:56:38 +000093 #write /sys/class/android_usb/android0/enable 1
94 #start adbd
Dees_Troy51a0e822012-09-05 15:24:24 -040095 setprop service.adb.root 1
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080096
Mike Lockwood718a2f72011-06-29 10:22:04 -040097# Restart adbd so it can run as root
Doug Zongkerfb04b872011-06-23 15:30:34 -070098on property:service.adb.root=1
99 write /sys/class/android_usb/android0/enable 0
100 restart adbd
Benoit Goby689e06b2014-02-19 17:41:02 -0800101 write /sys/class/android_usb/android0/enable 1