Home | History | Annotate | Download | only in fugu
      1 #
      2 # Copyright 2014 The Android Open Source Project
      3 #
      4 # Licensed under the Apache License, Version 2.0 (the "License");
      5 # you may not use this file except in compliance with the License.
      6 # You may obtain a copy of the License at
      7 #
      8 #      http://www.apache.org/licenses/LICENSE-2.0
      9 #
     10 # Unless required by applicable law or agreed to in writing, software
     11 # distributed under the License is distributed on an "AS IS" BASIS,
     12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 # See the License for the specific language governing permissions and
     14 # limitations under the License.
     15 #
     16 
     17 import init.fugu.usb.rc
     18 import init.intel.tools.rc
     19 import init.fugu.diag.rc
     20 
     21 on early-init
     22     mount debugfs debugfs /sys/kernel/debug mode=0755
     23 
     24     # IMG Graphics
     25     symlink /dev/dri/card0 /dev/card0
     26 
     27 on init
     28     # See storage config details at http://source.android.com/tech/storage/
     29     mkdir /mnt/shell/emulated 0700 shell shell
     30     mkdir /storage/emulated 0555 root root
     31 
     32     export EXTERNAL_STORAGE /storage/emulated/legacy
     33     export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
     34     export EMULATED_STORAGE_TARGET /storage/emulated
     35 
     36     # Android creates by-name disk links with the disk controller
     37     # in the generated path, so that the names pulled out of the GPT
     38     # can be associated with the correct disk. Create a shortcut to
     39     # /dev/block/by-name so that we can use the same fstabs everywhere.
     40     symlink /dev/block/pci/pci0000:00/0000:00:01.0/by-name /dev/block/by-name
     41 
     42     # Support legacy paths
     43     symlink /storage/emulated/legacy /sdcard
     44     symlink /storage/emulated/legacy /mnt/sdcard
     45     symlink /storage/emulated/legacy /storage/sdcard0
     46     symlink /mnt/shell/emulated/0 /storage/emulated/legacy
     47 
     48     # KSM options
     49     write /sys/kernel/mm/ksm/pages_to_scan 100
     50     write /sys/kernel/mm/ksm/sleep_millisecs 500
     51     write /sys/kernel/mm/ksm/run 1
     52 
     53     #  Mount the sep filesystem
     54     mount sepfs sepfs /sys/fs/sepfs
     55 
     56 on fs
     57     mkdir /logs 0770 system log
     58     mkdir /factory 0775 system system
     59 
     60     mount_all ./fstab.fugu
     61     swapon_all ./fstab.fugu
     62     setprop ro.crypto.fuse_sdcard true
     63 
     64     restorecon_recursive /factory
     65 
     66 on early-boot
     67     # set RLIMIT_MEMLOCK to 64MB
     68     setrlimit 8 67108864 67108864
     69     setprop ro.audio.flinger_standbytime_ms 600000
     70 
     71 on boot
     72     # Assign TCP buffer thresholds to be ceiling value of technology maximums
     73     # Increased technology maximums should be reflected here.
     74     write /proc/sys/net/core/rmem_max  1500000
     75     write /proc/sys/net/core/wmem_max  1500000
     76     write /proc/sys/net/ipv4/tcp_limit_output_bytes 1500000
     77     setprop net.tcp.buffersize.wifi 500000,1000000,1500000,500000,1000000,1500000
     78 
     79     chown system system /sys/class/backlight/psb-bl/brightness
     80     chown system system /sys/class/backlight/psb-bl/max_brightness
     81     chown system system /sys/class/backlight/psb-bl/actual_brightness
     82     chmod 0664 /sys/class/backlight/psb-bl/brightness
     83     chmod 0664 /sys/class/backlight/psb-bl/max_brightness
     84     chmod 0664 /sys/class/backlight/psb-bl/actual_brightness
     85 
     86     # Wifi
     87     setprop wifi.interface wlan0
     88 
     89 on post-fs
     90     # Performance tweaks for interactive governor
     91     chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
     92     chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
     93     chown system system /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
     94     chmod 0660 /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
     95     chown system system /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
     96     chmod 0660 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
     97     chown system system /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
     98     chmod 0660 /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
     99     chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
    100     chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
    101     chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
    102     chown system system /sys/devices/system/cpu/cpufreq/interactive/touchboostpulse
    103     chown system system /sys/devices/system/cpu/cpufreq/interactive/touchboostpulse_duration
    104     chown system system /sys/devices/system/cpu/cpufreq/interactive/touchboost_freq
    105     chmod 0220 /sys/devices/system/cpu/cpufreq/interactive/touchboostpulse
    106     chmod 0220 /sys/devices/system/cpu/cpufreq/interactive/boostpulse
    107 
    108     # Tune interactive governor parameters for Android TV UI animations
    109     write /sys/devices/system/cpu/cpufreq/interactive/timer_rate 4000
    110     write /sys/devices/system/cpu/cpufreq/interactive/timer_slack 16000
    111     write /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load 90
    112     write /sys/devices/system/cpu/cpufreq/interactive/target_loads 70
    113     write /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration 800000
    114 
    115     # SEP
    116     copy /system/etc/security/sep_policy.conf /sys/fs/sepfs/load
    117     chown system system /dev/dx_sep_q0
    118     chmod 0666 /dev/dx_sep_q0
    119     chown system system /dev/dx_sep_q1
    120     chmod 0666 /dev/dx_sep_q1
    121 
    122     # hdmi cec
    123     chown system system /sys/module/tngdisp/parameters/hdmi_state
    124     chmod 0440 /sys/module/tngdisp/parameters/hdmi_state
    125     chown system system /sys/module/tngdisp/parameters/hdmi_edid_src_phy_addr
    126     chmod 0440 /sys/module/tngdisp/parameters/hdmi_edid_src_phy_addr
    127 
    128 on post-fs-data
    129     mkdir /data/media 0770 media_rw media_rw
    130 
    131     # Create the directories used by the Wireless subsystem
    132     mkdir /data/misc/wifi 0770 wifi wifi
    133     mkdir /data/misc/wifi/sockets 0770 wifi wifi
    134     mkdir /data/misc/dhcp 0770 dhcp wifi
    135 
    136     mkdir /data/tombstones 0771 system system
    137 
    138     # Bluetooth
    139     setprop ro.bt.bdaddr_path "/factory/bt/bd_addr.conf"
    140     chmod 0660 /sys/class/rfkill/rfkill2/state
    141     chown bluetooth net_bt_stack /sys/class/rfkill/rfkill2/state
    142     chown bluetooth net_bt_stack /sys/class/rfkill/rfkill2/type
    143 
    144     # Create directory used by audio subsystem
    145     mkdir /data/misc/audio 0770 audio audio
    146 
    147     mkdir /data/system 0775 system system
    148 
    149     setprop vold.post_fs_data_done 1
    150 
    151     setprop init.post_fs_data.bootreason ${ro.boot.bootreason}
    152 
    153     # itux
    154     # Set this property to enable Thermal service
    155     setprop persist.service.thermal 1
    156     # Properties for Thermal Service
    157     setprop persist.thermal.turbo.dynamic 1
    158     setprop ro.thermal.ituxversion 3.0
    159     setprop persist.thermal.shutdown.msg 0
    160     setprop persist.thermal.shutdown.vibra 0
    161     setprop persist.thermal.shutdown.tone 0
    162     chown system system /sys/module/intel_mid_osip/parameters/force_shutdown_occured
    163     chown system system /sys/module/intel_mid_osip/parameters/thermal_shutdown_occured
    164     chown system system /sys/devices/platform/coretemp.0/temp2_threshold1
    165     chown system system /sys/devices/platform/coretemp.0/temp2_threshold2
    166     chown system system /sys/devices/virtual/thermal/thermal_zone6/emul_temp
    167     chown system system /sys/devices/virtual/thermal/thermal_zone7/emul_temp
    168 
    169     # Stop led blinking and reduce brightness
    170     write /sys/class/leds/white/device/led_lighting_effect 1
    171     write /sys/class/leds/white/brightness 0
    172 
    173     # Playready
    174     mkdir /data/mediadrm/playready/ 0770 mediadrm mediadrm
    175     copy  /system/vendor/firmware/PR-ModelCert /data/mediadrm/playready/bgroupcert.dat
    176     chown mediadrm mediadrm /data/mediadrm/playready/bgroupcert.dat
    177     chmod 0440 /data/mediadrm/playready/bgroupcert.dat
    178 
    179 on property:init.post_fs_data.bootreason=*
    180     # Create dump dir and collect dumps. (use the same location as in init.rc)
    181     mkdir /data/dontpanic 0750 root log
    182 
    183     copy /proc/emmc_ipanic_console /data/dontpanic/ipanic_console
    184     chown root log /data/dontpanic/ipanic_console
    185     chmod 0640 /data/dontpanic/ipanic_console
    186 
    187     copy /proc/emmc_ipanic_threads /data/dontpanic/ipanic_threads
    188     chown root log /data/dontpanic/ipanic_threads
    189     chmod 0640 /data/dontpanic/ipanic_threads
    190 
    191     copy /proc/emmc_ipanic_gbuffer /data/dontpanic/ipanic_gbuffer
    192     chown root log /data/dontpanic/ipanic_gbuffer
    193     chmod 0640 /data/dontpanic/ipanic_gbuffer
    194 
    195     # Clear panic partition
    196     write /proc/emmc_ipanic_header 1
    197 
    198 on property:init.svc.wpa_supplicant=stopped
    199     stop dhcpcd
    200 
    201 service wpa_supplicant /system/bin/wpa_supplicant -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -g@android:wpa_wlan0
    202     class main
    203     socket wpa_wlan0 dgram 660 wifi wifi
    204     group system wifi inet bluetooth
    205     disabled
    206     oneshot
    207 
    208 service p2p_supplicant /system/bin/wpa_supplicant \
    209    -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
    210    -m/data/misc/wifi/p2p_supplicant.conf \
    211    -puse_p2p_group_interface=1p2p_device=1use_multi_chan_concurrent=1 \
    212    -O/data/misc/wifi/sockets \
    213    -e/data/misc/wifi/entropy.bin \
    214    -g@android:wpa_wlan0
    215     class main
    216     socket wpa_wlan0 dgram 660 wifi wifi
    217     disabled
    218     oneshot
    219 
    220 service dhcpcd_eth0 /system/bin/dhcpcd -aABDKL
    221     class main
    222     disabled
    223     oneshot
    224 
    225 service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL
    226     class main
    227     disabled
    228     oneshot
    229 
    230 service dhcpcd_p2p /system/bin/dhcpcd -aABKL
    231     class main
    232     disabled
    233     oneshot
    234 
    235 service iprenew_eth0 /system/bin/dhcpcd -n
    236     class late_start
    237     disabled
    238     oneshot
    239 
    240 service iprenew_wlan0 /system/bin/dhcpcd -n
    241     class late_start
    242     disabled
    243     oneshot
    244 
    245 service iprenew_p2p /system/bin/dhcpcd -n
    246     class late_start
    247     disabled
    248     oneshot
    249 
    250 # Bluetooth related services
    251 service BtFwLoader /system/bin/BtFwLoader
    252     class main
    253     group bluetooth net_bt_stack
    254     user bluetooth
    255     oneshot
    256 
    257 service dhcpcd_bt-pan /system/bin/dhcpcd -ABKL
    258     class main
    259     group bluetooth wifi system dhcp
    260     disabled
    261     oneshot
    262 
    263 service iprenew_bt-pan /system/bin/dhcpcd -n
    264     group bluetooth system dhcp
    265     disabled
    266     oneshot
    267 
    268 # virtual sdcard daemon running as media_rw (1023)
    269 service sdcard /system/bin/sdcard -u 1023 -g 1023 -l /data/media /mnt/shell/emulated
    270     class late_start
    271 
    272 # bugreport is triggered by holding down volume down, volume up and power
    273 service bugreport /system/bin/dumpstate -d -p -B \
    274         -o /data/data/com.android.shell/files/bugreports/bugreport
    275     class main
    276     disabled
    277     oneshot
    278     keycodes 114 115 116
    279 
    280 # interval:60s margin:20s
    281 service watchdogd /sbin/watchdogd 60 20
    282     class core
    283     oneshot
    284     seclabel u:r:watchdogd:s0
    285 
    286 # Reset the watchdog counter once boot is completed
    287 on property:sys.boot_completed=1
    288     write /sys/devices/virtual/misc/watchdog/counter "0"
    289 
    290 service pvrsrvctl /system/vendor/bin/pvrsrvctl --no-module --start
    291     class core
    292     oneshot
    293     user root
    294 
    295 # Enable native bridge for target executables
    296 on early-init
    297     mount binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc
    298 
    299 on property:ro.enable.native.bridge.exec=1
    300     copy /system/etc/binfmt_misc/arm_exe /proc/sys/fs/binfmt_misc/register
    301     copy /system/etc/binfmt_misc/arm_dyn /proc/sys/fs/binfmt_misc/register
    302