Skip to content

Commit

Permalink
m7univ: Bring up for P/Q
Browse files Browse the repository at this point in the history
* Switch to prebuilt kernel.
* Added decryption blobs.
* Compress recovery image with LZMA.
* Drop old sepolicies.
  • Loading branch information
TARKZiM committed Jun 27, 2020
1 parent fcca527 commit 3eaee8f
Show file tree
Hide file tree
Showing 51 changed files with 591 additions and 561 deletions.
7 changes: 2 additions & 5 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ifeq ($(RECOVERY_VARIANT), twrp)
ifeq ($(TARGET_DEVICE), m7univ)

LOCAL_PATH := $(call my-dir)
include $(call first-makefiles-under, $(LOCAL_PATH))

endif
ifneq ($(filter m7univ,$(TARGET_DEVICE)),)
include $(call all-makefiles-under,$(LOCAL_PATH))
endif
8 changes: 0 additions & 8 deletions AndroidBoard.mk

This file was deleted.

2 changes: 1 addition & 1 deletion AndroidProducts.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/device.mk
$(LOCAL_DIR)/omni_m7univ.mk
30 changes: 14 additions & 16 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

USE_CAMERA_STUB := true
BOARD_VENDOR := htc

# inherit from the proprietary version
-include vendor/htc/m7univ/BoardConfigVendor.mk
Expand All @@ -41,8 +41,7 @@ BOARD_KERNEL_BASE := 0x80600000
BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.hardware=qcom user_debug=31 androidboot.selinux=permissive
BOARD_KERNEL_PAGESIZE := 2048
BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x01800000
TARGET_KERNEL_CONFIG := m7_defconfig
TARGET_KERNEL_SOURCE := kernel/htc/msm8960
TARGET_PREBUILT_KERNEL := device/$(BOARD_VENDOR)/$(TARGET_DEVICE)/prebuilt/zImage

# QCOM hardware
BOARD_USES_QCOM_HARDWARE := true
Expand All @@ -64,46 +63,45 @@ TARGET_POWERHAL_VARIANT := qcom

# Filesystem
TARGET_USERIMAGES_USE_EXT4 := true
TARGET_USERIMAGES_USE_F2FS := true
BOARD_BOOTIMAGE_PARTITION_SIZE := 16777216
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 16776704
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1946156032
BOARD_USERDATAIMAGE_PARTITION_SIZE := 27917287424
BOARD_FLASH_BLOCK_SIZE := 131072

# Android version & Security Patch Level
# Default TWRP Values
PLATFORM_VERSION := 20.1.0
PLATFORM_SECURITY_PATCH := 2099-12-31

# Recovery
BOARD_HAS_NO_SELECT_BUTTON := true
BOARD_NEEDS_LZMA_MINIGZIP := true
LZMA_RAMDISK_TARGETS := recovery

# Vold
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/m7univ/sepolicy

BOARD_SEPOLICY_UNION += \
akmd.te \
cir_fw_update.te

# Vendor Init
TARGET_UNIFIED_DEVICE := true
TARGET_INIT_VENDOR_LIB := libinit_m7univ
TARGET_LIBINIT_DEFINES_FILE := device/htc/m7univ/init/init_m7univ.c
TARGET_INIT_VENDOR_LIB := libinit_$(TARGET_DEVICE)

# TWRP
TW_THEME := portrait_hdpi
TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888"
RECOVERY_GRAPHICS_USE_LINELENGTH := true
TW_BRIGHTNESS_PATH := "/sys/class/leds/lcd-backlight/brightness"
TW_INCLUDE_CRYPTO := true
TW_OVERRIDE_SYSTEM_PROPS := "ro.build.fingerprint"
BOARD_RECOVERY_BLDRMSG_OFFSET := 2048
RECOVERY_VARIANT := twrp
TARGET_RECOVERY_DEVICE_MODULES := chargeled libinit_m7univ
TARGET_RECOVERY_DEVICE_MODULES := chargeled liblog_htc_sbin
RECOVERY_SDCARD_ON_DATA := true
BOARD_HAS_NO_REAL_SDCARD := true
#TW_USE_TOOLBOX := true
TW_NO_USB_STORAGE := true
TW_EXTERNAL_STORAGE_PATH := "/usb-otg"
TW_EXTERNAL_STORAGE_MOUNT_POINT := "usb-otg"
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
TeamWin Recovery Project

Device files for HTC One (M7)

