--- /dev/null
+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)
+
--- /dev/null
+PRODUCT_MAKEFILES := \
+ $(LOCAL_DIR)/omni_ttab.mk
--- /dev/null
+# 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
--- /dev/null
+#
+# 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}
--- /dev/null
+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
--- /dev/null
+# 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
--- /dev/null
+add_lunch_combo omni_ttab-eng