aosp添加一个新的product

原生product

原生product 都放在
build/target/ 目录下

lucas@njsdc-srv06:~/workspace/aosp/x86_emulater/build/target$ ls
board  OWNERS  product
lucas@njsdc-srv06:~/workspace/aosp/x86_emulater/build/target$ 

添加 product

lucas@njsdc-srv06:~/workspace/aosp/x86_emulater/device/jelly$ ls -al rice14/
total 20
drwxrwxr-x 2 lucas lucas 4096 Oct 14 11:34 .
drwxrwxr-x 3 lucas lucas 4096 Oct 14 11:32 ..
-rw-rw-r-- 1 lucas lucas  116 Oct 14 11:43 AndroidProducts.mk
-rwxrwxr-x 1 lucas lucas 2049 Oct 14 11:34 BoardConfig.mk
-rw-rw-r-- 1 lucas lucas 2331 Oct 14 11:50 rice14.mk
lucas@njsdc-srv06:~/workspace/aosp/x86_emulater/device/jelly$ 

添加的内容

这三个文件都是从原生product 目录复制过来的,但是 需要修改下名字等

lucas@njsdc-srv06:~/workspace/aosp/x86_emulater/device/jelly$ 
lucas@njsdc-srv06:~/workspace/aosp/x86_emulater/device/jelly$ 
lucas@njsdc-srv06:~/workspace/aosp/x86_emulater/device/jelly$ ls -al rice14/
total 20
drwxrwxr-x 2 lucas lucas 4096 Oct 14 11:34 .
drwxrwxr-x 3 lucas lucas 4096 Oct 14 11:32 ..
-rw-rw-r-- 1 lucas lucas  116 Oct 14 11:43 AndroidProducts.mk
-rwxrwxr-x 1 lucas lucas 2049 Oct 14 11:34 BoardConfig.mk
-rw-rw-r-- 1 lucas lucas 2331 Oct 14 11:50 rice14.mk
lucas@njsdc-srv06:~/workspace/aosp/x86_emulater/device/jelly$ cd rice14/
lucas@njsdc-srv06:~/workspace/aosp/x86_emulater/device/jelly/rice14$ cat rice14.mk 
#
# Copyright 2013 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.
#

PRODUCT_USE_DYNAMIC_PARTITIONS := true

# The system image of aosp_x86_64-userdebug is a GSI for the devices with:
# - x86 64 bits user space
# - 64 bits binder interface
# - system-as-root
# - VNDK enforcement
# - compatible property override enabled

# This is a build configuration for a full-featured build of the
# Open-Source part of the tree. It's geared toward a US-centric
# build quite specifically for the emulator, and might not be
# entirely appropriate to inherit from for on-device configurations.

#
# All components inherited here go to system image
#
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk)

# Enable mainline checking for excat this product name
# ifeq (rice14,$(TARGET_PRODUCT))
PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed
# endif

#
# All components inherited here go to system_ext image
#
$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system_ext.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system_ext.mk)

#
# All components inherited here go to product image
#
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_product.mk)

#
# All components inherited here go to vendor image
#
$(call inherit-product-if-exists, device/generic/goldfish/x86_64-vendor.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator_vendor.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_x86_64/device.mk)

#
# Special settings for GSI releasing
#
# ifeq (rice14,$(TARGET_PRODUCT))
$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_release.mk)
# endif


PRODUCT_NAME := rice14
PRODUCT_DEVICE := generic_x86_64
PRODUCT_BRAND := Android
PRODUCT_MODEL := AOSP on x86_64
lucas@njsdc-srv06:~/workspace/aosp/x86_emulater/device/jelly/rice14$ cat 
AndroidProducts.mk  BoardConfig.mk      rice14.mk           
lucas@njsdc-srv06:~/workspace/aosp/x86_emulater/device/jelly/rice14$ cat BoardConfig.mk 
# Copyright (C) 2018 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.
#

# x86_64 emulator specific definitions
TARGET_CPU_ABI := x86_64
TARGET_ARCH := x86_64
TARGET_ARCH_VARIANT := x86_64

TARGET_2ND_CPU_ABI := x86
TARGET_2ND_ARCH := x86
TARGET_2ND_ARCH_VARIANT := x86_64

include build/make/target/board/BoardConfigGsiCommon.mk

ifdef BUILDING_GSI
include build/make/target/board/BoardConfigGkiCommon.mk

