From 467fffc2682fabaedc38f9458050504429615629 Mon Sep 17 00:00:00 2001 From: Simon1511 Date: Tue, 14 Dec 2021 16:06:18 +0100 Subject: [PATCH] a52q: De-commonize A52 specific configs and files Change-Id: Ie7c1a0b49c200a72449fe05e9b4a51f0f3abf005 --- BoardConfig.mk | 3 + configs/audio/mixer_paths.xml | 4080 +++++++++++++++++ device.mk | 11 + extract-files.sh | 63 + .../base/core/res/res/values/config.xml | 43 + proprietary-files.txt | 84 + rootdir/Android.mk | 11 + rootdir/etc/init.a52q.rc | 105 + setup-makefiles.sh | 44 + 9 files changed, 4444 insertions(+) create mode 100644 configs/audio/mixer_paths.xml create mode 100755 extract-files.sh create mode 100644 overlay/frameworks/base/core/res/res/values/config.xml create mode 100644 proprietary-files.txt create mode 100644 rootdir/Android.mk create mode 100644 rootdir/etc/init.a52q.rc create mode 100755 setup-makefiles.sh diff --git a/BoardConfig.mk b/BoardConfig.mk index 00aa348..f02ac17 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -22,5 +22,8 @@ include device/samsung/sm7125-common/BoardConfigCommon.mk TARGET_KERNEL_CONFIG := vendor/lineage-a52q_defconfig BOARD_NAME := SRPTH31C002 +# Display +TARGET_SCREEN_DENSITY := 420 + # OTA assert TARGET_OTA_ASSERT_DEVICE := a52q diff --git a/configs/audio/mixer_paths.xml b/configs/audio/mixer_paths.xml new file mode 100644 index 0000000..6b339df --- /dev/null +++ b/configs/audio/mixer_paths.xml @@ -0,0 +1,4080 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/device.mk b/device.mk index 89996c1..9adf7b6 100644 --- a/device.mk +++ b/device.mk @@ -20,3 +20,14 @@ DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay # call the common setup $(call inherit-product, device/samsung/sm7125-common/common.mk) + +# call the proprietary setup +$(call inherit-product, vendor/samsung/a52q/a52q-vendor.mk) + +# Init files +PRODUCT_PACKAGES += \ + init.a52q.rc + +# Audio +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/configs/audio/mixer_paths.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths.xml diff --git a/extract-files.sh b/extract-files.sh new file mode 100755 index 0000000..dbca4de --- /dev/null +++ b/extract-files.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# +# Copyright (C) 2018-2020 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +DEVICE_COMMON=a52q +VENDOR=samsung + +# Load extractutils and do some sanity checks +MY_DIR="${BASH_SOURCE%/*}" +if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi + +ANDROID_ROOT="${MY_DIR}/../../.." + +HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" + exit 1 +fi +source "${HELPER}" + +# Default to sanitizing the vendor folder before extraction +CLEAN_VENDOR=true + +KANG= +SECTION= + +while [ "${#}" -gt 0 ]; do + case "${1}" in + -n | --no-cleanup ) + CLEAN_VENDOR=false + ;; + -k | --kang ) + KANG="--kang" + ;; + -s | --section ) + SECTION="${2}"; shift + CLEAN_VENDOR=false + ;; + * ) + SRC="${1}" + ;; + esac + shift +done + +if [ -z "${SRC}" ]; then + SRC="adb" +fi + +# Initialize the helper +setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true "${CLEAN_VENDOR}" + +extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" + +# Fix proprietary blobs +BLOB_ROOT="$ANDROID_ROOT"/vendor/"$VENDOR"/"$DEVICE_COMMON"/proprietary + +"${MY_DIR}/setup-makefiles.sh" diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml new file mode 100644 index 0000000..8a85a11 --- /dev/null +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -0,0 +1,43 @@ + + + + + + M 0,0 M 0,12.25101276465640 a 10.60613009248640,10.60613009248640 0 1,0 0,21.21226018497290 a 10.60613009248640,10.60613009248640 0 1,0 0,-21.21226018497290 Z @dp + diff --git a/proprietary-files.txt b/proprietary-files.txt new file mode 100644 index 0000000..77e2f26 --- /dev/null +++ b/proprietary-files.txt @@ -0,0 +1,84 @@ +# All blobs are from A525FXXU4AUJ2, unless pinned + +# ACDB +vendor/etc/audconf/ODM/Global_cal.acdb +vendor/etc/audconf/ODM/Bluetooth_cal.acdb +vendor/etc/audconf/ODM/Headset_cal.acdb +vendor/etc/audconf/ODM/General_cal.acdb +vendor/etc/audconf/ODM/workspaceFile.qwsp +vendor/etc/audconf/ODM/Speaker_cal.acdb +vendor/etc/audconf/ODM/Hdmi_cal.acdb +vendor/etc/audconf/ODM/Handset_cal.acdb +vendor/etc/audconf/OPEN/Global_cal.acdb +vendor/etc/audconf/OPEN/Bluetooth_cal.acdb +vendor/etc/audconf/OPEN/Headset_cal.acdb +vendor/etc/audconf/OPEN/General_cal.acdb +vendor/etc/audconf/OPEN/workspaceFile.qwsp +vendor/etc/audconf/OPEN/Speaker_cal.acdb +vendor/etc/audconf/OPEN/Hdmi_cal.acdb +vendor/etc/audconf/OPEN/Handset_cal.acdb + +# ADSP modules +vendor/lib/libsnpe_dsp_domains_v2.so +vendor/lib/libSNPE.so +vendor/lib/libsnpe_wrapper.so + +# Bluetooth +vendor/firmware/apbtfw11.tlv +vendor/firmware/crbtfw21.tlv + +# Camera +vendor/lib/camera/components/com.samsung.node.smooth_transition.so +vendor/lib64/camera/components/com.samsung.node.smooth_transition.so +vendor/lib/camera/components/com.samsung.node.uniplugin_recording.so +vendor/lib/camera/components/com.samsung.node.uniplugin_vdis.so +vendor/lib/camera/components/com.wrapper.stats.aec.so +vendor/lib64/camera/components/com.wrapper.stats.aec.so +vendor/lib/camera/com.qti.eeprom.sec2qcconversion.so +vendor/lib/camera/com.samsung.sensor.gc5035.so +vendor/lib64/camera/com.samsung.sensor.gc5035.so +vendor/lib/camera/com.samsung.sensormodule.0_0_sony_imx682.bin +vendor/lib64/camera/com.samsung.sensormodule.0_0_sony_imx682.bin +vendor/lib/camera/com.samsung.sensormodule.0_1_lsi_s5kgw1p_otp.bin +vendor/lib64/camera/com.samsung.sensormodule.0_1_lsi_s5kgw1p_otp.bin +vendor/lib/camera/com.samsung.sensormodule.3_lsi_gc5035.bin +vendor/lib64/camera/com.samsung.sensormodule.3_lsi_gc5035.bin +vendor/lib/camera/com.samsung.sensormodule.4_0_lsi_gc5035_macro.bin +vendor/lib64/camera/com.samsung.sensormodule.4_0_lsi_gc5035_macro.bin +vendor/lib/camera/com.samsung.sensormodule.4_1_lsi_dv_gc5035_macro_hw_2.bin +vendor/lib64/camera/com.samsung.sensormodule.4_1_lsi_dv_gc5035_macro_hw_2.bin +vendor/lib/camera/com.samsung.tuned.hynix_hi1336.bin +vendor/lib64/camera/com.samsung.tuned.hynix_hi1336.bin +vendor/lib/camera/com.samsung.tuned.lsi_gc5035.bin +vendor/lib64/camera/com.samsung.tuned.lsi_gc5035.bin +vendor/lib/camera/com.samsung.tuned.lsi_s5k3l6.bin +vendor/lib64/camera/com.samsung.tuned.lsi_s5k3l6.bin +vendor/lib/camera/com.samsung.tuned.lsi_s5kgw1p.bin +vendor/lib64/camera/com.samsung.tuned.lsi_s5kgw1p.bin +vendor/lib/camera/com.samsung.tuned.sony_imx682.bin +vendor/lib64/camera/com.samsung.tuned.sony_imx682.bin +vendor/lib/camera/ois_mcu_stm32g_fw.bin +vendor/lib/camera/uw_dual_calibration.bin +vendor/lib/hw/com.samsung.chi.override.so +vendor/lib64/hw/com.samsung.chi.override.so +vendor/lib/libsec2qc_conversion.so +vendor/lib64/libsec2qc_conversion.so +vendor/lib/libface_landmark.arcsoft.so +vendor/lib64/libface_landmark.arcsoft.so +vendor/lib/libvdis_interface.so +vendor/lib64/libvdis_interface.so + +# Fingerprint +vendor/lib/libgf_in_system_lib.so +vendor/lib64/libgf_in_system_lib.so + +# Graphics +vendor/etc/qdcm_calib_data_ss_dsi_panel_S6E3FC3_AMS646YD04_FHD.xml + +# Neuralnetworks +vendor/lib/libhta.so + +# Sensors +vendor/etc/sensors/config/atoll_qrd_ak991x_0.json +vendor/etc/sensors/config/atoll_qrd_ak991x_2.json +vendor/etc/sensors/config/atoll_qrd_ak991x_6.json diff --git a/rootdir/Android.mk b/rootdir/Android.mk new file mode 100644 index 0000000..1e06e1c --- /dev/null +++ b/rootdir/Android.mk @@ -0,0 +1,11 @@ +LOCAL_PATH := $(call my-dir) + +# Init files + +include $(CLEAR_VARS) +LOCAL_MODULE := init.a52q.rc +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/init.a52q.rc +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw +include $(BUILD_PREBUILT) diff --git a/rootdir/etc/init.a52q.rc b/rootdir/etc/init.a52q.rc new file mode 100644 index 0000000..53b3319 --- /dev/null +++ b/rootdir/etc/init.a52q.rc @@ -0,0 +1,105 @@ +# 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 +# setup cgroup freezer for freecess + mkdir /dev/freezer + mount cgroup none /dev/freezer freezer + mkdir /dev/freezer/frozen + mkdir /dev/freezer/thaw + write /dev/freezer/frozen/freezer.state FROZEN + write /dev/freezer/thaw/freezer.state THAWED + +# MARs for freecess + chown system system /dev/freezer + chown system system /dev/freezer/frozen + chown system system /dev/freezer/frozen/tasks + chown system system /dev/freezer/frozen/cgroup.procs + chown system system /dev/freezer/frozen/freezer.state + chown system system /dev/freezer/thaw + chown system system /dev/freezer/thaw/tasks + chown system system /dev/freezer/thaw/cgroup.procs + +# MARs for freecess + chmod 0644 /dev/freezer/frozen/tasks + chmod 0644 /dev/freezer/frozen/cgroup.procs + chmod 0644 /dev/freezer/frozen/freezer.state + chmod 0644 /dev/freezer/thaw/tasks + chmod 0644 /dev/freezer/thaw/cgroup.procs + +# SDHMS Slowdown : Freezer + mkdir /dev/freezer/abnormal + write /dev/freezer/abnormal/freezer.state THAWED + chown system system /dev/freezer/abnormal + chown system system /dev/freezer/abnormal/tasks + chown system system /dev/freezer/abnormal/cgroup.procs + chown system system /dev/freezer/abnormal/freezer.state + chmod 0644 /dev/freezer/abnormal/tasks + chmod 0644 /dev/freezer/abnormal/cgroup.procs + chmod 0644 /dev/freezer/abnormal/freezer.state + +on boot +# SDHMS Slowdown : Cpuset + mkdir /dev/cpuset/abnormal + write /dev/cpuset/abnormal/cpus 0-3 + copy /dev/cpuset/mems /dev/cpuset/abnormal/mems + + chown system system /dev/cpuset/abnormal + chown system system /dev/cpuset/abnormal/tasks + chown system system /dev/cpuset/abnormal/cpus + chmod 0664 /dev/cpuset/abnormal/tasks + chmod 0664 /dev/cpuset/abnormal/cpus + + mkdir /dev/cpuset/moderate + write /dev/cpuset/moderate/cpus 0-2,4-6 + copy /dev/cpuset/mems /dev/cpuset/moderate/mems + + chown system system /dev/cpuset/moderate + chown system system /dev/cpuset/moderate/tasks + chown system system /dev/cpuset/moderate/cpus + chmod 0664 /dev/cpuset/moderate/tasks + chmod 0664 /dev/cpuset/moderate/cpus + +# SSWAP + write /proc/sys/vm/swappiness 130 + +# SQZR +on property:sys.boot_completed=1 + swapon_all /vendor/etc/fstab.sqzr + +on property:sys.sysctl.zram_balance_ratio=* + write /sys/module/zram/parameters/zram_balance_ratio ${sys.sysctl.zram_balance_ratio} + +on post-fs-data + # MST/NFC Switch + chmod 0660 /dev/mst_ctrl + +# SSU (Samsung SIM Unlock) +on property:ro.boot.carrierid=MXO + setprop ssu.support 1 diff --git a/setup-makefiles.sh b/setup-makefiles.sh new file mode 100755 index 0000000..7afacc6 --- /dev/null +++ b/setup-makefiles.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# +# Copyright (C) 2017-2021 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +DEVICE_COMMON=a52q +VENDOR=samsung + +# Load extractutils and do some sanity checks +MY_DIR="${BASH_SOURCE%/*}" +if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi + +ANDROID_ROOT="${MY_DIR}/../../.." + +HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" + exit 1 +fi +source "${HELPER}" + +# Initialize the helper +setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true + +# Warning headers and guards +write_headers "a52q" + +write_makefiles "${MY_DIR}/proprietary-files.txt" true + +################################################################################################### +# CUSTOM PART START # +################################################################################################### + +OUTDIR=vendor/$VENDOR/$DEVICE_COMMON + +################################################################################################### +# CUSTOM PART END # +################################################################################################### +# Done +write_footers