Matt Mower | ec009e8 | 2015-01-30 13:00:49 -0600 | [diff] [blame] | 1 | import /init.recovery.usb.rc |
Matt Mower | 556411f | 2013-02-17 16:52:44 -0600 | [diff] [blame] | 2 | import /init.recovery.${ro.hardware}.rc |
| 3 | |
Colin Cross | dd6a041 | 2010-05-14 13:42:20 -0700 | [diff] [blame] | 4 | on early-init |
Ethan Yonker | 58b09f1 | 2015-10-26 12:42:15 -0500 | [diff] [blame] | 5 | # Apply strict SELinux checking of PROT_EXEC on mmap/mprotect calls. |
| 6 | write /sys/fs/selinux/checkreqprot 0 |
| 7 | |
| 8 | # Set the security context for the init process. |
| 9 | # This should occur before anything else (e.g. ueventd) is started. |
| 10 | setcon u:r:init:s0 |
| 11 | |
Colin Cross | dd6a041 | 2010-05-14 13:42:20 -0700 | [diff] [blame] | 12 | start ueventd |
Todd Poynor | 2f2c988 | 2013-06-04 13:11:44 -0700 | [diff] [blame] | 13 | start healthd |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 14 | |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 15 | service set_permissive /sbin/permissive.sh |
Ethan Yonker | 6cb35aa | 2014-12-16 14:21:42 -0600 | [diff] [blame] | 16 | oneshot |
| 17 | seclabel u:r:recovery:s0 |
| 18 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 19 | on init |
Doug Zongker | 55d6542 | 2014-01-14 09:50:35 -0800 | [diff] [blame] | 20 | export PATH /sbin:/system/bin |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 21 | export LD_LIBRARY_PATH .:/sbin |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 22 | export ANDROID_ROOT /system |
| 23 | export ANDROID_DATA /data |
| 24 | export EXTERNAL_STORAGE /sdcard |
| 25 | |
Matt Mower | 556411f | 2013-02-17 16:52:44 -0600 | [diff] [blame] | 26 | mkdir /boot |
| 27 | mkdir /recovery |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 28 | mkdir /system |
| 29 | mkdir /data |
| 30 | mkdir /cache |
Doug Zongker | 075ad80 | 2014-06-26 15:35:51 -0700 | [diff] [blame] | 31 | mkdir /sideload |
Doug Zongker | 55d6542 | 2014-01-14 09:50:35 -0800 | [diff] [blame] | 32 | mount tmpfs tmpfs /tmp |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 33 | |
Matt Mower | 556411f | 2013-02-17 16:52:44 -0600 | [diff] [blame] | 34 | chown root shell /tmp |
| 35 | chmod 0775 /tmp |
| 36 | |
Colin Cross | 22bcf97 | 2014-06-24 13:43:39 -0700 | [diff] [blame] | 37 | write /proc/sys/kernel/panic_on_oops 1 |
Jesse Zhao | 5bf74b2 | 2015-01-08 15:59:23 -0800 | [diff] [blame] | 38 | write /proc/sys/vm/max_map_count 1000000 |
Colin Cross | 22bcf97 | 2014-06-24 13:43:39 -0700 | [diff] [blame] | 39 | |
Benoit Goby | 689e06b | 2014-02-19 17:41:02 -0800 | [diff] [blame] | 40 | on fs |
Vojtech Bocek | 05ec1d4 | 2015-03-08 16:32:41 +0100 | [diff] [blame] | 41 | mount pstore pstore /sys/fs/pstore |
| 42 | |
Benoit Goby | 689e06b | 2014-02-19 17:41:02 -0800 | [diff] [blame] | 43 | mkdir /dev/usb-ffs 0770 shell shell |
| 44 | mkdir /dev/usb-ffs/adb 0770 shell shell |
| 45 | mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 |
| 46 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 47 | on boot |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 48 | ifup lo |
| 49 | hostname localhost |
| 50 | domainname localdomain |
| 51 | |
| 52 | class_start default |
| 53 | |
Riley Andrews | e739d7e | 2014-06-24 16:29:16 -0700 | [diff] [blame] | 54 | # Load properties from /system/ + /factory after fs mount. |
| 55 | on load_all_props_action |
| 56 | load_all_props |
| 57 | |
JP Abgrall | 9eb8c8b | 2014-10-20 20:02:57 -0700 | [diff] [blame] | 58 | on firmware_mounts_complete |
| 59 | rm /dev/.booting |
| 60 | |
Riley Andrews | e739d7e | 2014-06-24 16:29:16 -0700 | [diff] [blame] | 61 | # Mount filesystems and start core system services. |
| 62 | on late-init |
| 63 | trigger early-fs |
| 64 | trigger fs |
| 65 | trigger post-fs |
| 66 | trigger post-fs-data |
| 67 | |
| 68 | # Load properties from /system/ + /factory after fs mount. Place |
| 69 | # this in another action so that the load will be scheduled after the prior |
| 70 | # issued fs triggers have completed. |
| 71 | trigger load_all_props_action |
| 72 | |
JP Abgrall | 9eb8c8b | 2014-10-20 20:02:57 -0700 | [diff] [blame] | 73 | # Remove a file to wake up anything waiting for firmware |
| 74 | trigger firmware_mounts_complete |
| 75 | |
Riley Andrews | e739d7e | 2014-06-24 16:29:16 -0700 | [diff] [blame] | 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 | |
Colin Cross | dd6a041 | 2010-05-14 13:42:20 -0700 | [diff] [blame] | 82 | service ueventd /sbin/ueventd |
| 83 | critical |
Stephen Smalley | 2c9d5b2 | 2014-01-13 09:44:42 -0500 | [diff] [blame] | 84 | seclabel u:r:ueventd:s0 |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 85 | |
Todd Poynor | be96809 | 2013-09-13 16:34:12 -0700 | [diff] [blame] | 86 | service healthd /sbin/healthd -r |
Todd Poynor | 2f2c988 | 2013-06-04 13:11:44 -0700 | [diff] [blame] | 87 | critical |
Stephen Smalley | 2c9d5b2 | 2014-01-13 09:44:42 -0500 | [diff] [blame] | 88 | seclabel u:r:healthd:s0 |
Todd Poynor | 2f2c988 | 2013-06-04 13:11:44 -0700 | [diff] [blame] | 89 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 90 | service recovery /sbin/recovery |
| 91 | |
Nick Kralevich | c52c5b8 | 2014-01-18 09:22:50 -0800 | [diff] [blame] | 92 | 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] | 93 | disabled |
Doug Zongker | cc2958f | 2013-09-11 13:24:32 -0700 | [diff] [blame] | 94 | socket adbd stream 660 system system |
Stephen Smalley | 2c9d5b2 | 2014-01-13 09:44:42 -0500 | [diff] [blame] | 95 | seclabel u:r:adbd:s0 |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 96 | |
Mike Lockwood | 718a2f7 | 2011-06-29 10:22:04 -0400 | [diff] [blame] | 97 | # Always start adbd on userdebug and eng builds |
| 98 | on property:ro.debuggable=1 |
Dees_Troy | 0cd4cc2 | 2013-06-09 20:56:38 +0000 | [diff] [blame] | 99 | #write /sys/class/android_usb/android0/enable 1 |
| 100 | #start adbd |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 101 | setprop service.adb.root 1 |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 102 | |
Mike Lockwood | 718a2f7 | 2011-06-29 10:22:04 -0400 | [diff] [blame] | 103 | # Restart adbd so it can run as root |
Doug Zongker | fb04b87 | 2011-06-23 15:30:34 -0700 | [diff] [blame] | 104 | on property:service.adb.root=1 |
| 105 | write /sys/class/android_usb/android0/enable 0 |
| 106 | restart adbd |
Benoit Goby | 689e06b | 2014-02-19 17:41:02 -0800 | [diff] [blame] | 107 | write /sys/class/android_usb/android0/enable 1 |