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 |
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 | 075ef32 | 2014-01-14 09:50:35 -0800 | [diff] [blame] | 15 | export PATH /sbin:/system/bin |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 16 | export ANDROID_ROOT /system |
| 17 | export ANDROID_DATA /data |
| 18 | export EXTERNAL_STORAGE /sdcard |
| 19 | |
| 20 | symlink /system/etc /etc |
| 21 | |
| 22 | mkdir /sdcard |
| 23 | mkdir /system |
| 24 | mkdir /data |
| 25 | mkdir /cache |
Doug Zongker | 075ef32 | 2014-01-14 09:50:35 -0800 | [diff] [blame] | 26 | mount tmpfs tmpfs /tmp |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 27 | |
Doug Zongker | 703ed15 | 2012-03-19 15:52:03 -0700 | [diff] [blame] | 28 | chown root shell /tmp |
| 29 | chmod 0775 /tmp |
| 30 | |
Benoit Goby | 1b96411 | 2014-02-19 17:41:02 -0800 | [diff] [blame] | 31 | on fs |
| 32 | mkdir /dev/usb-ffs 0770 shell shell |
| 33 | mkdir /dev/usb-ffs/adb 0770 shell shell |
| 34 | mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 |
| 35 | |
Doug Zongker | 6639248 | 2012-01-10 12:16:04 -0800 | [diff] [blame] | 36 | write /sys/class/android_usb/android0/enable 0 |
| 37 | write /sys/class/android_usb/android0/idVendor 18D1 |
| 38 | write /sys/class/android_usb/android0/idProduct D001 |
Benoit Goby | 1b96411 | 2014-02-19 17:41:02 -0800 | [diff] [blame] | 39 | write /sys/class/android_usb/android0/f_ffs/aliases adb |
Doug Zongker | 6639248 | 2012-01-10 12:16:04 -0800 | [diff] [blame] | 40 | write /sys/class/android_usb/android0/functions adb |
| 41 | write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer} |
| 42 | write /sys/class/android_usb/android0/iProduct ${ro.product.model} |
| 43 | write /sys/class/android_usb/android0/iSerial ${ro.serialno} |
| 44 | |
| 45 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 46 | on boot |
| 47 | |
| 48 | ifup lo |
| 49 | hostname localhost |
| 50 | domainname localdomain |
| 51 | |
| 52 | class_start default |
| 53 | |
Doug Zongker | 77ea71d | 2013-08-30 12:20:16 -0700 | [diff] [blame] | 54 | on property:sys.powerctl=* |
| 55 | powerctl ${sys.powerctl} |
| 56 | |
Colin Cross | dd6a041 | 2010-05-14 13:42:20 -0700 | [diff] [blame] | 57 | service ueventd /sbin/ueventd |
| 58 | critical |
Stephen Smalley | 2c9d5b2 | 2014-01-13 09:44:42 -0500 | [diff] [blame] | 59 | seclabel u:r:ueventd:s0 |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 60 | |
Todd Poynor | be96809 | 2013-09-13 16:34:12 -0700 | [diff] [blame] | 61 | service healthd /sbin/healthd -r |
Todd Poynor | 2f2c988 | 2013-06-04 13:11:44 -0700 | [diff] [blame] | 62 | critical |
Stephen Smalley | 2c9d5b2 | 2014-01-13 09:44:42 -0500 | [diff] [blame] | 63 | seclabel u:r:healthd:s0 |
Todd Poynor | 2f2c988 | 2013-06-04 13:11:44 -0700 | [diff] [blame] | 64 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 65 | service recovery /sbin/recovery |
Stephen Smalley | 2c9d5b2 | 2014-01-13 09:44:42 -0500 | [diff] [blame] | 66 | seclabel u:r:recovery:s0 |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 67 | |
Nick Kralevich | c52c5b8 | 2014-01-18 09:22:50 -0800 | [diff] [blame] | 68 | 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] | 69 | disabled |
Doug Zongker | cc2958f | 2013-09-11 13:24:32 -0700 | [diff] [blame] | 70 | socket adbd stream 660 system system |
Stephen Smalley | 2c9d5b2 | 2014-01-13 09:44:42 -0500 | [diff] [blame] | 71 | seclabel u:r:adbd:s0 |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 72 | |
Mike Lockwood | 718a2f7 | 2011-06-29 10:22:04 -0400 | [diff] [blame] | 73 | # Always start adbd on userdebug and eng builds |
| 74 | on property:ro.debuggable=1 |
Mike Lockwood | 7e58b65 | 2011-06-19 02:52:01 -0400 | [diff] [blame] | 75 | write /sys/class/android_usb/android0/enable 1 |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 76 | start adbd |
| 77 | |
Mike Lockwood | 718a2f7 | 2011-06-29 10:22:04 -0400 | [diff] [blame] | 78 | # Restart adbd so it can run as root |
Doug Zongker | fb04b87 | 2011-06-23 15:30:34 -0700 | [diff] [blame] | 79 | on property:service.adb.root=1 |
| 80 | write /sys/class/android_usb/android0/enable 0 |
| 81 | restart adbd |
| 82 | write /sys/class/android_usb/android0/enable 1 |