Skip to content

Commit

Permalink
Ported to ubp-5.1
Browse files Browse the repository at this point in the history
Change-Id: Ieb0202f4357b849cce5f2459fbe1c5088e989644
  • Loading branch information
mariogrip committed Jan 28, 2016
1 parent 35b57e6 commit 13c28b8
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 46 deletions.
34 changes: 17 additions & 17 deletions AndroidBoard.mk
Expand Up @@ -3,31 +3,31 @@ LOCAL_PATH := $(call my-dir)
#----------------------------------------------------------------------
# Compile (L)ittle (K)ernel bootloader and the nandwrite utility
#----------------------------------------------------------------------
ifneq ($(strip $(TARGET_NO_BOOTLOADER)),true)
#ifneq ($(strip $(TARGET_NO_BOOTLOADER)),true)

TARGET_BOOTLOADER_PLATFORM_OVERRIDE := $(TARGET_PRODUCT)
#TARGET_BOOTLOADER_PLATFORM_OVERRIDE := $(TARGET_PRODUCT)

# Compile
include bootable/bootloader/lk/AndroidBoot.mk
#include bootable/bootloader/lk/AndroidBoot.mk

$(INSTALLED_BOOTLOADER_MODULE): $(TARGET_EMMC_BOOTLOADER) | $(ACP)
$(transform-prebuilt-to-target)
$(BUILT_TARGET_FILES_PACKAGE): $(INSTALLED_BOOTLOADER_MODULE)
#$(INSTALLED_BOOTLOADER_MODULE): $(TARGET_EMMC_BOOTLOADER) | $(ACP)
# $(transform-prebuilt-to-target)
#$(BUILT_TARGET_FILES_PACKAGE): $(INSTALLED_BOOTLOADER_MODULE)

droidcore: $(INSTALLED_BOOTLOADER_MODULE)
endif
#droidcore: $(INSTALLED_BOOTLOADER_MODULE)
#endif

#----------------------------------------------------------------------
# Compile Linux Kernel
#----------------------------------------------------------------------
ifeq ($(KERNEL_DEFCONFIG),)
KERNEL_DEFCONFIG := fairphone_defconfig
endif
#ifeq ($(KERNEL_DEFCONFIG),)
# KERNEL_DEFCONFIG := fairphone_defconfig
#endif

include kernel/AndroidKernel.mk
#include kernel/fairphone/AndroidKernel.mk

$(INSTALLED_KERNEL_TARGET): $(TARGET_PREBUILT_KERNEL) | $(ACP)
$(transform-prebuilt-to-target)
#$(INSTALLED_KERNEL_TARGET): $(TARGET_PREBUILT_KERNEL) | $(ACP)
# $(transform-prebuilt-to-target)

#----------------------------------------------------------------------
# Copy additional target-specific files
Expand Down Expand Up @@ -177,6 +177,6 @@ include $(BUILD_PREBUILT)
#----------------------------------------------------------------------
# extra images
#----------------------------------------------------------------------
ifeq (, $(wildcard vendor/qcom/build/tasks/generate_extra_images.mk))
include device/qcom/common/generate_extra_images.mk
endif
#ifeq (, $(wildcard vendor/qcom/build/tasks/generate_extra_images.mk))
include build/core/generate_extra_images.mk
#endif
2 changes: 0 additions & 2 deletions AndroidProducts.mk

This file was deleted.

15 changes: 11 additions & 4 deletions BoardConfig.mk
Expand Up @@ -9,6 +9,7 @@ endif
TARGET_KERNEL_ARCH := arm
BOARD_USES_GENERIC_AUDIO := true
USE_CAMERA_STUB := false
TARGET_NO_BOOTLOADER := true

TARGET_USES_AOSP := false
# Compile with msm kernel
Expand All @@ -17,12 +18,15 @@ TARGET_HAS_QC_KERNEL_SOURCE := true

-include $(QCPATH)/common/msm8974/BoardConfigVendor.mk

TARGET_USES_QCOM_BSP := true
COMMON_GLOBAL_CFLAGS += -DQCOM_BSP

#TODO: Fix-me: Setting TARGET_HAVE_HDMI_OUT to false
# to get rid of compilation error.
TARGET_HAVE_HDMI_OUT := false
TARGET_USES_OVERLAY := true
NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3
TARGET_NO_BOOTLOADER := false
TARGET_NO_BOOTLOADER := true
TARGET_NO_KERNEL := false
TARGET_NO_RADIOIMAGE := true
TARGET_NO_RPC := true
Expand Down Expand Up @@ -59,15 +63,18 @@ MAX_EGL_CACHE_KEY_SIZE := 12*1024
MAX_EGL_CACHE_SIZE := 2048*1024

