blob: 0a4c6e9dfd10e0c461c687db9d9da4a74e1bb89c [file] [log] [blame]
Colin Crossf510f062012-08-08 13:06:26 -07001import /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
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -08008 export ANDROID_ROOT /system
9 export ANDROID_DATA /data
10 export EXTERNAL_STORAGE /sdcard
11
12 symlink /system/etc /etc
13
14 mkdir /sdcard
15 mkdir /system
16 mkdir /data
17 mkdir /cache
Doug Zongker075ad802014-06-26 15:35:51 -070018 mkdir /sideload
Doug Zongker075ef322014-01-14 09:50:35 -080019 mount tmpfs tmpfs /tmp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080020
Doug Zongker703ed152012-03-19 15:52:03 -070021 chown root shell /tmp
22 chmod 0775 /tmp
23
Colin Cross22bcf972014-06-24 13:43:39 -070024 write /proc/sys/kernel/panic_on_oops 1
Jesse Zhao5bf74b22015-01-08 15:59:23 -080025 write /proc/sys/vm/max_map_count 1000000
Colin Cross22bcf972014-06-24 13:43:39 -070026
Benoit Goby1b964112014-02-19 17:41:02 -080027on fs
28 mkdir /dev/usb-ffs 0770 shell shell
29 mkdir /dev/usb-ffs/adb 0770 shell shell
30 mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
31
Doug Zongker66392482012-01-10 12:16:04 -080032 write /sys/class/android_usb/android0/enable 0
33 write /sys/class/android_usb/android0/idVendor 18D1
34 write /sys/class/android_usb/android0/idProduct D001
Benoit Goby1b964112014-02-19 17:41:02 -080035 write /sys/class/android_usb/android0/f_ffs/aliases adb
Doug Zongker66392482012-01-10 12:16:04 -080036 write /sys/class/android_usb/android0/functions adb
37 write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
38 write /sys/class/android_usb/android0/iProduct ${ro.product.model}
39 write /sys/class/android_usb/android0/iSerial ${ro.serialno}
40
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080041on boot
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080042 ifup lo
43 hostname localhost
44 domainname localdomain
45
46 class_start default
47
Riley Andrewse739d7e2014-06-24 16:29:16 -070048# Load properties from /system/ + /factory after fs mount.
Paul Lawrence392879e2015-07-07 17:05:39 +000049on load_all_props_action
50 load_all_props
Riley Andrewse739d7e2014-06-24 16:29:16 -070051
JP Abgrall9eb8c8b2014-10-20 20:02:57 -070052on firmware_mounts_complete
53 rm /dev/.booting
54
Riley Andrewse739d7e2014-06-24 16:29:16 -070055# Mount filesystems and start core system services.
56on late-init
57 trigger early-fs
58 trigger fs
59 trigger post-fs
60 trigger post-fs-data
61
62 # Load properties from /system/ + /factory after fs mount. Place
63 # this in another action so that the load will be scheduled after the prior
64 # issued fs triggers have completed.
Paul Lawrence392879e2015-07-07 17:05:39 +000065 trigger load_all_props_action
Riley Andrewse739d7e2014-06-24 16:29:16 -070066
JP Abgrall9eb8c8b2014-10-20 20:02:57 -070067 # Remove a file to wake up anything waiting for firmware
68 trigger firmware_mounts_complete
69
Riley Andrewse739d7e2014-06-24 16:29:16 -070070 trigger early-boot
71 trigger boot
72
Doug Zongker77ea71d2013-08-30 12:20:16 -070073on property:sys.powerctl=*
74 powerctl ${sys.powerctl}
75
Colin Crossdd6a0412010-05-14 13:42:20 -070076service ueventd /sbin/ueventd
77 critical
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050078 seclabel u:r:ueventd:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080079
Todd Poynorbe968092013-09-13 16:34:12 -070080service healthd /sbin/healthd -r
Todd Poynor2f2c9882013-06-04 13:11:44 -070081 critical
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050082 seclabel u:r:healthd:s0
Todd Poynor2f2c9882013-06-04 13:11:44 -070083
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080084service recovery /sbin/recovery
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050085 seclabel u:r:recovery:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080086
Nick Kralevichc52c5b82014-01-18 09:22:50 -080087service adbd /sbin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery
Kenny Rootecc76ba2010-06-28 09:01:22 -070088 disabled
Doug Zongkercc2958f2013-09-11 13:24:32 -070089 socket adbd stream 660 system system
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050090 seclabel u:r:adbd:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080091
Mike Lockwood718a2f72011-06-29 10:22:04 -040092# Always start adbd on userdebug and eng builds
93on property:ro.debuggable=1
Mike Lockwood7e58b652011-06-19 02:52:01 -040094 write /sys/class/android_usb/android0/enable 1
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080095 start adbd
96
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
101 write /sys/class/android_usb/android0/enable 1