| ReStranger | 1b85f70 | 2025-09-30 04:05:06 +0300 | [diff] [blame^] | 1 | # Copyright (c) 2020-2023 Qualcomm Technologies, Inc. |
| 2 | # All Rights Reserved. |
| 3 | # Confidential and Proprietary - Qualcomm Technologies, Inc. |
| 4 | # |
| 5 | # Copyright (c) 2009-2012, 2014-2019, The Linux Foundation. All rights reserved. |
| 6 | # |
| 7 | # Redistribution and use in source and binary forms, with or without |
| 8 | # modification, are permitted provided that the following conditions are met: |
| 9 | # * Redistributions of source code must retain the above copyright |
| 10 | # notice, this list of conditions and the following disclaimer. |
| 11 | # * Redistributions in binary form must reproduce the above copyright |
| 12 | # notice, this list of conditions and the following disclaimer in the |
| 13 | # documentation and/or other materials provided with the distribution. |
| 14 | # * Neither the name of The Linux Foundation nor |
| 15 | # the names of its contributors may be used to endorse or promote |
| 16 | # products derived from this software without specific prior written |
| 17 | # permission. |
| 18 | # |
| 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 21 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 22 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
| 23 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 24 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 25 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 28 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 29 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 | # |
| 31 | |
| 32 | KernelVersionStr=`cat /proc/sys/kernel/osrelease` |
| 33 | KernelVersionS=${KernelVersionStr:2:2} |
| 34 | KernelVersionA=${KernelVersionStr:0:1} |
| 35 | KernelVersionB=${KernelVersionS%.*} |
| 36 | |
| 37 | function configure_zram_parameters() { |
| 38 | MemTotalStr=`cat /proc/meminfo | grep MemTotal` |
| 39 | MemTotal=${MemTotalStr:16:8} |
| 40 | |
| 41 | low_ram=`getprop ro.config.low_ram` |
| 42 | |
| 43 | # Zram disk - 75% for Go devices. |
| 44 | # For 512MB Go device, size = 384MB, set same for Non-Go. |
| 45 | # For 1GB Go device, size = 768MB, set same for Non-Go. |
| 46 | # For 2GB Go device, size = 1536MB, set same for Non-Go. |
| 47 | # For >2GB Non-Go devices, size = 50% of RAM size. Limit the size to 4GB. |
| 48 | # And enable lz4 zram compression for Go targets. |
| 49 | |
| 50 | let RamSizeGB="( $MemTotal / 1048576 ) + 1" |
| 51 | diskSizeUnit=M |
| 52 | if [ $RamSizeGB -le 2 ]; then |
| 53 | let zRamSizeMB="( $RamSizeGB * 1024 ) * 3 / 4" |
| 54 | else |
| 55 | let zRamSizeMB="( $RamSizeGB * 1024 ) / 2" |
| 56 | fi |
| 57 | |
| 58 | # use MB avoid 32 bit overflow |
| 59 | if [ $zRamSizeMB -gt 4096 ]; then |
| 60 | let zRamSizeMB=4096 |
| 61 | fi |
| 62 | |
| 63 | if [ "$low_ram" == "true" ]; then |
| 64 | echo lz4 > /sys/block/zram0/comp_algorithm |
| 65 | fi |
| 66 | |
| 67 | if [ -f /sys/block/zram0/disksize ]; then |
| 68 | if [ -f /sys/block/zram0/use_dedup ]; then |
| 69 | echo 1 > /sys/block/zram0/use_dedup |
| 70 | fi |
| 71 | echo "$zRamSizeMB""$diskSizeUnit" > /sys/block/zram0/disksize |
| 72 | |
| 73 | # ZRAM may use more memory than it saves if SLAB_STORE_USER |
| 74 | # debug option is enabled. |
| 75 | if [ -e /sys/kernel/slab/zs_handle ]; then |
| 76 | echo 0 > /sys/kernel/slab/zs_handle/store_user |
| 77 | fi |
| 78 | if [ -e /sys/kernel/slab/zspage ]; then |
| 79 | echo 0 > /sys/kernel/slab/zspage/store_user |
| 80 | fi |
| 81 | |
| 82 | mkswap /dev/block/zram0 |
| 83 | swapon /dev/block/zram0 -p 32758 |
| 84 | fi |
| 85 | } |
| 86 | |
| 87 | function configure_read_ahead_kb_values() { |
| 88 | MemTotalStr=`cat /proc/meminfo | grep MemTotal` |
| 89 | MemTotal=${MemTotalStr:16:8} |
| 90 | |
| 91 | dmpts=$(ls /sys/block/*/queue/read_ahead_kb | grep -e dm -e mmc -e sd) |
| 92 | # dmpts holds below read_ahead_kb nodes if exists: |
| 93 | # /sys/block/dm-0/queue/read_ahead_kb to /sys/block/dm-10/queue/read_ahead_kb |
| 94 | # /sys/block/sda/queue/read_ahead_kb to /sys/block/sdh/queue/read_ahead_kb |
| 95 | |
| 96 | # Set 128 for <= 3GB & |
| 97 | # set 512 for >= 4GB targets. |
| 98 | if [ $MemTotal -le 3145728 ]; then |
| 99 | ra_kb=128 |
| 100 | else |
| 101 | ra_kb=512 |
| 102 | fi |
| 103 | if [ -f /sys/block/mmcblk0/bdi/read_ahead_kb ]; then |
| 104 | echo $ra_kb > /sys/block/mmcblk0/bdi/read_ahead_kb |
| 105 | fi |
| 106 | if [ -f /sys/block/mmcblk0rpmb/bdi/read_ahead_kb ]; then |
| 107 | echo $ra_kb > /sys/block/mmcblk0rpmb/bdi/read_ahead_kb |
| 108 | fi |
| 109 | for dm in $dmpts; do |
| 110 | echo $ra_kb > $dm |
| 111 | done |
| 112 | } |
| 113 | |
| 114 | function disable_core_ctl() { |
| 115 | if [ -f /sys/devices/system/cpu/cpu0/core_ctl/enable ]; then |
| 116 | echo 0 > /sys/devices/system/cpu/cpu0/core_ctl/enable |
| 117 | else |
| 118 | echo 1 > /sys/devices/system/cpu/cpu0/core_ctl/disable |
| 119 | fi |
| 120 | } |
| 121 | |
| 122 | function configure_memory_parameters() { |
| 123 | # Set Memory parameters. |
| 124 | # |
| 125 | # Set per_process_reclaim tuning parameters |
| 126 | # All targets will use vmpressure range 50-70, |
| 127 | # All targets will use 512 pages swap size. |
| 128 | # |
| 129 | # Set Low memory killer minfree parameters |
| 130 | # 32 bit Non-Go, all memory configurations will use 15K series |
| 131 | # 32 bit Go, all memory configurations will use uLMK + Memcg |
| 132 | # 64 bit will use Google default LMK series. |
| 133 | # |
| 134 | # Set ALMK parameters (usually above the highest minfree values) |
| 135 | # vmpressure_file_min threshold is always set slightly higher |
| 136 | # than LMK minfree's last bin value for all targets. It is calculated as |
| 137 | # vmpressure_file_min = (last bin - second last bin ) + last bin |
| 138 | # |
| 139 | # Set allocstall_threshold to 0 for all targets. |
| 140 | # |
| 141 | |
| 142 | # Set swappiness to 100 for all targets |
| 143 | echo 100 > /proc/sys/vm/swappiness |
| 144 | |
| 145 | # Disable wsf for all targets beacause we are using efk. |
| 146 | # wsf Range : 1..1000 So set to bare minimum value 1. |
| 147 | echo 1 > /proc/sys/vm/watermark_scale_factor |
| 148 | |
| 149 | configure_zram_parameters |
| 150 | |
| 151 | configure_read_ahead_kb_values |
| 152 | |
| 153 | # Disable periodic kcompactd wakeups. We do not use THP, so having many |
| 154 | # huge pages is not as necessary. |
| 155 | echo 0 > /proc/sys/vm/compaction_proactiveness |
| 156 | |
| 157 | # With THP enabled, the kernel greatly increases min_free_kbytes over its |
| 158 | # default value. Disable THP to prevent resetting of min_free_kbytes |
| 159 | # value during online/offline pages. |
| 160 | |
| 161 | if [ -f /sys/kernel/mm/transparent_hugepage/enabled ]; then |
| 162 | echo never > /sys/kernel/mm/transparent_hugepage/enabled |
| 163 | fi |
| 164 | |
| 165 | MemTotalStr=`cat /proc/meminfo | grep MemTotal` |
| 166 | MemTotal=${MemTotalStr:16:8} |
| 167 | let RamSizeGB="( $MemTotal / 1048576 ) + 1" |
| 168 | |
| 169 | # Set the min_free_kbytes to standard kernel value |
| 170 | if [ $RamSizeGB -ge 8 ]; then |
| 171 | echo 11584 > /proc/sys/vm/min_free_kbytes |
| 172 | elif [ $RamSizeGB -ge 4 ]; then |
| 173 | echo 8192 > /proc/sys/vm/min_free_kbytes |
| 174 | elif [ $RamSizeGB -ge 2 ]; then |
| 175 | echo 5792 > /proc/sys/vm/min_free_kbytes |
| 176 | else |
| 177 | echo 4096 > /proc/sys/vm/min_free_kbytes |
| 178 | fi |
| 179 | } |
| 180 | |
| 181 | function start_hbtp() |
| 182 | { |
| 183 | # Start the Host based Touch processing but not in the power off mode. |
| 184 | bootmode=`getprop ro.bootmode` |
| 185 | if [ "charger" != $bootmode ]; then |
| 186 | start vendor.hbtp |
| 187 | fi |
| 188 | } |
| 189 | |
| 190 | if [ -f /sys/devices/soc0/soc_id ]; then |
| 191 | soc_id=`cat /sys/devices/soc0/soc_id` |
| 192 | else |
| 193 | soc_id=`cat /sys/devices/system/soc/soc0/id` |
| 194 | fi |
| 195 | |
| 196 | configure_memory_parameters |
| 197 | |
| 198 | # Configure RT parameters: |
| 199 | # Long running RT task detection is confined to consolidated builds. |
| 200 | # Set RT throttle runtime to 50ms more than long running RT |
| 201 | # task detection time. |
| 202 | # Set RT throttle period to 100ms more than RT throttle runtime. |
| 203 | long_running_rt_task_ms=1200 |
| 204 | sched_rt_runtime_ms=`expr $long_running_rt_task_ms + 50` |
| 205 | sched_rt_runtime_us=`expr $sched_rt_runtime_ms \* 1000` |
| 206 | sched_rt_period_ms=`expr $sched_rt_runtime_ms + 100` |
| 207 | sched_rt_period_us=`expr $sched_rt_period_ms \* 1000` |
| 208 | if [ -d /sys/module/sched_walt_debug ]; then |
| 209 | echo $long_running_rt_task_ms > /proc/sys/walt/sched_long_running_rt_task_ms |
| 210 | fi |
| 211 | echo $sched_rt_period_us > /proc/sys/kernel/sched_rt_period_us |
| 212 | echo $sched_rt_runtime_us > /proc/sys/kernel/sched_rt_runtime_us |
| 213 | |
| 214 | # Disable Core control on silver |
| 215 | echo 0 > /sys/devices/system/cpu/cpu0/core_ctl/enable |
| 216 | |
| 217 | # Core control parameters for gold |
| 218 | if [ -d "/sys/devices/system/cpu/cpu4/" ]; then |
| 219 | echo 60 > /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres |
| 220 | echo 40 > /sys/devices/system/cpu/cpu4/core_ctl/busy_down_thres |
| 221 | echo 100 > /sys/devices/system/cpu/cpu4/core_ctl/offline_delay_ms |
| 222 | echo 4 > /sys/devices/system/cpu/cpu4/core_ctl/task_thres |
| 223 | if [ -d "/sys/devices/system/cpu/cpu7/" ]; then |
| 224 | echo 2 > /sys/devices/system/cpu/cpu4/core_ctl/min_cpus |
| 225 | echo 1 0 0 0 > /sys/devices/system/cpu/cpu4/core_ctl/not_preferred |
| 226 | else |
| 227 | echo 1 > /sys/devices/system/cpu/cpu4/core_ctl/min_cpus |
| 228 | echo 1 0 > /sys/devices/system/cpu/cpu4/core_ctl/not_preferred |
| 229 | fi |
| 230 | |
| 231 | elif [ -d "/sys/devices/system/cpu/cpu5/" ]; then |
| 232 | echo 1 > /sys/devices/system/cpu/cpu5/core_ctl/min_cpus |
| 233 | echo 60 > /sys/devices/system/cpu/cpu5/core_ctl/busy_up_thres |
| 234 | echo 40 > /sys/devices/system/cpu/cpu5/core_ctl/busy_down_thres |
| 235 | echo 100 > /sys/devices/system/cpu/cpu5/core_ctl/offline_delay_ms |
| 236 | echo 4 > /sys/devices/system/cpu/cpu5/core_ctl/task_thres |
| 237 | echo 1 0 > /sys/devices/system/cpu/cpu5/core_ctl/not_preferred |
| 238 | |
| 239 | elif [ -d "/sys/devices/system/cpu/cpu6/" ]; then |
| 240 | echo 1 > /sys/devices/system/cpu/cpu6/core_ctl/min_cpus |
| 241 | echo 60 > /sys/devices/system/cpu/cpu6/core_ctl/busy_up_thres |
| 242 | echo 40 > /sys/devices/system/cpu/cpu6/core_ctl/busy_down_thres |
| 243 | echo 100 > /sys/devices/system/cpu/cpu6/core_ctl/offline_delay_ms |
| 244 | echo 4 > /sys/devices/system/cpu/cpu6/core_ctl/task_thres |
| 245 | echo 1 0 > /sys/devices/system/cpu/cpu6/core_ctl/not_preferred |
| 246 | fi |
| 247 | |
| 248 | # Controls how many more tasks should be eligible to run on gold CPUs |
| 249 | # w.r.t number of gold CPUs available to trigger assist (max number of |
| 250 | # tasks eligible to run on previous cluster minus number of CPUs in |
| 251 | # the previous cluster). |
| 252 | # |
| 253 | # Setting to 1 by default which means there should be at least |
| 254 | # 5 tasks eligible to run on gold cluster (tasks running on gold cores |
| 255 | # plus misfit tasks on silver cores) to trigger assitance from gold+. |
| 256 | #echo 1 > /sys/devices/system/cpu/cpu7/core_ctl/nr_prev_assist_thresh |
| 257 | |
| 258 | # Setting b.L scheduler parameters |
| 259 | echo 65 > /proc/sys/walt/sched_downmigrate |
| 260 | echo 71 > /proc/sys/walt/sched_upmigrate |
| 261 | echo 100 > /proc/sys/walt/sched_group_upmigrate |
| 262 | echo 85 > /proc/sys/walt/sched_group_downmigrate |
| 263 | echo 1 > /proc/sys/walt/sched_walt_rotate_big_tasks |
| 264 | echo 400000000 > /proc/sys/walt/sched_coloc_downmigrate_ns |
| 265 | echo 39000000 39000000 39000000 39000000 39000000 39000000 39000000 39000000 > /proc/sys/walt/sched_coloc_busy_hyst_cpu_ns |
| 266 | echo 248 > /proc/sys/walt/sched_coloc_busy_hysteresis_enable_cpus |
| 267 | echo 10 10 10 10 10 10 10 10 > /proc/sys/walt/sched_coloc_busy_hyst_cpu_busy_pct |
| 268 | echo 8500000 8500000 8500000 8500000 8500000 8500000 8500000 8500000 > /proc/sys/walt/sched_util_busy_hyst_cpu_ns |
| 269 | echo 255 > /proc/sys/walt/sched_util_busy_hysteresis_enable_cpus |
| 270 | echo 1 1 1 1 1 1 1 1 > /proc/sys/walt/sched_util_busy_hyst_cpu_util |
| 271 | echo 40 > /proc/sys/walt/sched_cluster_util_thres_pct |
| 272 | echo 0 > /proc/sys/walt/sched_idle_enough |
| 273 | |
| 274 | #Set early upmigrate tunables |
| 275 | nr_cpus=`grep -c processor /proc/cpuinfo` |
| 276 | if [ $nr_cpus -gt 4 ]; then |
| 277 | freq_to_migrate=1228800 |
| 278 | silver_fmax=`cat /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq` |
| 279 | silver_early_upmigrate="$((1024 * $silver_fmax / $freq_to_migrate))" |
| 280 | silver_early_downmigrate="$((((1024 * $silver_fmax) / (((10*$freq_to_migrate) - $silver_fmax) / 10))))" |
| 281 | sched_upmigrate=`cat /proc/sys/walt/sched_upmigrate` |
| 282 | sched_downmigrate=`cat /proc/sys/walt/sched_downmigrate` |
| 283 | sched_upmigrate=${sched_upmigrate:0:2} |
| 284 | sched_downmigrate=${sched_downmigrate:0:2} |
| 285 | gold_early_upmigrate="$((1024 * 100 / $sched_upmigrate))" |
| 286 | gold_early_downmigrate="$((1024 * 100 / $sched_downmigrate))" |
| 287 | echo $silver_early_downmigrate $gold_early_downmigrate > /proc/sys/walt/sched_early_downmigrate |
| 288 | echo $silver_early_upmigrate $gold_early_upmigrate > /proc/sys/walt/sched_early_upmigrate |
| 289 | fi |
| 290 | |
| 291 | # set the threshold for low latency task boost feature which prioritize |
| 292 | # binder activity tasks |
| 293 | echo 325 > /proc/sys/walt/walt_low_latency_task_threshold |
| 294 | |
| 295 | # cpuset parameters |
| 296 | echo 0-3 > /dev/cpuset/background/cpus |
| 297 | echo 0-3 > /dev/cpuset/system-background/cpus |
| 298 | |
| 299 | # Turn off scheduler boost at the end |
| 300 | echo 0 > /proc/sys/walt/sched_boost |
| 301 | |
| 302 | # Reset the RT boost, which is 1024 (max) by default. |
| 303 | echo 0 > /proc/sys/kernel/sched_util_clamp_min_rt_default |
| 304 | |
| 305 | # configure governor settings for silver cluster |
| 306 | echo "walt" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor |
| 307 | echo 0 > /sys/devices/system/cpu/cpufreq/policy0/walt/down_rate_limit_us |
| 308 | echo 0 > /sys/devices/system/cpu/cpufreq/policy0/walt/up_rate_limit_us |
| 309 | echo 1516800 > /sys/devices/system/cpu/cpufreq/policy0/walt/hispeed_freq |
| 310 | echo 691200 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq |
| 311 | echo 1 > /sys/devices/system/cpu/cpufreq/policy0/walt/pl |
| 312 | echo 0 > /sys/devices/system/cpu/cpufreq/policy0/walt/rtg_boost_freq |
| 313 | |
| 314 | # configure input boost settings |
| 315 | echo 1190000 0 0 0 0 0 0 0 > /proc/sys/walt/input_boost/input_boost_freq |
| 316 | echo 80 > /proc/sys/walt/input_boost/input_boost_ms |
| 317 | |
| 318 | # configure governor settings for gold cluster |
| 319 | if [ -d "/sys/devices/system/cpu/cpufreq/policy4/" ]; then |
| 320 | echo "walt" > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor |
| 321 | echo 0 > /sys/devices/system/cpu/cpufreq/policy4/walt/down_rate_limit_us |
| 322 | echo 0 > /sys/devices/system/cpu/cpufreq/policy4/walt/up_rate_limit_us |
| 323 | echo 1344000 > /sys/devices/system/cpu/cpufreq/policy4/walt/hispeed_freq |
| 324 | echo 1056000 > /sys/devices/system/cpu/cpufreq/policy4/scaling_min_freq |
| 325 | echo 1 > /sys/devices/system/cpu/cpufreq/policy4/walt/pl |
| 326 | echo 0 > /sys/devices/system/cpu/cpufreq/policy4/walt/rtg_boost_freq |
| 327 | |
| 328 | elif [ -d "/sys/devices/system/cpu/cpufreq/policy5/" ]; then |
| 329 | echo "walt" > /sys/devices/system/cpu/cpufreq/policy5/scaling_governor |
| 330 | echo 0 > /sys/devices/system/cpu/cpufreq/policy5/walt/down_rate_limit_us |
| 331 | echo 0 > /sys/devices/system/cpu/cpufreq/policy5/walt/up_rate_limit_us |
| 332 | echo 1344000 > /sys/devices/system/cpu/cpufreq/policy5/walt/hispeed_freq |
| 333 | echo 1056000 > /sys/devices/system/cpu/cpufreq/policy5/scaling_min_freq |
| 334 | echo 1 > /sys/devices/system/cpu/cpufreq/policy5/walt/pl |
| 335 | echo 0 > /sys/devices/system/cpu/cpufreq/policy5/walt/rtg_boost_freq |
| 336 | |
| 337 | elif [ -d "/sys/devices/system/cpu/cpufreq/policy6/" ]; then |
| 338 | echo "walt" > /sys/devices/system/cpu/cpufreq/policy6/scaling_governor |
| 339 | echo 0 > /sys/devices/system/cpu/cpufreq/policy6/walt/down_rate_limit_us |
| 340 | echo 0 > /sys/devices/system/cpu/cpufreq/policy6/walt/up_rate_limit_us |
| 341 | echo 1344000 > /sys/devices/system/cpu/cpufreq/policy6/walt/hispeed_freq |
| 342 | echo 1056000 > /sys/devices/system/cpu/cpufreq/policy6/scaling_min_freq |
| 343 | echo 1 > /sys/devices/system/cpu/cpufreq/policy6/walt/pl |
| 344 | echo 0 > /sys/devices/system/cpu/cpufreq/policy6/walt/rtg_boost_freq |
| 345 | fi |
| 346 | |
| 347 | # configure bus-dcvs |
| 348 | bus_dcvs="/sys/devices/system/cpu/bus_dcvs" |
| 349 | |
| 350 | for device in $bus_dcvs/* |
| 351 | do |
| 352 | cat $device/hw_min_freq > $device/boost_freq |
| 353 | done |
| 354 | |
| 355 | for ddrbw in $bus_dcvs/DDR/*bwmon-ddr |
| 356 | do |
| 357 | echo "762 2086 2929 3879 5931 6881 7980" > $ddrbw/mbps_zones |
| 358 | echo 4 > $ddrbw/sample_ms |
| 359 | echo 85 > $ddrbw/io_percent |
| 360 | echo 20 > $ddrbw/hist_memory |
| 361 | echo 0 > $ddrbw/hyst_length |
| 362 | echo 80 > $ddrbw/down_thres |
| 363 | echo 0 > $ddrbw/guard_band_mbps |
| 364 | echo 250 > $ddrbw/up_scale |
| 365 | echo 1600 > $ddrbw/idle_mbps |
| 366 | echo 2092000 > $ddrbw/max_freq |
| 367 | done |
| 368 | |
| 369 | echo s2idle > /sys/power/mem_sleep |
| 370 | echo N > /sys/devices/system/cpu/qcom_lpm/parameters/sleep_disabled |
| 371 | |
| 372 | # Let kernel know our image version/variant/crm_version |
| 373 | if [ -f /sys/devices/soc0/select_image ]; then |
| 374 | image_version="10:" |
| 375 | image_version+=`getprop ro.build.id` |
| 376 | image_version+=":" |
| 377 | image_version+=`getprop ro.build.version.incremental` |
| 378 | image_variant=`getprop ro.product.name` |
| 379 | image_variant+="-" |
| 380 | image_variant+=`getprop ro.build.type` |
| 381 | oem_version=`getprop ro.build.version.codename` |
| 382 | echo 10 > /sys/devices/soc0/select_image |
| 383 | echo $image_version > /sys/devices/soc0/image_version |
| 384 | echo $image_variant > /sys/devices/soc0/image_variant |
| 385 | echo $oem_version > /sys/devices/soc0/image_crm_version |
| 386 | fi |
| 387 | |
| 388 | echo 4 > /proc/sys/kernel/printk |
| 389 | |
| 390 | # Change console log level as per console config property |
| 391 | console_config=`getprop persist.vendor.console.silent.config` |
| 392 | case "$console_config" in |
| 393 | "1") |
| 394 | echo "Enable console config to $console_config" |
| 395 | echo 0 > /proc/sys/kernel/printk |
| 396 | ;; |
| 397 | *) |
| 398 | echo "Enable console config to $console_config" |
| 399 | ;; |
| 400 | esac |
| 401 | |
| 402 | # Post-setup services |
| 403 | setprop vendor.post_boot.parsed 1 |