From cb1b743b8da4bba5d7ffd930467d387ea2a18b16 Mon Sep 17 00:00:00 2001 From: Max Weffers Date: Tue, 6 Aug 2019 20:05:02 +0200 Subject: [PATCH] sdm660-common: Transform into common sdm660 tree --- Android.mk | 2 +- BoardConfigCommon.mk | 8 ++-- README.md | 17 +++++++- biometrics/Android.bp | 4 +- biometrics/BiometricsFingerprint.cpp | 2 +- ....fingerprint@2.1-service.xiaomi_sdm660.rc} | 2 +- biometrics/service.cpp | 2 +- extract-files.sh | 2 +- init/Android.mk | 8 ++-- init/{init_wayne.cpp => init_sdm660.cpp} | 2 +- init/{init_wayne.h => init_sdm660.h} | 4 +- light/Android.bp | 4 +- light/Light.cpp | 2 +- ...rdware.light@2.0-service.xiaomi_sdm660.rc} | 2 +- light/service.cpp | 2 +- wayne.mk => sdm660.mk | 8 ++-- sepolicy/vendor/file_contexts | 4 +- sepolicy/vendor/hal_fingerprint_sdm660.te | 39 +++++++++++++++++++ sepolicy/vendor/hal_fingerprint_wayne.te | 39 ------------------- setup-makefiles.sh | 4 +- 20 files changed, 86 insertions(+), 71 deletions(-) rename biometrics/{android.hardware.biometrics.fingerprint@2.1-service.xiaomi_wayne.rc => android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sdm660.rc} (95%) rename init/{init_wayne.cpp => init_sdm660.cpp} (99%) rename init/{init_wayne.h => init_sdm660.h} (96%) rename light/{android.hardware.light@2.0-service.xiaomi_wayne.rc => android.hardware.light@2.0-service.xiaomi_sdm660.rc} (96%) rename wayne.mk => sdm660.mk (98%) create mode 100644 sepolicy/vendor/hal_fingerprint_sdm660.te delete mode 100644 sepolicy/vendor/hal_fingerprint_wayne.te diff --git a/Android.mk b/Android.mk index 7e31f382..9a3c41e3 100644 --- a/Android.mk +++ b/Android.mk @@ -16,7 +16,7 @@ LOCAL_PATH := $(call my-dir) -ifneq ($(filter jasmine_sprout wayne,$(TARGET_DEVICE)),) +ifneq ($(filter jasmine_sprout wayne clover,$(TARGET_DEVICE)),) $(shell mkdir -p $(TARGET_OUT_VENDOR)/firmware; \ ln -sf /dev/block/bootdevice/by-name/msadp \ diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index 5e529452..3274cd7f 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -22,7 +22,7 @@ # definition file). # -COMMON_PATH := device/xiaomi/wayne-common +COMMON_PATH := device/xiaomi/sdm660-common BOARD_VENDOR := xiaomi @@ -197,9 +197,9 @@ DEVICE_MANIFEST_FILE := $(COMMON_PATH)/manifest.xml DEVICE_MATRIX_FILE := $(COMMON_PATH)/compatibility_matrix.xml # Init -TARGET_INIT_VENDOR_LIB := libinit_wayne +TARGET_INIT_VENDOR_LIB := libinit_sdm660 TARGET_PLATFORM_DEVICE_BASE := /devices/soc/ -TARGET_RECOVERY_DEVICE_MODULES := libinit_wayne +TARGET_RECOVERY_DEVICE_MODULES := libinit_sdm660 # Keystore TARGET_PROVIDES_KEYMASTER := true @@ -282,4 +282,4 @@ WIFI_HIDL_FEATURE_DUAL_INTERFACE := true WPA_SUPPLICANT_VERSION := VER_0_8_X # Inherit the proprietary files --include vendor/xiaomi/wayne-common/BoardConfigVendor.mk +-include vendor/xiaomi/sdm660-common/BoardConfigVendor.mk diff --git a/README.md b/README.md index e9d629b4..d2803a26 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,19 @@ -This repository contains common device configuration for Xiaomi wayne-based devices +This repository contains device configuration for Xiaomi SDM660 devices + +Basic | Spec Sheet +-------:|:---------- +CPU | Quad-core 1.84 GHz Qualcomm Kryo 260 LP +CPU | Quad-core 2.20 GHz Qualcomm Kryo 260 HP +Chipset | Qualcomm Snapdragon 660, SDM660 +GPU | Adreno 512 +ROM | 32/64/128GB +RAM | 3/4/6GB +Android | 8.1.0 + +Note: +Depends on: android_packages_resources_devicesettings from LineageOS + +Currently Supported Devices: wayne (MI 6X), jasmine_sprout (MI A2) and clover (MI PAD 4 /4 Plus) ## Copyright diff --git a/biometrics/Android.bp b/biometrics/Android.bp index d6d13622..dacc3e3d 100644 --- a/biometrics/Android.bp +++ b/biometrics/Android.bp @@ -14,10 +14,10 @@ // limitations under the License. cc_binary { - name: "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_wayne", + name: "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sdm660", relative_install_path: "hw", defaults: ["hidl_defaults"], - init_rc: ["android.hardware.biometrics.fingerprint@2.1-service.xiaomi_wayne.rc"], + init_rc: ["android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sdm660.rc"], srcs: ["service.cpp", "BiometricsFingerprint.cpp"], shared_libs: [ "libbase", diff --git a/biometrics/BiometricsFingerprint.cpp b/biometrics/BiometricsFingerprint.cpp index bd934d2d..42243aba 100644 --- a/biometrics/BiometricsFingerprint.cpp +++ b/biometrics/BiometricsFingerprint.cpp @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_wayne" +#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sdm660" #include diff --git a/biometrics/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_wayne.rc b/biometrics/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sdm660.rc similarity index 95% rename from biometrics/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_wayne.rc rename to biometrics/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sdm660.rc index d3890ed0..00312b39 100644 --- a/biometrics/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_wayne.rc +++ b/biometrics/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sdm660.rc @@ -11,7 +11,7 @@ on boot chown system system /sys/devices/soc/soc:fpc1020/wakeup_enable chmod 0660 /sys/devices/soc/soc:fpc1020/wakeup_enable -service vendor.fps_hal /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_wayne +service vendor.fps_hal /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sdm660 class late_start user system group system input diff --git a/biometrics/service.cpp b/biometrics/service.cpp index ca36c468..bf833b32 100644 --- a/biometrics/service.cpp +++ b/biometrics/service.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_wayne" +#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sdm660" #include #include diff --git a/extract-files.sh b/extract-files.sh index 78b1ca42..85b8e765 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -17,7 +17,7 @@ set -e -DEVICE_COMMON=wayne-common +DEVICE_COMMON=sdm660-common VENDOR=xiaomi # Load extract_utils and do some sanity checks diff --git a/init/Android.mk b/init/Android.mk index fc4a5ba0..89ff9543 100644 --- a/init/Android.mk +++ b/init/Android.mk @@ -21,17 +21,17 @@ include $(CLEAR_VARS) LOCAL_C_INCLUDES := \ system/core/base/include \ system/core/init -LOCAL_MODULE := libinit_wayne +LOCAL_MODULE := libinit_sdm660 LOCAL_MODULE_TAGS := optional -LOCAL_SRC_FILES := init_wayne.cpp +LOCAL_SRC_FILES := init_sdm660.cpp LOCAL_STATIC_LIBRARIES := \ libbase \ libselinux LOCAL_CFLAGS := -Wall -ifneq ($(TARGET_LIBINIT_WAYNE_DEFINES_FILE),) +ifneq ($(TARGET_LIBINIT_SDM660_DEFINES_FILE),) LOCAL_CFLAGS += -DTARGET_HAVE_LIBINIT - LOCAL_SRC_FILES += ../../../../$(TARGET_LIBINIT_WAYNE_DEFINES_FILE) + LOCAL_SRC_FILES += ../../../../$(TARGET_LIBINIT_SDM660_DEFINES_FILE) endif include $(BUILD_STATIC_LIBRARY) diff --git a/init/init_wayne.cpp b/init/init_sdm660.cpp similarity index 99% rename from init/init_wayne.cpp rename to init/init_sdm660.cpp index dc6a4a26..5b76c754 100644 --- a/init/init_wayne.cpp +++ b/init/init_sdm660.cpp @@ -40,7 +40,7 @@ #include "vendor_init.h" #include "property_service.h" -#include "init_wayne.h" +#include "init_sdm660.h" using android::base::GetProperty; using android::init::property_set; diff --git a/init/init_wayne.h b/init/init_sdm660.h similarity index 96% rename from init/init_wayne.h rename to init/init_sdm660.h index 9630892a..5d82ddec 100644 --- a/init/init_wayne.h +++ b/init/init_sdm660.h @@ -28,8 +28,8 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef __INIT_WAYNE__H__ -#define __INIT_WAYNE__H__ +#ifndef __INIT_SDM660__H__ +#define __INIT_SDM660__H__ #ifdef TARGET_HAVE_LIBINIT void init_target_properties(); #endif diff --git a/light/Android.bp b/light/Android.bp index a60fcf8f..e05d16df 100644 --- a/light/Android.bp +++ b/light/Android.bp @@ -15,8 +15,8 @@ cc_binary { defaults: ["hidl_defaults"], - name: "android.hardware.light@2.0-service.xiaomi_wayne", - init_rc: ["android.hardware.light@2.0-service.xiaomi_wayne.rc"], + name: "android.hardware.light@2.0-service.xiaomi_sdm660", + init_rc: ["android.hardware.light@2.0-service.xiaomi_sdm660.rc"], srcs: ["service.cpp", "Light.cpp"], shared_libs: [ "libhardware", diff --git a/light/Light.cpp b/light/Light.cpp index 721e20a5..c62bc331 100644 --- a/light/Light.cpp +++ b/light/Light.cpp @@ -16,7 +16,7 @@ //Author := dev_harsh1998, Isaac Chen -#define LOG_TAG "android.hardware.light@2.0-service.xiaomi_wayne" +#define LOG_TAG "android.hardware.light@2.0-service.xiaomi_sdm660" #include #include diff --git a/light/android.hardware.light@2.0-service.xiaomi_wayne.rc b/light/android.hardware.light@2.0-service.xiaomi_sdm660.rc similarity index 96% rename from light/android.hardware.light@2.0-service.xiaomi_wayne.rc rename to light/android.hardware.light@2.0-service.xiaomi_sdm660.rc index f803030b..ba0f41ae 100644 --- a/light/android.hardware.light@2.0-service.xiaomi_wayne.rc +++ b/light/android.hardware.light@2.0-service.xiaomi_sdm660.rc @@ -14,7 +14,7 @@ on boot chmod 660 /sys/class/leds/red/ramp_step_ms chmod 660 /sys/class/leds/red/start_idx -service vendor.light-hal-2-0 /vendor/bin/hw/android.hardware.light@2.0-service.xiaomi_wayne +service vendor.light-hal-2-0 /vendor/bin/hw/android.hardware.light@2.0-service.xiaomi_sdm660 class hal user system group system diff --git a/light/service.cpp b/light/service.cpp index abefdc04..8f6fa889 100644 --- a/light/service.cpp +++ b/light/service.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#define LOG_TAG "android.hardware.light@2.0-service.xiaomi_wayne" +#define LOG_TAG "android.hardware.light@2.0-service.xiaomi_sdm660" #include diff --git a/wayne.mk b/sdm660.mk similarity index 98% rename from wayne.mk rename to sdm660.mk index 566e9a7e..be081aad 100644 --- a/wayne.mk +++ b/sdm660.mk @@ -22,9 +22,9 @@ # # Inherit proprietary files -$(call inherit-product, vendor/xiaomi/wayne-common/wayne-common-vendor.mk) +$(call inherit-product, vendor/xiaomi/sdm660-common/sdm660-common-vendor.mk) -COMMON_PATH := device/xiaomi/wayne-common +COMMON_PATH := device/xiaomi/sdm660-common # Inherit properties $(call inherit-product, $(COMMON_PATH)/properties.mk) @@ -136,7 +136,7 @@ PRODUCT_COPY_FILES += \ # Biometrics PRODUCT_PACKAGES += \ - android.hardware.biometrics.fingerprint@2.1-service.xiaomi_wayne + android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sdm660 PRODUCT_PACKAGES += \ IFAAService \ @@ -282,7 +282,7 @@ PRODUCT_COPY_FILES += \ # Lights PRODUCT_PACKAGES += \ - android.hardware.light@2.0-service.xiaomi_wayne + android.hardware.light@2.0-service.xiaomi_sdm660 # LiveDisplay native PRODUCT_PACKAGES += \ diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index 6939ff57..81d98220 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -1,5 +1,5 @@ # Biometric -/(vendor|system/vendor)/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.1-service\.xiaomi_wayne u:object_r:hal_fingerprint_wayne_exec:s0 +/(vendor|system/vendor)/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.1-service\.xiaomi_sdm660 u:object_r:hal_fingerprint_sdm660_exec:s0 # Fpc Fingerprint /sys/devices/soc/soc:fpc1020(/.*)? u:object_r:fingerprint_sysfs:s0 @@ -27,7 +27,7 @@ /vendor/usr/keylayout(/.*)? u:object_r:vendor_keylayout_file:s0 # Light HAL -/(vendor|system/vendor)/bin/hw/android\.hardware\.light@2\.0-service\.xiaomi_wayne u:object_r:hal_light_default_exec:s0 +/(vendor|system/vendor)/bin/hw/android\.hardware\.light@2\.0-service\.xiaomi_sdm660 u:object_r:hal_light_default_exec:s0 # Mlipay /(vendor|system/vendor)/bin/mlipayd@1.1 u:object_r:hal_mlipay_default_exec:s0 diff --git a/sepolicy/vendor/hal_fingerprint_sdm660.te b/sepolicy/vendor/hal_fingerprint_sdm660.te new file mode 100644 index 00000000..32e513b3 --- /dev/null +++ b/sepolicy/vendor/hal_fingerprint_sdm660.te @@ -0,0 +1,39 @@ +type hal_fingerprint_sdm660, domain, binder_in_vendor_violators; +hal_server_domain(hal_fingerprint_sdm660, hal_fingerprint) + +type hal_fingerprint_sdm660_exec, exec_type, vendor_file_type, file_type; +typeattribute hal_fingerprint_sdm660 data_between_core_and_vendor_violators; +binder_use(hal_fingerprint_sdm660) +init_daemon_domain(hal_fingerprint_sdm660) + +allow hal_fingerprint_sdm660 fingerprint_device:chr_file { read write open ioctl }; +allow hal_fingerprint_sdm660 { tee_device uhid_device }:chr_file { read write open ioctl }; +allow hal_fingerprint_sdm660 fingerprint_data_file:file rw_file_perms; +allow hal_fingerprint_sdm660 fingerprintd_data_file:dir rw_dir_perms; +allow hal_fingerprint_sdm660 fingerprintd_data_file:file create_file_perms; +allow hal_fingerprint_sdm660 { fuse mnt_user_file storage_file }:dir search; +allow hal_fingerprint_sdm660 { mnt_user_file storage_file }:lnk_file read; +allow hal_fingerprint_sdm660 fingerprint_sysfs:dir r_dir_perms; +allow hal_fingerprint_sdm660 fingerprint_sysfs:file rw_file_perms; + +allow hal_fingerprint_sdm660 hal_fingerprint_sdm660:netlink_socket { create bind write read }; + +binder_call(hal_fingerprint_sdm660, vndservicemanager) +binder_call(hal_fingerprint_sdm660, hal_perf_default) + +binder_use(hal_fingerprint_sdm660) + +r_dir_file(hal_fingerprint_sdm660, firmware_file) + +add_service(hal_fingerprint_sdm660, goodixvnd_service) +add_hwservice(hal_fingerprint_sdm660, goodixhw_service) + +allow hal_fingerprint_sdm660 vndbinder_device:chr_file ioctl; + +get_prop(hal_fingerprint_sdm660, hal_fingerprint_prop) +set_prop(hal_fingerprint_sdm660, hal_fingerprint_prop) + +vndbinder_use(hal_fingerprint_sdm660) + +dontaudit hal_fingerprint_sdm660 { media_rw_data_file sdcardfs}:dir search; +dontaudit hal_fingerprint_sdm660 media_rw_data_file:dir { read open }; diff --git a/sepolicy/vendor/hal_fingerprint_wayne.te b/sepolicy/vendor/hal_fingerprint_wayne.te deleted file mode 100644 index 11a99ded..00000000 --- a/sepolicy/vendor/hal_fingerprint_wayne.te +++ /dev/null @@ -1,39 +0,0 @@ -type hal_fingerprint_wayne, domain, binder_in_vendor_violators; -hal_server_domain(hal_fingerprint_wayne, hal_fingerprint) - -type hal_fingerprint_wayne_exec, exec_type, vendor_file_type, file_type; -typeattribute hal_fingerprint_wayne data_between_core_and_vendor_violators; -binder_use(hal_fingerprint_wayne) -init_daemon_domain(hal_fingerprint_wayne) - -allow hal_fingerprint_wayne fingerprint_device:chr_file { read write open ioctl }; -allow hal_fingerprint_wayne { tee_device uhid_device }:chr_file { read write open ioctl }; -allow hal_fingerprint_wayne fingerprint_data_file:file rw_file_perms; -allow hal_fingerprint_wayne fingerprintd_data_file:dir rw_dir_perms; -allow hal_fingerprint_wayne fingerprintd_data_file:file create_file_perms; -allow hal_fingerprint_wayne { fuse mnt_user_file storage_file }:dir search; -allow hal_fingerprint_wayne { mnt_user_file storage_file }:lnk_file read; -allow hal_fingerprint_wayne fingerprint_sysfs:dir r_dir_perms; -allow hal_fingerprint_wayne fingerprint_sysfs:file rw_file_perms; - -allow hal_fingerprint_wayne hal_fingerprint_wayne:netlink_socket { create bind write read }; - -binder_call(hal_fingerprint_wayne, vndservicemanager) -binder_call(hal_fingerprint_wayne, hal_perf_default) - -binder_use(hal_fingerprint_wayne) - -r_dir_file(hal_fingerprint_wayne, firmware_file) - -add_service(hal_fingerprint_wayne, goodixvnd_service) -add_hwservice(hal_fingerprint_wayne, goodixhw_service) - -allow hal_fingerprint_wayne vndbinder_device:chr_file ioctl; - -get_prop(hal_fingerprint_wayne, hal_fingerprint_prop) -set_prop(hal_fingerprint_wayne, hal_fingerprint_prop) - -vndbinder_use(hal_fingerprint_wayne) - -dontaudit hal_fingerprint_wayne { media_rw_data_file sdcardfs}:dir search; -dontaudit hal_fingerprint_wayne media_rw_data_file:dir { read open }; diff --git a/setup-makefiles.sh b/setup-makefiles.sh index f6375b4f..586ec543 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -17,7 +17,7 @@ set -e -DEVICE_COMMON=wayne-common +DEVICE_COMMON=sdm660-common VENDOR=xiaomi INITIAL_COPYRIGHT_YEAR=2018 @@ -39,7 +39,7 @@ fi setup_vendor "$DEVICE_COMMON" "$VENDOR" "$LINEAGE_ROOT" true # Copyright headers and guards -write_headers "jasmine_sprout wayne" +write_headers "jasmine_sprout wayne clover" write_makefiles "$MY_DIR"/proprietary-files.txt true