13

我正在建造AOSP 4.2 Jelly Bean。当我构建默认full-eng配置并在模拟器上运行它时,一切都很好。

我需要构建自定义设备并运行它(在emulator- 用于测试它是否真的有效,并且在真实设备上)。当我基于full_base.mk文件创建自定义设备并运行它时emulator-emulator只是挂断了带有 ANDROID 文本的第一个屏幕,并且根本不会加载。我system.img, userdata.img, ramdisk.img在建立目录之后。这就是我构建自定义 AOSP 并在设备上运行它所需的全部内容吗?我可以在模拟器上运行我的构建,还是只在真实设备上运行?

我是否应该有一些额外的东西来为真实设备构建 AOSP:内核、设备驱动程序等?

自定义设备文件夹文件(device/my_company/my_product):

安卓.mk

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

ifneq ($(filter my_product,$(TARGET_DEVICE)),)
include $(call all-makefiles-under,$(LOCAL_PATH))
endif

安卓产品.mk

PRODUCT_MAKEFILES := \
    $(LOCAL_DIR)/full_myproduct.mk

BoardConfig.mk

TARGET_NO_BOOTLOADER := true
TARGET_NO_KERNEL := true

TARGET_ARCH := arm

TARGET_ARCH_VARIANT := armv7-a
TARGET_CPU_VARIANT := generic
TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi

HAVE_HTC_AUDIO_DRIVER := true
BOARD_USES_GENERIC_AUDIO := true

# no hardware camera
USE_CAMERA_STUB := true

# Enable dex-preoptimization to speed up the first boot sequence
# of an SDK AVD. Note that this operation only works on Linux for now
ifeq ($(HOST_OS),linux)
  ifeq ($(WITH_DEXPREOPT),)
    WITH_DEXPREOPT := true
  endif
endif

# Build OpenGLES emulation guest and host libraries
BUILD_EMULATOR_OPENGL := true

# Build and enable the OpenGL ES View renderer. When running on the emulator,
# the GLES renderer disables itself if host GL acceleration isn't available.
USE_OPENGL_RENDERER := true

full_myproduct.mk

$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)

#DEVICE_PACKAGE_OVERLAYS :=
#PRODUCT_PACKAGES +=
#PRODUCT_COPY_FILES +=

PRODUCT_NAME := full_myproduct
PRODUCT_DEVICE := myproduct
PRODUCT_MODEL := Customized Android
PRODUCT_BRAND := Android

供应商设置.sh

add_lunch_combo full_myproduct-userdebug
4

2 回答 2

12

您似乎对 AOSP 构建系统有很好的把握,尤其是在如何添加新设备方面。

full-eng只针对模拟器。通常你会为有问题的设备构建自定义.img,因为硬件驱动程序在设备是否工作方面起着重要作用。

例如,如果您有 agrouper或 a maguro,您最终会为该设备构建而不是full-eng. lunch应该在您将它们添加到您的device/vendor/树时列出其他设备。Google 在其 [网站][https://developers.google.com/android/nexus/drivers] 上提供了为 Nexus 设备系列构建所需的文件。

What is the custom device that you are building for? If your device is commercially sold, chances are someone on XDA is trying to port AOSP and friends (CM, AOKP, etc) to your device.

Even if your device isn't on XDA, chances are it has hardware common with a bunch of other devices that you can find on AOSP. At that point, you'd have to go cherry pick driver-specific bits of code, like wifi chipsets, sound devices, etc.

I don't have a good primer for building off the top of my head, but http://wiki.cyanogenmod.org/w/Main_Page should be fairly helpful to you. This wiki has improved a lot since its creation and now has a chockful of useful information.

于 2013-04-04T03:05:51.553 回答
1

You are missing some of the vendor's drivers. goto: https://developers.google.com/android/nexus/drivers

download the appropriate drivers for the exact device. put the *.sh file in your aosp top directory. run each of the shell file and accept the terms.

then recompile the code!

于 2013-11-01T19:34:11.983 回答