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