Skip to content

Commit

Permalink
Update configuration for cm-12.0
Browse files Browse the repository at this point in the history
Change-Id: I9a606913f7beaae68f1309843b1b2f84412d2dcb
  • Loading branch information
mdmower committed Feb 25, 2015
1 parent 52ae6b9 commit 7b699ed
Show file tree
Hide file tree
Showing 46 changed files with 180 additions and 261 deletions.
71 changes: 32 additions & 39 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# Copyright (C) 2015 Matthew D. Mower
# Copyright (C) 2015 The CyanogenMod Project
# Copyright (C) 2013 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

USE_CAMERA_STUB := true

# inherit from the proprietary version
Expand All @@ -18,6 +34,7 @@ TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi
TARGET_CPU_SMP := true
TARGET_CPU_VARIANT := krait
TARGET_USE_QCOM_BIONIC_OPTIMIZATION := true

# Kernel
BOARD_KERNEL_BASE := 0x80600000
Expand All @@ -29,24 +46,21 @@ TARGET_KERNEL_SOURCE := kernel/htc/msm8960

# QCOM hardware
BOARD_USES_QCOM_HARDWARE := true
TARGET_ENABLE_QC_AV_ENHANCEMENTS := true
TARGET_QCOM_AUDIO_VARIANT := caf
TARGET_QCOM_DISPLAY_VARIANT := caf
TARGET_QCOM_MEDIA_VARIANT := caf
TARGET_USES_QCOM_BSP := true

# Flags
COMMON_GLOBAL_CFLAGS += -DHTCLOG
COMMON_GLOBAL_CFLAGS += -DNO_SECURE_DISCARD

# Graphics
USE_OPENGL_RENDERER := true
TARGET_DISPLAY_USE_RETIRE_FENCE := true
TARGET_USES_C2D_COMPOSITION := true
TARGET_USES_ION := true
BOARD_EGL_CFG := device/htc/m7/configs/egl.cfg
NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3

# Power
TARGET_POWERHAL_VARIANT := cm
TARGET_POWERHAL_VARIANT := qcom

# Filesystem
TARGET_USERIMAGES_USE_EXT4 := true
Expand All @@ -56,56 +70,35 @@ BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1946156032
BOARD_USERDATAIMAGE_PARTITION_SIZE := 27917287424
BOARD_FLASH_BLOCK_SIZE := 131072

# Use power button as select in recovery
# Recovery
BOARD_HAS_NO_SELECT_BUTTON := true

# Vold
BOARD_VOLD_MAX_PARTITIONS := 37
TARGET_USE_CUSTOM_LUN_FILE_PATH := /sys/devices/platform/msm_hsusb/gadget/lun%d/file
BOARD_VOLD_MAX_PARTITIONS := 38

# Charge mode
BOARD_CHARGING_MODE_BOOTING_LPM := /sys/htc_lpm/lpm_mode

# SELinux
-include device/qcom/sepolicy/sepolicy.mk

BOARD_SEPOLICY_DIRS += device/htc/m7/sepolicy

BOARD_SEPOLICY_UNION += \
app.te \
bluetooth.te \
device.te \
domain.te \
drmserver.te \
file_contexts \
file.te \
hci_init.te \
healthd.te \
init_shell.te \
init.te \
keystore.te \
kickstart.te \
mediaserver.te \
rild.te \
surfaceflinger.te \
system.te \
ueventd.te \
wpa_socket.te \
wpa.te
akmd.te \
cir_fw_update.te

# TWRP
DEVICE_RESOLUTION := 1080x1920
TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888"
BOARD_USE_CUSTOM_RECOVERY_FONT := \"roboto_23x41.h\"
RECOVERY_GRAPHICS_USE_LINELENGTH := true
TW_BRIGHTNESS_PATH := "/sys/class/leds/lcd-backlight/brightness"
TW_FLASH_FROM_STORAGE := true
TW_INTERNAL_STORAGE_PATH := "/data/media"
TW_INTERNAL_STORAGE_MOUNT_POINT := "data"
TW_EXTERNAL_STORAGE_PATH := "/usb-otg"
TW_EXTERNAL_STORAGE_MOUNT_POINT := "usb-otg"
RECOVERY_SDCARD_ON_DATA := true
BOARD_HAS_NO_REAL_SDCARD := true
TW_INCLUDE_JB_CRYPTO := true
TW_NO_USB_STORAGE := true
TW_INCLUDE_CRYPTO := true
BOARD_RECOVERY_BLDRMSG_OFFSET := 2048
RECOVERY_VARIANT := twrp
TARGET_RECOVERY_DEVICE_MODULES := chargeled
RECOVERY_SDCARD_ON_DATA := true
BOARD_HAS_NO_REAL_SDCARD := true
TW_NO_USB_STORAGE := true
TW_EXTERNAL_STORAGE_PATH := "/usb-otg"
TW_EXTERNAL_STORAGE_MOUNT_POINT := "usb-otg"
2 changes: 1 addition & 1 deletion configs/egl.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
0 0 android
0 1 adreno200
0 1 adreno
2 changes: 0 additions & 2 deletions device.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ else
LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
endif

COMMON_GLOBAL_CFLAGS += -DNO_SECURE_DISCARD

$(call inherit-product, build/target/product/full.mk)

PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0
Expand Down
1 change: 0 additions & 1 deletion recovery/root/fstab.qcom
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#<src> <mnt_point> <type> <mnt_flags> <fs_mgr_flags>
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 nosuid,nodev,noatime,barrier=1 wait,check
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,noauto_da_alloc,barrier=1 wait,check,encryptable=/dev/block/platform/msm_sdcc.1/by-name/extra
/dev/block/platform/msm_sdcc.1/by-name/devlog /devlog ext4 noatime,nosuid,nodev,barrier=1 wait
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,noatime,barrier=1 wait
33 changes: 24 additions & 9 deletions recovery/root/init.recovery.qcom.rc
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
on boot
setprop usb.vendor 0bb4
setprop usb.product.adb 0c02
setprop usb.product.mtpadb 0f87
write /sys/module/rpm_resources/enable_low_power/L2_cache 1
write /sys/module/rpm_resources/enable_low_power/pxo 1
write /sys/module/rpm_resources/enable_low_power/vdd_dig 1
Expand All @@ -15,10 +12,20 @@ on boot
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 384000
write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 384000
write /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 384000
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 0bb4
write /sys/class/android_usb/android0/idProduct 0c02
setprop usb.vendor 0bb4
setprop usb.product.adb 0c02
setprop usb.product.mtpadb 0f87
setprop recovery.perf.mode 0
start choice_fn
start chargeled

on charger
start choice_fn
start detect_key
start offmode_charging

on property:recovery.perf.mode=0
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "ondemand"
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "ondemand"
Expand All @@ -37,17 +44,25 @@ on property:recovery.perf.mode=1
write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "performance"
write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor "performance"

service choice_fn /sbin/choice_fn
service chargeled /sbin/chargeled
disabled
seclabel u:r:healthd:s0

service power_test /sbin/power_test
service choice_fn /sbin/choice_fn
disabled
oneshot
seclabel u:r:recovery:s0

service offmode_charging /sbin/offmode_charging
service detect_key /sbin/detect_key
disabled
oneshot
seclabel u:r:healthd:s0

service detect_key /sbin/detect_key
service offmode_charging /sbin/offmode_charging
disabled
seclabel u:r:healthd:s0

service chargeled /sbin/chargeled
service power_test /sbin/power_test
disabled
oneshot
seclabel u:r:recovery:s0
71 changes: 0 additions & 71 deletions recovery/root/lpm.rc

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file modified recovery/root/sbin/choice_fn
Binary file not shown.
Binary file modified recovery/root/sbin/detect_key
Binary file not shown.
Binary file modified recovery/root/sbin/offmode_charging
Binary file not shown.
Binary file modified recovery/root/sbin/power_test
Binary file not shown.
8 changes: 8 additions & 0 deletions sepolicy/akmd.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type akmd, domain;
type akmd_exec, exec_type, file_type;
init_daemon_domain(akmd)

allow akmd sensors_data_file:file { getattr setattr open read write create };
allow akmd sensors_device:chr_file { open read write ioctl };
allow akmd system_data_file:dir { add_name write };
type_transition akmd system_data_file:file sensors_data_file;
3 changes: 0 additions & 3 deletions sepolicy/app.te

This file was deleted.

2 changes: 1 addition & 1 deletion sepolicy/bluetooth.te
Original file line number Diff line number Diff line change
@@ -1 +1 @@
allow bluetooth smd_device:chr_file rw_file_perms;
allow bluetooth bluetooth_device:chr_file { write open };
6 changes: 6 additions & 0 deletions sepolicy/cir_fw_update.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type cir_fw_update, domain;
type cir_fw_update_exec, exec_type, file_type;
init_daemon_domain(cir_fw_update)

allow cir_fw_update cir_device:chr_file { getattr open read write ioctl };
allow cir_fw_update self:capability dac_override;
22 changes: 3 additions & 19 deletions sepolicy/device.te
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
# GPU (used by most UI apps)
type gpu_device, dev_type;

# BT lock device for BCM4335
type btlock_device, dev_type;

# Qualcomm Secure Execution Environment Communicator (QSEECOM) device
type qseecom_device, dev_type;

type diag_device, dev_type;

# Qualcomm MSM Audio ACDB device
type msm_acdb_device, dev_type;

# Kickstart device used by QC qcks
type kickstart_device, dev_type;

# SMD device, used by hci_qcomm_init
type smd_device, dev_type;
type bluetooth_device, dev_type;
type cir_device, dev_type;
type timerirq_device, dev_type;
1 change: 0 additions & 1 deletion sepolicy/domain.te

This file was deleted.

3 changes: 0 additions & 3 deletions sepolicy/drmserver.te

This file was deleted.

11 changes: 2 additions & 9 deletions sepolicy/file.te
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
# Qualcomm MSM Interface (QMI) socket types
type qmux_audio_socket, file_type;
type qmux_bluetooth_socket, file_type;
type qmux_gps_socket, file_type;
type qmux_radio_socket, file_type;

allow efs_file rootfs:filesystem associate;
allow cache_file rootfs:filesystem associate;
allow asec_apk_file rootfs:filesystem associate;
type camera_sysfs, fs_type, sysfs_type;
type vibeamp_sysfs, fs_type, sysfs_type;
Loading

0 comments on commit 7b699ed

Please sign in to comment.