From c27907f1a4fedd88a098ae040235e74c75ebc5aa Mon Sep 17 00:00:00 2001 From: Stricted Date: Wed, 18 Apr 2018 14:28:26 +0200 Subject: [PATCH 1/1] initial commit Change-Id: Ib590e7b6630f8dae5de18f296ed4c7ef0a95f08f --- Android.mk | 11 ++++++ AndroidProducts.mk | 2 ++ BoardConfig.mk | 56 ++++++++++++++++++++++++++++++ mkbootimg.mk | 77 +++++++++++++++++++++++++++++++++++++++++ omni_ttab.mk | 14 ++++++++ recovery/etc/twrp.fstab | 29 ++++++++++++++++ vendorsetup.sh | 1 + 7 files changed, 190 insertions(+) create mode 100644 Android.mk create mode 100644 AndroidProducts.mk create mode 100644 BoardConfig.mk create mode 100644 mkbootimg.mk create mode 100644 omni_ttab.mk create mode 100644 recovery/etc/twrp.fstab create mode 100644 vendorsetup.sh diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..fbe77d5 --- /dev/null +++ b/Android.mk @@ -0,0 +1,11 @@ +LOCAL_PATH := $(call my-dir) + +$(shell mkdir -p out/target/product/$(TARGET_DEVICE)/recovery/root/custpack) +$(shell mkdir -p out/target/product/$(TARGET_DEVICE)/recovery/root/external_sd) +$(shell mkdir -p out/target/product/$(TARGET_DEVICE)/recovery/root/usbotg) +$(shell mkdir -p out/target/product/$(TARGET_DEVICE)/recovery/root/and-sec) + +include $(call all-subdir-makefiles,$(LOCAL_PATH)) + +include $(CLEAR_VARS) + diff --git a/AndroidProducts.mk b/AndroidProducts.mk new file mode 100644 index 0000000..8f4c4cc --- /dev/null +++ b/AndroidProducts.mk @@ -0,0 +1,2 @@ +PRODUCT_MAKEFILES := \ + $(LOCAL_DIR)/omni_ttab.mk diff --git a/BoardConfig.mk b/BoardConfig.mk new file mode 100644 index 0000000..afb19dc --- /dev/null +++ b/BoardConfig.mk @@ -0,0 +1,56 @@ +# Bootloader +TARGET_NO_BOOTLOADER := false +TARGET_BOOTLOADER_BOARD_NAME := mt8127 + +# Platform +TARGET_BOARD_PLATFORM := mt8127 + +TARGET_ARCH := arm +TARGET_CPU_ABI := armeabi-v7a +TARGET_CPU_ABI2 := armeabi +TARGET_ARCH_VARIANT := armv7-a-neon +TARGET_CPU_SMP := true +TARGET_CPU_VARIANT := cortex-a7 + +# Flags +TARGET_GLOBAL_CFLAGS += -mfpu=neon -mfloat-abi=softfp +TARGET_GLOBAL_CPPFLAGS += -mfpu=neon -mfloat-abi=softfp + +# Kernel +#TARGET_PREBUILT_KERNEL := device/alcatel/ttab/kernel +TARGET_KERNEL_CONFIG := ttab_defconfig +TARGET_KERNEL_SOURCE := kernel/alcatel/ttab +BOARD_KERNEL_IMAGE_NAME := zImage +BOARD_KERNEL_CMDLINE := androidboot.selinux=permissive +BOARD_KERNEL_BASE := 0x80000000 +BOARD_KERNEL_PAGESIZE := 2048 +BOARD_CUSTOM_BOOTIMG_MK := device/alcatel/ttab/mkbootimg.mk +BOARD_MKBOOTIMG_ARGS := --cmdline "$(BOARD_KERNEL_CMDLINE)" --base 0x80000000 --pagesize 2048 --kernel_offset 0x00008000 --ramdisk_offset 0x04000000 --second_offset 0x00f00000 --tags_offset 0x00000100 --board vC1O-0 + +BOARD_RECOVERYIMAGE_PARTITION_SIZE := 16777216 +BOARD_FLASH_BLOCK_SIZE := 131072 +TARGET_USERIMAGES_USE_EXT4 := true +TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false + +TARGET_RECOVERY_FSTAB := device/alcatel/ttab/recovery/etc/twrp.fstab +BOARD_HAS_MTK_HARDWARE := true +BOARD_SUPPRESS_SECURE_ERASE := true + +# TWRP +TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID := true +TW_NO_EXFAT := true +TWHAVE_SELINUX := true +TW_THEME := portrait_mdpi +TW_NO_EXFAT_FUSE := true +TARGET_USE_CUSTOM_LUN_FILE_PATH := "/sys/devices/platform/mt_usb/musb-hdrc.0.auto/gadget/lun%d/file" +#TW_EXCLUDE_SUPERSU := true +TW_BRIGHTNESS_PATH := /sys/class/leds/lcd-backlight/brightness +TW_MAX_BRIGHTNESS := 255 +TW_CUSTOM_CPU_TEMP_PATH := /sys/devices/virtual/thermal/thermal_zone1/temp +TWRP_EVENT_LOGGING := true +TW_INCLUDE_CRYPTO := true +TW_NO_REBOOT_BOOTLOADER := true +TW_NO_SCREEN_BLANK := true + +TWRP_INCLUDE_LOGCAT := true +TARGET_USES_LOGD := true diff --git a/mkbootimg.mk b/mkbootimg.mk new file mode 100644 index 0000000..cc6df9c --- /dev/null +++ b/mkbootimg.mk @@ -0,0 +1,77 @@ +# +# Copyright (C) 2017 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. +# + +# can this be done in bash? credits go to bgcngm +define make_header + perl -e 'print pack("a4 L a32 a472", "\x88\x16\x88\x58", $$ARGV[0], $$ARGV[1], "\xFF"x472)' $(1) $(2) > $(3) +endef + +# this is overriding targets from build/core/Makefile +$(INSTALLED_KERNEL_TARGET).mtk.header: $(INSTALLED_KERNEL_TARGET) + size=$$($(call get-file-size,$(INSTALLED_KERNEL_TARGET))); \ + $(call make_header, $$((size)), "KERNEL", $@) +$(INSTALLED_KERNEL_TARGET).mtk: $(INSTALLED_KERNEL_TARGET).mtk.header + $(call pretty,"Adding MTK header to kernel.") + cat $(INSTALLED_KERNEL_TARGET).mtk.header $(INSTALLED_KERNEL_TARGET) \ + > $@ + +$(INSTALLED_RAMDISK_TARGET).mtk.header: $(INSTALLED_RAMDISK_TARGET) + size=$$($(call get-file-size,$(INSTALLED_RAMDISK_TARGET))); \ + $(call make_header, $$((size)), "ROOTFS", $@) +$(INSTALLED_RAMDISK_TARGET).mtk: $(INSTALLED_RAMDISK_TARGET).mtk.header + $(call pretty,"Adding MTK header to ramdisk.") + cat $(INSTALLED_RAMDISK_TARGET).mtk.header $(INSTALLED_RAMDISK_TARGET) \ + > $@ + +$(PRODUCT_OUT)/recovery_kernel.mtk.header: $(recovery_kernel) + size=$$($(call get-file-size,$(recovery_kernel))); \ + $(call make_header, $$((size)), "KERNEL", $@) +$(PRODUCT_OUT)/recovery_kernel.mtk: $(PRODUCT_OUT)/recovery_kernel.mtk.header + $(call pretty,"Adding MTK header to recovery kernel.") + cat $(PRODUCT_OUT)/recovery_kernel.mtk.header $(recovery_kernel) > $@ + +$(recovery_ramdisk).mtk.header: $(recovery_ramdisk) + size=$$($(call get-file-size,$(recovery_ramdisk))); \ + $(call make_header, $$((size)), "RECOVERY", $@) +$(recovery_ramdisk).mtk: $(MKBOOTIMG) $(recovery_ramdisk).mtk.header + $(call pretty,"Adding MTK header to recovery ramdisk.") + cat $(recovery_ramdisk).mtk.header $(recovery_ramdisk) > $@ + +INTERNAL_MTK_BOOTIMAGE_ARGS := \ + --kernel $(INSTALLED_KERNEL_TARGET).mtk \ + --ramdisk $(INSTALLED_RAMDISK_TARGET).mtk + +$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG)\ + $(INSTALLED_RAMDISK_TARGET).mtk $(INSTALLED_KERNEL_TARGET).mtk + $(call pretty,"Target boot image: $@") + $(MKBOOTIMG) $(INTERNAL_MTK_BOOTIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) \ + --output $@ + $(hide) $(call assert-max-image-size,$@, \ + $(BOARD_BOOTIMAGE_PARTITION_SIZE),raw) + @echo -e ${CL_CYN}"Made boot image: $@"${CL_RST} + +INTERNAL_MTK_RECOVERYIMAGE_ARGS := \ + --kernel $(INSTALLED_KERNEL_TARGET).mtk \ + --ramdisk $(recovery_ramdisk).mtk + +$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) \ + $(recovery_ramdisk).mtk $(INSTALLED_KERNEL_TARGET).mtk + @echo -e ${CL_CYN}"----- Making recovery image ------"${CL_RST} + $(MKBOOTIMG) $(INTERNAL_MTK_RECOVERYIMAGE_ARGS) \ + $(BOARD_MKBOOTIMG_ARGS) --output $@ + $(hide) $(call assert-max-image-size,$@, \ + $(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw) + @echo -e ${CL_CYN}"Made recovery image: $@"${CL_RST} diff --git a/omni_ttab.mk b/omni_ttab.mk new file mode 100644 index 0000000..4c4e27f --- /dev/null +++ b/omni_ttab.mk @@ -0,0 +1,14 @@ +PRODUCT_RELEASE_NAME := ttab + +# Inherit device configuration +$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) + +# Device identifier. This must come after all inclusions +PRODUCT_DEVICE := ttab +PRODUCT_NAME := omni_ttab +PRODUCT_BRAND := alcatel +PRODUCT_MANUFACTURER := alcatel +PRODUCT_MODEL := ttab + +TARGET_SCREEN_HEIGHT := 1280 +TARGET_SCREEN_WIDTH := 800 diff --git a/recovery/etc/twrp.fstab b/recovery/etc/twrp.fstab new file mode 100644 index 0000000..d814cc8 --- /dev/null +++ b/recovery/etc/twrp.fstab @@ -0,0 +1,29 @@ +# mount point fstype device [device2] + +/boot emmc /dev/bootimg flags=display="Boot";backup=1 +/recovery emmc /dev/recovery flags=display="Recovery";backup=1 +/nvram emmc /dev/nvram flags=display="Nvram";backup=1;flashimg=1 + +/custpack ext4 /dev/block/mmcblk0p5 flags=display="Custpack";backup=1;wipeingui +/custpack_image emmc /dev/block/mmcblk0p5 flags=display="Custpack Image";backup=1;wipeingui +/system ext4 /dev/block/mmcblk0p6 flags=display="System";backup=1;wipeingui +/system_image emmc /dev/block/mmcblk0p6 flags=display="System Image";backup=1;wipeingui +/cache ext4 /dev/block/mmcblk0p7 flags=display="Cache";wipeingui;wipeduringfactoryreset +/data ext4 /dev/block/mmcblk0p8 flags=display="Data";wipeingui;settingsstorage;backup=1;wipeduringfactoryreset + +/pro_info emmc /dev/pro_info flags=display="proinfo";backup=1 +/protect_f emmc /dev/block/mmcblk0p2 flags=display="protect_f";backup=1 +/protect_s emmc /dev/block/mmcblk0p3 flags=display="protect_s";backup=1 +/logo emmc /dev/logo flags=display="logo";backup=1;flashimg=1 +/secro emmc /dev/block/mmcblk0p4 flags=display="secro";backup=1 +/tee1 emmc /dev/tee1 flags=display="tee1";backup=1 +/tee2 emmc /dev/tee2 flags=display="tee2";backup=1 +/ebr1 emmc /dev/block/mmcblk0p1 flags=display="ebr1";backup=1 +/uboot emmc /dev/uboot flags=display="Uboot";backup=1;flashimg=1 +/expdb emmc /dev/expdb flags=display="expdb";backup=1 + + +#/system_image emmc /dev/block/mmcblk0p6 flags=display="System Image";backup=1;flashimg=1;wipeingui + +/external_sd vfat /dev/block/mmcblk1p1 flags=display="External SDcard";storage;wipeingui;removable;backup=0 +/usbotg auto /dev/block/sda1 flags=display="USB-OTG";storage;removable;backup=0 \ No newline at end of file diff --git a/vendorsetup.sh b/vendorsetup.sh new file mode 100644 index 0000000..784ab11 --- /dev/null +++ b/vendorsetup.sh @@ -0,0 +1 @@ +add_lunch_combo omni_ttab-eng -- 2.20.1