1import /init.recovery.${ro.hardware}.rc
2
3on early-init
4    start ueventd
5    start healthd
6
7on init
8    export PATH /sbin:/system/bin
9    export ANDROID_ROOT /system
10    export ANDROID_DATA /data
11    export EXTERNAL_STORAGE /sdcard
12
13    symlink /system/etc /etc
14
15    mkdir /sdcard
16    mkdir /system
17    mkdir /data
18    mkdir /cache
19    mkdir /sideload
20    mount tmpfs tmpfs /tmp
21
22    chown root shell /tmp
23    chmod 0775 /tmp
24
25    write /proc/sys/kernel/panic_on_oops 1
26    write /proc/sys/vm/max_map_count 1000000
27
28on fs
29    mkdir /dev/usb-ffs 0770 shell shell
30    mkdir /dev/usb-ffs/adb 0770 shell shell
31    mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
32
33    write /sys/class/android_usb/android0/enable 0
34    write /sys/class/android_usb/android0/idVendor 18D1
35    write /sys/class/android_usb/android0/idProduct D001
36    write /sys/class/android_usb/android0/f_ffs/aliases adb
37    write /sys/class/android_usb/android0/functions adb
38    write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
39    write /sys/class/android_usb/android0/iProduct ${ro.product.model}
40    write /sys/class/android_usb/android0/iSerial ${ro.serialno}
41
42on boot
43    ifup lo
44    hostname localhost
45    domainname localdomain
46
47    class_start default
48
49# Load properties from /system/ + /factory after fs mount.
50on load_all_props_action
51    load_all_props
52
53on firmware_mounts_complete
54   rm /dev/.booting
55
56# Mount filesystems and start core system services.
57on late-init
58    trigger early-fs
59    trigger fs
60    trigger post-fs
61    trigger post-fs-data
62
63    # Load properties from /system/ + /factory after fs mount. Place
64    # this in another action so that the load will be scheduled after the prior
65    # issued fs triggers have completed.
66    trigger load_all_props_action
67
68    # Remove a file to wake up anything waiting for firmware
69    trigger firmware_mounts_complete
70
71    trigger early-boot
72    trigger boot
73
74on property:sys.powerctl=*
75   powerctl ${sys.powerctl}
76
77service ueventd /sbin/ueventd
78    critical
79    seclabel u:r:ueventd:s0
80
81service healthd /sbin/healthd -r
82    critical
83    seclabel u:r:healthd:s0
84
85service recovery /sbin/recovery
86    seclabel u:r:recovery:s0
87
88service adbd /sbin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery
89    disabled
90    socket adbd stream 660 system system
91    seclabel u:r:adbd:s0
92
93# Always start adbd on userdebug and eng builds
94on property:ro.debuggable=1
95    write /sys/class/android_usb/android0/enable 1
96    start adbd
97
98# Restart adbd so it can run as root
99on property:service.adb.root=1
100    write /sys/class/android_usb/android0/enable 0
101    restart adbd
102    write /sys/class/android_usb/android0/enable 1
103