diff --git a/rootdir/Android.mk b/rootdir/Android.mk index 29bb96a..53ed91f 100644 --- a/rootdir/Android.mk +++ b/rootdir/Android.mk @@ -71,3 +71,9 @@ LOCAL_MODULE_CLASS := ETC LOCAL_SRC_FILES := etc/init.crda.sh include $(BUILD_PREBUILT) +include $(CLEAR_VARS) +LOCAL_MODULE := init.sec.boot.sh +LOCAL_MODULE_TAGS := optional eng +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/init.sec.boot.sh +include $(BUILD_PREBUILT) diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index 744101d..03dfddb 100644 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -28,6 +28,7 @@ import init.qcom.usb.rc on early-init + mount debugfs debugfs /sys/kernel/debug write /sys/block/mmcblk0/queue/scheduler noop on init @@ -66,26 +67,34 @@ on init on early-boot # set RLIMIT_MEMLOCK to 64MB setrlimit 8 67108864 67108864 - setprop qcom.audio.init complete - setprop qcom.thermal thermal-engine - exec /system/bin/sh /init.qcom.early_boot.sh ${ro.board.platform} - exec /system/bin/sh /init.qcom.syspart_fixup.sh ${ro.board.platform} ${ro.serialno} + # Allow subsystem (modem etc) debugging + write /sys/module/subsystem_restart/parameters/enable_debug ${persist.sys.ssr.enable_debug} + write /sys/kernel/boot_adsp/boot 1 + # exec /system/bin/sh /init.qcom.early_boot.sh ${ro.board.platform} + # exec /system/bin/sh /init.qcom.syspart_fixup.sh ${ro.board.platform} ${ro.serialno} on boot-pause exec system/bin/battery_charging on boot + + mount debugfs /sys/kernel/debug /sys/kernel/debug + chown bluetooth bluetooth /sys/module/bluetooth_power/parameters/power chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state chown bluetooth bluetooth /proc/bluetooth/sleep/proto + chown bluetooth bluetooth /sys/module/hci_uart/parameters/ath_lpm + chown bluetooth bluetooth /sys/module/hci_uart/parameters/ath_btwrite chown system system /sys/module/sco/parameters/disable_esco chown bluetooth bluetooth /sys/module/hci_smd/parameters/hcismd_set chmod 0660 /sys/module/bluetooth_power/parameters/power chmod 0660 /sys/module/hci_smd/parameters/hcismd_set chmod 0660 /sys/class/rfkill/rfkill0/state chmod 0660 /proc/bluetooth/sleep/proto - chown bluetooth bluetooth /dev/ttyHS0 + chown bluetooth net_bt_stack /dev/ttyHS0 + chmod 0660 /sys/module/hci_uart/parameters/ath_lpm + chmod 0660 /sys/module/hci_uart/parameters/ath_btwrite chmod 0660 /dev/ttyHS0 chown bluetooth bluetooth /sys/devices/platform/msm_serial_hs.0/clock chmod 0660 /sys/devices/platform/msm_serial_hs.0/clock @@ -93,6 +102,13 @@ on boot chmod 0660 /dev/ttyHS2 chown bluetooth bluetooth /dev/ttyHS2 + # for BT MAC address + mkdir /efs/bluetooth 0775 radio system + + #Audience ES705 UART + chmod 0660 /dev/ttyHS3 + chown system system /dev/ttyHS3 + # bluetooth LPM chmod 0220 /proc/bluetooth/sleep/lpm chmod 0220 /proc/bluetooth/sleep/btwrite @@ -111,6 +127,8 @@ on boot mkdir /dev/socket/qmux_gps 0770 gps gps chmod 2770 /dev/socket/qmux_gps + setprop wifi.interface wlan0 + # Allow QMUX daemon to assign port open wait time chown radio radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait @@ -126,8 +144,12 @@ on boot #Remove SUID bit for iproute2 ip tool chmod 0755 /system/bin/ip + chmod 0444 /sys/devices/platform/msm_hsusb/gadget/usb_state + #For bridgemgr daemon to inform the USB driver of the correct transport + chown radio radio /sys/class/android_usb/f_rmnet_smd_sdio/transport + # create symlink for fb1 as HDMI symlink /dev/graphics/fb1 /dev/graphics/hdmi @@ -170,6 +192,10 @@ on boot write /proc/sys/net/ipv6/conf/rmnet_sdio5/accept_ra 2 write /proc/sys/net/ipv6/conf/rmnet_sdio6/accept_ra 2 write /proc/sys/net/ipv6/conf/rmnet_sdio7/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet_usb0/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet_usb1/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet_usb2/accept_ra 2 + write /proc/sys/net/ipv6/conf/rmnet_usb3/accept_ra 2 # To prevent out of order acknowledgements from making # connection tracking to treat them as not belonging to @@ -179,13 +205,20 @@ on boot # an ack packet comes out of order write /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal 1 + # NFC local data and nfcee xml storage + mkdir /data/nfc 0770 nfc nfc + mkdir /data/nfc/param 0770 nfc nfc + + # Set the console loglevel to < KERN_INFO + # Set the default message loglevel to KERN_INFO + # modified by SEC, SEC use a loglevel path with another way. + # write /proc/sys/kernel/printk "6 6 1 7" + # Flash storage isn't a good entropy source, and only causes locking # overhead in the kernel. Turn it off. write /sys/block/mmcblk0/queue/add_random 0 -# import cne init file on post-fs - #export_rc /persist/init.cne.rc # Increase max readahead size to 512 KB write /sys/block/mmcblk0/queue/read_ahead_kb 512 # for controlling write performance boosting @@ -207,23 +240,42 @@ on post-fs-data mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi mkdir /data/misc/dhcp 0770 dhcp dhcp + # Create the directories used by CnE subsystem + mkdir /data/connectivity 0771 system system + chown system system /data/connectivity + # for WIFI TRP/TIS - write /data/.psm.info 1 chown system root /data/.psm.info - chmod 0660 /data/.psm.info + chmod 0664 /data/.psm.info + + # for WIFI Antena Selection + chown system root /data/.ant.info + chmod 0664 /data/.ant.info + + # for WIFI Version + write /data/.wifiver.info 0 + chown system root /data/.wifiver.info + chmod 0664 /data/.wifiver.info + + # for WIFI Cert + chmod 0664 /data/.bustxglom.info + chmod 0664 /data/.roamoff.info + chmod 0664 /data/.frameburst.info + chmod 0664 /data/.txbf.info # for WIFI MAC address mkdir /efs/wifi 0775 radio system - chown system system /efs/wifi/.mac.info - chmod 0664 /efs/wifi/.mac.info + chown system wifi /efs/wifi/.mac.info + chmod 0660 /efs/wifi/.mac.info + chmod 0660 /efs/wifi/.mac.cob # Create directory used by audio subsystem mkdir /data/misc/audio 0770 audio audio # Mounting of persist is moved to 'on emmc-fs' and 'on fs' sections # We chown/chmod /persist again so because mount is run as root + defaults - #chown system system /persist - #chmod 0771 /persist + chown system system /persist + chmod 0771 /persist chmod 0664 /sys/devices/platform/msm_sdcc.1/polling chmod 0664 /sys/devices/platform/msm_sdcc.2/polling chmod 0664 /sys/devices/platform/msm_sdcc.3/polling @@ -244,11 +296,6 @@ on post-fs-data #Create the symlink to qcn wpa_supplicant folder for ar6000 wpa_supplicant mkdir /data/system 0775 system system - rm /data/system/wpa_supplicant - - #Create directories for wiper services - mkdir /data/wpstiles/ 0755 shell - mkdir /data/wiper 0755 location qcom_oncrpc #Create directories for gpsone_daemon services mkdir /data/misc/gpsone_d 0770 system system @@ -269,6 +316,8 @@ on post-fs-data mkdir /data/fota 0771 chown system system /data/fota + #Create directory for hostapd + mkdir /data/hostapd 0770 system wifi #Provide the access to hostapd.conf only to root and group chmod 0660 /data/hostapd/hostapd.conf @@ -285,12 +334,16 @@ on post-fs-data setprop vold.post_fs_data_done 1 - chown root radio /sys/module/rmnet_usb/parameters/dump_ctrl_msg + #Create a folder for SRS to be able to create a usercfg file + mkdir /data/data/media 0770 media media - write /sys/devices/system/cpu/cpu0/online 1 - write /sys/devices/system/cpu/cpu1/online 1 - write /sys/devices/system/cpu/cpu2/online 1 - write /sys/devices/system/cpu/cpu3/online 1 + # Gpio DVS + chown radio system /sys/class/secgpio_check/secgpio_check_all/secgpio_ctrl + + #write /sys/devices/system/cpu/cpu0/online 1 + #write /sys/devices/system/cpu/cpu1/online 1 + #write /sys/devices/system/cpu/cpu2/online 1 + #write /sys/devices/system/cpu/cpu3/online 1 # Export GPIO56 for fusion targets to enable/disable hub service usbhub_init /system/bin/usbhub_init @@ -629,6 +682,11 @@ service profiler_daemon /system/bin/profiler_daemon group root disabled +service sec-sh /system/bin/sh /system/etc/init.sec.boot.sh + class main + user root + oneshot + # virtual sdcard daemon running as media_rw (1023) service sdcard /system/bin/sdcard -u 1023 -g 1023 -l /data/media /mnt/shell/emulated class late_start diff --git a/rootdir/etc/init.sec.boot.sh b/rootdir/etc/init.sec.boot.sh new file mode 100644 index 0000000..bf4cdd3 --- /dev/null +++ b/rootdir/etc/init.sec.boot.sh @@ -0,0 +1,17 @@ +#!/system/bin/sh + +echo "init.sec.boot.sh: start" > /dev/kmsg + +# start deferred initcalls +cat /proc/deferred_initcalls + +## strace for system_server +#str="" +#while [ "$str" = "" ]; do +# str=`ps | grep system_server` +# sleep 0.1 +#done +# +#pid=${str:10:4} +#echo "init.sec.boot.sh: strace -tt -T -o /data/log/strace.txt -p ${pid}" > /dev/kmsg +#strace -tt -T -o /data/log/strace.txt -p ${pid}