Home | History | Annotate | Download | only in flo
      1 #
      2 # Copyright 2012 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.flo.usb.rc
     18 
     19 on early-init
     20     mount debugfs debugfs /sys/kernel/debug
     21     chown system system /sys/kernel/debug/kgsl/proc
     22     symlink /data/tombstones /tombstones
     23 
     24 on init
     25     # See storage config details at http://source.android.com/tech/storage/
     26     mkdir /mnt/shell/emulated 0700 shell shell
     27     mkdir /storage/emulated 0555 root root
     28 
     29     export EXTERNAL_STORAGE /storage/emulated/legacy
     30     export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
     31     export EMULATED_STORAGE_TARGET /storage/emulated
     32 
     33     # Support legacy paths
     34     symlink /storage/emulated/legacy /sdcard
     35     symlink /storage/emulated/legacy /mnt/sdcard
     36     symlink /storage/emulated/legacy /storage/sdcard0
     37     symlink /mnt/shell/emulated/0 /storage/emulated/legacy
     38 
     39 on init
     40     # Set permissions for persist partition
     41     mkdir /persist 0771 system system
     42     mkdir /firmware 0771 system system
     43 
     44 on fs
     45     mount_all ./fstab.flo
     46     setprop ro.crypto.fuse_sdcard true
     47     write /sys/kernel/boot_adsp/boot 1
     48 
     49 on early-boot
     50     # set RLIMIT_MEMLOCK to 64MB
     51     setrlimit 8 67108864 67108864
     52 
     53 on boot
     54     #Create QMUX deamon socket area
     55     mkdir /dev/socket/qmux_radio 0770 radio radio
     56     chmod 2770 /dev/socket/qmux_radio
     57     mkdir /dev/socket/qmux_audio 0770 media audio
     58     chmod 2770 /dev/socket/qmux_audio
     59     mkdir /dev/socket/qmux_bluetooth 0770 bluetooth net_bt_stack
     60     chmod 2770 /dev/socket/qmux_bluetooth
     61     mkdir /dev/socket/qmux_gps 0770 gps gps
     62     chmod 2770 /dev/socket/qmux_gps
     63 
     64     # Allow QMUX daemon to assign port open wait time
     65     chown radio radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait
     66 
     67     #Remove SUID bit for iproute2 ip tool
     68     chmod 0755 /system/bin/ip
     69 
     70     #port-bridge
     71     chmod 0660 /dev/smd0
     72     chown system system /dev/smd0
     73 
     74     chmod 0444 /sys/devices/platform/msm_hsusb/gadget/usb_state
     75 
     76     # create symlink for fb1 as HDMI
     77     symlink /dev/graphics/fb1 /dev/graphics/hdmi
     78 
     79     # Remove write permissions to video related nodes
     80     chmod 0664 /sys/devices/virtual/graphics/fb1/hpd
     81     chmod 0664 /sys/devices/virtual/graphics/fb1/video_mode
     82     chmod 0664 /sys/devices/virtual/graphics/fb1/format_3d
     83 
     84     # Change owner and group for media server and surface flinger
     85     chown system system /sys/devices/virtual/graphics/fb1/format_3d
     86     chown system system /sys/devices/virtual/graphics/fb1/hpd
     87 
     88     #For bridgemgr daemon to inform the USB driver of the correct transport
     89     chown radio radio /sys/class/android_usb/f_rmnet_smd_sdio/transport
     90 
     91     chmod 660 /dev/rtc0
     92     chown system system /dev/rtc0
     93 
     94     chown root system /proc/net/ip_conntrack
     95 
     96     # Enable DEBUG_SUSPEND, DEBUG_EXIT_SUSPEND, and DEBUG_WAKEUP
     97     write /sys/module/wakelock/parameters/debug_mask 7
     98 
     99     write /proc/sys/vm/swappiness 0
    100 
    101     #To allow interfaces to get v6 address when tethering is enabled
    102     write /proc/sys/net/ipv6/conf/rmnet0/accept_ra 2
    103     write /proc/sys/net/ipv6/conf/rmnet1/accept_ra 2
    104     write /proc/sys/net/ipv6/conf/rmnet2/accept_ra 2
    105     write /proc/sys/net/ipv6/conf/rmnet3/accept_ra 2
    106     write /proc/sys/net/ipv6/conf/rmnet4/accept_ra 2
    107     write /proc/sys/net/ipv6/conf/rmnet5/accept_ra 2
    108     write /proc/sys/net/ipv6/conf/rmnet6/accept_ra 2
    109     write /proc/sys/net/ipv6/conf/rmnet7/accept_ra 2
    110     write /proc/sys/net/ipv6/conf/rmnet_sdio0/accept_ra 2
    111     write /proc/sys/net/ipv6/conf/rmnet_sdio1/accept_ra 2
    112     write /proc/sys/net/ipv6/conf/rmnet_sdio2/accept_ra 2
    113     write /proc/sys/net/ipv6/conf/rmnet_sdio3/accept_ra 2
    114     write /proc/sys/net/ipv6/conf/rmnet_sdio4/accept_ra 2
    115     write /proc/sys/net/ipv6/conf/rmnet_sdio5/accept_ra 2
    116     write /proc/sys/net/ipv6/conf/rmnet_sdio6/accept_ra 2
    117     write /proc/sys/net/ipv6/conf/rmnet_sdio7/accept_ra 2
    118 
    119 
    120 # NFC: create data/nfc for nv storage
    121     mkdir /data/nfc 770 nfc nfc
    122     mkdir /data/nfc/param 770 nfc nfc
    123 
    124 # Assign TCP buffer thresholds to be ceiling value of technology maximums
    125 # Increased technology maximums should be reflected here.
    126     write /proc/sys/net/core/rmem_max  1220608
    127     write /proc/sys/net/core/wmem_max  1220608
    128 
    129 # msm specific files that need to be created on /data
    130 on post-fs-data
    131     mkdir /data/media 0770 media_rw media_rw
    132 
    133     # Create the directories used by the Wireless subsystem
    134     mkdir /data/misc/wifi 0770 wifi wifi
    135     mkdir /data/misc/wifi/sockets 0770 wifi wifi
    136     mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi
    137     mkdir /data/misc/dhcp 0770 dhcp dhcp
    138 
    139     chown system system /dev/wcnss_wlan
    140     write /sys/module/wcnss_ssr_8960/parameters/enable_riva_ssr 1
    141 
    142     mkdir /data/tombstones 0771 system system
    143     mkdir /tombstones/modem 0771 system system
    144     mkdir /tombstones/lpass 0771 system system
    145     mkdir /tombstones/wcnss 0771 system system
    146     mkdir /tombstones/dsps 0771 system system
    147     mkdir /tombstones/mdm 0771 system system
    148 
    149 # to observe dnsmasq.leases file for dhcp information of soft ap.
    150     chown dhcp system /data/misc/dhcp
    151 
    152     # Create directory used by audio subsystem
    153     mkdir /data/misc/audio 0770 audio audio
    154 
    155     # Mounting of persist is moved to 'on emmc-fs' and 'on fs' sections
    156     # We chown/chmod /persist again so because mount is run as root + defaults
    157     chown system system /persist
    158     chmod 0664 /sys/devices/platform/msm_sdcc.1/polling
    159     chmod 0664 /sys/devices/platform/msm_sdcc.2/polling
    160     chmod 0664 /sys/devices/platform/msm_sdcc.3/polling
    161     chmod 0664 /sys/devices/platform/msm_sdcc.4/polling
    162 
    163     # Chown polling nodes as needed from UI running on system server
    164     chown system system /sys/devices/platform/msm_sdcc.1/polling
    165     chown system system /sys/devices/platform/msm_sdcc.2/polling
    166     chown system system /sys/devices/platform/msm_sdcc.3/polling
    167     chown system system /sys/devices/platform/msm_sdcc.4/polling
    168 
    169     #Create the symlink to qcn wpa_supplicant folder for ar6000 wpa_supplicant
    170     mkdir /data/system 0775 system system
    171     #symlink /data/misc/wifi/wpa_supplicant /data/system/wpa_supplicant
    172 
    173     #Create directory used by sensor subsystem(dsps)
    174     mkdir /data/system/sensors
    175     chmod 665 /data/system/sensors
    176     write /data/system/sensors/settings 1
    177     chmod 660 /data/system/sensors/settings
    178 
    179     # AKM setting data
    180     mkdir /data/misc/sensors
    181     chmod 775 /data/misc/sensors
    182 
    183     mkdir /persist/sensors
    184     chmod 775 /persist/sensors
    185 
    186     # Modify from 777 (for camera calibration) to 775
    187     chmod 775 /persist/camera_calibration
    188 
    189     # Modify from 777 (for lightsensor) to 775
    190     chmod 775 /persist/lightsensor
    191 
    192     # Modify from 777 (for lightsensor calibration data) to 664
    193     chmod 664 /persist/lightsensor/AL3010_Config.ini
    194 
    195     chmod 664 /persist/ssn
    196     chmod 664 /persist/60isn
    197 
    198     #Provide the access to hostapd.conf only to root and group
    199     chmod 0660 /data/hostapd/hostapd.conf
    200 
    201     # Enable the setgid bit on the directory
    202     mkdir /data/audio 0770 media audio
    203     chmod 2770 /data/audio
    204 
    205     # kickstart
    206     mkdir /data/qcks 0770 system system
    207     chown system /dev/block/platform/msm_sdcc.1/by-name
    208 
    209     setprop vold.post_fs_data_done 1
    210 
    211     rm /data/local/tmp/adreno_config.txt
    212 
    213     # White LED
    214     chown system system /sys/class/leds/white/device/lock
    215     chown system system /sys/class/leds/white/brightness
    216     chown system system /sys/class/leds/white/device/grpfreq
    217     chown system system /sys/class/leds/white/device/grppwm
    218     chown system system /sys/class/leds/white/device/blink
    219 
    220     # communicate with mpdecision and thermald
    221     mkdir /dev/socket/mpdecision 0770 system system
    222     chmod 2770 /dev/socket/mpdecision
    223 
    224     # adjust vibrator amplitude
    225     write /sys/class/timed_output/vibrator/amp 70
    226 
    227     # Enable Power modes and set the CPU Freq Sampling rates
    228     write /sys/module/rpm_resources/enable_low_power/L2_cache 1
    229     write /sys/module/rpm_resources/enable_low_power/pxo 1
    230     write /sys/module/rpm_resources/enable_low_power/vdd_dig 1
    231     write /sys/module/rpm_resources/enable_low_power/vdd_mem 1
    232     write /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled 1
    233     write /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled 1
    234     write /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled 1
    235     write /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled 1
    236     write /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled 1
    237     write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "ondemand"
    238     write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "ondemand"
    239     write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "ondemand"
    240     write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor "ondemand"
    241     write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 90
    242     write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 50000
    243     write /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy 1
    244     write /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor 4
    245     write /sys/devices/system/cpu/cpufreq/ondemand/down_differential 10
    246     write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core 60
    247     write /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core 3
    248     write /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq 918000
    249     write /sys/devices/system/cpu/cpufreq/ondemand/sync_freq 1026000
    250     write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load 80
    251     write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 384000
    252     write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 384000
    253     write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 384000
    254     write /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 384000
    255     write /sys/devices/system/cpu/cpu1/online 1
    256     write /sys/devices/system/cpu/cpu2/online 1
    257     write /sys/devices/system/cpu/cpu3/online 1
    258     write /dev/cpuctl/apps/cpu.notify_on_migrate 1
    259 
    260 on charger
    261     # Enable Power modes and set the CPU Freq Sampling rates
    262     write /sys/module/rpm_resources/enable_low_power/L2_cache 1
    263     write /sys/module/rpm_resources/enable_low_power/pxo 1
    264     write /sys/module/rpm_resources/enable_low_power/vdd_dig 1
    265     write /sys/module/rpm_resources/enable_low_power/vdd_mem 1
    266     write /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled 1
    267     write /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled 1
    268     write /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled 1
    269     write /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled 1
    270     write /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled 1
    271     write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "powersave"
    272     write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "powersave"
    273     write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "powersave"
    274     write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor "powersave"
    275     write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 90
    276     write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 50000
    277     write /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy 1
    278     write /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor 4
    279     write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 384000
    280     write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 384000
    281     write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 384000
    282     write /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 384000
    283 
    284 on property:init.svc.wpa_supplicant=stopped
    285     stop dhcpcd
    286 
    287 service irsc_util /system/bin/logwrapper /system/bin/irsc_util "/etc/sec_config"
    288     class main
    289     user root
    290     oneshot
    291 
    292 service rmt_storage /system/bin/rmt_storage
    293     class main
    294     user root
    295 
    296 service hciattach /system/bin/sh /system/etc/init.flo.bt.sh
    297     class late_start
    298     user bluetooth
    299     group qcom_oncrpc bluetooth net_bt_admin system net_bt_stack
    300     disabled
    301     oneshot
    302 
    303 on property:bluetooth.hciattach=true
    304     start hciattach
    305 
    306 on property:bluetooth.hciattach=false
    307     setprop bluetooth.status off
    308 
    309 service bridgemgrd /system/bin/bridgemgrd
    310     class main
    311     user radio
    312     group radio
    313 
    314 service qcom-c_main-sh /system/bin/sh /init.qcom.class_main.sh
    315     class main
    316     user root
    317     oneshot
    318 
    319 # QMUX must be in multiple groups to support external process connections
    320 service qmuxd /system/bin/qmuxd
    321     class main
    322     user radio
    323     group radio audio bluetooth gps net_bt_stack
    324     disabled
    325 
    326 service ks_checker /system/bin/sh /system/etc/kickstart_checker.sh
    327     class core
    328     oneshot
    329 
    330 service kickstart /system/bin/qcks -i /firmware/image/ -r /data/tombstones/mdm/
    331     class core
    332     user system
    333     group system
    334     disabled
    335     oneshot
    336 
    337 service asus-dbug-d /data/data/com.asus.debugger/files/asus-debugger-d
    338     class late_start
    339     disabled
    340 
    341 on property:gsm.radio.kickstart=on
    342     start kickstart
    343 
    344 on property:gsm.radio.kickstart=off
    345     stop kickstart
    346 
    347 on property:ril.asus_debugger_running=1
    348     start asus-dbug-d
    349 
    350 service netmgrd /system/bin/netmgrd
    351     class main
    352     disabled
    353 
    354 
    355 service sensors /system/bin/sensors.qcom
    356     class late_start
    357     user root
    358     group root
    359 
    360 service wpa_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant \
    361     -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
    362     -I/system/etc/wifi/wpa_supplicant_overlay.conf \
    363     -O/data/misc/wifi/sockets \
    364     -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
    365     #   we will start as root and wpa_supplicant will switch to user wifi
    366     #   after setting up the capabilities required for WEXT
    367     #   user wifi
    368     #   group wifi inet keystore
    369     class main
    370     socket wpa_wlan0 dgram 660 wifi wifi
    371     disabled
    372     oneshot
    373 
    374 service p2p_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant \
    375     -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \
    376     -I/system/etc/wifi/p2p_supplicant_overlay.conf -N \
    377     -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
    378     -I/system/etc/wifi/wpa_supplicant_overlay.conf \
    379     -O/data/misc/wifi/sockets -puse_p2p_group_interface=1 \
    380     -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
    381 #   we will start as root and wpa_supplicant will switch to user wifi
    382 #   after setting up the capabilities required for WEXT
    383 #   user wifi
    384 #   group wifi inet keystore
    385     class main
    386     socket wpa_wlan0 dgram 660 wifi wifi
    387     disabled
    388     oneshot
    389 
    390 service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL
    391     class main
    392     disabled
    393     oneshot
    394 
    395 service dhcpcd_p2p /system/bin/dhcpcd -aABKL
    396     class main
    397     disabled
    398     oneshot
    399 
    400 service iprenew_wlan0 /system/bin/dhcpcd -n
    401     class main
    402     disabled
    403     oneshot
    404 
    405 service iprenew_p2p /system/bin/dhcpcd -n
    406     class main
    407     disabled
    408     oneshot
    409 
    410 service dhcpcd_bt-pan /system/bin/dhcpcd -ABKL
    411     class main
    412     disabled
    413     oneshot
    414 
    415 service iprenew_bt-pan /system/bin/dhcpcd -n
    416     class main
    417     disabled
    418     oneshot
    419 
    420 on property:ro.data.large_tcp_window_size=true
    421     # Adjust socket buffer to enlarge TCP receive window for high bandwidth (e.g. DO-RevB)
    422     write /proc/sys/net/ipv4/tcp_adv_win_scale  1
    423 
    424 service charger /charger
    425     class charger
    426 
    427 # virtual sdcard daemon running as media_rw (1023)
    428 service sdcard /system/bin/sdcard -u 1023 -g 1023 -l /data/media /mnt/shell/emulated
    429     class late_start
    430 
    431 service thermald /system/bin/thermald
    432     class main
    433 
    434 service mpdecision /system/bin/mpdecision --no_sleep --avg_comp
    435     class main
    436 
    437 service ppd /system/bin/mm-pp-daemon
    438     class late_start
    439     disabled
    440     user system
    441     socket pps stream 0660 system system graphics
    442     group system graphics
    443 
    444 service qcamerasvr /system/bin/mm-qcamera-daemon
    445     class late_start
    446     user camera
    447     group camera system inet input
    448 
    449 service wcnss_init /system/bin/sh /system/etc/init.flo.wifi.sh
    450     class main
    451     user system
    452     group system wifi
    453     oneshot
    454 
    455 service bdAddrLoader /system/bin/bdAddrLoader -f /persist/bluetooth/.bdaddr -h -x
    456     class main
    457     user bluetooth
    458     group system bluetooth net_bt_stack
    459     oneshot
    460 
    461 # bugreport is triggered by holding down volume down, volume up and power
    462 service bugreport /system/bin/dumpstate -d -p -B \
    463         -o /data/data/com.android.shell/files/bugreports/bugreport
    464     class main
    465     disabled
    466     oneshot
    467     keycodes 114 115 116
    468 
    469 service qseecomd /system/bin/qseecomd
    470     class late_start
    471     user system
    472     group system
    473 
    474 service diag_mdlog /system/bin/logwrapper /system/bin/diag_mdlog -s 100
    475     class late_start
    476     disabled
    477 
    478 
    479 
    480 # on property:gsm.sim.state=READY
    481 #    start diag_mdlog
    482 
    483 on property:ro.boot.baseband=mdm
    484     start qmuxd
    485     start netmgrd
    486 
    487 on property:ro.boot.baseband=apq
    488     setprop ro.radio.noril yes
    489     stop ril-daemon
    490 
    491 on property:init.svc.surfaceflinger=running
    492     start ppd
    493 
    494 on property:init.svc.surfaceflinger=stopped
    495     stop ppd
    496