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