BOARD_KERNEL-5.4_BOOTIMAGE_PARTITION_SIZE := 67108864
BOARD_KERNEL-5.4-ALLSYMS_BOOTIMAGE_PARTITION_SIZE := 67108864
BOARD_KERNEL-5.10_BOOTIMAGE_PARTITION_SIZE := 67108864
BOARD_KERNEL-5.10-ALLSYMS_BOOTIMAGE_PARTITION_SIZE := 67108864

BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800

BOARD_KERNEL_BINARIES := \
    kernel-5.4 \
    kernel-5.10 \

ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
BOARD_KERNEL_BINARIES += \
    kernel-5.4-allsyms \
    kernel-5.10-allsyms \

endif

else # BUILDING_GSI
include build/make/target/board/BoardConfigEmuCommon.mk

BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800

BOARD_SEPOLICY_DIRS += device/generic/goldfish/sepolicy/x86

# Wifi.
BOARD_WLAN_DEVICE           := emulator
BOARD_HOSTAPD_DRIVER        := NL80211
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
BOARD_HOSTAPD_PRIVATE_LIB   := lib_driver_cmd_simulated
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_simulated
WPA_SUPPLICANT_VERSION      := VER_0_8_X
WIFI_DRIVER_FW_PATH_PARAM   := "/dev/null"
WIFI_DRIVER_FW_PATH_STA     := "/dev/null"
WIFI_DRIVER_FW_PATH_AP      := "/dev/null"

endif # BUILDING_GSI
lucas@njsdc-srv06:~/workspace/aosp/x86_emulater/device/jelly/rice14$ 
lucas@njsdc-srv06:~/workspace/aosp/x86_emulater/device/jelly/rice14$ 
lucas@njsdc-srv06:~/workspace/aosp/x86_emulater/device/jelly/rice14$ cat 
AndroidProducts.mk  BoardConfig.mk      rice14.mk           
lucas@njsdc-srv06:~/workspace/aosp/x86_emulater/device/jelly/rice14$ cat AndroidProducts.mk 
PRODUCT_MAKEFILES :=\
        $(LOCAL_DIR)/rice14.mk

COMMON_LUNCH_CHOICES :=\
        rice14-eng\
        rice14-user\
        rice14-userdebuglucas@njsdc-srv06:~/workspace/aosp/x86_emulater/device/jelly/rice14$ 

lunch 结果

lucas@njsdc-srv06:~/workspace/aosp/x86_emulater$ source build/envsetup.sh 
lucas@njsdc-srv06:~/workspace/aosp/x86_emulater$ lunch

You're building on Linux

Lunch menu... pick a combo:
........
     67. poplar-eng
     68. poplar-user
     69. poplar-userdebug
     70. qemu_trusty_arm64-userdebug
     71. rice14-eng
     72. rice14-user
     73. rice14-userdebug
     74. sdk_car_arm-userdebug
     75. sdk_car_arm64-userdebug
     76. sdk_car_portrait_x86_64-userdebug
     77. sdk_car_x86-userdebug
     78. sdk_car_x86_64-userdebug
     79. silvermont-eng
     80. uml-userdebug
     81. yukawa-userdebug
     82. yukawa_sei510-userdebug

Which would you like? [aosp_arm-eng] 71

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=12
TARGET_PRODUCT=rice14
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=x86_64
TARGET_ARCH_VARIANT=x86_64
TARGET_2ND_ARCH=x86
TARGET_2ND_ARCH_VARIANT=x86_64
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.15.0-213-generic-x86_64-Ubuntu-18.04.6-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=SQ3A.220705.001.B2
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/generic/goldfish device/generic/goldfish-opengl hardware/google/camera hardware/google/camera/devices/EmulatedCamera
============================================
lucas@njsdc-srv06:~/workspace/aosp/x86_emulater$ make -j128
build/make/core/soong_config.mk:195: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
build/make/core/soong_config.mk:196: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=12
TARGET_PRODUCT=rice14
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=x86_64
TARGET_ARCH_VARIANT=x86_64
TARGET_2ND_ARCH=x86
TARGET_2ND_ARCH_VARIANT=x86_64
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.15.0-213-generic-x86_64-Ubuntu-18.04.6-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=SQ3A.220705.001.B2
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/generic/goldfish device/generic/goldfish-opengl hardware/google/camera hardware/google/camera/devices/EmulatedCamera
============================================
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值