该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
#
# Copyright 2014 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.
#
# WARNING: This line must come *before* including the proprietary
# variant, so that it gets overwritten by the parent (which goes
# against the traditional rules of inheritance).
# The proprietary variant sets USE_CAMERA_STUB := false, this way
# we use the camera stub when the vendor tree isn*t present, and
# the true camera library when the vendor tree is available.
USE_CAMERA_STUB := true ---这个是是否使用虚拟相机的标志
# Inherit from the proprietary version
-include vendor/huawei/msm7x27a-common/BoardConfigVendor.mk
TARGET_NO_BOOTLOADER := true
TARGET_NO_RADIOIMAGE := true ------------若手机bootloader以及radio不是镜像,则这里些false
TARGET_SPECIFIC_HEADER_PATH := device/huawei/msm7x27a-common/include ----此处是引用设备编译时需要用到的头文件
# Architecture and CPU
TARGET_ARCH := arm
TARGET_ARCH_VARIANT := armv7-a-neon
TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi
TARGET_CPU_VARIANT := cortex-a5
TARGET_BOARD_PLATFORM := msm7x27a
TARGET_BOARD_PLATFORM_GPU := qcom-adreno200
-----------cpu,gpu架构,按照自己机型的技术参数设置
TARGET_ARCH_LOWMEM := true
-----------按照手机内存大小设置,若小于1024M建议此处设置为false,不过关系不大
# Qualcomm hardware
BOARD_USES_QCOM_HARDWARE := true
COMMON_GLOBAL_CFLAGS += -DQCOM_BSP -DQCOM_HARDWARE
TARGET_USES_ION := true
TARGET_USES_QCOM_BSP := true
由于手机是高通的,此处是高通设置,上面设置项参考同架构机型
BOARD_WANTS_EMMC_BOOT := true -----从emmc启动
# Compiler flags
TARGET_GLOBAL_CFLAGS += -mfloat-abi=softfp -mfpu=neon-vfpv4 -mtune=cortex-a5
TARGET_GLOBAL_CPPFLAGS += -mfloat-abi=softfp -mfpu=neon-vfpv4 -mtune=cortex-a5
-----编译参数,可以照搬,建议参考配置相似机型的device
# Audio
BOARD_USES_LEGACY_ALSA_AUDIO := true
TARGET_QCOM_AUDIO_VARIANT := caf
------------配置了声音使用什么驱动(qcom-caf) ,以及是否存在ALSA_AUDIO设备
# Bluetooth
BOARD_HAVE_BLUETOOTH := true
------蓝牙,自己设置即可
# Camera
COMMON_GLOBAL_CFLAGS += -DMR0_CAMERA_BLOB -DNEEDS_VECTORIMPL_SYMBOLS
--------关于相机的(如双摄像头,等等)
# GPS
BOARD_USES_QCOM_GPS := true
BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION := 50000
BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := $(TARGET_BOARD_PLATFORM)
-------gps的驱动源码,api版本等等
# Graphics
BOARD_ADRENO_DECIDE_TEXTURE_TARGET := true
BOARD_EGL_CFG := device/huawei/msm7x27a-common/configs/egl.cfg
BOARD_EGL_WORKAROUND_BUG_10194508 := true
BOARD_USE_MHEAP_SCREENSHOT := true
TARGET_DOESNT_USE_FENCE_SYNC := true
TARGET_QCOM_DISPLAY_VARIANT := legacy
USE_OPENGL_RENDERER := true
------------这里是与图形有关的设置
# Hardware
BOARD_HARDWARE_CLASS := device/huawei/msm7x27a-common/cmhw
---------------hardware的类“cmhw”放在device目录下
# Kernel
BOARD_KERNEL_BASE := 0x00200000
BOARD_KERNEL_CMDLINE := androidboot.hardware=huawei androidboot.selinux=permissive
BOARD_PAGE_SIZE := 2048
TARGET_KERNEL_SOURCE := kernel/huawei/huawei-kernel-3.4
内核相关设置,包括源码位置,bootflag等等
# Lights
TARGET_PROVIDES_LIBLIGHTS := true
是否有提供灯光驱动
# Media
TARGET_ENABLE_QC_AV_ENHANCEMENTS := true
TARGET_QCOM_MEDIA_VARIANT := legacy
媒体播放选用源码,qcom有这个设置
# Partitions
BOARD_BOOTIMAGE_PARTITION_SIZE := 0x800000
BOARD_CACHEIMAGE_PARTITION_SIZE := 201326592 # 0xC000000
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x1400000
BOARD_FLASH_BLOCK_SIZE := 131072
TARGET_USERIMAGES_USE_EXT4 := true
一些分区信息
# Recovery
BOARD_CUSTOM_RECOVERY_KEYMAPPING := ../../device/huawei/msm7x27a-common/recovery/recovery-keys.c
BOARD_UMS_LUNFILE := /sys/class/android_usb/android0/f_mass_storage/lun%d/file
TARGET_RECOVERY_INITRC := device/huawei/msm7x27a-common/recovery/init.rc
TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888
recovery相关设置
# SELinux
BOARD_SEPOLICY_DIRS += device/huawei/msm7x27a-common/sepolicy
---------这是4.3以后的selinux源码
BOARD_SEPOLICY_UNION += \
file_contexts \
file.te
# USB 下为分区,usb等设置
BOARD_VOLD_EMMC_SHARES_DEV_MAJOR := true
BOARD_VOLD_MAX_PARTITIONS := 19
TARGET_USE_CUSTOM_LUN_FILE_PATH := /sys/class/android_usb/android0/f_mass_storage/lun%d/file
TARGET_USE_CUSTOM_SECOND_LUN_NUM := 1
# Web Rendering
ENABLE_WEBGL := true
#PRODUCT_PREBUILT_WEBVIEWCHROMIUM := yes
TARGET_FORCE_CPU_UPLOAD := true
------------这个是浏览器相关,由于我的设备与android原生webview不兼容,故添加这些项目
# Wi-Fi
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
BOARD_HOSTAPD_DRIVER := NL80211
TARGET_CUSTOM_WIFI := ../../device/huawei/msm7x27a-common/libhardware_legacy/wifi/wifi.c
WPA_SUPPLICANT_VERSION := VER_0_8_X
此处是wifi芯片,包括wpa版本等的设定,具体得看手机官方固件的相关参数