Home | History | Annotate | Download | only in etc
      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 
     34 on fs
     35     mkdir /dev/usb-ffs 0770 shell shell
     36     mkdir /dev/usb-ffs/adb 0770 shell shell
     37     mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
     38 
     39     write /sys/class/android_usb/android0/enable 0
     40     write /sys/class/android_usb/android0/idVendor 18D1
     41     write /sys/class/android_usb/android0/idProduct D001
     42     write /sys/class/android_usb/android0/f_ffs/aliases adb
     43     write /sys/class/android_usb/android0/functions adb
     44     write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
     45     write /sys/class/android_usb/android0/iProduct ${ro.product.model}
     46     write /sys/class/android_usb/android0/iSerial ${ro.serialno}
     47 
     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 # 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.
     70     trigger load_all_props_action
     71 
     72     trigger early-boot
     73     trigger boot
     74 
     75 on property:sys.powerctl=*
     76    powerctl ${sys.powerctl}
     77 
     78 service ueventd /sbin/ueventd
     79     critical
     80     seclabel u:r:ueventd:s0
     81 
     82 service healthd /sbin/healthd -r
     83     critical
     84     seclabel u:r:healthd:s0
     85 
     86 service recovery /sbin/recovery
     87     seclabel u:r:recovery:s0
     88 
     89 service adbd /sbin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery
     90     disabled
     91     socket adbd stream 660 system system
     92     seclabel u:r:adbd:s0
     93 
     94 # Always start adbd on userdebug and eng builds
     95 on property:ro.debuggable=1
     96     write /sys/class/android_usb/android0/enable 1
     97     start adbd
     98 
     99 # Restart adbd so it can run as root
    100 on property:service.adb.root=1
    101     write /sys/class/android_usb/android0/enable 0
    102     restart adbd
    103     write /sys/class/android_usb/android0/enable 1
    104