From eb6d9770dd42e1a41f90a3a66a74755d72664b17 Mon Sep 17 00:00:00 2001
From: Chen Wang
Date: Tue, 2 Nov 2021 17:20:57 +0800
Subject: [PATCH] pass build with m --skip-ninja --skip-soong-tests
---
core/binary.mk | 2 +-
core/build-system.html | 1 +
core/clang/TARGET_riscv64.mk | 10 +++
core/combo/TARGET_linux-riscv64.mk | 49 +++++++++++++
core/combo/arch/riscv64/riscv64.mk | 0
core/config.mk | 5 ++
envsetup.sh | 16 +++--
target/board/generic_riscv64/BoardConfig.mk | 65 ++++++++++++++++++
target/board/generic_riscv64/README.txt | 7 ++
target/board/generic_riscv64/device.mk | 45 ++++++++++++
target/board/generic_riscv64/sepolicy/OWNERS | 1 +
target/board/generic_riscv64/sepolicy/file.te | 6 ++
.../generic_riscv64/sepolicy/file_contexts | 12 ++++
target/board/generic_riscv64/system_ext.prop | 5 ++
target/product/AndroidProducts.mk | 3 +
target/product/aosp_riscv64.mk | 68 +++++++++++++++++++
16 files changed, 288 insertions(+), 7 deletions(-)
create mode 100644 core/clang/TARGET_riscv64.mk
create mode 100644 core/combo/TARGET_linux-riscv64.mk
create mode 100644 core/combo/arch/riscv64/riscv64.mk
create mode 100644 target/board/generic_riscv64/BoardConfig.mk
create mode 100644 target/board/generic_riscv64/README.txt
create mode 100644 target/board/generic_riscv64/device.mk
create mode 100644 target/board/generic_riscv64/sepolicy/OWNERS
create mode 100644 target/board/generic_riscv64/sepolicy/file.te
create mode 100644 target/board/generic_riscv64/sepolicy/file_contexts
create mode 100644 target/board/generic_riscv64/system_ext.prop
create mode 100644 target/product/aosp_riscv64.mk
diff --git a/core/binary.mk b/core/binary.mk
index cf47374b5e..defcabfc9d 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -166,7 +166,7 @@ ifneq ($(LOCAL_SDK_VERSION),)
# Make sure we've built the NDK.
my_additional_dependencies += $(SOONG_OUT_DIR)/ndk_base.timestamp
- ifneq (,$(filter arm64 x86_64,$(my_arch)))
+ ifneq (,$(filter arm64 riscv64 x86_64,$(my_arch)))
my_min_sdk_version := 21
else
my_min_sdk_version := $(MIN_SUPPORTED_SDK_VERSION)
diff --git a/core/build-system.html b/core/build-system.html
index b872909c07..74df020b7d 100644
--- a/core/build-system.html
+++ b/core/build-system.html
@@ -494,6 +494,7 @@ set to and some examples.
TARGET_ARCH
arm
arm64
+ riscv64
x86
x86_64
diff --git a/core/clang/TARGET_riscv64.mk b/core/clang/TARGET_riscv64.mk
new file mode 100644
index 0000000000..34f830bfae
--- /dev/null
+++ b/core/clang/TARGET_riscv64.mk
@@ -0,0 +1,10 @@
+RS_TRIPLE := renderscript64-linux-android
+RS_TRIPLE_CFLAGS :=
+RS_COMPAT_TRIPLE := riscv64-linux-android
+
+TARGET_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-riscv64-android.a
+TARGET_LIBCRT_BUILTINS := $(LLVM_RTLIB_PATH)/libclang_rt.builtins-riscv64-android.a
+
+# Address sanitizer clang config
+ADDRESS_SANITIZER_LINKER := /system/bin/linker_asan64
+ADDRESS_SANITIZER_LINKER_FILE := /system/bin/bootstrap/linker_asan64
diff --git a/core/combo/TARGET_linux-riscv64.mk b/core/combo/TARGET_linux-riscv64.mk
new file mode 100644
index 0000000000..9c02b1691a
--- /dev/null
+++ b/core/combo/TARGET_linux-riscv64.mk
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 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.
+#
+
+# Configuration for Linux on RISC-V.
+# Included by combo/select.mk
+
+# You can set TARGET_ARCH_VARIANT to use an arch version other
+# than ARMv5TE. Each value should correspond to a file named
+# $(BUILD_COMBOS)/arch/.mk which must contain
+# makefile variable definitions. Their
+# purpose is to allow module Android.mk files to selectively compile
+# different versions of code based upon the funtionality and
+# instructions available in a given architecture version.
+#
+# The blocks also define specific arch_variant_cflags, which
+# include defines, and compiler settings for the given architecture
+# version.
+#
+ifeq ($(strip $(TARGET_ARCH_VARIANT)),)
+TARGET_ARCH_VARIANT := imafdc
+endif
+
+TARGET_ARCH_SPECIFIC_MAKEFILE := $(BUILD_COMBOS)/arch/$(TARGET_ARCH)/$(TARGET_ARCH_VARIANT).mk
+ifeq ($(strip $(wildcard $(TARGET_ARCH_SPECIFIC_MAKEFILE))),)
+$(error Unknown RISC-V architecture version: $(TARGET_ARCH_VARIANT))
+endif
+
+include $(TARGET_ARCH_SPECIFIC_MAKEFILE)
+
+define $(combo_var_prefix)transform-shared-lib-to-toc
+$(call _gen_toc_command_for_elf,$(1),$(2))
+endef
+
+TARGET_PACK_MODULE_RELOCATIONS := true
+
+TARGET_LINKER := /system/bin/linker64
diff --git a/core/combo/arch/riscv64/riscv64.mk b/core/combo/arch/riscv64/riscv64.mk
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/core/config.mk b/core/config.mk
index 93c5db12d2..eb7e66168c 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -394,7 +394,12 @@ include $(BUILD_SYSTEM)/rbe.mk
endif
# GCC version selection
+#TARGET_GCC_VERSION := 4.9
+ifeq ($(TARGET_ARCH),riscv64)
+TARGET_GCC_VERSION := 8.1
+else
TARGET_GCC_VERSION := 4.9
+endif
ifdef TARGET_2ND_ARCH
2ND_TARGET_GCC_VERSION := 4.9
endif
diff --git a/envsetup.sh b/envsetup.sh
index 8a995c7fdc..aa0a72bba2 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -8,9 +8,9 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y
Selects as the product to build, and as the variant to
build, and stores those selections in the environment to be read by subsequent
invocations of 'm' etc.
-- tapas: tapas [ ...] [arm|x86|arm64|x86_64] [eng|userdebug|user]
+- tapas: tapas [ ...] [arm|x86|arm64|riscv64|x86_64] [eng|userdebug|user]
Sets up the build environment for building unbundled apps (APKs).
-- banchan: banchan [ ...] [arm|x86|arm64|x86_64] [eng|userdebug|user]
+- banchan: banchan [ ...] [arm|x86|arm64|riscv64|x86_64] [eng|userdebug|user]
Sets up the build environment for building unbundled modules (APEXes).
- croot: Changes directory to the top of the tree, or a subdirectory thereof.
- m: Makes from the top of the tree.
@@ -227,6 +227,8 @@ function setpaths()
arm64) toolchaindir=aarch64/aarch64-linux-android-$targetgccversion/bin;
toolchaindir2=arm/arm-linux-androideabi-$targetgccversion2/bin
;;
+ riscv64) toolchaindir=riscv64/riscv64-linux-$targetgccversion/bin
+ ;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
@@ -743,10 +745,10 @@ function _lunch()
function tapas()
{
local showHelp="$(echo $* | xargs -n 1 echo | \grep -E '^(help)$' | xargs)"
- local arch="$(echo $* | xargs -n 1 echo | \grep -E '^(arm|x86|arm64|x86_64)$' | xargs)"
+ local arch="$(echo $* | xargs -n 1 echo | \grep -E '^(arm|x86|arm64|riscv64|x86_64)$' | xargs)"
local variant="$(echo $* | xargs -n 1 echo | \grep -E '^(user|userdebug|eng)$' | xargs)"
local density="$(echo $* | xargs -n 1 echo | \grep -E '^(ldpi|mdpi|tvdpi|hdpi|xhdpi|xxhdpi|xxxhdpi|alldpi)$' | xargs)"
- local apps="$(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng|arm|x86|arm64|x86_64|ldpi|mdpi|tvdpi|hdpi|xhdpi|xxhdpi|xxxhdpi|alldpi)$' | xargs)"
+ local apps="$(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng|arm|x86|arm64|riscv64|x86_64|ldpi|mdpi|tvdpi|hdpi|xhdpi|xxhdpi|xxxhdpi|alldpi)$' | xargs)"
if [ "$showHelp" != "" ]; then
$(gettop)/build/make/tapasHelp.sh
@@ -770,6 +772,7 @@ function tapas()
case $arch in
x86) product=aosp_x86;;
arm64) product=aosp_arm64;;
+ riscv64) product=aosp_riscv64;;
x86_64) product=aosp_x86_64;;
esac
if [ -z "$variant" ]; then
@@ -799,9 +802,9 @@ function tapas()
function banchan()
{
local showHelp="$(echo $* | xargs -n 1 echo | \grep -E '^(help)$' | xargs)"
- local product="$(echo $* | xargs -n 1 echo | \grep -E '^(.*_)?(arm|x86|arm64|x86_64)$' | xargs)"
+ local product="$(echo $* | xargs -n 1 echo | \grep -E '^(.*_)?(arm|x86|arm64|riscv64|x86_64)$' | xargs)"
local variant="$(echo $* | xargs -n 1 echo | \grep -E '^(user|userdebug|eng)$' | xargs)"
- local apps="$(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng|(.*_)?(arm|x86|arm64|x86_64))$' | xargs)"
+ local apps="$(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng|(.*_)?(arm|x86|arm64|riscv64|x86_64))$' | xargs)"
if [ "$showHelp" != "" ]; then
$(gettop)/build/make/banchanHelp.sh
@@ -827,6 +830,7 @@ function banchan()
arm) product=module_arm;;
x86) product=module_x86;;
arm64) product=module_arm64;;
+ riscv64) product=module_riscv64;;
x86_64) product=module_x86_64;;
esac
if [ -z "$variant" ]; then
diff --git a/target/board/generic_riscv64/BoardConfig.mk b/target/board/generic_riscv64/BoardConfig.mk
new file mode 100644
index 0000000000..164e626204
--- /dev/null
+++ b/target/board/generic_riscv64/BoardConfig.mk
@@ -0,0 +1,65 @@
+# 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.
+#
+
+# riscv64 emulator specific definitions
+TARGET_ARCH := riscv64
+TARGET_ARCH_VARIANT := riscv64
+TARGET_CPU_VARIANT := generic
+TARGET_CPU_ABI := riscv64
+
+include build/make/target/board/BoardConfigGsiCommon.mk
+include build/make/target/board/BoardConfigGkiCommon.mk
+
+BOARD_KERNEL-4.19-GZ_BOOTIMAGE_PARTITION_SIZE := 47185920
+BOARD_KERNEL-4.19-GZ-ALLSYMS_BOOTIMAGE_PARTITION_SIZE := 47185920
+BOARD_KERNEL-5.4_BOOTIMAGE_PARTITION_SIZE := 67108864
+BOARD_KERNEL-5.4-ALLSYMS_BOOTIMAGE_PARTITION_SIZE := 67108864
+BOARD_KERNEL-5.4-GZ_BOOTIMAGE_PARTITION_SIZE := 47185920
+BOARD_KERNEL-5.4-GZ-ALLSYMS_BOOTIMAGE_PARTITION_SIZE := 47185920
+BOARD_KERNEL-5.4-LZ4_BOOTIMAGE_PARTITION_SIZE := 53477376
+BOARD_KERNEL-5.4-LZ4-ALLSYMS_BOOTIMAGE_PARTITION_SIZE := 53477376
+BOARD_KERNEL-5.10_BOOTIMAGE_PARTITION_SIZE := 67108864
+BOARD_KERNEL-5.10-ALLSYMS_BOOTIMAGE_PARTITION_SIZE := 67108864
+BOARD_KERNEL-5.10-GZ_BOOTIMAGE_PARTITION_SIZE := 47185920
+BOARD_KERNEL-5.10-GZ-ALLSYMS_BOOTIMAGE_PARTITION_SIZE := 47185920
+BOARD_KERNEL-5.10-LZ4_BOOTIMAGE_PARTITION_SIZE := 53477376
+BOARD_KERNEL-5.10-LZ4-ALLSYMS_BOOTIMAGE_PARTITION_SIZE := 53477376
+
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800
+
+BOARD_KERNEL_BINARIES := \
+ kernel-4.19-gz \
+ kernel-5.4 kernel-5.4-gz kernel-5.4-lz4 \
+ kernel-5.10 kernel-5.10-gz kernel-5.10-lz4 \
+
+ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
+BOARD_KERNEL_BINARIES += \
+ kernel-4.19-gz-allsyms \
+ kernel-5.4-allsyms kernel-5.4-gz-allsyms kernel-5.4-lz4-allsyms \
+ kernel-5.10-allsyms kernel-5.10-gz-allsyms kernel-5.10-lz4-allsyms \
+
+endif
+
+# Some vendors still haven't cleaned up all device specific directories under
+# root!
+
+# TODO(b/111434759, b/111287060) SoC specific hacks
+BOARD_ROOT_EXTRA_SYMLINKS += /vendor/lib/dsp:/dsp
+BOARD_ROOT_EXTRA_SYMLINKS += /mnt/vendor/persist:/persist
+BOARD_ROOT_EXTRA_SYMLINKS += /vendor/firmware_mnt:/firmware
+
+# TODO(b/36764215): remove this setting when the generic system image
+# no longer has QCOM-specific directories under /.
+BOARD_SEPOLICY_DIRS += build/make/target/board/generic_riscv64/sepolicy
diff --git a/target/board/generic_riscv64/README.txt b/target/board/generic_riscv64/README.txt
new file mode 100644
index 0000000000..9811982d43
--- /dev/null
+++ b/target/board/generic_riscv64/README.txt
@@ -0,0 +1,7 @@
+The "generic_riscv64" product defines a non-hardware-specific riscv64 target
+without a bootloader.
+
+It is also the target to build the generic kernel image (GKI).
+
+It is not a product "base class"; no other products inherit
+from it or use it in any way.
diff --git a/target/board/generic_riscv64/device.mk b/target/board/generic_riscv64/device.mk
new file mode 100644
index 0000000000..ef7496eccc
--- /dev/null
+++ b/target/board/generic_riscv64/device.mk
@@ -0,0 +1,45 @@
+#
+# Copyright (C) 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_COPY_FILES += \
+ kernel/prebuilts/4.19/arm64/kernel-4.19-gz:kernel-4.19-gz \
+ kernel/prebuilts/5.4/arm64/kernel-5.4:kernel-5.4 \
+ kernel/prebuilts/5.4/arm64/kernel-5.4-gz:kernel-5.4-gz \
+ kernel/prebuilts/5.4/arm64/kernel-5.4-lz4:kernel-5.4-lz4 \
+ kernel/prebuilts/5.10/arm64/kernel-5.10:kernel-5.10 \
+ kernel/prebuilts/5.10/arm64/kernel-5.10-gz:kernel-5.10-gz \
+ kernel/prebuilts/5.10/arm64/kernel-5.10-lz4:kernel-5.10-lz4 \
+
+#$(call dist-for-goals, dist_files, kernel/prebuilts/4.19/arm64/prebuilt-info.txt:kernel/4.19/prebuilt-info.txt)
+#$(call dist-for-goals, dist_files, kernel/prebuilts/5.4/arm64/prebuilt-info.txt:kernel/5.4/prebuilt-info.txt)
+#$(call dist-for-goals, dist_files, kernel/prebuilts/5.10/arm64/prebuilt-info.txt:kernel/5.10/prebuilt-info.txt)
+
+ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
+#PRODUCT_COPY_FILES += \
+ kernel/prebuilts/4.19/arm64/kernel-4.19-gz-allsyms:kernel-4.19-gz-allsyms \
+ kernel/prebuilts/5.4/arm64/kernel-5.4-allsyms:kernel-5.4-allsyms \
+ kernel/prebuilts/5.4/arm64/kernel-5.4-gz-allsyms:kernel-5.4-gz-allsyms \
+ kernel/prebuilts/5.4/arm64/kernel-5.4-lz4-allsyms:kernel-5.4-lz4-allsyms \
+ kernel/prebuilts/5.10/arm64/kernel-5.10-allsyms:kernel-5.10-allsyms \
+ kernel/prebuilts/5.10/arm64/kernel-5.10-gz-allsyms:kernel-5.10-gz-allsyms \
+ kernel/prebuilts/5.10/arm64/kernel-5.10-lz4-allsyms:kernel-5.10-lz4-allsyms \
+
+endif
+
+PRODUCT_BUILD_VENDOR_BOOT_IMAGE := false
+PRODUCT_BUILD_RECOVERY_IMAGE := false
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_ramdisk.mk)
diff --git a/target/board/generic_riscv64/sepolicy/OWNERS b/target/board/generic_riscv64/sepolicy/OWNERS
new file mode 100644
index 0000000000..6dc2b86753
--- /dev/null
+++ b/target/board/generic_riscv64/sepolicy/OWNERS
@@ -0,0 +1 @@
+include platform/system/sepolicy:/OWNERS
diff --git a/target/board/generic_riscv64/sepolicy/file.te b/target/board/generic_riscv64/sepolicy/file.te
new file mode 100644
index 0000000000..7adfdfa4e6
--- /dev/null
+++ b/target/board/generic_riscv64/sepolicy/file.te
@@ -0,0 +1,6 @@
+# TODO(b/36764215): remove this file when the generic system image
+# no longer has these directories
+type persist_file, file_type;
+
+# Default type for anything under /firmware.
+type firmware_file, fs_type, contextmount_type;
diff --git a/target/board/generic_riscv64/sepolicy/file_contexts b/target/board/generic_riscv64/sepolicy/file_contexts
new file mode 100644
index 0000000000..0a80559e17
--- /dev/null
+++ b/target/board/generic_riscv64/sepolicy/file_contexts
@@ -0,0 +1,12 @@
+# TODO(b/36764215): remove this file when the generic system image
+# no longer has these directories. They are specific to QCOM.
+
+# /
+/tombstones u:object_r:rootfs:s0
+/dsp u:object_r:rootfs:s0
+
+# /persist
+/persist(/.*)? u:object_r:persist_file:s0
+
+# files in firmware
+/firmware(/.*)? u:object_r:firmware_file:s0
diff --git a/target/board/generic_riscv64/system_ext.prop b/target/board/generic_riscv64/system_ext.prop
new file mode 100644
index 0000000000..42c4ef520a
--- /dev/null
+++ b/target/board/generic_riscv64/system_ext.prop
@@ -0,0 +1,5 @@
+#
+# system.prop for generic riscv64 sdk
+#
+
+rild.libpath=/vendor/lib64/libreference-ril.so
diff --git a/target/product/AndroidProducts.mk b/target/product/AndroidProducts.mk
index 7d9d90e92a..1183f36c65 100644
--- a/target/product/AndroidProducts.mk
+++ b/target/product/AndroidProducts.mk
@@ -40,12 +40,14 @@ PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/aosp_x86.mk \
$(LOCAL_DIR)/full.mk \
$(LOCAL_DIR)/full_x86.mk \
+ $(LOCAL_DIR)/aosp_riscv64.mk \
else
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/aosp_64bitonly_x86_64.mk \
$(LOCAL_DIR)/aosp_arm64.mk \
$(LOCAL_DIR)/aosp_arm.mk \
+ $(LOCAL_DIR)/aosp_riscv64.mk \
$(LOCAL_DIR)/aosp_x86_64.mk \
$(LOCAL_DIR)/aosp_x86_arm.mk \
$(LOCAL_DIR)/aosp_x86.mk \
@@ -82,5 +84,6 @@ PRODUCT_MAKEFILES += \
COMMON_LUNCH_CHOICES := \
aosp_arm64-eng \
aosp_arm-eng \
+ aosp_riscv64-eng \
aosp_x86_64-eng \
aosp_x86-eng \
diff --git a/target/product/aosp_riscv64.mk b/target/product/aosp_riscv64.mk
new file mode 100644
index 0000000000..265abd3512
--- /dev/null
+++ b/target/product/aosp_riscv64.mk
@@ -0,0 +1,68 @@
+#
+# 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.
+#
+
+# The system image of aosp_arm64-userdebug is a GSI for the devices with:
+# - ARM 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 (aosp_arm64,$(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 or vendor_boot image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator_vendor.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_riscv64/device.mk)
+
+#
+# Special settings for GSI releasing
+#
+ifeq (aosp_arm64,$(TARGET_PRODUCT))
+$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_release.mk)
+endif
+
+
+PRODUCT_NAME := aosp_riscv64
+PRODUCT_DEVICE := generic_riscv64
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := AOSP on RISCV64
--
Gitee