blob: c78a44a2aa7724051da32ecc42280e8656b51a8e [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 Zongker075ad802014-06-26 15:35:51 -070026 mkdir /sideload
Doug Zongker075ef322014-01-14 09:50:35 -080027 mount tmpfs tmpfs /tmp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080028
Doug Zongker703ed152012-03-19 15:52:03 -070029 chown root shell /tmp
30 chmod 0775 /tmp
31
Colin Cross22bcf972014-06-24 13:43:39 -070032 write /proc/sys/kernel/panic_on_oops 1
Jesse Zhao5bf74b22015-01-08 15:59:23 -080033 write /proc/sys/vm/max_map_count 1000000
Colin Cross22bcf972014-06-24 13:43:39 -070034
Benoit Goby1b964112014-02-19 17:41:02 -080035on fs
36 mkdir /dev/usb-ffs 0770 shell shell
37 mkdir /dev/usb-ffs/adb 0770 shell shell
38 mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
39
Doug Zongker66392482012-01-10 12:16:04 -080040 write /sys/class/android_usb/android0/enable 0
41 write /sys/class/android_usb/android0/idVendor 18D1
42 write /sys/class/android_usb/android0/idProduct D001
Benoit Goby1b964112014-02-19 17:41:02 -080043 write /sys/class/android_usb/android0/f_ffs/aliases adb
Doug Zongker66392482012-01-10 12:16:04 -080044 write /sys/class/android_usb/android0/functions adb
45 write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
46 write /sys/class/android_usb/android0/iProduct ${ro.product.model}
47 write /sys/class/android_usb/android0/iSerial ${ro.serialno}
48
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080049on boot
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080050 ifup lo
51 hostname localhost
52 domainname localdomain
53
54 class_start default
55
Riley Andrewse739d7e2014-06-24 16:29:16 -070056# Load properties from /system/ + /factory after fs mount.
57on load_all_props_action
58 load_all_props
59
JP Abgrall9eb8c8b2014-10-20 20:02:57 -070060on firmware_mounts_complete
61 rm /dev/.booting
62
Riley Andrewse739d7e2014-06-24 16:29:16 -070063# Mount filesystems and start core system services.
64on late-init
65 trigger early-fs
66 trigger fs
67 trigger post-fs
68 trigger post-fs-data
69
70 # Load properties from /system/ + /factory after fs mount. Place
71 # this in another action so that the load will be scheduled after the prior
72 # issued fs triggers have completed.
73 trigger load_all_props_action
74
JP Abgrall9eb8c8b2014-10-20 20:02:57 -070075 # Remove a file to wake up anything waiting for firmware
76 trigger firmware_mounts_complete
77
Riley Andrewse739d7e2014-06-24 16:29:16 -070078 trigger early-boot
79 trigger boot
80
Doug Zongker77ea71d2013-08-30 12:20:16 -070081on property:sys.powerctl=*
82 powerctl ${sys.powerctl}
83
Colin Crossdd6a0412010-05-14 13:42:20 -070084service ueventd /sbin/ueventd
85 critical
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050086 seclabel u:r:ueventd:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080087
Todd Poynorbe968092013-09-13 16:34:12 -070088service healthd /sbin/healthd -r
Todd Poynor2f2c9882013-06-04 13:11:44 -070089 critical
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050090 seclabel u:r:healthd:s0
Todd Poynor2f2c9882013-06-04 13:11:44 -070091
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080092service recovery /sbin/recovery
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050093 seclabel u:r:recovery:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080094
Nick Kralevichc52c5b82014-01-18 09:22:50 -080095service adbd /sbin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery
Kenny Rootecc76ba2010-06-28 09:01:22 -070096 disabled
Doug Zongkercc2958f2013-09-11 13:24:32 -070097 socket adbd stream 660 system system
Stephen Smalley2c9d5b22014-01-13 09:44:42 -050098 seclabel u:r:adbd:s0
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080099
Mike Lockwood718a2f72011-06-29 10:22:04 -0400100# Always start adbd on userdebug and eng builds
101on property:ro.debuggable=1
Mike Lockwood7e58b652011-06-19 02:52:01 -0400102 write /sys/class/android_usb/android0/enable 1
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800103 start adbd
104
Mike Lockwood718a2f72011-06-29 10:22:04 -0400105# Restart adbd so it can run as root
Doug Zongkerfb04b872011-06-23 15:30:34 -0700106on property:service.adb.root=1
107 write /sys/class/android_usb/android0/enable 0
108 restart adbd
109 write /sys/class/android_usb/android0/enable 1