Albert I b09005f206
sm6250-common: Configure zRAM using fstab
* "32-bit overflow" CAF mentioned in the function wrapper inside post-boot
  script sounds very bs, since if it's 64-bit it won't be affected anyways

* We do the setup using fstab instead to allow setting up more flags such
  as setting up backing device and compression streams; as such kanged from
  Pixels

* zRAM size = 50% physical memory size to satisfy what CAF really wants

* Use LZ4 compression even for regular devices

Signed-off-by: Albert I <kras@raphielgang.org>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Change-Id: Ia6efb3d28e56fb026d9b28fc6633b2eac77dfa47
2021-09-09 18:46:08 +02:00

172 lines
6.5 KiB
Plaintext

# Copyright (c) 2013-2018,2020, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
on init
write /sys/module/qpnp_rtc/parameters/poweron_alarm 1
wait /dev/block/platform/soc/${ro.boot.bootdevice}
symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
write /dev/cpuset/top-app/cpus 0-3
write /dev/cpuset/foreground/cpus 0-3
write /dev/cpuset/foreground/boost/cpus 0-3
write /dev/cpuset/background/cpus 0-3
write /dev/cpuset/system-background/cpus 0-3
write /dev/cpuset/top-app/cpus 0-7
write /dev/cpuset/foreground/cpus 0-7
write /dev/cpuset/foreground/boost/cpus 0-7
write /dev/cpuset/background/cpus 0-7
write /dev/cpuset/system-background/cpus 0-7
mkdir /dev/cpuset/camera-daemon
write /dev/cpuset/camera-daemon/cpus 0-3
write /dev/cpuset/camera-daemon/mems 0
chown cameraserver cameraserver /dev/cpuset/camera-daemon
chown cameraserver cameraserver /dev/cpuset/camera-daemon/tasks
chmod 0660 /dev/cpuset/camera-daemon/tasks
on early-fs
start vold
on fs
start hwservicemanager
mount_all --early
chown root system /mnt/vendor/persist
chmod 0771 /mnt/vendor/persist
restorecon_recursive /mnt/vendor/persist
mkdir /mnt/vendor/persist/data 0700 system system
mkdir /mnt/vendor/persist/subsys 0770 root system
mkdir /mnt/vendor/persist/audio 0755 system system
mkdir /mnt/vendor/persist/haptics 0755 system system
chmod 0664 /sys/class/thermal/thermal_message/sconfig
chown system system /sys/class/thermal/thermal_message/sconfig
chmod 0666 /sys/class/thermal/thermal_message/temp_state
chown system system /sys/class/thermal/thermal_message/temp_state
on post-fs
write /dev/ipa 1
on late-fs
wait_for_prop hwservicemanager.ready true
exec_start wait_for_keymaster
mount_all --late
on post-fs-data
mkdir /data/vendor/touchpad 0775 system system
mkdir /data/vendor/hbtp 0750 system system
mkdir /persist/qti_fp 0700 system system
mkdir /data/vendor/nnhal 0700 system system
mkdir /data/vendor/mac_addr 0771 system system
mkdir /data/vendor/thermal 0771 root system
mkdir /data/vendor/thermal/config 0771 root system
on boot
chown system system /sys/class/drm/card0-DSI-1/disp_param
chmod 0664 /sys/class/drm/card0-DSI-1/disp_param
chown system system /sys/class/drm/card0-DSI-1/mipi_reg
chmod 0664 /sys/class/drm/card0-DSI-1/mipi_reg
chown system system /sys/class/drm/card0-DSI-1/panel_info
chmod 0444 /sys/class/drm/card0-DSI-1/panel_info
chown system system /sys/kernel/hbtp/display_pwr
start rmt_storage
start rfs_access
chmod 0666 sys/devices/platform/soc/890000.i2c/i2c-1/1-005a/cali
chmod 0666 sys/devices/platform/soc/890000.i2c/i2c-1/1-005a/cali_save
chmod 0666 sys/devices/platform/soc/890000.i2c/i2c-1/1-005a/f0_save
chmod 0666 sys/devices/platform/soc/890000.i2c/i2c-1/1-005a/osc_save
chmod 0666 sys/devices/platform/soc/890000.i2c/i2c-1/1-005a/osc_cali
# access permissions for fingerprint
chown system system /sys/bus/platform/devices/soc/soc:fpc1020/irq
chown system system /sys/bus/platform/devices/soc/soc:fpc1020/wakeup_enable
chown system system /sys/bus/platform/devices/soc/soc:fpc1020/modalias
chmod 0666 /dev/qseecom
chmod 0644 /dev/goodix_fp
chown system system /dev/goodix_fp
#USB controller configuration
setprop vendor.usb.rndis.func.name "gsi"
setprop vendor.usb.rmnet.func.name "gsi"
setprop vendor.usb.rmnet.inst.name "rmnet"
setprop vendor.usb.dpl.inst.name "dpl"
setprop vendor.usb.qdss.inst.name "qdss"
setprop vendor.usb.controller a600000.dwc3
#pd-mapper
service vendor.pd_mapper /vendor/bin/pd-mapper
class core
user system
group system
#Peripheral manager
service vendor.per_mgr /vendor/bin/pm-service
class core
user system
group system
ioprio rt 4
service vendor.per_proxy /vendor/bin/pm-proxy
class core
user system
group system
disabled
on property:init.svc.vendor.per_mgr=running
start vendor.per_proxy
on property:sys.shutdown.requested=*
stop vendor.per_proxy
on charger
mkdir /mnt/vendor/persist
chown root system /mnt/vendor/persist
chmod 0771 /mnt/vendor/persist
mkdir /mnt/vendor/persist/subsys 0770 root system
setprop sys.usb.controller a600000.dwc3
setprop sys.usb.configfs 1
chown system system /sys/class/leds/red/brightness
chmod 0666 /sys/class/leds/red/brightness
chmod 0666 /sys/class/backlight/panel0-backlight/brightness
start vendor.power_off_alarm
on property:sys.boot_completed=1
# Read only one page at a time
write /proc/sys/vm/page-cluster 0
# Swap more aggressively
write /proc/sys/vm/swappiness 100
# Set zRAM compression algorithm to LZ4
write /sys/block/zram0/comp_algorithm lz4
# Enable zRAM data deduplication feature
write /sys/block/zram0/use_dedup 1
# Mount swap partitions specified in fstab
swapon_all /vendor/etc/fstab.qcom
on property:ro.boot.multisim_config=*
setprop persist.radio.multisim.config ${ro.boot.multisim_config}