From c101e27d547ee218337b2600e8158dedd0a064af Mon Sep 17 00:00:00 2001 From: Bruce Beare Date: Tue, 31 May 2011 10:40:20 -0700 Subject: [PATCH 01/23] Refactor Stripper. Allow a stripper other than SOSLIM to be specified Orig-Change-Id: I61137f5bb123dc5f610af9928ed3debdf85ba74d Signed-off-by: Bruce Beare --- core/combo/HOST_darwin-x86.mk | 2 ++ core/combo/TARGET_linux-arm.mk | 2 ++ core/combo/TARGET_linux-sh.mk | 4 +++- core/combo/TARGET_linux-x86.mk | 4 +++- core/combo/select.mk | 1 + core/config.mk | 1 - core/definitions.mk | 5 +---- core/dynamic_binary.mk | 4 ++-- 8 files changed, 14 insertions(+), 9 deletions(-) diff --git a/core/combo/HOST_darwin-x86.mk b/core/combo/HOST_darwin-x86.mk index 093ecbe212..121f89b030 100644 --- a/core/combo/HOST_darwin-x86.mk +++ b/core/combo/HOST_darwin-x86.mk @@ -45,6 +45,8 @@ HOST_NO_UNDEFINED_LDFLAGS := -Wl,-undefined,error HOST_CC := $(CC) HOST_CXX := $(CXX) HOST_AR := $(AR) +HOST_STRIP := $(STRIP) +HOST_STRIP_COMMAND = $(HOST_STRIP) --strip-debug $< -o $@ HOST_SHLIB_SUFFIX := .dylib HOST_JNILIB_SUFFIX := .jnilib diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk index ae1997c4f4..6139b676ae 100644 --- a/core/combo/TARGET_linux-arm.mk +++ b/core/combo/TARGET_linux-arm.mk @@ -52,6 +52,8 @@ TARGET_CXX := $(TARGET_TOOLS_PREFIX)g++$(HOST_EXECUTABLE_SUFFIX) TARGET_AR := $(TARGET_TOOLS_PREFIX)ar$(HOST_EXECUTABLE_SUFFIX) TARGET_OBJCOPY := $(TARGET_TOOLS_PREFIX)objcopy$(HOST_EXECUTABLE_SUFFIX) TARGET_LD := $(TARGET_TOOLS_PREFIX)ld$(HOST_EXECUTABLE_SUFFIX) +TARGET_STRIP := $(HOST_OUT_EXECUTABLES)/soslim$(HOST_EXECUTABLE_SUFFIX) +TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip --shady --quiet $< --outfile $@ TARGET_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined diff --git a/core/combo/TARGET_linux-sh.mk b/core/combo/TARGET_linux-sh.mk index f373d21d70..cf945fec6a 100644 --- a/core/combo/TARGET_linux-sh.mk +++ b/core/combo/TARGET_linux-sh.mk @@ -28,6 +28,8 @@ TARGET_CXX := $(TARGET_TOOLS_PREFIX)c++$(HOST_EXECUTABLE_SUFFIX) TARGET_AR := $(TARGET_TOOLS_PREFIX)ar$(HOST_EXECUTABLE_SUFFIX) TARGET_OBJCOPY := $(TARGET_TOOLS_PREFIX)objcopy$(HOST_EXECUTABLE_SUFFIX) TARGET_LD := $(TARGET_TOOLS_PREFIX)ld$(HOST_EXECUTABLE_SUFFIX) +TARGET_STRIP := $(TARGET_TOOLS_PREFIX)strip$(HOST_EXECUTABLE_SUFFIX) +TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-debug $< -o $@ TARGET_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined @@ -106,7 +108,7 @@ TARGET_CRTEND_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_android.o TARGET_CRTBEGIN_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/sobegin.o TARGET_CRTEND_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/soend.o -TARGET_STRIP_MODULE:=false +TARGET_STRIP_MODULE:=true TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES := libc libstdc++ libm diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk index 6629cbd812..d5bcba2255 100644 --- a/core/combo/TARGET_linux-x86.mk +++ b/core/combo/TARGET_linux-x86.mk @@ -44,6 +44,8 @@ TARGET_CXX := $(TARGET_TOOLS_PREFIX)g++$(HOST_EXECUTABLE_SUFFIX) TARGET_AR := $(TARGET_TOOLS_PREFIX)ar$(HOST_EXECUTABLE_SUFFIX) TARGET_OBJCOPY := $(TARGET_TOOLS_PREFIX)objcopy$(HOST_EXECUTABLE_SUFFIX) TARGET_LD := $(TARGET_TOOLS_PREFIX)ld$(HOST_EXECUTABLE_SUFFIX) +TARGET_STRIP := $(TARGET_TOOLS_PREFIX)strip$(HOST_EXECUTABLE_SUFFIX) +TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-debug $< -o $@ ifneq ($(wildcard $(TARGET_CC)),) TARGET_LIBGCC := \ @@ -97,7 +99,7 @@ TARGET_CRTEND_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_android.o TARGET_CRTBEGIN_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_so.o TARGET_CRTEND_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_so.o -# TARGET_STRIP_MODULE:=true +TARGET_STRIP_MODULE:=true TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES := libc libstdc++ libm diff --git a/core/combo/select.mk b/core/combo/select.mk index 797c573972..c8863424a4 100644 --- a/core/combo/select.mk +++ b/core/combo/select.mk @@ -28,6 +28,7 @@ combo_os_arch := $($(combo_target)OS)-$($(combo_target)ARCH) $(combo_target)CC := $(CC) $(combo_target)CXX := $(CXX) $(combo_target)AR := $(AR) +$(combo_target)STRIP := $(STRIP) $(combo_target)BINDER_MINI := 0 diff --git a/core/config.mk b/core/config.mk index f8bee808a8..d3a83f58f6 100644 --- a/core/config.mk +++ b/core/config.mk @@ -232,7 +232,6 @@ EMMA_JAR := external/emma/lib/emma$(COMMON_JAVA_PACKAGE_SUFFIX) # Binary prelinker/compressor tools APRIORI := $(HOST_OUT_EXECUTABLES)/apriori$(HOST_EXECUTABLE_SUFFIX) LSD := $(HOST_OUT_EXECUTABLES)/lsd$(HOST_EXECUTABLE_SUFFIX) -SOSLIM := $(HOST_OUT_EXECUTABLES)/soslim$(HOST_EXECUTABLE_SUFFIX) # Deal with archaic version of bison on Mac OS X. ifeq ($(filter 1.28,$(shell $(YACC) -V)),) diff --git a/core/definitions.mk b/core/definitions.mk index 11cea3fb0e..cd50f62d83 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -1086,13 +1086,10 @@ endef ## Commands for filtering a target executable or library ########################################################### -# Because of bug 743462 ("Prelinked image magic gets stripped -# by arm-elf-objcopy"), we have to use soslim to strip target -# binaries. define transform-to-stripped @mkdir -p $(dir $@) @echo "target Strip: $(PRIVATE_MODULE) ($@)" -$(hide) $(SOSLIM) --strip --shady --quiet $< --outfile $@ +$(hide) $(TARGET_STRIP_COMMAND) endef define transform-to-prelinked diff --git a/core/dynamic_binary.mk b/core/dynamic_binary.mk index cfbe7402ef..0fa7647d24 100644 --- a/core/dynamic_binary.mk +++ b/core/dynamic_binary.mk @@ -75,7 +75,7 @@ ifeq ($(LOCAL_COMPRESS_MODULE_SYMBOLS),true) $(error Symbol compression not yet supported.) compress_output := $(intermediates)/COMPRESSED-$(LOCAL_BUILT_MODULE_STEM) -#TODO: write the real $(SOSLIM) rule. +#TODO: write the real $(STRIPPER) rule. #TODO: define a rule to build TARGET_SYMBOL_FILTER_FILE, and # make it depend on ALL_ORIGINAL_DYNAMIC_BINARIES. $(compress_output): $(compress_input) $(TARGET_SYMBOL_FILTER_FILE) | $(ACP) @@ -137,7 +137,7 @@ endif ifeq ($(LOCAL_STRIP_MODULE),true) # Strip the binary -$(strip_output): $(strip_input) | $(SOSLIM) +$(strip_output): $(strip_input) | $(TARGET_STRIP) $(transform-to-stripped) else # Don't strip the binary, just copy it. We can't skip this step From f7661706b03e4258d1b48c6ad71ce4a5e287ee2a Mon Sep 17 00:00:00 2001 From: Bruce Beare Date: Tue, 31 May 2011 11:03:09 -0700 Subject: [PATCH 02/23] Allow TARGET_ARCH to be set from BoardConfig.mk Orig-Change-Id: I66aed78b763d238719822257c1f4f35301247df6 Signed-off-by: Bruce Beare --- core/config.mk | 2 + core/dumpvar.mk | 77 ++++++++++++++++++++++++ core/envsetup.mk | 78 ------------------------- target/board/generic_x86/BoardConfig.mk | 1 + 4 files changed, 80 insertions(+), 78 deletions(-) create mode 100644 core/dumpvar.mk diff --git a/core/config.mk b/core/config.mk index d3a83f58f6..3b389fddeb 100644 --- a/core/config.mk +++ b/core/config.mk @@ -142,6 +142,8 @@ include $(board_config_mk) TARGET_DEVICE_DIR := $(patsubst %/,%,$(dir $(board_config_mk))) board_config_mk := +include $(BUILD_SYSTEM)/dumpvar.mk + # Clean up/verify variables defined by the board config file. TARGET_BOOTLOADER_BOARD_NAME := $(strip $(TARGET_BOOTLOADER_BOARD_NAME)) TARGET_CPU_ABI := $(strip $(TARGET_CPU_ABI)) diff --git a/core/dumpvar.mk b/core/dumpvar.mk new file mode 100644 index 0000000000..f469f354cc --- /dev/null +++ b/core/dumpvar.mk @@ -0,0 +1,77 @@ +# --------------------------------------------------------------- +# the setpath shell function in envsetup.sh uses this to figure out +# what to add to the path given the config we have chosen. +ifeq ($(CALLED_FROM_SETUP),true) + +ABP:=$(PWD)/$(HOST_OUT_EXECUTABLES) + +ifeq ($(TARGET_SIMULATOR),true) + ABP:=$(ABP):$(TARGET_OUT_EXECUTABLES) +else + # this should be copied to HOST_OUT_EXECUTABLES instead + ABP:=$(ABP):$(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-eabi-4.4.3/bin +endif +ANDROID_BUILD_PATHS := $(ABP) +ANDROID_PREBUILTS := prebuilt/$(HOST_PREBUILT_TAG) + +# The "dumpvar" stuff lets you say something like +# +# CALLED_FROM_SETUP=true \ +# make -f config/envsetup.make dumpvar-TARGET_OUT +# or +# CALLED_FROM_SETUP=true \ +# make -f config/envsetup.make dumpvar-abs-HOST_OUT_EXECUTABLES +# +# The plain (non-abs) version just dumps the value of the named variable. +# The "abs" version will treat the variable as a path, and dumps an +# absolute path to it. +# +dumpvar_goals := \ + $(strip $(patsubst dumpvar-%,%,$(filter dumpvar-%,$(MAKECMDGOALS)))) +ifdef dumpvar_goals + + ifneq ($(words $(dumpvar_goals)),1) + $(error Only one "dumpvar-" goal allowed. Saw "$(MAKECMDGOALS)") + endif + + # If the goal is of the form "dumpvar-abs-VARNAME", then + # treat VARNAME as a path and return the absolute path to it. + absolute_dumpvar := $(strip $(filter abs-%,$(dumpvar_goals))) + ifdef absolute_dumpvar + dumpvar_goals := $(patsubst abs-%,%,$(dumpvar_goals)) + DUMPVAR_VALUE := $(PWD)/$($(dumpvar_goals)) + dumpvar_target := dumpvar-abs-$(dumpvar_goals) + else + DUMPVAR_VALUE := $($(dumpvar_goals)) + dumpvar_target := dumpvar-$(dumpvar_goals) + endif + +.PHONY: $(dumpvar_target) +$(dumpvar_target): + @echo $(DUMPVAR_VALUE) + +endif # dumpvar_goals + +ifneq ($(dumpvar_goals),report_config) +PRINT_BUILD_CONFIG:= +endif + +endif # CALLED_FROM_SETUP + + +ifneq ($(PRINT_BUILD_CONFIG),) +$(info ============================================) +$(info PLATFORM_VERSION_CODENAME=$(PLATFORM_VERSION_CODENAME)) +$(info PLATFORM_VERSION=$(PLATFORM_VERSION)) +$(info TARGET_PRODUCT=$(TARGET_PRODUCT)) +$(info TARGET_BUILD_VARIANT=$(TARGET_BUILD_VARIANT)) +$(info TARGET_SIMULATOR=$(TARGET_SIMULATOR)) +$(info TARGET_BUILD_TYPE=$(TARGET_BUILD_TYPE)) +$(info TARGET_BUILD_APPS=$(TARGET_BUILD_APPS)) +$(info TARGET_ARCH=$(TARGET_ARCH)) +$(info HOST_ARCH=$(HOST_ARCH)) +$(info HOST_OS=$(HOST_OS)) +$(info HOST_BUILD_TYPE=$(HOST_BUILD_TYPE)) +$(info BUILD_ID=$(BUILD_ID)) +$(info ============================================) +endif diff --git a/core/envsetup.mk b/core/envsetup.mk index c70a5e2c68..e2d4d11c6d 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -283,81 +283,3 @@ endif ifeq ($(PRINT_BUILD_CONFIG),) PRINT_BUILD_CONFIG := true endif - -# --------------------------------------------------------------- -# the setpath shell function in envsetup.sh uses this to figure out -# what to add to the path given the config we have chosen. -ifeq ($(CALLED_FROM_SETUP),true) - -ABP:=$(PWD)/$(HOST_OUT_EXECUTABLES) - -ifeq ($(TARGET_SIMULATOR),true) - ABP:=$(ABP):$(TARGET_OUT_EXECUTABLES) -else - # this should be copied to HOST_OUT_EXECUTABLES instead - ABP:=$(ABP):$(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-eabi-4.4.3/bin -endif -ANDROID_BUILD_PATHS := $(ABP) -ANDROID_PREBUILTS := prebuilt/$(HOST_PREBUILT_TAG) - -# The "dumpvar" stuff lets you say something like -# -# CALLED_FROM_SETUP=true \ -# make -f config/envsetup.make dumpvar-TARGET_OUT -# or -# CALLED_FROM_SETUP=true \ -# make -f config/envsetup.make dumpvar-abs-HOST_OUT_EXECUTABLES -# -# The plain (non-abs) version just dumps the value of the named variable. -# The "abs" version will treat the variable as a path, and dumps an -# absolute path to it. -# -dumpvar_goals := \ - $(strip $(patsubst dumpvar-%,%,$(filter dumpvar-%,$(MAKECMDGOALS)))) -ifdef dumpvar_goals - - ifneq ($(words $(dumpvar_goals)),1) - $(error Only one "dumpvar-" goal allowed. Saw "$(MAKECMDGOALS)") - endif - - # If the goal is of the form "dumpvar-abs-VARNAME", then - # treat VARNAME as a path and return the absolute path to it. - absolute_dumpvar := $(strip $(filter abs-%,$(dumpvar_goals))) - ifdef absolute_dumpvar - dumpvar_goals := $(patsubst abs-%,%,$(dumpvar_goals)) - DUMPVAR_VALUE := $(PWD)/$($(dumpvar_goals)) - dumpvar_target := dumpvar-abs-$(dumpvar_goals) - else - DUMPVAR_VALUE := $($(dumpvar_goals)) - dumpvar_target := dumpvar-$(dumpvar_goals) - endif - -.PHONY: $(dumpvar_target) -$(dumpvar_target): - @echo $(DUMPVAR_VALUE) - -endif # dumpvar_goals - -ifneq ($(dumpvar_goals),report_config) -PRINT_BUILD_CONFIG:= -endif - -endif # CALLED_FROM_SETUP - - -ifneq ($(PRINT_BUILD_CONFIG),) -$(info ============================================) -$(info PLATFORM_VERSION_CODENAME=$(PLATFORM_VERSION_CODENAME)) -$(info PLATFORM_VERSION=$(PLATFORM_VERSION)) -$(info TARGET_PRODUCT=$(TARGET_PRODUCT)) -$(info TARGET_BUILD_VARIANT=$(TARGET_BUILD_VARIANT)) -$(info TARGET_SIMULATOR=$(TARGET_SIMULATOR)) -$(info TARGET_BUILD_TYPE=$(TARGET_BUILD_TYPE)) -$(info TARGET_BUILD_APPS=$(TARGET_BUILD_APPS)) -$(info TARGET_ARCH=$(TARGET_ARCH)) -$(info HOST_ARCH=$(HOST_ARCH)) -$(info HOST_OS=$(HOST_OS)) -$(info HOST_BUILD_TYPE=$(HOST_BUILD_TYPE)) -$(info BUILD_ID=$(BUILD_ID)) -$(info ============================================) -endif diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index 608aee1dc6..89fb5e4dca 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -1,3 +1,4 @@ +TARGET_ARCH=x86 TARGET_COMPRESS_MODULE_SYMBOLS := false TARGET_PRELINK_MODULE := false TARGET_NO_RECOVERY := true From 93b4c25f00083dc936d6200b814000299513a9a6 Mon Sep 17 00:00:00 2001 From: Bruce Beare Date: Tue, 31 May 2011 12:47:58 -0700 Subject: [PATCH 03/23] Vendorsetup needs to look in additional places. Orig-Change-Id: I698856f8e02487322540e804c038bba28cc23532 Signed-off-by: Bruce Beare --- envsetup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/envsetup.sh b/envsetup.sh index 2911fd7350..287a07a70e 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -1096,7 +1096,7 @@ fi unset _xarray # Execute the contents of any vendorsetup.sh files we can find. -for f in `/bin/ls vendor/*/vendorsetup.sh vendor/*/build/vendorsetup.sh device/*/*/vendorsetup.sh 2> /dev/null` +for f in `/bin/ls vendor/*/vendorsetup.sh vendor/*/*/vendorsetup.sh device/*/*/vendorsetup.sh 2> /dev/null` do echo "including $f" . $f From 28290a0cec7736f0f5eaa19a0dd7f1ed690f8bdc Mon Sep 17 00:00:00 2001 From: Bruce Beare Date: Mon, 12 Jul 2010 11:32:37 -0700 Subject: [PATCH 04/23] Move buildspec vars to BoardConfig.mk Orig-Change-Id: I48ed4b55e91aae51076d9c609b44bf9fa24c3ecd Signed-off-by: Bruce Beare --- target/board/generic_x86/BoardConfig.mk | 6 ++++++ target/board/generic_x86/README.txt | 10 +++------- target/board/generic_x86/buildspec-generic_x86.mk | 7 ------- 3 files changed, 9 insertions(+), 14 deletions(-) delete mode 100644 target/board/generic_x86/buildspec-generic_x86.mk diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index 89fb5e4dca..7586db8984 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -1,4 +1,5 @@ TARGET_ARCH=x86 +DISABLE_DEXPREOPT := true TARGET_COMPRESS_MODULE_SYMBOLS := false TARGET_PRELINK_MODULE := false TARGET_NO_RECOVERY := true @@ -19,3 +20,8 @@ TARGET_DISK_LAYOUT_CONFIG := build/target/board/generic_x86/disk_layout.conf BOARD_BOOTIMAGE_MAX_SIZE := 8388608 BOARD_SYSLOADER_MAX_SIZE := 7340032 BOARD_FLASH_BLOCK_SIZE := 512 + + +# The eth0 device should be started with dhcp on boot. +# Useful for emulators that don't provide a wifi connection. +NET_ETH0_STARTONBOOT := true diff --git a/target/board/generic_x86/README.txt b/target/board/generic_x86/README.txt index 97e2d5b801..585a373fa1 100644 --- a/target/board/generic_x86/README.txt +++ b/target/board/generic_x86/README.txt @@ -8,15 +8,11 @@ A1. Create a new top level directory and pull the AOSP repository repo init -u git://android.git.kernel.org/platform/manifest.git repo sync -A2. Copy in the buildspeck.mk - cd $HOME/AOSP - cp build/target/board/generic_x86/buildspec-generic_x86.mk buildspec.mk - -A3. Copy in the kernel +A2. Copy in the kernel cd $HOME/AOSP cp ~/bzImage.your_device $HOME/AOSP/prebuilt/android-x86/kernel/kernel -A4. Build +A3. Build cd $HOME/AOSP source build/envsetup.sh lunch generic_x86-eng @@ -25,7 +21,7 @@ A4. Build The build will generate some image files whose format may or may not be correct for your device. You can build an installer image disk for the VirtualBox emulator using the command: -A5. Build a VirtualBox installer image +A4. Build a VirtualBox installer image cd $HOME/AOSP source build/envsetup.sh lunch generic_x86-eng diff --git a/target/board/generic_x86/buildspec-generic_x86.mk b/target/board/generic_x86/buildspec-generic_x86.mk deleted file mode 100644 index fbc3947b3e..0000000000 --- a/target/board/generic_x86/buildspec-generic_x86.mk +++ /dev/null @@ -1,7 +0,0 @@ -BUILD_ENV_SEQUENCE_NUMBER := 9 -DISABLE_DEXPREOPT := true -TARGET_ARCH := x86 - -# The eth0 device should be started with dhcp on boot. -# Useful for emulators that don't provide a wifi connection. -NET_ETH0_STARTONBOOT := true From 379e127fe4744b0e8ca881a278fd84535cfec1fd Mon Sep 17 00:00:00 2001 From: Bruce Beare Date: Tue, 31 May 2011 12:50:27 -0700 Subject: [PATCH 05/23] Add generic_x86-eng to the lunch menu Orig-Change-Id: Ie4e0f9054c5bc6ad8845b5b885a00174dd8c9534 Signed-off-by: Bruce Beare --- envsetup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/envsetup.sh b/envsetup.sh index 287a07a70e..4d443c9f1a 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -433,6 +433,7 @@ function add_lunch_combo() # add the default one here add_lunch_combo generic-eng +add_lunch_combo generic_x86-eng # if we're on linux, add the simulator. There is a special case # in lunch to deal with the simulator From f7e4141f0eefd5f534bb7720347b4db9cba84afb Mon Sep 17 00:00:00 2001 From: Bruce Beare Date: Thu, 14 Oct 2010 12:21:58 -0700 Subject: [PATCH 06/23] Display the TARGET_ARCH_VARIANT Signed-off-by: Bruce Beare --- core/dumpvar.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/core/dumpvar.mk b/core/dumpvar.mk index f469f354cc..0c585590c9 100644 --- a/core/dumpvar.mk +++ b/core/dumpvar.mk @@ -69,6 +69,7 @@ $(info TARGET_SIMULATOR=$(TARGET_SIMULATOR)) $(info TARGET_BUILD_TYPE=$(TARGET_BUILD_TYPE)) $(info TARGET_BUILD_APPS=$(TARGET_BUILD_APPS)) $(info TARGET_ARCH=$(TARGET_ARCH)) +$(info TARGET_ARCH_VARIANT=$(TARGET_ARCH_VARIANT)) $(info HOST_ARCH=$(HOST_ARCH)) $(info HOST_OS=$(HOST_OS)) $(info HOST_BUILD_TYPE=$(HOST_BUILD_TYPE)) From ecabf85f325b6b38a59f32eacfd71b5cc3f9061c Mon Sep 17 00:00:00 2001 From: Bruce Beare Date: Tue, 31 May 2011 12:52:06 -0700 Subject: [PATCH 07/23] Fix TARGET_PREBUILT_TAG so that get_build_var can retrieve the correct value across architectures Orig-Change-Id: I5c1010d9caaa8d9ffaf65999fa3649c3c2be8caa Signed-off-by: Bruce Beare --- core/config.mk | 8 ++++++++ core/envsetup.mk | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/config.mk b/core/config.mk index 3b389fddeb..e20afe9c65 100644 --- a/core/config.mk +++ b/core/config.mk @@ -142,6 +142,14 @@ include $(board_config_mk) TARGET_DEVICE_DIR := $(patsubst %/,%,$(dir $(board_config_mk))) board_config_mk := +# This is the standard way to name a directory containing prebuilt target +# objects. E.g., prebuilt/$(TARGET_PREBUILT_TAG)/libc.so +ifeq ($(TARGET_SIMULATOR),true) + TARGET_PREBUILT_TAG := $(TARGET_OS)-$(TARGET_ARCH) +else + TARGET_PREBUILT_TAG := android-$(TARGET_ARCH) +endif + include $(BUILD_SYSTEM)/dumpvar.mk # Clean up/verify variables defined by the board config file. diff --git a/core/envsetup.mk b/core/envsetup.mk index e2d4d11c6d..67fe754dcf 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -158,14 +158,6 @@ ifneq ($(TARGET_BUILD_TYPE),debug) TARGET_BUILD_TYPE := release endif -# This is the standard way to name a directory containing prebuilt target -# objects. E.g., prebuilt/$(TARGET_PREBUILT_TAG)/libc.so -ifeq ($(TARGET_SIMULATOR),true) - TARGET_PREBUILT_TAG := $(TARGET_OS)-$(TARGET_ARCH) -else - TARGET_PREBUILT_TAG := android-$(TARGET_ARCH) -endif - # --------------------------------------------------------------- # figure out the output directories From 88d929b9e4dee2b6bf5c65a808177c3cd4ca6e0e Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Mon, 13 Jun 2011 23:43:02 +0200 Subject: [PATCH 08/23] GB Updates for init.rc and boot command line Change-Id: Iae0f5b1eda109f99be6c484082abebc7b51adf51 Orig-Change-Id: I0638c8834fccbdc94ec99e7592a75b6972cb53b8 Signed-off-by: Bruce Beare --- target/board/generic_x86/AndroidBoard.mk | 7 - target/board/generic_x86/BoardConfig.mk | 4 +- target/board/generic_x86/init.rc | 254 ----------------------- 3 files changed, 2 insertions(+), 263 deletions(-) delete mode 100644 target/board/generic_x86/init.rc diff --git a/target/board/generic_x86/AndroidBoard.mk b/target/board/generic_x86/AndroidBoard.mk index ff461499e7..d8b37c615c 100644 --- a/target/board/generic_x86/AndroidBoard.mk +++ b/target/board/generic_x86/AndroidBoard.mk @@ -1,12 +1,5 @@ LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) -LOCAL_MODULE := init.rc -LOCAL_SRC_FILES := init.rc -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) -include $(BUILD_PREBUILT) - ifeq ($(TARGET_PREBUILT_KERNEL),) LOCAL_KERNEL := prebuilt/android-x86/kernel/kernel else diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index 7586db8984..485d6853d6 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -13,8 +13,8 @@ TARGET_USERIMAGES_USE_EXT2 := true TARGET_BOOTIMAGE_USE_EXT2 := true # For VirtualBox and likely other emulators -BOARD_INSTALLER_CMDLINE := init=/init console=ttyS0 console=tty0 androidboot.hardware=generic_x86 vga=788 verbose -BOARD_KERNEL_CMDLINE := init=/init console=tty0 console=ttyS0 androidboot.hardware=generic_x86 vga=788 +BOARD_INSTALLER_CMDLINE := init=/init console=ttyS0 console=tty0 androidboot.hardware=generic_x86 vga=788 androidboot.console=tty0 verbose +BOARD_KERNEL_CMDLINE := init=/init console=tty0 console=ttyS0 androidboot.hardware=generic_x86 vga=788 androidboot.console=tty0 verbose TARGET_USE_DISKINSTALLER := true TARGET_DISK_LAYOUT_CONFIG := build/target/board/generic_x86/disk_layout.conf BOARD_BOOTIMAGE_MAX_SIZE := 8388608 diff --git a/target/board/generic_x86/init.rc b/target/board/generic_x86/init.rc deleted file mode 100644 index 235083df29..0000000000 --- a/target/board/generic_x86/init.rc +++ /dev/null @@ -1,254 +0,0 @@ - -on init - -sysclktz 0 - -loglevel 3 - -# setup the global environment - export PATH /sbin:/system/sbin:/system/bin:/system/xbin - export LD_LIBRARY_PATH /system/lib - export ANDROID_BOOTLOGO 1 - export ANDROID_ROOT /system - export ANDROID_ASSETS /system/app - export ANDROID_DATA /data - export EXTERNAL_STORAGE /sdcard - export BOOTCLASSPATH /system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar - -# Backward compatibility - symlink /system/etc /etc - -# create mountpoints and mount tmpfs on sqlite_stmt_journals and debugfs on d - mkdir /d - mkdir /sdcard 0000 system system - mkdir /system - mkdir /data 0771 system system - mkdir /cache 0770 system cache - mkdir /sqlite_stmt_journals 01777 root root - mount tmpfs tmpfs /sqlite_stmt_journals - mount debugfs debugfs /d - - mount rootfs rootfs / rw remount - - write /proc/sys/kernel/panic_on_oops 1 - write /proc/sys/kernel/hung_task_timeout_secs 0 - write /proc/cpu/alignment 4 - write /proc/sys/kernel/sched_latency_ns 10000000 - write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000 - -# mount mtd partitions - # Hack... - # We'll attempt to mount both as sdcard and harddisk... - # Only one or the other will actually work... this way, we can - # use the same init.rc for both - mount ext3 /dev/block/mmcblk0p6 /system - mount ext3 /dev/block/mmcblk0p6 /system rw remount - mount ext3 /dev/block/mmcblk0p2 /data nosuid nodev - mount ext3 /dev/block/mmcblk0p7 /cache nosuid nodev - mount ext3 /dev/block/sda6 /system - mount ext3 /dev/block/sda6 /system rw remount - mount ext3 /dev/block/sda8 /data - - # We chown/chmod /data again so because mount is run as root + defaults - chown system system /data - chmod 0771 /data - - # Same reason as /data above - chown system cache /cache - chmod 0770 /cache - - # This may have been created by the recovery system with odd permissions - chown system system /cache/recovery - chmod 0770 /cache/recovery - -# create basic filesystem structure - mkdir /data/misc 01771 system misc - mkdir /data/misc/hcid 0770 bluetooth bluetooth - mkdir /data/local 0771 shell shell - mkdir /data/local/tmp 0771 shell shell - mkdir /data/data 0771 system system - mkdir /data/app-private 0771 system system - mkdir /data/app 0771 system system - mkdir /data/property 0700 root root - - # create dalvik-cache and double-check the perms - mkdir /data/dalvik-cache 0771 system system - chown system system /data/dalvik-cache - chmod 0771 /data/dalvik-cache - - # create the lost+found directories, so as to enforce our permissions - mkdir /system/lost+found 0770 - mkdir /data/lost+found 0770 - mkdir /cache/lost+found 0770 - - # double check the perms, in case lost+found already exists, and set owner - chown root root /data/lost+found - chmod 0770 /data/lost+found - chown root root /cache/lost+found - chmod 0770 /cache/lost+found - -on boot - -### Load some modules - -# basic network init - ifup lo - hostname localhost - domainname localdomain - - -# set RLIMIT_NICE to allow priorities from 19 to -20 - setrlimit 13 40 40 - mkdir /data/core 0777 - write /proc/sys/kernel/core_pattern /data/core/%e.%p - setrlimit 4 -1 -1 - -# Define the oom_adj values for the classes of processes that can be -# killed by the kernel. These are used in ActivityManagerService. - setprop ro.FOREGROUND_APP_ADJ 0 - setprop ro.VISIBLE_APP_ADJ 1 - setprop ro.SECONDARY_SERVER_ADJ 2 - setprop ro.HIDDEN_APP_MIN_ADJ 7 - setprop ro.CONTENT_PROVIDER_ADJ 14 - setprop ro.EMPTY_APP_ADJ 15 - setprop ro.BACKUP_APP_ADJ 2 - setprop ro.HOME_APP_ADJ 4 - - -# Define the memory thresholds at which the above process classes will -# be killed. These numbers are in pages (4k). - setprop ro.FOREGROUND_APP_MEM 1536 - setprop ro.VISIBLE_APP_MEM 2048 - setprop ro.SECONDARY_SERVER_MEM 4096 - setprop ro.BACKUP_APP_MEM 4096 - setprop ro.HOME_APP_MEM 4096 - setprop ro.HIDDEN_APP_MEM 5120 - setprop ro.CONTENT_PROVIDER_MEM 5632 - setprop ro.EMPTY_APP_MEM 6144 - - -# Write value must be consistent with the above properties. - write /sys/module/lowmemorykiller/parameters/adj 0,1,2,7,14,15 - - write /proc/sys/vm/overcommit_memory 1 - write /sys/module/lowmemorykiller/parameters/minfree 1536,2048,4096,8192,16384 - - # Set init its forked children's oom_adj. - write /proc/1/oom_adj -16 - - # Permissions for System Server and daemons. - chown radio system /sys/android_power/state - chown radio system /sys/android_power/request_state - chown radio system /sys/android_power/acquire_full_wake_lock - chown radio system /sys/android_power/acquire_partial_wake_lock - chown radio system /sys/android_power/release_wake_lock - chown radio system /sys/power/state - chown radio system /sys/power/wake_lock - chown radio system /sys/power/wake_unlock - chmod 0660 /sys/power/state - chmod 0660 /sys/power/wake_lock - chmod 0660 /sys/power/wake_unlock - - chown system system /sys/class/timed_output/vibrator/enable - chown system system /sys/class/leds/keyboard-backlight/brightness - chown system system /sys/class/leds/lcd-backlight/brightness - chown system system /sys/class/leds/button-backlight/brightness - chown system system /sys/class/leds/red/brightness - chown system system /sys/class/leds/green/brightness - chown system system /sys/class/leds/blue/brightness - chown system system /sys/class/leds/red/device/grpfreq - chown system system /sys/class/leds/red/device/grppwm - chown system system /sys/class/leds/red/device/blink - chown system system /sys/class/leds/red/brightness - chown system system /sys/class/leds/green/brightness - chown system system /sys/class/leds/blue/brightness - chown system system /sys/class/leds/red/device/grpfreq - chown system system /sys/class/leds/red/device/grppwm - chown system system /sys/class/leds/red/device/blink - chown system system /sys/class/timed_output/vibrator/enable - chown bluetooth bluetooth /sys/module/board_trout/parameters/bluetooth_power_on - chown system system /sys/module/sco/parameters/disable_esco - chmod 0660 /sys/module/board_trout/parameters/bluetooth_power_on - chown radio audio /system/etc/AudioPara4.csv - chown system system /sys/kernel/ipv4/tcp_wmem_min - chown system system /sys/kernel/ipv4/tcp_wmem_def - chown system system /sys/kernel/ipv4/tcp_wmem_max - chown system system /sys/kernel/ipv4/tcp_rmem_min - chown system system /sys/kernel/ipv4/tcp_rmem_def - chown system system /sys/kernel/ipv4/tcp_rmem_max - chown root radio /proc/cmdline - -# Enable audio based on existing /dev/dsp - chmod 0666 /dev/snd/dsp - -# Define TCP buffer sizes for various networks -# ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax, - setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208 - setprop net.tcp.buffersize.wifi 4095,87380,110208,4096,16384,110208 - setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208 - setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040 - setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680 - - class_start default - - -## Daemon processes to be run by init. -## -service console /system/bin/sh - console - -# adbd is controlled by the persist.service.adb.enable system property -service adbd /sbin/adbd -# disabled - -# adbd on at boot in emulator -on property:ro.kernel.qemu=1 - start adbd - -# adbd on at boot in insecure builds -on property:ro.secure=0 - start adbd - -on property:persist.service.adb.enable=1 - start adbd - -on property:persist.service.adb.enable=0 - stop adbd - -service servicemanager /system/bin/servicemanager - user system - critical - onrestart restart zygote - onrestart restart media - -service vold /system/bin/vold - socket vold stream 0660 root mount - -service zygote /system/bin/app_process -Xzygote -Xint:fast /system/bin --zygote --start-system-server - socket zygote stream 666 - onrestart write /sys/android_power/request_state wake - -service media /system/bin/mediaserver - user media - group system audio camera graphics inet net_bt net_bt_admin - -service dbus /system/bin/dbus-daemon --system --nofork - socket dbus stream 660 bluetooth bluetooth - user bluetooth - group bluetooth net_bt_admin - -service brick /system/bin/wipe nuke - disabled - -service installd /system/bin/installd - socket installd stream 600 system system - -# -# Set by PRODUCT_PROPERTY_OVERRIDES in .mk -on property:net.eth0.startonboot=1 - setprop ro.com.android.dataroaming true - start start_eth0 - -service start_eth0 /system/bin/netcfg eth0 dhcp - oneshot - disabled From 594519e655d9df6fabdfa9ee385ad3f2371ce4f1 Mon Sep 17 00:00:00 2001 From: Bruce Beare Date: Mon, 27 Dec 2010 13:05:23 -0800 Subject: [PATCH 09/23] Use ext4 file system for generic_x86 userdata partition Orig-Change-Id: I05710c2bda521b35712513bc219fc73ed00e4617 Signed-off-by: Bruce Beare --- target/board/generic_x86/BoardConfig.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index 485d6853d6..f9065700b2 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -9,7 +9,7 @@ USE_CAMERA_STUB := true TARGET_PROVIDES_INIT_RC := true USE_CUSTOM_RUNTIME_HEAP_MAX := "32M" TARGET_CPU_ABI := x86 -TARGET_USERIMAGES_USE_EXT2 := true +TARGET_USERIMAGES_USE_EXT4 := true TARGET_BOOTIMAGE_USE_EXT2 := true # For VirtualBox and likely other emulators @@ -20,6 +20,8 @@ TARGET_DISK_LAYOUT_CONFIG := build/target/board/generic_x86/disk_layout.conf BOARD_BOOTIMAGE_MAX_SIZE := 8388608 BOARD_SYSLOADER_MAX_SIZE := 7340032 BOARD_FLASH_BLOCK_SIZE := 512 +BOARD_USERDATAIMAGE_PARTITION_SIZE := 50M +BOARD_INSTALLERIMAGE_PARTITION_SIZE := 500M # The eth0 device should be started with dhcp on boot. From f7f5479b56ef9649a3558d08372edef0f77b5249 Mon Sep 17 00:00:00 2001 From: Bruce Beare Date: Tue, 28 Dec 2010 15:33:22 -0800 Subject: [PATCH 10/23] generic_x86 builds don't need/use the sparse ext4 format. Orig-Change-Id: I62973b131a728c3862be4642e2d49d0fa61555ac Signed-off-by: Bruce Beare --- target/board/generic_x86/BoardConfig.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index f9065700b2..2268d4100f 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -22,6 +22,7 @@ BOARD_SYSLOADER_MAX_SIZE := 7340032 BOARD_FLASH_BLOCK_SIZE := 512 BOARD_USERDATAIMAGE_PARTITION_SIZE := 50M BOARD_INSTALLERIMAGE_PARTITION_SIZE := 500M +TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true # The eth0 device should be started with dhcp on boot. From 8a545e04ee862f88284ea122c3ddc402419cb689 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Queru Date: Fri, 22 Oct 2010 09:52:09 -0700 Subject: [PATCH 11/23] Truly default to the full config. It is much better than generic for emulator-based work. Orig-Change-Id: I8b69b208bc4969d3f95c3467ca6737de8fd9460d --- core/envsetup.mk | 2 +- envsetup.sh | 8 ++++---- target/product/full.mk | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/envsetup.mk b/core/envsetup.mk index 67fe754dcf..e4c99d5f43 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -26,7 +26,7 @@ ifeq ($(TARGET_PRODUCT),) ifeq ($(TARGET_SIMULATOR),true) TARGET_PRODUCT := sim else -TARGET_PRODUCT := generic +TARGET_PRODUCT := full endif endif diff --git a/envsetup.sh b/envsetup.sh index 4d443c9f1a..d633bbe0f0 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -314,7 +314,7 @@ function chooseproduct() if [ "$TARGET_SIMULATOR" = true ] ; then default_value=sim else - default_value=generic + default_value=full fi fi @@ -468,7 +468,7 @@ function lunch() answer=$1 else print_lunch_menu - echo -n "Which would you like? [generic-eng] " + echo -n "Which would you like? [full-eng] " read answer fi @@ -476,7 +476,7 @@ function lunch() if [ -z "$answer" ] then - selection=generic-eng + selection=full-eng elif [ "$answer" = "simulator" ] then selection=simulator @@ -564,7 +564,7 @@ function tapas() apps=all fi - export TARGET_PRODUCT=generic + export TARGET_PRODUCT=full export TARGET_BUILD_VARIANT=$variant export TARGET_SIMULATOR=false export TARGET_BUILD_TYPE=release diff --git a/target/product/full.mk b/target/product/full.mk index c204aad2e0..19c1e240a2 100644 --- a/target/product/full.mk +++ b/target/product/full.mk @@ -16,8 +16,8 @@ # 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 of the emulator, but all those aspects can be overridden -# in inherited configurations. +# build quite specifically for the emulator, and might not be +# entirely appropriate to inherit from for on-device configurations. PRODUCT_PACKAGES := \ OpenWnn \ From e050219f1f9b22eff8023bb937aef123e7a8c7f2 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Queru Date: Fri, 22 Oct 2010 10:22:42 -0700 Subject: [PATCH 12/23] Make a full list of locales available Use it for the sim build and full build. Change-Id: I0050f9ee10aafa96cb89cad5d3f492bb1839e331 Orig-Change-Id: I64dfa7ac1b374529ef5f0c1460dd35171311115e --- target/product/full.mk | 8 +++++--- target/product/locales_full.mk | 5 +++++ target/product/sim.mk | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 target/product/locales_full.mk diff --git a/target/product/full.mk b/target/product/full.mk index 19c1e240a2..6f4aded8cb 100644 --- a/target/product/full.mk +++ b/target/product/full.mk @@ -39,6 +39,9 @@ PRODUCT_COPY_FILES := \ development/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ development/data/etc/vold.conf:system/etc/vold.conf +# Put en_US first in the list, so make it default. +PRODUCT_LOCALES := en_US + # Pick up some sounds - stick with the short list to save space # on smaller devices. $(call inherit-product, frameworks/base/data/sounds/OriginalAudio.mk) @@ -46,9 +49,8 @@ $(call inherit-product, frameworks/base/data/sounds/OriginalAudio.mk) # Get the TTS language packs $(call inherit-product-if-exists, external/svox/pico/lang/all_pico_languages.mk) -# Get a list of languages. We use the small list to save space -# on smaller devices. -$(call inherit-product, build/target/product/languages_small.mk) +# Get the list of languages. +$(call inherit-product, build/target/product/locales_full.mk) $(call inherit-product, build/target/product/generic.mk) diff --git a/target/product/locales_full.mk b/target/product/locales_full.mk new file mode 100644 index 0000000000..eb6a9c5729 --- /dev/null +++ b/target/product/locales_full.mk @@ -0,0 +1,5 @@ +# The locales from the ICU "-large.dat" data set. +# See external/icu4c/stubdata. +# This is distinct from "languages_full.mk", which contains those locales for +# which we have translations. If you like, this file is i18n rather than l18n. +PRODUCT_LOCALES := en_US diff --git a/target/product/sim.mk b/target/product/sim.mk index 51b36766cb..09722d6c18 100644 --- a/target/product/sim.mk +++ b/target/product/sim.mk @@ -1,6 +1,6 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/locales_full.mk) # Overrides PRODUCT_NAME := sim PRODUCT_DEVICE := sim -PRODUCT_LOCALES := en_US From 79feb857d025ab9d97dad97c72fb800bd7eb139d Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Queru Date: Fri, 22 Oct 2010 14:41:55 -0700 Subject: [PATCH 13/23] Clean up full config - DO NOT MERGE This splits the existing full.mk in two parts: -One is the device-independent full_base.mk -The other is the emulator-specific device.mk This way we'll be able to inherit from full_base.mk for on-device builds without any emulator-specific files getting in the way. Change-Id: I7f8254bf8c1177594fbdfbdb082bdc429a4a5b25 Orig-Change-Id: Ieb1f4ed47988c8fff119ff53f1f374032da3752d --- target/board/generic/device.mk | 26 ++++++++++++++++++ target/product/full.mk | 40 +++------------------------- target/product/full_base.mk | 48 ++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 36 deletions(-) create mode 100644 target/board/generic/device.mk create mode 100644 target/product/full_base.mk diff --git a/target/board/generic/device.mk b/target/board/generic/device.mk new file mode 100644 index 0000000000..0b4dc271c8 --- /dev/null +++ b/target/board/generic/device.mk @@ -0,0 +1,26 @@ +# +# Copyright (C) 2009 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. +# + +# This is a build configuration for the product aspects that +# are specific to the emulator. + +PRODUCT_PROPERTY_OVERRIDES := \ + ro.ril.hsxpa=1 \ + ro.ril.gprsclass=10 + +PRODUCT_COPY_FILES := \ + development/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ + development/data/etc/vold.conf:system/etc/vold.conf diff --git a/target/product/full.mk b/target/product/full.mk index 6f4aded8cb..6f8edeae12 100644 --- a/target/product/full.mk +++ b/target/product/full.mk @@ -19,43 +19,11 @@ # build quite specifically for the emulator, and might not be # entirely appropriate to inherit from for on-device configurations. -PRODUCT_PACKAGES := \ - OpenWnn \ - PinyinIME \ - VoiceDialer \ - libWnnEngDic \ - libWnnJpnDic \ - libwnndict - -# Additional settings used in all AOSP builds -PRODUCT_PROPERTY_OVERRIDES := \ - keyguard.no_require_sim=true \ - ro.com.android.dateformat=MM-dd-yyyy \ - ro.com.android.dataroaming=true \ - ro.ril.hsxpa=1 \ - ro.ril.gprsclass=10 - -PRODUCT_COPY_FILES := \ - development/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ - development/data/etc/vold.conf:system/etc/vold.conf - -# Put en_US first in the list, so make it default. -PRODUCT_LOCALES := en_US - -# Pick up some sounds - stick with the short list to save space -# on smaller devices. -$(call inherit-product, frameworks/base/data/sounds/OriginalAudio.mk) - -# Get the TTS language packs -$(call inherit-product-if-exists, external/svox/pico/lang/all_pico_languages.mk) - -# Get the list of languages. -$(call inherit-product, build/target/product/locales_full.mk) - -$(call inherit-product, build/target/product/generic.mk) +$(call inherit-product, build/target/board/generic/device.mk) +$(call inherit-product, build/target/product/full_base.mk) # Overrides PRODUCT_NAME := full -PRODUCT_BRAND := generic PRODUCT_DEVICE := generic -PRODUCT_MODEL := Full Android +PRODUCT_BRAND := Android +PRODUCT_MODEL := Full Android on Emulator diff --git a/target/product/full_base.mk b/target/product/full_base.mk new file mode 100644 index 0000000000..2739a53e01 --- /dev/null +++ b/target/product/full_base.mk @@ -0,0 +1,48 @@ +# +# Copyright (C) 2009 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. +# + +# This is a build configuration for a full-featured build of the +# Open-Source part of the tree. This is a base configuration to +# bes used for AOSP builds on various target devices. + +PRODUCT_PACKAGES := \ + OpenWnn \ + PinyinIME \ + VoiceDialer \ + libWnnEngDic \ + libWnnJpnDic \ + libwnndict + +# Additional settings used in all AOSP builds +PRODUCT_PROPERTY_OVERRIDES := \ + keyguard.no_require_sim=true \ + ro.com.android.dateformat=MM-dd-yyyy \ + ro.com.android.dataroaming=true + +# Put en_US first in the list, to make it default. +PRODUCT_LOCALES := en_US + +# Pick up some sounds - stick with the short list to save space +# on smaller devices. +$(call inherit-product-if-exists, frameworks/base/data/sounds/OriginalAudio.mk) + +# Get the TTS language packs +$(call inherit-product-if-exists, external/svox/pico/lang/all_pico_languages.mk) + +# Get the list of languages. +$(call inherit-product, build/target/product/locales_full.mk) + +$(call inherit-product, build/target/product/generic.mk) From c30945757c0763a31410edb2f9acacab0a46a198 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Queru Date: Fri, 22 Oct 2010 16:13:02 -0700 Subject: [PATCH 14/23] Minor cleanup - DO NOT MERGE Orig-Change-Id: I0fc4e3c45ae5a545f1a02ed974bc3c7500286e22 --- target/product/full.mk | 4 ++-- target/product/full_base.mk | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/product/full.mk b/target/product/full.mk index 6f8edeae12..c563bccca4 100644 --- a/target/product/full.mk +++ b/target/product/full.mk @@ -19,8 +19,8 @@ # build quite specifically for the emulator, and might not be # entirely appropriate to inherit from for on-device configurations. -$(call inherit-product, build/target/board/generic/device.mk) -$(call inherit-product, build/target/product/full_base.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/board/generic/device.mk) # Overrides PRODUCT_NAME := full diff --git a/target/product/full_base.mk b/target/product/full_base.mk index 2739a53e01..76907ce76e 100644 --- a/target/product/full_base.mk +++ b/target/product/full_base.mk @@ -43,6 +43,6 @@ $(call inherit-product-if-exists, frameworks/base/data/sounds/OriginalAudio.mk) $(call inherit-product-if-exists, external/svox/pico/lang/all_pico_languages.mk) # Get the list of languages. -$(call inherit-product, build/target/product/locales_full.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/locales_full.mk) -$(call inherit-product, build/target/product/generic.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk) From 73511b40103295925ba57e909d6ef145e4beeece Mon Sep 17 00:00:00 2001 From: Bruce Beare Date: Tue, 31 May 2011 13:11:42 -0700 Subject: [PATCH 15/23] x86: sdk_x86 build target Orig-Change-Id: I3876246ddf884ffd09ff0f8e3e300dffb4a332f0 Signed-off-by: Bruce Beare --- target/product/AndroidProducts.mk | 1 + target/product/sdk_x86.mk | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 target/product/sdk_x86.mk diff --git a/target/product/AndroidProducts.mk b/target/product/AndroidProducts.mk index 9a91da916c..ab8e05d67e 100644 --- a/target/product/AndroidProducts.mk +++ b/target/product/AndroidProducts.mk @@ -37,5 +37,6 @@ PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/generic_x86.mk \ $(LOCAL_DIR)/full.mk \ $(LOCAL_DIR)/sdk.mk \ + $(LOCAL_DIR)/sdk_x86.mk \ $(LOCAL_DIR)/sim.mk endif diff --git a/target/product/sdk_x86.mk b/target/product/sdk_x86.mk new file mode 100644 index 0000000000..6c5e7467cf --- /dev/null +++ b/target/product/sdk_x86.mk @@ -0,0 +1,28 @@ +# +# Copyright (C) 2009 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. +# + +# 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. + +$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk) + +# Overrides +PRODUCT_BRAND := generic_x86 +PRODUCT_NAME := sdk_x86 +PRODUCT_DEVICE := generic_x86 +PRODUCT_MODEL := Android SDK built for x86 From 5e2feda77374f00d3fa3a20d02b5448c51f2c05e Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Queru Date: Thu, 15 Jul 2010 14:04:39 -0700 Subject: [PATCH 16/23] Add full_x86 product. By inheriting from full, this will be more self-maintaining, and automatically gets a better-configured variant (e.g. it has locales, a date format, etc...). Orig-Change-Id: I67b6c2d9f9b7d20cb89154906c3f3d6a5391c838 --- envsetup.sh | 4 ++-- target/product/AndroidProducts.mk | 1 + target/product/full_x86.mk | 34 +++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 target/product/full_x86.mk diff --git a/envsetup.sh b/envsetup.sh index d633bbe0f0..5a36b27032 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -432,8 +432,8 @@ function add_lunch_combo() } # add the default one here -add_lunch_combo generic-eng -add_lunch_combo generic_x86-eng +add_lunch_combo full-eng +add_lunch_combo full_x86-eng # if we're on linux, add the simulator. There is a special case # in lunch to deal with the simulator diff --git a/target/product/AndroidProducts.mk b/target/product/AndroidProducts.mk index ab8e05d67e..eb17b3b36e 100644 --- a/target/product/AndroidProducts.mk +++ b/target/product/AndroidProducts.mk @@ -36,6 +36,7 @@ PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/generic.mk \ $(LOCAL_DIR)/generic_x86.mk \ $(LOCAL_DIR)/full.mk \ + $(LOCAL_DIR)/full_x86.mk \ $(LOCAL_DIR)/sdk.mk \ $(LOCAL_DIR)/sdk_x86.mk \ $(LOCAL_DIR)/sim.mk diff --git a/target/product/full_x86.mk b/target/product/full_x86.mk new file mode 100644 index 0000000000..affdc13917 --- /dev/null +++ b/target/product/full_x86.mk @@ -0,0 +1,34 @@ +# +# Copyright (C) 2009 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. +# + +# 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 +# x86 build, but all those aspects can be overridden +# in inherited configurations. + +# If running on an emulator or some other device that has a LAN connection +# that isn't a wifi connection. This will instruct init.rc to enable the +# network connection so that you can use it with ADB +ifdef NET_ETH0_STARTONBOOT + PRODUCT_PROPERTY_OVERRIDES += net.eth0.startonboot=1 +endif + +$(call inherit-product, build/target/product/full.mk) + +# Overrides +PRODUCT_NAME := full_x86 +PRODUCT_DEVICE := generic_x86 +PRODUCT_MODEL := Full Android x86 From f844ec96dd36f6fe3a1aa52c751bc0fbf1562222 Mon Sep 17 00:00:00 2001 From: Bruce Beare Date: Tue, 31 May 2011 13:16:31 -0700 Subject: [PATCH 17/23] x86: qemu emulator is the default build target Change-Id: I200536d2d997eda6a6e62eaa9050269e3c7ff6c4 Orig-Change-Id: I1fc3cb491d593d3e28f90278cfc8de5d77852932 Signed-off-by: Bruce Beare Signed-off-by: Jun Nakajima --- core/Makefile | 4 +- target/board/generic_x86/AndroidBoard.mk | 9 +--- target/board/generic_x86/BoardConfig.mk | 45 ++++++++----------- target/board/generic_x86/README.txt | 33 +++----------- target/board/generic_x86/device.mk | 26 +++++++++++ target/board/generic_x86/disk_layout.conf | 54 ----------------------- target/board/generic_x86/system.prop | 6 +++ target/product/full_x86.mk | 17 +++---- target/product/generic_x86.mk | 44 ++++++++---------- 9 files changed, 85 insertions(+), 153 deletions(-) create mode 100644 target/board/generic_x86/device.mk delete mode 100644 target/board/generic_x86/disk_layout.conf create mode 100644 target/board/generic_x86/system.prop diff --git a/core/Makefile b/core/Makefile index f4669f27be..8de9b0450a 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1219,7 +1219,7 @@ ifneq ($(TARGET_SIMULATOR),true) INTERNAL_EMULATOR_PACKAGE_FILES += \ $(HOST_OUT_EXECUTABLES)/emulator$(HOST_EXECUTABLE_SUFFIX) \ - prebuilt/android-arm/kernel/kernel-qemu \ + prebuilt/android-$(TARGET_ARCH)/kernel/kernel-qemu \ $(INSTALLED_RAMDISK_TARGET) \ $(INSTALLED_SYSTEMIMAGE) \ $(INSTALLED_USERDATAIMAGE_TARGET) @@ -1337,6 +1337,8 @@ $(INTERNAL_SDK_TARGET): $(deps) -I $(HOST_OUT) \ -I $(TARGET_COMMON_OUT_ROOT) \ -v "PLATFORM_NAME=android-$(PLATFORM_VERSION)" \ + -v "TARGET_ARCH=$(TARGET_ARCH)" \ + -v "TARGET_CPU_ABI=$(TARGET_CPU_ABI)" \ -o $(PRIVATE_DIR) && \ cp -f $(target_notice_file_txt) \ $(PRIVATE_DIR)/platforms/android-$(PLATFORM_VERSION)/images/NOTICE.txt && \ diff --git a/target/board/generic_x86/AndroidBoard.mk b/target/board/generic_x86/AndroidBoard.mk index d8b37c615c..8fb68f80a4 100644 --- a/target/board/generic_x86/AndroidBoard.mk +++ b/target/board/generic_x86/AndroidBoard.mk @@ -1,10 +1,3 @@ LOCAL_PATH := $(call my-dir) -ifeq ($(TARGET_PREBUILT_KERNEL),) -LOCAL_KERNEL := prebuilt/android-x86/kernel/kernel -else -LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL) -endif - -PRODUCT_COPY_FILES += \ - $(LOCAL_KERNEL):kernel +# diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index 2268d4100f..1bad20d5b3 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -1,30 +1,23 @@ -TARGET_ARCH=x86 -DISABLE_DEXPREOPT := true -TARGET_COMPRESS_MODULE_SYMBOLS := false -TARGET_PRELINK_MODULE := false -TARGET_NO_RECOVERY := true -TARGET_HARDWARE_3D := false -BOARD_USES_GENERIC_AUDIO := true -USE_CAMERA_STUB := true -TARGET_PROVIDES_INIT_RC := true -USE_CUSTOM_RUNTIME_HEAP_MAX := "32M" +# config.mk +# +# Product-specific compile-time definitions. +# + +# The generic product target doesn't have any hardware-specific pieces. +TARGET_NO_BOOTLOADER := true +TARGET_NO_KERNEL := true TARGET_CPU_ABI := x86 -TARGET_USERIMAGES_USE_EXT4 := true -TARGET_BOOTIMAGE_USE_EXT2 := true +TARGET_ARCH := x86 +TARGET_ARCH_VARIANT := x86-atom +TARGET_PRELINK_MODULE := false -# For VirtualBox and likely other emulators -BOARD_INSTALLER_CMDLINE := init=/init console=ttyS0 console=tty0 androidboot.hardware=generic_x86 vga=788 androidboot.console=tty0 verbose -BOARD_KERNEL_CMDLINE := init=/init console=tty0 console=ttyS0 androidboot.hardware=generic_x86 vga=788 androidboot.console=tty0 verbose -TARGET_USE_DISKINSTALLER := true -TARGET_DISK_LAYOUT_CONFIG := build/target/board/generic_x86/disk_layout.conf -BOARD_BOOTIMAGE_MAX_SIZE := 8388608 -BOARD_SYSLOADER_MAX_SIZE := 7340032 -BOARD_FLASH_BLOCK_SIZE := 512 -BOARD_USERDATAIMAGE_PARTITION_SIZE := 50M -BOARD_INSTALLERIMAGE_PARTITION_SIZE := 500M -TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true +# The IA emulator (qemu) uses the Goldfish devices +HAVE_HTC_AUDIO_DRIVER := true +BOARD_USES_GENERIC_AUDIO := true +# no hardware camera +USE_CAMERA_STUB := true + +# Set /system/bin/sh to mksh, not ash, to test the transition. +TARGET_SHELL := mksh -# The eth0 device should be started with dhcp on boot. -# Useful for emulators that don't provide a wifi connection. -NET_ETH0_STARTONBOOT := true diff --git a/target/board/generic_x86/README.txt b/target/board/generic_x86/README.txt index 585a373fa1..938d982e94 100644 --- a/target/board/generic_x86/README.txt +++ b/target/board/generic_x86/README.txt @@ -1,29 +1,8 @@ -The generic_x86 board target provides basic services on very basic -hardware (really for an emulation). To build with generic_x86, you will -need an appropriate kernel for your emulation (or device). +The "generic_x86" product defines a non-hardware-specific IA target +without a kernel or bootloader. -A1. Create a new top level directory and pull the AOSP repository - mkdir $HOME/AOSP - cd $HOME/AOSP - repo init -u git://android.git.kernel.org/platform/manifest.git - repo sync - -A2. Copy in the kernel - cd $HOME/AOSP - cp ~/bzImage.your_device $HOME/AOSP/prebuilt/android-x86/kernel/kernel - -A3. Build - cd $HOME/AOSP - source build/envsetup.sh - lunch generic_x86-eng - make -j8 - -The build will generate some image files whose format may or may not be correct for your -device. You can build an installer image disk for the VirtualBox emulator using the command: - -A4. Build a VirtualBox installer image - cd $HOME/AOSP - source build/envsetup.sh - lunch generic_x86-eng - make -j8 installer_vdi +It can be used to build the entire user-level system, and +will work with the IA version of the emulator, +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_x86/device.mk b/target/board/generic_x86/device.mk new file mode 100644 index 0000000000..0b4dc271c8 --- /dev/null +++ b/target/board/generic_x86/device.mk @@ -0,0 +1,26 @@ +# +# Copyright (C) 2009 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. +# + +# This is a build configuration for the product aspects that +# are specific to the emulator. + +PRODUCT_PROPERTY_OVERRIDES := \ + ro.ril.hsxpa=1 \ + ro.ril.gprsclass=10 + +PRODUCT_COPY_FILES := \ + development/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ + development/data/etc/vold.conf:system/etc/vold.conf diff --git a/target/board/generic_x86/disk_layout.conf b/target/board/generic_x86/disk_layout.conf deleted file mode 100644 index 7b073eef54..0000000000 --- a/target/board/generic_x86/disk_layout.conf +++ /dev/null @@ -1,54 +0,0 @@ -device { - path /dev/block/sda - - scheme mbr - - # bytes in a disk sector (== 1 LBA), must be a power of 2! - sector_size 512 - - # What LBA should the partitions start at? - start_lba 2048 - - # Autodetect disk size if == 0 - num_lba 0 - - partitions { - sysloader { - active y - type linux - len 7M - } - - recovery { - active y - type linux - len 16M - } - - boot { - active y - type linux - len 8M - } - - cache { - type linux - len 512M - } - - system { - type linux - len 512M - } - - third_party { - type linux - len 512M - } - - data { - type linux - len -1 - } - } -} diff --git a/target/board/generic_x86/system.prop b/target/board/generic_x86/system.prop new file mode 100644 index 0000000000..137a0f9b1f --- /dev/null +++ b/target/board/generic_x86/system.prop @@ -0,0 +1,6 @@ +# +# system.prop for generic sdk +# + +rild.libpath=/system/lib/libreference-ril.so +rild.libargs=-d /dev/ttyS0 diff --git a/target/product/full_x86.mk b/target/product/full_x86.mk index affdc13917..e33ef142ed 100644 --- a/target/product/full_x86.mk +++ b/target/product/full_x86.mk @@ -16,19 +16,14 @@ # 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 -# x86 build, but all those aspects can be overridden -# in inherited configurations. +# build quite specifically for the emulator, and might not be +# entirely appropriate to inherit from for on-device configurations. -# If running on an emulator or some other device that has a LAN connection -# that isn't a wifi connection. This will instruct init.rc to enable the -# network connection so that you can use it with ADB -ifdef NET_ETH0_STARTONBOOT - PRODUCT_PROPERTY_OVERRIDES += net.eth0.startonboot=1 -endif - -$(call inherit-product, build/target/product/full.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/board/generic/device.mk) # Overrides PRODUCT_NAME := full_x86 PRODUCT_DEVICE := generic_x86 -PRODUCT_MODEL := Full Android x86 +PRODUCT_BRAND := Android +PRODUCT_MODEL := Full Android on x86 Emulator diff --git a/target/product/generic_x86.mk b/target/product/generic_x86.mk index 971390055e..7e77a273ae 100644 --- a/target/product/generic_x86.mk +++ b/target/product/generic_x86.mk @@ -1,34 +1,26 @@ +# +# Copyright (C) 2007 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. +# + # This is a generic product that isn't specialized for a specific device. -# It includes the base Android platform. If you need Google-specific features, -# you should derive from generic_with_google.mk - -PRODUCT_PACKAGES := \ - AlarmClock \ - AlarmProvider \ - Calendar \ - Camera \ - DrmProvider \ - LatinIME \ - Mms \ - Music \ - Settings \ - Sync \ - Updater \ - CalendarProvider \ - SubscribedFeedsProvider \ - SyncProvider +# It includes the base Android platform. +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk) # Overrides PRODUCT_BRAND := generic_x86 PRODUCT_DEVICE := generic_x86 PRODUCT_NAME := generic_x86 -PRODUCT_POLICY := android.policy_phone - -# If running on an emulator or some other device that has a LAN connection -# that isn't a wifi connection. This will instruct init.rc to enable the -# network connection so that you can use it with ADB -ifdef NET_ETH0_STARTONBOOT - PRODUCT_PROPERTY_OVERRIDES += net.eth0.startonboot=1 -endif From b23e918346fe4a6ba839572019c5f7b2af32157b Mon Sep 17 00:00:00 2001 From: Bruce Beare Date: Wed, 2 Mar 2011 08:29:59 -0800 Subject: [PATCH 18/23] sdk: Add pc-bios files for IA qemu emulator Orig-Change-Id: Ia919ff57295cd020810989f241da713210bc8720 Signed-off-by: Bruce Beare --- target/product/sdk.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/product/sdk.mk b/target/product/sdk.mk index d73e7025bb..4349463c90 100644 --- a/target/product/sdk.mk +++ b/target/product/sdk.mk @@ -60,6 +60,8 @@ PRODUCT_PACKAGES += \ hprof-conv \ mksdcard \ emulator \ + bios.bin \ + vgabios-cirrus.bin \ ddms \ hierarchyviewer \ draw9patch \ From 63152fd929265b73195492e64b29352e1d068287 Mon Sep 17 00:00:00 2001 From: Bruce Beare Date: Thu, 8 Jul 2010 14:59:16 -0700 Subject: [PATCH 19/23] x86: Add proper gcc-4.4.3 x86 toolchain support. This patch combines 7 AOSP patches to add proper support to build x86 platform images using the 4.4.3 toolchain. The Orig-Changed-Id fields below correspond to the change ids of the original changes in the AOSP master branch history. Define __ANDROID__ for x86 to be on par with ARM build requirements Orig-Change-Id: I79c8f29af1f20b694f22a39f848216022809a5c6 Signed-off-by: Bruce Beare Enables x86-atom as a valid TARGET_ARCH_VARIANT for the simulator build. Orig-Change-Id: Idbceb6c7d4117fbecd35e4261330e6405666189e IA: enable SSE fpmath, Separate ARCH_VARIANT and ARCH makefile settings Change-Id: I9ba661d68a3b375c21eb6b56442d8ba66a5369b3 Orig-Change-Id: I60b8121c92b39a60b513bc2496a1e0a21015c586 Signed-off-by: Bruce Beare x86: Use GCC 4.4.3 Orig-Change-Id: I083c1afcbb98cfeb48d7bcb7681e5c34db52e767 Author: H.J. Lu Signed-off-by: Bruce Beare x86: the -mbionic flag is needed for IA builds. Orig-Change-Id: I00c75f37d7ea46b9f8ad3d7b2ff7094477ff0916 Signed-off-by: Bruce Beare x86: Disable stack-protector until bionic is fixed Orig-Change-Id: I2862de5c1b02490197704f4578a8a91d0565eef0 Signed-off-by: Bruce Beare Clean up of X86 build flags Orig-Change-Id: Ife75c32cd49b32345712dee28fa5f2283069a90e Signed-off-by: Mark D Horn Author: Bruce Beare x86: Enable -fstack-protector Orig-Change-Id: I1fe10159b7a29452ecfc6ba328164948cf9950d6 Signed-off-by: Bruce Beare --- core/combo/TARGET_linux-x86.mk | 50 ++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk index d5bcba2255..a683a0ec67 100644 --- a/core/combo/TARGET_linux-x86.mk +++ b/core/combo/TARGET_linux-x86.mk @@ -25,7 +25,9 @@ TARGET_AR := $(HOST_AR) TARGET_GLOBAL_CFLAGS := $(HOST_GLOBAL_CFLAGS) -m32 TARGET_GLOBAL_LDFLAGS := $(HOST_GLOBAL_LDFLAGS) -m32 -lpthread TARGET_NO_UNDEFINED_LDFLAGS := $(HOST_NO_UNDEFINED_LDFLAGS) +ifeq ($(strip $(TARGET_ARCH_VARIANT)),) TARGET_ARCH_VARIANT := x86 +endif else #simulator # Provide a default variant. @@ -36,7 +38,7 @@ endif # You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else ifeq ($(strip $(TARGET_TOOLS_PREFIX)),) TARGET_TOOLS_PREFIX := \ - prebuilt/$(HOST_PREBUILT_TAG)/toolchain/i686-unknown-linux-gnu-4.2.1/bin/i686-unknown-linux-gnu- + prebuilt/$(HOST_PREBUILT_TAG)/toolchain/i686-android-linux-4.4.3/bin/i686-android-linux- endif TARGET_CC := $(TARGET_TOOLS_PREFIX)gcc$(HOST_EXECUTABLE_SUFFIX) @@ -49,8 +51,7 @@ TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-debug $< -o $@ ifneq ($(wildcard $(TARGET_CC)),) TARGET_LIBGCC := \ - $(shell $(TARGET_CC) -m32 -print-file-name=libgcc.a) \ - $(shell $(TARGET_CC) -m32 -print-file-name=libgcc_eh.a) + $(shell $(TARGET_CC) -m32 -print-file-name=libgcc.a) endif TARGET_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined @@ -74,14 +75,48 @@ endif KERNEL_HEADERS := $(KERNEL_HEADERS_COMMON) $(KERNEL_HEADERS_ARCH) TARGET_GLOBAL_CFLAGS += \ - -march=i686 \ - -m32 \ + -O2 \ + -Ulinux \ + -Wa,--noexecstack \ + -Werror=format-security \ + -Wstrict-aliasing=2 \ -fPIC \ + -ffunction-sections \ + -finline-functions \ + -finline-limit=300 \ + -fno-inline-functions-called-once \ + -fno-short-enums \ + -fstrict-aliasing \ + -funswitch-loops \ + -funwind-tables \ -include $(call select-android-config-h,target_linux-x86) +TARGET_GLOBAL_CFLAGS += -fstack-protector + +# Needs to be added for RELEASE +#TARGET_GLOBAL_CFLAGS += \ +# -DNDEBUG + + +# Fix this after ssp.c is fixed for x86 +# TARGET_GLOBAL_CFLAGS += -fstack-protector + TARGET_GLOBAL_CPPFLAGS += \ -fno-use-cxa-atexit +ifeq ($(TARGET_ARCH_VARIANT),x86-atom) + TARGET_GLOBAL_CFLAGS += -march=atom -mstackrealign -DUSE_SSSE3 -DUSE_SSE2 -mfpmath=sse +else + TARGET_GLOBAL_CFLAGS += -march=i686 +endif + +TARGET_GLOBAL_CFLAGS += -mbionic +TARGET_GLOBAL_CFLAGS += -D__ANDROID__ + +TARGET_GLOBAL_LDFLAGS += -m32 +TARGET_GLOBAL_LDFLAGS += -Wl,-z,noexecstack +TARGET_GLOBAL_LDFLAGS += -Wl,--gc-sections + TARGET_C_INCLUDES := \ $(libc_root)/arch-x86/include \ $(libc_root)/include \ @@ -109,7 +144,7 @@ $(TARGET_CXX) \ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ -nostdlib -Wl,-soname,$(notdir $@) \ -shared -Bsymbolic \ - -fPIC -march=i686 \ + $(TARGET_GLOBAL_CFLAGS) \ $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \ $(PRIVATE_TARGET_CRTBEGIN_SO_O) \ $(PRIVATE_ALL_OBJECTS) \ @@ -159,7 +194,4 @@ $(TARGET_CXX) \ $(TARGET_CRTEND_O) endef -TARGET_GLOBAL_CFLAGS += -m32 -TARGET_GLOBAL_LDFLAGS += -m32 - endif #simulator From c7e3877dad2333bfdf41e99470d559f381431d3c Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Wed, 15 Jun 2011 15:33:24 +0200 Subject: [PATCH 20/23] emulator: Build emulator platform images as ARMv7-A Backport from AOSP master. Now that the emulator supports proper ARMv7 emulation, switch to building all emulator-specific platform images using this instruction set, in order to benefit from the noticeable speed boost provided by Thumb-2 instructions. Note that we don't build with NEON support because emulated NEON instructions are currently slow, though they work. IMPORTANT: You need to have the following emulator patch in your tree in order to start these platform builds easily: https://review.source.android.com//#change,23798 Otherwise, the alternative is to do these things: 1/ Telling the emulator to emulate an ARMv7-A CPU, instead of an ARMv5TE one. This is normally done with "-qemu cortex-a8" 2/ Using an ARMv7-A capable kernel image, which is available and usable with -kernel prebuilt/android-arm/kernel-qemu-armv7 Note that the emulator has a special hack that automatically enables 1/ if 2/ is being used (i.e. if the kernel image name ends with -armv7, then emulate an ARMv7-A CPU automatically). So in reality, only 2/ is required. Change-Id: Id3ac7cdbda892e519af98aff1f02136f344406b8 Orig-Change-Id: I5c0245ba5e6a2bc34d0d49b2c024fffd317a5eed --- target/board/generic/BoardConfig.mk | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk index 9e52d25c4d..1e8f9e49eb 100644 --- a/target/board/generic/BoardConfig.mk +++ b/target/board/generic/BoardConfig.mk @@ -6,7 +6,22 @@ # The generic product target doesn't have any hardware-specific pieces. TARGET_NO_BOOTLOADER := true TARGET_NO_KERNEL := true -TARGET_CPU_ABI := armeabi + +# Note: we build the platform images for ARMv7-A _without_ NEON. +# +# Technically, the emulator supports ARMv7-A _and_ NEON instructions, but +# emulated NEON code paths typically ends up 2x slower than the normal C code +# it is supposed to replace (unlike on real devices where it is 2x to 3x +# faster). +# +# What this means is that the platform image will not use NEON code paths +# that are slower to emulate. On the other hand, it is possible to emulate +# application code generated with the NDK that uses NEON in the emulator. +# +TARGET_ARCH_VARIANT := armv7-a +TARGET_CPU_ABI := armeabi-v7a +TARGET_CPU_ABI2 := armeabi + HAVE_HTC_AUDIO_DRIVER := true BOARD_USES_GENERIC_AUDIO := true From 3248bb2e076cb26a71c6a08e9788b2853e1f5f97 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Thu, 23 Jun 2011 12:49:02 +0200 Subject: [PATCH 21/23] sdk: provide ABI-dependent atree files Backport from AOSP master This patch allows development/sdk/ to provide ABI-specific .atree files. This is useful to copy prebuilt CPU model-specific files to the SDK platform image directory. This is needed to deal with the fact that for ARMv7 platform builds, the kernel image to use is prebuilt/android-arm/kernel-qemu-armv7 instead of prebuilt/android-arm/kernel/qemu Change-Id: Ib76caa54a059eca2dafc9cdba812b29f98b5e3c3 Orig-Change-Id: Icdca751852c01421fccf196436a9bc1114ea90f7 --- core/Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/Makefile b/core/Makefile index 8de9b0450a..10f82df37f 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1291,6 +1291,14 @@ sdk_atree_files := \ $(atree_dir)/sdk-$(HOST_OS)-$(HOST_ARCH).atree \ sdk/build/tools.atree +# development/build/sdk-android-.atree is used to differentiate +# between architecture models (e.g. ARMv5TE versus ARMv7) when copying +# files like the kernel image. We use TARGET_CPU_ABI because we don't +# have a better way to distinguish between CPU models. +ifneq (,$(strip $(wildcard $(atree_dir)/sdk-android-$(TARGET_CPU_ABI).atree))) + sdk_atree_files += $(atree_dir)/sdk-android-$(TARGET_CPU_ABI).atree +endif + deps := \ $(target_notice_file_txt) \ $(tools_notice_file_txt) \ @@ -1341,7 +1349,7 @@ $(INTERNAL_SDK_TARGET): $(deps) -v "TARGET_CPU_ABI=$(TARGET_CPU_ABI)" \ -o $(PRIVATE_DIR) && \ cp -f $(target_notice_file_txt) \ - $(PRIVATE_DIR)/platforms/android-$(PLATFORM_VERSION)/images/NOTICE.txt && \ + $(PRIVATE_DIR)/platforms/android-$(PLATFORM_VERSION)/images/$(TARGET_CPU_ABI)/NOTICE.txt && \ cp -f $(tools_notice_file_txt) $(PRIVATE_DIR)/tools/NOTICE.txt && \ HOST_OUT_EXECUTABLES=$(HOST_OUT_EXECUTABLES) HOST_OS=$(HOST_OS) \ development/build/tools/sdk_clean.sh $(PRIVATE_DIR) && \ From 4b65598642fce27ab7d2e02bfb24b76baa67580d Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Thu, 16 Jun 2011 01:32:20 +0200 Subject: [PATCH 22/23] emulator: Enable dex-preoptimization Backport from AOSP master. This enables the Dex pre-optimization for emulator-specific builds. The idea is to speed up the initial boot sequence of an SDK AVD by avoiding the costly on-device preopt pass that is performed otherwise the first time the AVD is launched. Benchmarking shows reductions in first boot time from 1m30s to 40s on a 2.4GHz Xeon when emulating the AOSP master ToT. Change-Id: Ibf5ebe68aa4d363c9df05d2ffe7cb828ef99f922 Orig-Change-Id: I67a9ce9791220c202817864c6e83dc8fd9cbc027 --- target/board/generic/BoardConfig.mk | 6 ++++++ target/board/generic_x86/BoardConfig.mk | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk index 1e8f9e49eb..64b1dbebc2 100644 --- a/target/board/generic/BoardConfig.mk +++ b/target/board/generic/BoardConfig.mk @@ -27,3 +27,9 @@ 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) +WITH_DEXPREOPT := true +endif diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index 1bad20d5b3..02064342e2 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -21,3 +21,8 @@ USE_CAMERA_STUB := true # Set /system/bin/sh to mksh, not ash, to test the transition. TARGET_SHELL := mksh +# 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) +WITH_DEXPREOPT := true +endif From 9fb131a9b6aa23223e79af4f1bb8b9823727b4f5 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Fri, 8 Jul 2011 01:56:51 +0200 Subject: [PATCH 23/23] sdk-addon.mk: Copy image files to ABI-specific dir Change-Id: I39ad022a5bb03ea39fc41c134d1d4855dc491deb --- core/tasks/sdk-addon.mk | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/tasks/sdk-addon.mk b/core/tasks/sdk-addon.mk index e21fedcb36..2641a31f63 100644 --- a/core/tasks/sdk-addon.mk +++ b/core/tasks/sdk-addon.mk @@ -55,10 +55,11 @@ files_to_copy += $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SDK_ADDON_COPY_FILES) # All SDK add-ons have these files files_to_copy += \ - $(BUILT_SYSTEMIMAGE):images/system.img \ - $(BUILT_USERDATAIMAGE_TARGET):images/userdata.img \ - $(BUILT_RAMDISK_TARGET):images/ramdisk.img \ - $(target_notice_file_txt):images/NOTICE.txt + $(BUILT_SYSTEMIMAGE):images/$(TARGET_CPU_ABI)/system.img \ + $(BUILT_USERDATAIMAGE_TARGET):images/$(TARGET_CPU_ABI)/userdata.img \ + $(BUILT_RAMDISK_TARGET):images/$(TARGET_CPU_ABI)/ramdisk.img \ + $(ANDROID_PRODUCT_OUT)/system/build.prop:images/$(TARGET_CPU_ABI)/build.prop \ + $(target_notice_file_txt):images/$(TARGET_CPU_ABI)/NOTICE.txt # Generate rules to copy the requested files $(foreach cf,$(files_to_copy), \