summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--BoardConfig.mk1
-rw-r--r--mkbootimg.mk29
2 files changed, 30 insertions, 0 deletions
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 902da90..00f0b05 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -34,6 +34,7 @@ BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/samsung/i9300/bluetooth
# Kernel
TARGET_KERNEL_SOURCE := kernel/samsung/smdk4412
TARGET_KERNEL_CONFIG := cyanogenmod_i9300_defconfig
+#BOARD_CUSTOM_BOOTIMG_MK := device/samsung/i9300/mkbootimg.mk
# Recovery
TARGET_RECOVERY_FSTAB := device/samsung/i9300/rootdir/fstab.smdk4x12
diff --git a/mkbootimg.mk b/mkbootimg.mk
new file mode 100644
index 0000000..5211cce
--- /dev/null
+++ b/mkbootimg.mk
@@ -0,0 +1,29 @@
+LOCAL_PATH := $(call my-dir)
+
+DTB_FILE = $(KERNEL_OUT)/arch/arm/boot/dts/exynos4412-trats2.dtb
+KERNEL_ZIMG = $(KERNEL_OUT)/arch/arm/boot/zImage
+KERNEL_ZIMG_DTB = $(KERNEL_ZIMG)-dtb
+KERNEL_APP = $(OUT)/kernel
+
+$(KERNEL_ZIMG_DTB): $(KERNEL_APP)
+ cat $(KERNEL_ZIMG) $(DTB_FILE) > $(KERNEL_ZIMG_DTB);
+ rm -f $(KERNEL_APP);
+ cp $(KERNEL_ZIMG_DTB) $(KERNEL_APP);
+
+## Overload bootimg generation: Same as the original, except use appended dtb kernel
+$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(KERNEL_ZIMG_DTB)
+ $(call pretty,"Target boot image: $@")
+ $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --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, except use appended dtb kernel
+$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) \
+ $(recovery_ramdisk) \
+ $(recovery_kernel) \
+ $(KERNEL_ZIMG_DTB)
+ @echo -e ${CL_CYN}"----- Making recovery image ------"${CL_RST}
+ $(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@
+ $(hide) $(call assert-max-image-size,$@,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw)
+ @echo -e ${CL_CYN}"Made recovery image: $@"${CL_RST}
+