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