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