blob: 5915b8d8013c99a9a1de9fea61aa87b6bb8bd860 [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
Alex Deymo080f5222016-03-02 14:21:02 -08004 # Set the security context of /postinstall if present.
5 restorecon /postinstall
6
Colin Crossdd6a0412010-05-14 13:42:20 -07007 start ueventd
Todd Poynor2f2c9882013-06-04 13:11:44 -07008 start healthd
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -08009
10on init
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080011 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
Doug Zongker075ad802014-06-26 15:35:51 -070021 mkdir /sideload
Doug Zongker075ef322014-01-14 09:50:35 -080022 mount tmpfs tmpfs /tmp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080023
Doug Zongker703ed152012-03-19 15:52:03 -070024 chown root shell /tmp
25 chmod 0775 /tmp
26
Colin Cross22bcf972014-06-24 13:43:39 -070027 write /proc/sys/kernel/panic_on_oops 1
Jesse Zhao5bf74b22015-01-08 15:59:23 -080028 write /proc/sys/vm/max_map_count 1000000
Colin Cross22bcf972014-06-24 13:43:39 -070029
Benoit Goby1b964112014-02-19 17:41:02 -080030on 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
Doug Zongker66392482012-01-10 12:16:04 -080035 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
Benoit Goby1b964112014-02-19 17:41:02 -080038 write /sys/class/android_usb/android0/f_ffs/aliases adb
Doug Zongker66392482012-01-10 12:16:04 -080039 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
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080044on boot
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080045 ifup lo
46 hostname localhost
47 domainname localdomain
48
49 class_start default
50
Riley Andrewse739d7e2014-06-24 16:29:16 -070051# Load properties from /system/ + /factory after fs mount.
Paul Lawrence90c75b02015-07-06 10:44:33 -070052on load_system_props_action
53 load_system_props
Riley Andrewse739d7e2014-06-24 16:29:16 -070054
JP Abgrall9eb8c8b2014-10-20 20:02:57 -070055on firmware_mounts_complete
56 rm /dev/.booting
57
Riley Andrewse739d7e2014-06-24 16:29:16 -070058# 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.
Paul Lawrence90c75b02015-07-06 10:44:33 -070068 trigger load_system_props_action
Riley Andrewse739d7e2014-06-24 16:29:16 -070069
JP Abgrall9eb8c8b2014-10-20 20:02:57 -070070 # Remove a file to wake up anything waiting for firmware
71 trigger firmware_mounts_complete
72
Riley Andrewse739d7e2014-06-24 16:29:16 -070073 trigger early-boot
74 trigger boot
75
Doug Zongker77ea71d2013-08-30 12:20:16 -070076on property:sys.powerctl=*
77 powerctl ${sys.powerctl}
78
Colin Crossdd6a0412010-05-14 13:42:20 -070079service ueventd /sbin/ueventd
80 critical
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050081 seclabel u:r:ueventd:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080082
Todd Poynorbe968092013-09-13 16:34:12 -070083service healthd /sbin/healthd -r
Todd Poynor2f2c9882013-06-04 13:11:44 -070084 critical
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050085 seclabel u:r:healthd:s0
Todd Poynor2f2c9882013-06-04 13:11:44 -070086
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080087service recovery /sbin/recovery
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050088 seclabel u:r:recovery:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080089
Nick Kralevichc52c5b82014-01-18 09:22:50 -080090service adbd /sbin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery
Kenny Rootecc76ba2010-06-28 09:01:22 -070091 disabled
Doug Zongkercc2958f2013-09-11 13:24:32 -070092 socket adbd stream 660 system system
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050093 seclabel u:r:adbd:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080094
Mike Lockwood718a2f72011-06-29 10:22:04 -040095# Always start adbd on userdebug and eng builds
96on property:ro.debuggable=1
Mike Lockwood7e58b652011-06-19 02:52:01 -040097 write /sys/class/android_usb/android0/enable 1
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080098 start adbd
99
Mike Lockwood718a2f72011-06-29 10:22:04 -0400100# Restart adbd so it can run as root
Doug Zongkerfb04b872011-06-23 15:30:34 -0700101on 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