Colin Cross | f510f06 | 2012-08-08 13:06:26 -0700 | [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 |
Alex Deymo | 6bcc8af | 2016-03-02 14:21:02 -0800 | [diff] [blame] | 4 | # Set the security context of /postinstall if present. |
| 5 | restorecon /postinstall |
| 6 | |
Colin Cross | dd6a041 | 2010-05-14 13:42:20 -0700 | [diff] [blame] | 7 | start ueventd |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 8 | |
| 9 | on init |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 10 | export ANDROID_ROOT /system |
| 11 | export ANDROID_DATA /data |
| 12 | export EXTERNAL_STORAGE /sdcard |
| 13 | |
| 14 | symlink /system/etc /etc |
| 15 | |
Elliott Hughes | 48ebb07 | 2016-06-15 15:15:15 -0700 | [diff] [blame] | 16 | mount cgroup none /acct cpuacct |
| 17 | mkdir /acct/uid |
| 18 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 19 | mkdir /sdcard |
| 20 | mkdir /system |
| 21 | mkdir /data |
| 22 | mkdir /cache |
Doug Zongker | 075ad80 | 2014-06-26 15:35:51 -0700 | [diff] [blame] | 23 | mkdir /sideload |
Doug Zongker | 075ef32 | 2014-01-14 09:50:35 -0800 | [diff] [blame] | 24 | mount tmpfs tmpfs /tmp |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 25 | |
Doug Zongker | 703ed15 | 2012-03-19 15:52:03 -0700 | [diff] [blame] | 26 | chown root shell /tmp |
| 27 | chmod 0775 /tmp |
| 28 | |
Colin Cross | 22bcf97 | 2014-06-24 13:43:39 -0700 | [diff] [blame] | 29 | write /proc/sys/kernel/panic_on_oops 1 |
Jesse Zhao | 5bf74b2 | 2015-01-08 15:59:23 -0800 | [diff] [blame] | 30 | write /proc/sys/vm/max_map_count 1000000 |
Colin Cross | 22bcf97 | 2014-06-24 13:43:39 -0700 | [diff] [blame] | 31 | |
Benoit Goby | 1b96411 | 2014-02-19 17:41:02 -0800 | [diff] [blame] | 32 | on fs |
| 33 | mkdir /dev/usb-ffs 0770 shell shell |
| 34 | mkdir /dev/usb-ffs/adb 0770 shell shell |
| 35 | mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 |
| 36 | |
Doug Zongker | 6639248 | 2012-01-10 12:16:04 -0800 | [diff] [blame] | 37 | write /sys/class/android_usb/android0/enable 0 |
| 38 | write /sys/class/android_usb/android0/idVendor 18D1 |
| 39 | write /sys/class/android_usb/android0/idProduct D001 |
Benoit Goby | 1b96411 | 2014-02-19 17:41:02 -0800 | [diff] [blame] | 40 | write /sys/class/android_usb/android0/f_ffs/aliases adb |
Doug Zongker | 6639248 | 2012-01-10 12:16:04 -0800 | [diff] [blame] | 41 | write /sys/class/android_usb/android0/functions adb |
| 42 | write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer} |
| 43 | write /sys/class/android_usb/android0/iProduct ${ro.product.model} |
| 44 | write /sys/class/android_usb/android0/iSerial ${ro.serialno} |
| 45 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 46 | on boot |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 47 | ifup lo |
| 48 | hostname localhost |
| 49 | domainname localdomain |
| 50 | |
| 51 | class_start default |
| 52 | |
Riley Andrews | e739d7e | 2014-06-24 16:29:16 -0700 | [diff] [blame] | 53 | # Load properties from /system/ + /factory after fs mount. |
Paul Lawrence | 90c75b0 | 2015-07-06 10:44:33 -0700 | [diff] [blame] | 54 | on load_system_props_action |
| 55 | load_system_props |
Riley Andrews | e739d7e | 2014-06-24 16:29:16 -0700 | [diff] [blame] | 56 | |
JP Abgrall | 9eb8c8b | 2014-10-20 20:02:57 -0700 | [diff] [blame] | 57 | on firmware_mounts_complete |
| 58 | rm /dev/.booting |
| 59 | |
Riley Andrews | e739d7e | 2014-06-24 16:29:16 -0700 | [diff] [blame] | 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. |
Paul Lawrence | 90c75b0 | 2015-07-06 10:44:33 -0700 | [diff] [blame] | 70 | trigger load_system_props_action |
Riley Andrews | e739d7e | 2014-06-24 16:29:16 -0700 | [diff] [blame] | 71 | |
JP Abgrall | 9eb8c8b | 2014-10-20 20:02:57 -0700 | [diff] [blame] | 72 | # Remove a file to wake up anything waiting for firmware |
| 73 | trigger firmware_mounts_complete |
| 74 | |
Riley Andrews | e739d7e | 2014-06-24 16:29:16 -0700 | [diff] [blame] | 75 | trigger early-boot |
| 76 | trigger boot |
| 77 | |
Doug Zongker | 77ea71d | 2013-08-30 12:20:16 -0700 | [diff] [blame] | 78 | on property:sys.powerctl=* |
| 79 | powerctl ${sys.powerctl} |
| 80 | |
Colin Cross | dd6a041 | 2010-05-14 13:42:20 -0700 | [diff] [blame] | 81 | service ueventd /sbin/ueventd |
| 82 | critical |
Stephen Smalley | 2c9d5b2 | 2014-01-13 09:44:42 -0500 | [diff] [blame] | 83 | seclabel u:r:ueventd:s0 |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 84 | |
Sandeep Patil | c4b381c | 2016-11-01 08:49:51 -0700 | [diff] [blame] | 85 | service charger /charger -r |
Todd Poynor | 2f2c988 | 2013-06-04 13:11:44 -0700 | [diff] [blame] | 86 | critical |
Sandeep Patil | c4b381c | 2016-11-01 08:49:51 -0700 | [diff] [blame] | 87 | seclabel u:r:charger:s0 |
Todd Poynor | 2f2c988 | 2013-06-04 13:11:44 -0700 | [diff] [blame] | 88 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 89 | service recovery /sbin/recovery |
Stephen Smalley | 2c9d5b2 | 2014-01-13 09:44:42 -0500 | [diff] [blame] | 90 | seclabel u:r:recovery:s0 |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 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 |
Mike Lockwood | 7e58b65 | 2011-06-19 02:52:01 -0400 | [diff] [blame] | 99 | write /sys/class/android_usb/android0/enable 1 |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 100 | start adbd |
| 101 | |
Mike Lockwood | 718a2f7 | 2011-06-29 10:22:04 -0400 | [diff] [blame] | 102 | # Restart adbd so it can run as root |
Doug Zongker | fb04b87 | 2011-06-23 15:30:34 -0700 | [diff] [blame] | 103 | on property:service.adb.root=1 |
| 104 | write /sys/class/android_usb/android0/enable 0 |
| 105 | restart adbd |
| 106 | write /sys/class/android_usb/android0/enable 1 |