1 import /init.recovery.${ro.hardware}.rc 2 3 on early-init 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 11 start ueventd 12 start healthd 13 14 on init 15 export PATH /sbin:/system/bin 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 26 mkdir /sideload 27 mount tmpfs tmpfs /tmp 28 29 chown root shell /tmp 30 chmod 0775 /tmp 31 32 write /proc/sys/kernel/panic_on_oops 1 33 write /proc/sys/vm/max_map_count 1000000 34 35 on fs 36 mkdir /dev/usb-ffs 0770 shell shell 37 mkdir /dev/usb-ffs/adb 0770 shell shell 38 mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 39 40 write /sys/class/android_usb/android0/enable 0 41 write /sys/class/android_usb/android0/idVendor 18D1 42 write /sys/class/android_usb/android0/idProduct D001 43 write /sys/class/android_usb/android0/f_ffs/aliases adb 44 write /sys/class/android_usb/android0/functions adb 45 write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer} 46 write /sys/class/android_usb/android0/iProduct ${ro.product.model} 47 write /sys/class/android_usb/android0/iSerial ${ro.serialno} 48 49 on boot 50 ifup lo 51 hostname localhost 52 domainname localdomain 53 54 class_start default 55 56 # Load properties from /system/ + /factory after fs mount. 57 on load_all_props_action 58 load_all_props 59 60 on firmware_mounts_complete 61 rm /dev/.booting 62 63 # Mount filesystems and start core system services. 64 on late-init 65 trigger early-fs 66 trigger fs 67 trigger post-fs 68 trigger post-fs-data 69 70 # Load properties from /system/ + /factory after fs mount. Place 71 # this in another action so that the load will be scheduled after the prior 72 # issued fs triggers have completed. 73 trigger load_all_props_action 74 75 # Remove a file to wake up anything waiting for firmware 76 trigger firmware_mounts_complete 77 78 trigger early-boot 79 trigger boot 80 81 on property:sys.powerctl=* 82 powerctl ${sys.powerctl} 83 84 service ueventd /sbin/ueventd 85 critical 86 seclabel u:r:ueventd:s0 87 88 service healthd /sbin/healthd -r 89 critical 90 seclabel u:r:healthd:s0 91 92 service recovery /sbin/recovery 93 seclabel u:r:recovery:s0 94 95 service adbd /sbin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery 96 disabled 97 socket adbd stream 660 system system 98 seclabel u:r:adbd:s0 99 100 # Always start adbd on userdebug and eng builds 101 on property:ro.debuggable=1 102 write /sys/class/android_usb/android0/enable 1 103 start adbd 104 105 # Restart adbd so it can run as root 106 on property:service.adb.root=1 107 write /sys/class/android_usb/android0/enable 0 108 restart adbd 109 write /sys/class/android_usb/android0/enable 1 110