Created
July 14, 2014 12:38
-
-
Save antdking/df95801029e54e34d59b to your computer and use it in GitHub Desktop.
for boot image building
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BOARD_KERNEL_SEPARATED_DT := true | |
BOARD_CUSTOM_BOOTIMG_MK := device/motorola/condor/mkbootimg.mk | |
TARGET_KERNEL_SOURCE := kernel/motorola/msm8610 | |
TARGET_KERNEL_CONFIG := msm8610_defconfig | |
BOARD_KERNEL_BASE := 0x00000000 | |
BOARD_KERNEL_PAGESIZE := 2048 | |
BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 utags.blkdev=/dev/block/platform/msm_sdcc.1/by-name/utags vmalloc=400M | |
BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x01000000 --tags_offset 0x00000100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOCAL_PATH := $(call my-dir) | |
## Don't change anything under here. The variables are named MSM8610_whatever | |
## on purpose, to avoid conflicts with similarly named variables at other | |
## parts of the build environment | |
## Imported from the original makefile... | |
KERNEL_CONFIG := $(KERNEL_OUT)/.config | |
MSM8610_DTS_NAMES := msm8610 | |
MSM8610_DTS_FILES = $(wildcard $(TOP)/$(TARGET_KERNEL_SOURCE)/arch/arm/boot/dts/msm8610-condor*.dts) | |
MSM8610_DTS_FILE = $(lastword $(subst /, ,$(1))) | |
DTB_FILE = $(addprefix $(KERNEL_OUT)/arch/arm/boot/,$(patsubst %.dts,%.dtb,$(call MSM8610_DTS_FILE,$(1)))) | |
ZIMG_FILE = $(addprefix $(KERNEL_OUT)/arch/arm/boot/,$(patsubst %.dts,%-zImage,$(call MSM8610_DTS_FILE,$(1)))) | |
KERNEL_ZIMG = $(KERNEL_OUT)/arch/arm/boot/zImage | |
DTC = $(KERNEL_OUT)/scripts/dtc/dtc | |
define append-msm8610-dtb | |
mkdir -p $(KERNEL_OUT)/arch/arm/boot;\ | |
$(foreach MSM8610_DTS_NAME, $(MSM8610_DTS_NAMES), \ | |
$(foreach d, $(MSM8610_DTS_FILES), \ | |
$(DTC) -p 1024 -O dtb -o $(call DTB_FILE,$(d)) $(d); \ | |
cat $(KERNEL_ZIMG) $(call DTB_FILE,$(d)) > $(call ZIMG_FILE,$(d));)) | |
endef | |
## Build and run dtbtool | |
DTBTOOL := $(HOST_OUT_EXECUTABLES)/dtbToolCM$(HOST_EXECUTABLE_SUFFIX) | |
INSTALLED_DTIMAGE_TARGET := $(PRODUCT_OUT)/dt.img | |
$(INSTALLED_DTIMAGE_TARGET): $(DTBTOOL) $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr $(INSTALLED_KERNEL_TARGET) | |
@echo -e ${CL_CYN}"Start DT image: $@"${CL_RST} | |
$(call append-msm8610-dtb) | |
$(call pretty,"Target dt image: $(INSTALLED_DTIMAGE_TARGET)") | |
$(hide) $(DTBTOOL) -o $(INSTALLED_DTIMAGE_TARGET) -s $(BOARD_KERNEL_PAGESIZE) -p $(KERNEL_OUT)/scripts/dtc/ $(KERNEL_OUT)/arch/arm/boot/ | |
@echo -e ${CL_CYN}"Made DT image: $@"${CL_RST} | |
## Overload bootimg generation: Same as the original, + --dt arg | |
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(INSTALLED_DTIMAGE_TARGET) | |
$(call pretty,"Target boot image: $@") | |
$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --dt $(INSTALLED_DTIMAGE_TARGET) --output $@ | |
$(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw) | |
@echo -e ${CL_CYN}"Made boot image: $@"${CL_RST} | |
## Overload recoveryimg generation: Same as the original, + --dt arg | |
$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) $(INSTALLED_DTIMAGE_TARGET) \ | |
$(recovery_ramdisk) \ | |
$(recovery_kernel) | |
@echo -e ${CL_CYN}"----- Making recovery image ------"${CL_RST} | |
$(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --dt $(INSTALLED_DTIMAGE_TARGET) --output $@ | |
$(hide) $(call assert-max-image-size,$@,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw) | |
@echo -e ${CL_CYN}"Made recovery image: $@"${CL_RST} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment