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