blob: 8d49f24e627bd8dc66ed40630b2740b2964c34e5 [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
Stephen Smalley2c9d5b22014-01-13 09:44:42 -05004 # Apply strict SELinux checking of PROT_EXEC on mmap/mprotect calls.
5 write /sys/fs/selinux/checkreqprot 0
6
7 # Set the security context for the init process.
8 # This should occur before anything else (e.g. ueventd) is started.
9 setcon u:r:init:s0
10
Colin Crossdd6a0412010-05-14 13:42:20 -070011 start ueventd
Todd Poynor2f2c9882013-06-04 13:11:44 -070012 start healthd
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080013
14on init
Doug Zongker075ef322014-01-14 09:50:35 -080015 export PATH /sbin:/system/bin
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080016 export ANDROID_ROOT /system
17 export ANDROID_DATA /data
18 export EXTERNAL_STORAGE /sdcard
19
20 symlink /system/etc /etc
21
22 mkdir /sdcard
23 mkdir /system
24 mkdir /data
25 mkdir /cache
Doug Zongker075ef322014-01-14 09:50:35 -080026 mount tmpfs tmpfs /tmp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080027
Doug Zongker703ed152012-03-19 15:52:03 -070028 chown root shell /tmp
29 chmod 0775 /tmp
30
Doug Zongker66392482012-01-10 12:16:04 -080031 write /sys/class/android_usb/android0/enable 0
32 write /sys/class/android_usb/android0/idVendor 18D1
33 write /sys/class/android_usb/android0/idProduct D001
34 write /sys/class/android_usb/android0/functions adb
35 write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
36 write /sys/class/android_usb/android0/iProduct ${ro.product.model}
37 write /sys/class/android_usb/android0/iSerial ${ro.serialno}
38
39
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080040on boot
41
42 ifup lo
43 hostname localhost
44 domainname localdomain
45
46 class_start default
47
Doug Zongker77ea71d2013-08-30 12:20:16 -070048on property:sys.powerctl=*
49 powerctl ${sys.powerctl}
50
Colin Crossdd6a0412010-05-14 13:42:20 -070051service ueventd /sbin/ueventd
52 critical
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050053 seclabel u:r:ueventd:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080054
Todd Poynor2f2c9882013-06-04 13:11:44 -070055service healthd /sbin/healthd -n
56 critical
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050057 seclabel u:r:healthd:s0
Todd Poynor2f2c9882013-06-04 13:11:44 -070058
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080059service recovery /sbin/recovery
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050060 seclabel u:r:recovery:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080061
62service adbd /sbin/adbd recovery
Kenny Rootecc76ba2010-06-28 09:01:22 -070063 disabled
Doug Zongkercc2958f2013-09-11 13:24:32 -070064 socket adbd stream 660 system system
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050065 seclabel u:r:adbd:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080066
Mike Lockwood718a2f72011-06-29 10:22:04 -040067# Always start adbd on userdebug and eng builds
68on property:ro.debuggable=1
Mike Lockwood7e58b652011-06-19 02:52:01 -040069 write /sys/class/android_usb/android0/enable 1
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080070 start adbd
71
Mike Lockwood718a2f72011-06-29 10:22:04 -040072# Restart adbd so it can run as root
Doug Zongkerfb04b872011-06-23 15:30:34 -070073on property:service.adb.root=1
74 write /sys/class/android_usb/android0/enable 0
75 restart adbd
76 write /sys/class/android_usb/android0/enable 1