| ReStranger | 3d63ad7 | 2025-09-30 04:05:06 +0300 | [diff] [blame^] | 1 | #============================================================================= |
| 2 | # Copyright (c) 2019-2022 Qualcomm Technologies, Inc. |
| 3 | # All Rights Reserved. |
| 4 | # Confidential and Proprietary - Qualcomm Technologies, Inc. |
| 5 | # |
| 6 | # Copyright (c) 2009-2012, 2014-2019, The Linux Foundation. All rights reserved. |
| 7 | # |
| 8 | # Redistribution and use in source and binary forms, with or without |
| 9 | # modification, are permitted provided that the following conditions are met: |
| 10 | # * Redistributions of source code must retain the above copyright |
| 11 | # notice, this list of conditions and the following disclaimer. |
| 12 | # * Redistributions in binary form must reproduce the above copyright |
| 13 | # notice, this list of conditions and the following disclaimer in the |
| 14 | # documentation and/or other materials provided with the distribution. |
| 15 | # * Neither the name of The Linux Foundation nor |
| 16 | # the names of its contributors may be used to endorse or promote |
| 17 | # products derived from this software without specific prior written |
| 18 | # permission. |
| 19 | # |
| 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 21 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 22 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 23 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
| 24 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 25 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 26 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| 27 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 28 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 29 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 30 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 31 | #============================================================================= |
| 32 | import /vendor/etc/init/hw/init.qti.kernel.test.rc |
| 33 | |
| 34 | on early-init |
| 35 | # Set the console loglevel to < KERN_WARN |
| 36 | # Set the default message loglevel to KERN_INFO |
| 37 | write /proc/sys/kernel/printk "4 6 1 7" |
| 38 | |
| 39 | start gki.modprobe |
| 40 | start vendor.modprobe |
| 41 | |
| 42 | # Mount tracefs in /sys/kernel/tracing as CONFIG_DEBUG_FS might be |
| 43 | # disabled and /sys/kernel/debug/tracing might not be available |
| 44 | mount tracefs tracefs /sys/kernel/tracing |
| 45 | chmod 0755 /sys/kernel/tracing |
| 46 | |
| 47 | chown root system /dev/kmsg |
| 48 | chmod 0620 /dev/kmsg |
| 49 | |
| 50 | write /proc/sys/kernel/sched_boost 1 |
| 51 | |
| 52 | write /proc/sys/kernel/firmware_config/force_sysfs_fallback 1 |
| 53 | |
| 54 | on post-fs |
| 55 | wait_for_prop vendor.all.modules.ready 1 |
| 56 | |
| 57 | # Create cgroup mount point for memory |
| 58 | mkdir /sys/fs/cgroup/memory/bg 0750 root system |
| 59 | write /sys/fs/cgroup/memory/bg/memory.swappiness 140 |
| 60 | write /sys/fs/cgroup/memory/bg/memory.move_charge_at_immigrate 1 |
| 61 | chown root system /sys/fs/cgroup/memory/bg/tasks |
| 62 | chmod 0660 /sys/fs/cgroup/memory/bg/tasks |
| 63 | |
| 64 | # update scheduler tunables |
| 65 | write /dev/cpuctl/foreground/cpu.uclamp.sched_boost_no_override 1 |
| 66 | write /dev/cpuctl/top-app/cpu.uclamp.sched_boost_no_override 1 |
| 67 | write /dev/cpuctl/background/cpu.uclamp.colocate 0 |
| 68 | write /dev/cpuctl/foreground/cpu.uclamp.colocate 0 |
| 69 | write /dev/cpuctl/top-app/cpu.uclamp.colocate 1 |
| 70 | |
| 71 | # set aggressive read ahead for dm-0 and dm-1 during boot up |
| 72 | write /sys/block/dm-0/queue/read_ahead_kb 2048 |
| 73 | write /sys/block/dm-1/queue/read_ahead_kb 2048 |
| 74 | write /sys/block/dm-2/queue/read_ahead_kb 2048 |
| 75 | |
| 76 | on early-boot |
| 77 | # Allow subsystem (modem etc) debugging |
| 78 | exec_background u:r:vendor_qti_init_shell_bg:s0 -- /vendor/bin/init.qti.write.sh /sys/kernel/boot_adsp/boot 1 |
| 79 | exec_background u:r:vendor_qti_init_shell_bg:s0 -- /vendor/bin/init.qti.write.sh /sys/kernel/boot_cdsp/boot 1 |
| 80 | exec_background u:r:vendor_qti_init_shell_bg:s0 -- /vendor/bin/init.qti.write.sh /sys/devices/virtual/cvp/cvp/boot 1 |
| 81 | |
| 82 | on boot |
| 83 | # Allow access to dload sysfs node |
| 84 | chown root system /sys/kernel/dload/emmc_dload |
| 85 | chmod 0660 /sys/kernel/dload/emmc_dload |
| 86 | chown root system /dev/block/bootdevice/by-name/ramdump |
| 87 | chmod 0660 /dev/block/bootdevice/by-name/ramdump |
| 88 | chown root system /sys/kernel/dload/dload_mode |
| 89 | chmod 0660 /sys/kernel/dload/dload_mode |
| 90 | |
| 91 | # set the io-scheduler to bfq on all mq support devices |
| 92 | write /sys/block/sda/queue/scheduler bfq |
| 93 | write /sys/block/sdb/queue/scheduler bfq |
| 94 | write /sys/block/sdc/queue/scheduler bfq |
| 95 | write /sys/block/sdd/queue/scheduler bfq |
| 96 | write /sys/block/sde/queue/scheduler bfq |
| 97 | write /sys/block/sdf/queue/scheduler bfq |
| 98 | write /sys/block/sdg/queue/scheduler bfq |
| 99 | write /sys/block/sdh/queue/scheduler bfq |
| 100 | write /sys/class/block/mmcblk0/queue/scheduler bfq |
| 101 | write /sys/class/block/mmcblk1/queue/scheduler bfq |
| 102 | |
| 103 | # update io-scheduler tunables |
| 104 | write /sys/block/sda/queue/iosched/slice_idle 0 |
| 105 | write /sys/block/sdb/queue/iosched/slice_idle 0 |
| 106 | write /sys/block/sdc/queue/iosched/slice_idle 0 |
| 107 | write /sys/block/sdd/queue/iosched/slice_idle 0 |
| 108 | write /sys/block/sde/queue/iosched/slice_idle 0 |
| 109 | write /sys/block/sdf/queue/iosched/slice_idle 0 |
| 110 | write /sys/block/sdg/queue/iosched/slice_idle 0 |
| 111 | write /sys/block/sdh/queue/iosched/slice_idle 0 |
| 112 | write /sys/class/block/mmcblk0/queue/iosched/slice_idle 0 |
| 113 | write /sys/class/block/mmcblk1/queue/iosched/slice_idle 0 |
| 114 | |
| 115 | # Allow access to memory hotplug device attributes |
| 116 | chown system system /sys/kernel/mem-offline/anon_migrate |
| 117 | |
| 118 | on post-fs-data |
| 119 | # Create directory used for dump collection |
| 120 | mkdir /data/vendor/ssrdump 0770 root system |
| 121 | |
| 122 | on property:persist.sys.ssr.enable_debug=* |
| 123 | write /sys/module/subsys_pil_tz/parameters/enable_debug ${persist.sys.ssr.enable_debug} |
| 124 | |
| 125 | on property:persist.sys.mba_boot_timeout=* |
| 126 | write /sys/module/pil_msa/parameters/pbl_mba_boot_timeout_ms ${persist.sys.mba_boot_timeout} |
| 127 | |
| 128 | on property:persist.sys.modem_auth_timeout=* |
| 129 | write /sys/module/pil_msa/parameters/modem_auth_timeout_ms ${persist.sys.modem_auth_timeout} |
| 130 | |
| 131 | on property:persist.sys.pil_proxy_timeout=* |
| 132 | write /sys/module/peripheral_loader/parameters/proxy_timeout_ms ${persist.sys.pil_proxy_timeout} |
| 133 | |
| 134 | on property:persist.vendor.ssr.enable_ramdumps=1 |
| 135 | write /sys/module/subsystem_restart/parameters/enable_ramdumps 1 |
| 136 | |
| 137 | on property:persist.vendor.ssr.enable_ramdumps=0 |
| 138 | write /sys/module/subsystem_restart/parameters/enable_ramdumps 0 |
| 139 | |
| 140 | on property:persist.vendor.sys.rawdump_copy=1 |
| 141 | write /sys/kernel/dload/emmc_dload 1 |
| 142 | |
| 143 | on property:persist.vendor.sys.rawdump_copy=0 |
| 144 | write /sys/kernel/dload/emmc_dload 0 |
| 145 | |
| 146 | service kernel-boot /vendor/bin/sh /vendor/bin/init.qti.kernel.sh |
| 147 | class core |
| 148 | user root |
| 149 | group root |
| 150 | disabled |
| 151 | oneshot |
| 152 | |
| 153 | service kernel-post-boot /vendor/bin/sh /vendor/bin/init.kernel.post_boot.sh |
| 154 | class core |
| 155 | user root |
| 156 | group root system wakelock graphics |
| 157 | disabled |
| 158 | oneshot |
| 159 | |
| 160 | on property:sys.boot_completed=1 |
| 161 | write /dev/kmsg "Boot completed " |
| 162 | #Reset read ahead for dm-0, dm-1 and dm-2 to 512kb |
| 163 | write /sys/block/dm-0/queue/read_ahead_kb 512 |
| 164 | write /sys/block/dm-1/queue/read_ahead_kb 512 |
| 165 | write /sys/block/dm-2/queue/read_ahead_kb 512 |
| 166 | write /proc/sys/vm/page-cluster 0 |
| 167 | start kernel-boot |
| 168 | start kernel-post-boot |
| 169 | |
| 170 | on charger |
| 171 | start kernel-post-boot |
| 172 | |
| 173 | service vendor.msm_irqbalance /vendor/bin/msm_irqbalance -f /system/vendor/etc/msm_irqbalance.conf |
| 174 | class core |
| 175 | user root |
| 176 | group root |
| 177 | disabled |
| 178 | |
| 179 | service gki.modprobe /vendor/bin/system_dlkm_modprobe.sh |
| 180 | class main |
| 181 | user root |
| 182 | group root system |
| 183 | disabled |
| 184 | stdio_to_kmsg |
| 185 | seclabel u:r:vendor_modprobe:s0 |
| 186 | oneshot |
| 187 | |
| 188 | service vendor.modprobe /vendor/bin/vendor_modprobe.sh |
| 189 | class main |
| 190 | user root |
| 191 | group root system |
| 192 | disabled |
| 193 | stdio_to_kmsg |
| 194 | seclabel u:r:vendor_modprobe:s0 |
| 195 | oneshot |