Matt Mower | 556411f | 2013-02-17 16:52:44 -0600 | [diff] [blame] | 1 | import /init.recovery.${ro.hardware}.rc |
| 2 | |
Colin Cross | dd6a041 | 2010-05-14 13:42:20 -0700 | [diff] [blame] | 3 | on early-init |
Stephen Smalley | 2c9d5b2 | 2014-01-13 09:44:42 -0500 | [diff] [blame] | 4 | # 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 Cross | dd6a041 | 2010-05-14 13:42:20 -0700 | [diff] [blame] | 11 | start ueventd |
Todd Poynor | 2f2c988 | 2013-06-04 13:11:44 -0700 | [diff] [blame] | 12 | start healthd |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 13 | |
Ethan Yonker | 6cb35aa | 2014-12-16 14:21:42 -0600 | [diff] [blame] | 14 | service set_permissive /sbin/toolbox setenforce 0 |
| 15 | oneshot |
| 16 | seclabel u:r:recovery:s0 |
| 17 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 18 | on init |
Doug Zongker | 55d6542 | 2014-01-14 09:50:35 -0800 | [diff] [blame] | 19 | export PATH /sbin:/system/bin |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 20 | export LD_LIBRARY_PATH .:/sbin |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 21 | export ANDROID_ROOT /system |
| 22 | export ANDROID_DATA /data |
| 23 | export EXTERNAL_STORAGE /sdcard |
| 24 | |
Matt Mower | 556411f | 2013-02-17 16:52:44 -0600 | [diff] [blame] | 25 | mkdir /boot |
| 26 | mkdir /recovery |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 27 | mkdir /system |
| 28 | mkdir /data |
| 29 | mkdir /cache |
Doug Zongker | 075ad80 | 2014-06-26 15:35:51 -0700 | [diff] [blame] | 30 | mkdir /sideload |
Doug Zongker | 55d6542 | 2014-01-14 09:50:35 -0800 | [diff] [blame] | 31 | mount tmpfs tmpfs /tmp |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 32 | |
Matt Mower | 556411f | 2013-02-17 16:52:44 -0600 | [diff] [blame] | 33 | chown root shell /tmp |
| 34 | chmod 0775 /tmp |
| 35 | |
Colin Cross | 22bcf97 | 2014-06-24 13:43:39 -0700 | [diff] [blame] | 36 | write /proc/sys/kernel/panic_on_oops 1 |
| 37 | |
Benoit Goby | 689e06b | 2014-02-19 17:41:02 -0800 | [diff] [blame] | 38 | on fs |
| 39 | mkdir /dev/usb-ffs 0770 shell shell |
| 40 | mkdir /dev/usb-ffs/adb 0770 shell shell |
| 41 | mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 |
| 42 | |
Matt Mower | 556411f | 2013-02-17 16:52:44 -0600 | [diff] [blame] | 43 | write /sys/class/android_usb/android0/enable 0 |
| 44 | write /sys/class/android_usb/android0/idVendor 18D1 |
bigbiff bigbiff | c7eee6f | 2014-09-02 18:59:01 -0400 | [diff] [blame] | 45 | write /sys/class/android_usb/android0/idProduct D002 |
Benoit Goby | 689e06b | 2014-02-19 17:41:02 -0800 | [diff] [blame] | 46 | write /sys/class/android_usb/android0/f_ffs/aliases adb |
Matt Mower | 556411f | 2013-02-17 16:52:44 -0600 | [diff] [blame] | 47 | write /sys/class/android_usb/android0/functions adb |
| 48 | write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer} |
| 49 | write /sys/class/android_usb/android0/iProduct ${ro.product.model} |
| 50 | write /sys/class/android_usb/android0/iSerial ${ro.serialno} |
| 51 | |
| 52 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 53 | on boot |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 54 | ifup lo |
| 55 | hostname localhost |
| 56 | domainname localdomain |
| 57 | |
| 58 | class_start default |
| 59 | |
Riley Andrews | e739d7e | 2014-06-24 16:29:16 -0700 | [diff] [blame] | 60 | # Load properties from /system/ + /factory after fs mount. |
| 61 | on load_all_props_action |
| 62 | load_all_props |
| 63 | |
| 64 | # Mount filesystems and start core system services. |
| 65 | on late-init |
| 66 | trigger early-fs |
| 67 | trigger fs |
| 68 | trigger post-fs |
| 69 | trigger post-fs-data |
| 70 | |
| 71 | # Load properties from /system/ + /factory after fs mount. Place |
| 72 | # this in another action so that the load will be scheduled after the prior |
| 73 | # issued fs triggers have completed. |
| 74 | trigger load_all_props_action |
| 75 | |
| 76 | trigger early-boot |
| 77 | trigger boot |
| 78 | |
Doug Zongker | 77ea71d | 2013-08-30 12:20:16 -0700 | [diff] [blame] | 79 | on property:sys.powerctl=* |
| 80 | powerctl ${sys.powerctl} |
| 81 | |
Jason Riordan | 26ff4c0 | 2014-01-16 22:44:15 -0500 | [diff] [blame] | 82 | on property:sys.storage.ums_enabled=1 |
| 83 | write /sys/class/android_usb/android0/enable 0 |
| 84 | write /sys/class/android_usb/android0/functions adb,mass_storage |
| 85 | write /sys/class/android_usb/android0/enable 1 |
| 86 | |
| 87 | on property:sys.storage.ums_enabled=0 |
| 88 | write /sys/class/android_usb/android0/enable 0 |
| 89 | write /sys/class/android_usb/android0/functions adb |
| 90 | write /sys/class/android_usb/android0/enable ${service.adb.root} |
| 91 | |
bigbiff bigbiff | c7eee6f | 2014-09-02 18:59:01 -0400 | [diff] [blame] | 92 | on property:sys.usb.config=none |
| 93 | stop adbd |
| 94 | write /sys/class/android_usb/android0/enable 0 |
| 95 | write /sys/class/android_usb/android0/bDeviceClass 0 |
| 96 | |
| 97 | on property:sys.usb.config=mtp,adb |
| 98 | stop adbd |
| 99 | write /sys/class/android_usb/android0/enable 0 |
| 100 | write /sys/class/android_usb/android0/functions mtp,adb |
| 101 | write /sys/class/android_usb/android0/enable 1 |
| 102 | start adbd |
| 103 | |
| 104 | on property:sys.usb.config=adb |
| 105 | stop adbd |
| 106 | write /sys/class/android_usb/android0/enable 0 |
| 107 | write /sys/class/android_usb/android0/functions adb |
| 108 | write /sys/class/android_usb/android0/enable ${service.adb.root} |
| 109 | start adbd |
| 110 | |
Colin Cross | dd6a041 | 2010-05-14 13:42:20 -0700 | [diff] [blame] | 111 | service ueventd /sbin/ueventd |
| 112 | critical |
Stephen Smalley | 2c9d5b2 | 2014-01-13 09:44:42 -0500 | [diff] [blame] | 113 | seclabel u:r:ueventd:s0 |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 114 | |
Todd Poynor | be96809 | 2013-09-13 16:34:12 -0700 | [diff] [blame] | 115 | service healthd /sbin/healthd -r |
Todd Poynor | 2f2c988 | 2013-06-04 13:11:44 -0700 | [diff] [blame] | 116 | critical |
Stephen Smalley | 2c9d5b2 | 2014-01-13 09:44:42 -0500 | [diff] [blame] | 117 | seclabel u:r:healthd:s0 |
Todd Poynor | 2f2c988 | 2013-06-04 13:11:44 -0700 | [diff] [blame] | 118 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 119 | service recovery /sbin/recovery |
| 120 | |
Nick Kralevich | c52c5b8 | 2014-01-18 09:22:50 -0800 | [diff] [blame] | 121 | service adbd /sbin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery |
Kenny Root | ecc76ba | 2010-06-28 09:01:22 -0700 | [diff] [blame] | 122 | disabled |
Doug Zongker | cc2958f | 2013-09-11 13:24:32 -0700 | [diff] [blame] | 123 | socket adbd stream 660 system system |
Stephen Smalley | 2c9d5b2 | 2014-01-13 09:44:42 -0500 | [diff] [blame] | 124 | seclabel u:r:adbd:s0 |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 125 | |
Mike Lockwood | 718a2f7 | 2011-06-29 10:22:04 -0400 | [diff] [blame] | 126 | # Always start adbd on userdebug and eng builds |
| 127 | on property:ro.debuggable=1 |
Dees_Troy | 0cd4cc2 | 2013-06-09 20:56:38 +0000 | [diff] [blame] | 128 | #write /sys/class/android_usb/android0/enable 1 |
| 129 | #start adbd |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 130 | setprop service.adb.root 1 |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 131 | |
Mike Lockwood | 718a2f7 | 2011-06-29 10:22:04 -0400 | [diff] [blame] | 132 | # Restart adbd so it can run as root |
Doug Zongker | fb04b87 | 2011-06-23 15:30:34 -0700 | [diff] [blame] | 133 | on property:service.adb.root=1 |
| 134 | write /sys/class/android_usb/android0/enable 0 |
| 135 | restart adbd |
Benoit Goby | 689e06b | 2014-02-19 17:41:02 -0800 | [diff] [blame] | 136 | write /sys/class/android_usb/android0/enable 1 |