Builds with OmniROM android-8.1 tree
9 changes: 0 additions & 9 deletions Readme.md

This file was deleted.

6 changes: 0 additions & 6 deletions cm.dependencies

This file was deleted.

15 changes: 0 additions & 15 deletions cm.mk

This file was deleted.

21 changes: 0 additions & 21 deletions device.mk

This file was deleted.

24 changes: 12 additions & 12 deletions recovery/chargeled/Android.mk → init/Android.mk
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
#
# Copyright (C) 2014 The CyanogenMod Project
# Copyright (C) 2016 The CyanogenMod 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
# 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.
#

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_SRC_FILES := chargeled.c
LOCAL_MODULE_TAGS := optional
LOCAL_C_INCLUDES := system/core/init
LOCAL_CFLAGS := -Wall -DANDROID_TARGET=\"$(TARGET_BOARD_PLATFORM)\"

LOCAL_SRC_FILES := init_$(TARGET_DEVICE).cpp

LOCAL_CFLAGS += -Wall
LOCAL_MODULE := libinit_$(TARGET_DEVICE)

LOCAL_STATIC_LIBRARIES := libc liblog libcutils
LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_STATIC_LIBRARIES := \
libbase

LOCAL_MODULE := chargeled
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
include $(BUILD_EXECUTABLE)
include $(BUILD_STATIC_LIBRARY)
83 changes: 83 additions & 0 deletions init/init_m7univ.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
Copyright (c) 2013, 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.
*/

#include <stdlib.h>
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>

#include <android-base/properties.h>
#include <android-base/logging.h>

#include "property_service.h"

namespace android {
namespace init {

void property_override(char const prop[], char const value[]) {
prop_info *pi;

pi = (prop_info*) __system_property_find(prop);
if (pi)
__system_property_update(pi, value, strlen(value));
else
__system_property_add(prop, strlen(prop), value, strlen(value));
}

void property_override_dual(char const system_prop[], char const vendor_prop[],
char const value[])
{
property_override(system_prop, value);
property_override(vendor_prop, value);
}

void vendor_load_properties() {
std::string platform = android::base::GetProperty("ro.board.platform", "");
std::string bootmid;
std::string device;

bootmid = android::base::GetProperty("ro.boot.mid", "");
if (bootmid == "PN0720000") {
/* m7wls */
property_override_dual("ro.product.device", "ro.vendor.product.device", "m7wls");
property_override("ro.build.product", "m7wls");
} else if (bootmid == "PN0731000") {
/* m7wlv */
property_override_dual("ro.product.device", "ro.vendor.product.device", "m7wlv");
property_override("ro.build.product", "m7wlv");
} else {
/* m7 */
property_override_dual("ro.product.device", "ro.vendor.product.device", "m7");
property_override("ro.build.product", "m7");
}
device = android::base::GetProperty("ro.product.device", "");
LOG(INFO) << "Found bootmid '" << bootmid.c_str() <<
"' setting build properties for '" << device.c_str() << "' device\n";
}
} // namespace init
} // namespace android
14 changes: 14 additions & 0 deletions omni.dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"remote": "github",
"repository": "TeamWin/android_device_qcom_htc-common",
"target_path": "device/qcom/htc-common",
"revision": "android-8.1"
},
{
"remote": "github",
"repository": "TeamWin/android_device_qcom_common",
"target_path": "device/qcom/common",
"revision": "android-8.1"
}
]
38 changes: 38 additions & 0 deletions omni_m7univ.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (C) 2011 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.

#
# This file is the build configuration for a full Android
# build for maguro hardware. This cleanly combines a set of
# device-specific aspects (drivers) with a device-agnostic
# product configuration (apps). Except for a few implementation
# details, it only fundamentally contains two inherit-product
# lines, full and maguro, hence its name.
#

# Release name
PRODUCT_RELEASE_NAME := m7univ

# Inherit from the common Open Source product configuration
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)

# Inherit some common Omni stuff.
$(call inherit-product, vendor/omni/config/common.mk)

## Device identifier. This must come after all inclusions
PRODUCT_DEVICE := m7univ
PRODUCT_NAME := omni_m7univ
PRODUCT_BRAND := htc
PRODUCT_MODEL := One
PRODUCT_MANUFACTURER := HTC
Binary file added prebuilt/zImage
Binary file not shown.
2 changes: 0 additions & 2 deletions recovery/Android.mk

This file was deleted.

Loading

0 comments on commit 3eaee8f

Please sign in to comment.