diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/Makefile | 3 | ||||
-rw-r--r-- | core/tasks/kernel.mk | 43 |
2 files changed, 41 insertions, 5 deletions
diff --git a/core/Makefile b/core/Makefile index 775365b..c66ccc4 100644 --- a/core/Makefile +++ b/core/Makefile @@ -714,7 +714,7 @@ TARGET_RECOVERY_ROOT_TIMESTAMP := $(TARGET_RECOVERY_OUT)/root.ts $(TARGET_RECOVERY_ROOT_TIMESTAMP): $(INTERNAL_RECOVERY_FILES) \ $(INSTALLED_RAMDISK_TARGET) \ - $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) \ + $(MKBOOTIMG) \ $(recovery_binary) \ $(recovery_initrc) \ $(INSTALLED_2NDBOOTLOADER_TARGET) \ @@ -761,6 +761,7 @@ $(recovery_ramdisk): $(MKBOOTFS) \ ifndef BOARD_CUSTOM_BOOTIMG_MK $(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) \ + $(INTERNAL_BOOTIMAGE_FILES) \ $(recovery_ramdisk) \ $(recovery_kernel) @echo -e ${CL_CYN}"----- Making recovery image ------"${CL_RST} diff --git a/core/tasks/kernel.mk b/core/tasks/kernel.mk index dc51e7c..9f21fdc 100644 --- a/core/tasks/kernel.mk +++ b/core/tasks/kernel.mk @@ -22,21 +22,27 @@ TARGET_KERNEL_SOURCE ?= $(TARGET_AUTO_KDIR) KERNEL_SRC := $(TARGET_KERNEL_SOURCE) # kernel configuration - mandatory KERNEL_DEFCONFIG := $(TARGET_KERNEL_CONFIG) +KERNEL_RECOVERY_DEFCONFIG := $(TARGET_KERNEL_RECOVERY_CONFIG) VARIANT_DEFCONFIG := $(TARGET_KERNEL_VARIANT_CONFIG) SELINUX_DEFCONFIG := $(TARGET_KERNEL_SELINUX_CONFIG) ## Internal variables KERNEL_OUT := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ KERNEL_CONFIG := $(KERNEL_OUT)/.config +KERNEL_RECOVERY_OUT := $(TARGET_OUT_INTERMEDIATES)/KERNEL_RECOVERY_OBJ +KERNEL_RECOVERY_CONFIG := $(KERNEL_RECOVERY_OUT)/.config ifeq ($(BOARD_USES_UBOOT),true) TARGET_PREBUILT_INT_KERNEL := $(KERNEL_OUT)/arch/$(TARGET_ARCH)/boot/uImage + TARGET_PREBUILT_INT_KERNEL_RECOVERY := $(KERNEL_RECOVERY_OUT)/arch/$(TARGET_ARCH)/boot/uImage TARGET_PREBUILT_INT_KERNEL_TYPE := uImage else ifeq ($(BOARD_USES_UNCOMPRESSED_BOOT),true) TARGET_PREBUILT_INT_KERNEL := $(KERNEL_OUT)/arch/$(TARGET_ARCH)/boot/Image + TARGET_PREBUILT_INT_KERNEL_RECOVERY := $(KERNEL_RECOVERY_OUT)/arch/$(TARGET_ARCH)/boot/Image TARGET_PREBUILT_INT_KERNEL_TYPE := Image else TARGET_PREBUILT_INT_KERNEL := $(KERNEL_OUT)/arch/$(TARGET_ARCH)/boot/zImage + TARGET_PREBUILT_INT_KERNEL_RECOVERY := $(KERNEL_RECOVERY_OUT)/arch/$(TARGET_ARCH)/boot/zImage TARGET_PREBUILT_INT_KERNEL_TYPE := zImage endif @@ -63,6 +69,7 @@ ifeq "$(wildcard $(KERNEL_SRC) )" "" $(warning ***************************************************************) FULL_KERNEL_BUILD := false KERNEL_BIN := $(TARGET_PREBUILT_KERNEL) + KERNEL_RECOVERY_BIN := $(TARGET_PREBUILT_KERNEL) else $(warning ***************************************************************) $(warning * *) @@ -97,6 +104,15 @@ else KERNEL_BIN := $(TARGET_PREBUILT_INT_KERNEL) endif endif + ifneq ($(TARGET_KERNEL_RECOVERY_CONFIG),) + FULL_KERNEL_BUILD := true + ifeq ($(TARGET_USES_UNCOMPRESSED_KERNEL),true) + $(info Using uncompressed kernel) + KERNEL_RECOVERY_BIN := $(KERNEL_RECOVERY_OUT)/piggy + else + KERNEL_RECOVERY_BIN := $(TARGET_PREBUILT_INT_KERNEL_RECOVERY) + endif + endif endif ifeq ($(FULL_KERNEL_BUILD),true) @@ -158,19 +174,31 @@ $(KERNEL_OUT): mkdir -p $(KERNEL_OUT) mkdir -p $(KERNEL_MODULES_OUT) +$(KERNEL_RECOVERY_OUT): + mkdir -p $(KERNEL_RECOVERY_OUT) + $(KERNEL_CONFIG): $(KERNEL_OUT) $(MAKE) $(MAKE_FLAGS) -C $(KERNEL_SRC) O=$(KERNEL_OUT) ARCH=$(TARGET_ARCH) $(ARM_CROSS_COMPILE) VARIANT_DEFCONFIG=$(VARIANT_DEFCONFIG) SELINUX_DEFCONFIG=$(SELINUX_DEFCONFIG) $(KERNEL_DEFCONFIG) +$(KERNEL_RECOVERY_CONFIG): $(KERNEL_RECOVERY_OUT) + $(MAKE) $(MAKE_FLAGS) -C $(KERNEL_SRC) O=$(KERNEL_RECOVERY_OUT) ARCH=$(TARGET_ARCH) $(ARM_CROSS_COMPILE) $(KERNEL_RECOVERY_DEFCONFIG) + $(KERNEL_OUT)/piggy : $(TARGET_PREBUILT_INT_KERNEL) $(hide) gunzip -c $(KERNEL_OUT)/arch/$(TARGET_ARCH)/boot/compressed/piggy.gzip > $(KERNEL_OUT)/piggy -TARGET_KERNEL_BINARIES: $(KERNEL_OUT) $(KERNEL_CONFIG) $(KERNEL_HEADERS_INSTALL) +$(KERNEL_RECOVERY_OUT)/piggy : $(TARGET_PREBUILT_INT_KERNEL_RECOVERY) + $(hide) gunzip -c $(KERNEL_OUT)/arch/$(TARGET_ARCH)/boot/compressed/piggy.gzip > $(KERNEL_RECOVERY_OUT)/piggy + +TARGET_KERNEL_BINARIES: $(BUILT_RAMDISK_TARGET) $(KERNEL_OUT) $(KERNEL_CONFIG) $(KERNEL_HEADERS_INSTALL) $(MAKE) $(MAKE_FLAGS) -C $(KERNEL_SRC) O=$(KERNEL_OUT) ARCH=$(TARGET_ARCH) $(ARM_CROSS_COMPILE) $(TARGET_PREBUILT_INT_KERNEL_TYPE) -$(MAKE) $(MAKE_FLAGS) -C $(KERNEL_SRC) O=$(KERNEL_OUT) ARCH=$(TARGET_ARCH) $(ARM_CROSS_COMPILE) modules -$(MAKE) $(MAKE_FLAGS) -C $(KERNEL_SRC) O=$(KERNEL_OUT) INSTALL_MOD_PATH=../../$(KERNEL_MODULES_INSTALL) ARCH=$(TARGET_ARCH) $(ARM_CROSS_COMPILE) modules_install $(mv-modules) $(clean-module-folder) +$(TARGET_PREBUILT_INT_KERNEL_RECOVERY): $(recovery_ramdisk) $(KERNEL_RECOVERY_OUT) $(KERNEL_RECOVERY_CONFIG) + $(MAKE) $(MAKE_FLAGS) -C $(KERNEL_SRC) O=$(KERNEL_RECOVERY_OUT) ARCH=$(TARGET_ARCH) $(ARM_CROSS_COMPILE) $(TARGET_PREBUILT_INT_KERNEL_TYPE) + $(TARGET_KERNEL_MODULES): TARGET_KERNEL_BINARIES $(TARGET_PREBUILT_INT_KERNEL): $(TARGET_KERNEL_MODULES) @@ -185,10 +213,17 @@ endif # FULL_KERNEL_BUILD ## Install it ifeq ($(NEEDS_KERNEL_COPY),true) -file := $(INSTALLED_KERNEL_TARGET) -ALL_PREBUILT += $(file) -$(file) : $(KERNEL_BIN) | $(ACP) +installed_kernel := $(INSTALLED_KERNEL_TARGET) +ALL_PREBUILT += $(installed_kernel) +$(installed_kernel) : $(KERNEL_BIN) | $(ACP) $(transform-prebuilt-to-target) ALL_PREBUILT += $(INSTALLED_KERNEL_TARGET) + +installed_recovery_kernel := $(INSTALLED_RECOVERY_KERNEL_TARGET) +ALL_PREBUILT += $(installed_recovery_kernel) +$(installed_recovery_kernel) : $(KERNEL_RECOVERY_BIN) | $(ACP) + $(transform-prebuilt-to-target) + +ALL_PREBUILT += $(INSTALLED_RECOVERY_KERNEL_TARGET) endif |