# Use signed boot and recovery image
TARGET_BOOTIMG_SIGNED := true
TARGET_BOOTIMG_SIGNED := false

TARGET_USERIMAGES_USE_EXT4 := true
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_PERSISTIMAGE_FILE_SYSTEM_TYPE := ext4

BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3b7 ehci-hcd.park=3 androidboot.bootdevice=msm_sdcc.1
BOARD_KERNEL_CMDLINE := console=tty0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3b7 ehci-hcd.park=3 androidboot.bootdevice=msm_sdcc.1
BOARD_KERNEL_SEPARATED_DT := true

BOARD_CUSTOM_BOOTIMG_MK := device/fairphone_devices/FP2/mkbootimg.mk
TARGET_KERNEL_SOURCE := kernel/fairphone
TARGET_KERNEL_CONFIG := fairphone_defconfig
BOARD_EGL_CFG := device/fairphone_devices/FP2/egl.cfg

BOARD_BOOTIMAGE_PARTITION_SIZE := 0x01000000
Expand Down Expand Up @@ -103,7 +110,7 @@ BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/generic/common/bluetooth
OVERRIDE_RS_DRIVER := libRSDriver_adreno.so

TARGET_INIT_VENDOR_LIB := libinit_msm
TARGET_RECOVERY_UPDATER_LIBS := librecovery_updater_msm
#TARGET_RECOVERY_UPDATER_LIBS := librecovery_updater_msm

TARGET_LDPRELOAD := libNimsWrap.so

Expand Down
34 changes: 12 additions & 22 deletions FP2.mk
Expand Up @@ -22,13 +22,6 @@ endif

$(call inherit-product, device/qcom/common/common.mk)

PRODUCT_NAME := FP2
PRODUCT_DEVICE := FP2
PRODUCT_BRAND := Fairphone
PRODUCT_MANUFACTURER := Fairphone
PRODUCT_PROPERTY_OVERRIDES += \
ro.com.google.clientidbase=android-fairphone

# Audio configuration file
PRODUCT_COPY_FILES += \
device/fairphone_devices/FP2/audio_policy.conf:system/etc/audio_policy.conf \
Expand Down Expand Up @@ -60,6 +53,14 @@ PRODUCT_PACKAGES += \
battery_monitor \
battery_shutdown

# Graphics
PRODUCT_PACKAGES += \
copybit.msm8974 \
gralloc.msm8974 \
hwcomposer.msm8974 \
memtrack.msm8974 \
liboverlay

#fstab.qcom
PRODUCT_PACKAGES += fstab.qcom

Expand All @@ -81,6 +82,8 @@ PRODUCT_PACKAGES += \
ANTRadioService \
antradio_app



# Enable strict operation
PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
persist.sys.strict_op_enable=false \
Expand Down Expand Up @@ -142,20 +145,6 @@ PRODUCT_BOOT_JARS += qsb-port
PRODUCT_BOOT_JARS += oem-services
endif

PRODUCT_PACKAGES += \
FairphoneUpdater \
FairphoneLauncher3 \
AppOps \
MyContactsWidget \
ClockWidget \
FairphonePrivacyImpact \
ProgrammableButton

PRODUCT_PACKAGES += iFixit

# Amaze File Manager
PRODUCT_PACKAGES += Amaze

# Add boot animation
PRODUCT_COPY_FILES += device/fairphone_devices/FP2/bootanimation.zip:system/media/bootanimation.zip

Expand All @@ -172,7 +161,6 @@ PRODUCT_PROPERTY_OVERRIDES += \
fairphone.ota.beta=0 \
fairphone.ota.image_type=FP2

PRODUCT_MODEL := FP2

# include an expanded selection of fonts for the SDK.
EXTENDED_FONT_FOOTPRINT := true
Expand All @@ -190,4 +178,6 @@ ifeq ($(strip $(FP2_SKIP_BOOT_JARS_CHECK)),)
SKIP_BOOT_JARS_CHECK := true
endif

$(call inherit-product, hardware/qcom/display-caf/msm8974/Android.mk)

DEVICE_PACKAGE_OVERLAYS += device/fairphone_devices/FP2/overlay
42 changes: 42 additions & 0 deletions cm.mk
@@ -0,0 +1,42 @@
# Copyright (C) 2014 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
#
# 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.

# Inherit from those products. Most specific first.
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)

# Inherit from bacon device
$(call inherit-product, device/fairphone_devices/FP2/FP2.mk)

# Inherit some common CM stuff.
$(call inherit-product, vendor/cm/config/common_full_phone.mk)

PRODUCT_MODEL := FP2

PRODUCT_NAME := cm_FP2
PRODUCT_DEVICE := FP2
PRODUCT_BRAND := Fairphone
PRODUCT_MANUFACTURER := Fairphone
PRODUCT_PROPERTY_OVERRIDES += \
ro.com.google.clientidbase=android-fairphone

TARGET_VENDOR := Fairphone
TARGET_VENDOR_PRODUCT_NAME := FP2
TARGET_VENDOR_DEVICE_NAME := FP2
PRODUCT_BUILD_PROP_OVERRIDES += TARGET_DEVICE=FP2 PRODUCT_NAME=FP2

## Use the latest approved GMS identifiers unless running a signed build
ifneq ($(SIGN_BUILD),true)
PRODUCT_BUILD_PROP_OVERRIDES += \
PRIVATE_BUILD_DESC="f2p-user 5.1.1 LMY48B YOG4PAS1N0 release-keys"
endif
42 changes: 42 additions & 0 deletions mkbootimg.mk
@@ -0,0 +1,42 @@
LOCAL_PATH := $(call my-dir)

CM_DTB_FILES = $(wildcard $(TOP)/$(TARGET_KERNEL_SOURCE)/arch/arm/boot/*.dtb)
CM_DTS_FILE = $(lastword $(subst /, ,$(1)))
DTB_FILE := $(addprefix $(KERNEL_OUT)/arch/arm/boot/,$(patsubst %.dts,%.dtb,$(call CM_DTS_FILE,$(1))))
ZIMG_FILE = $(addprefix $(KERNEL_OUT)/arch/arm/boot/,$(patsubst %.dts,%-zImage,$(call CM_DTS_FILE,$(1))))
KERNEL_ZIMG = $(KERNEL_OUT)/arch/arm/boot/zImage

define append-cm-dtb
mkdir -p $(KERNEL_OUT)/arch/arm/boot;\
$(foreach d, $(CM_DTB_FILES), \
cat $(KERNEL_ZIMG) $(call DTB_FILE,$(d)) > $(call ZIMG_FILE,$(d));)
endef


## Build and run dtbtool
DTBTOOL := $(HOST_OUT_EXECUTABLES)/dtbToolCM$(HOST_EXECUTABLE_SUFFIX)
INSTALLED_DTIMAGE_TARGET := $(PRODUCT_OUT)/dt.img

$(INSTALLED_DTIMAGE_TARGET): $(DTBTOOL) $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr $(INSTALLED_KERNEL_TARGET)
@echo -e ${CL_CYN}"Start DT image: $@"${CL_RST}
$(call append-cm-dtb)
$(call pretty,"Target dt image: $(INSTALLED_DTIMAGE_TARGET)")
$(DTBTOOL) -2 -o $(INSTALLED_DTIMAGE_TARGET) -s $(BOARD_KERNEL_PAGESIZE) -p $(KERNEL_OUT)/scripts/dtc/ $(KERNEL_OUT)/arch/arm/boot/
@echo -e ${CL_CYN}"Made DT image: $@"${CL_RST}


## Overload bootimg generation: Same as the original, + --dt arg
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(INSTALLED_DTIMAGE_TARGET)
$(call pretty,"Target boot image: $@")
$(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_BOOTIMAGE_ARGS_COMMON) $(BOARD_MKBOOTIMG_ARGS) --dt $(INSTALLED_DTIMAGE_TARGET) --output $@
$(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw)
@echo -e ${CL_CYN}"Made boot image: $@"${CL_RST}

## Overload recoveryimg generation: Same as the original, + --dt arg
$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) $(INSTALLED_DTIMAGE_TARGET) \
$(recovery_ramdisk) \
$(recovery_kernel)
@echo -e ${CL_CYN}"----- Making recovery image ------"${CL_RST}
$(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --dt $(INSTALLED_DTIMAGE_TARGET) --output $@
$(hide) $(call assert-max-image-size,$@,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw)
@echo -e ${CL_CYN}"Made recovery image: $@"${CL_RST}
1 change: 0 additions & 1 deletion system.prop
Expand Up @@ -143,4 +143,3 @@ audio.offload.gapless.enabled=false

#enable dsds
persist.radio.multisim.config=dsds
ro.adb.secure=1
3 changes: 3 additions & 0 deletions vendorsetup.sh
@@ -0,0 +1,3 @@
add_lunch_combo cm_FP2-user
add_lunch_combo cm_FP2-userdebug
add_lunch_combo cm_FP2-eng

0 comments on commit 13c28b8

Please sign in to comment.