2021-09-08

Android device

based on android12

android device结构:

device/vendor_name/product_name/

Writing product makefiles
The following steps describe how to set up product makefiles in a way similar to that of the Pixel product line:

  1. Create a device// directory for your
    product. For example, device/google/marlin. This directory will
    contain source code for your device along with the makefiles to
    build them.
  2. Create a device.mk makefile that declares the files and modules
    needed for the device. For an example, see
    device/google/marlin/device-marlin.mk.
  3. Create a product definition makefile to create a specific product
    based on the device. The following makefile is taken from
    device/google/marlin/aosp_marlin.mk as an example. Notice that the
    product inherits from the device/google/marlin/device-marlin.mk and
    vendor/google/marlin/device-vendor-marlin.mk files through the
    makefile while also declaring the product-specific information such
    as name, brand, and model.
# Inherit from the common Open Source product configuration
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)

PRODUCT_NAME := aosp_marlin
PRODUCT_DEVICE := marlin
PRODUCT_BRAND := Android
PRODUCT_MODEL := AOSP on msm8996
PRODUCT_MANUFACTURER := Google
PRODUCT_RESTRICT_VENDOR_FILES := true

PRODUCT_COPY_FILES += device/google/marlin/fstab.common:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.marlin

$(call inherit-product, device/google/marlin/device-marlin.mk)
$(call inherit-product-if-exists, vendor/google_devices/marlin/device-vendor-marlin.mk)

PRODUCT_PACKAGES += \
    Launcher3QuickStep \
    WallpaperPicker

See Setting product definition variables for additional product-specific variables that you can add to your makefiles.

  1. Create an AndroidProducts.mk file that points to the product’s
    makefiles. In this example, only the product definition makefile is
    needed. The example below is from
    device/google/marlin/AndroidProducts.mk (which contains both marlin,
    the Pixel, and sailfish, the Pixel XL, which shared most
    configuration):
PRODUCT_MAKEFILES := \
	$(LOCAL_DIR)/aosp_marlin.mk \
	$(LOCAL_DIR)/aosp_sailfish.mk

COMMON_LUNCH_CHOICES := \
	aosp_marlin-userdebug \
	aosp_sailfish-userdebug
  1. Create a BoardConfig.mk makefile that contains board-specific
    configurations. For an example, see
    device/google/marlin/BoardConfig.mk.
  2. For Android 9 and lower only, create a vendorsetup.sh file to add
    your product (a “lunch combo”) to the build along with a build
    variant separated by a dash. For example:
add_lunch_combo <product-name>-userdebug
  1. At this point, you can create more product variants based on the
    same device.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值