diff --git a/ef44/BoardConfig.mk b/ef44/BoardConfig.mk index dddc64e..c04eab6 100644 --- a/ef44/BoardConfig.mk +++ b/ef44/BoardConfig.mk @@ -62,3 +62,5 @@ TW_NO_SCREEN_BLANK := true TW_THEME := portrait_hdpi #BOARD_HAS_VIBRATOR_IMPLEMENTATION := device/pantech/ef44/vibrator/vibrator.c +LZMA_RAMDISK_TARGETS := recovery + diff --git a/ef44/mkbootimg.mk b/ef44/mkbootimg.mk new file mode 100644 index 0000000..3689de0 --- /dev/null +++ b/ef44/mkbootimg.mk @@ -0,0 +1,36 @@ +LOCAL_PATH := $(call my-dir) + +# Compress recovery ramdisk using XZ +KERNEL_IMAGE := $(PRODUCT_OUT)/kernel + +BUILT_RAMDISK_CPIO := $(PRODUCT_OUT)/ramdisk-recovery.cpio +COMPRESS_COMMAND := lzma --force -9e + +INSTALLED_RECOVERYIMAGE_TARGET := $(PRODUCT_OUT)/recovery.img +$(INSTALLED_RECOVERYIMAGE_TARGET): $(recovery_ramdisk) + @echo "------- Compressing recovery ramdisk -------" + $(hide) $(COMPRESS_COMMAND) "$(BUILT_RAMDISK_CPIO)" + @echo "------- Making recovery image -------" + $(hide) $(MKBOOTIMG) \ + --kernel $(KERNEL_IMAGE) \ + --ramdisk $(BUILT_RAMDISK_CPIO).lzma \ + --cmdline "$(BOARD_KERNEL_CMDLINE)" \ + --base $(BOARD_KERNEL_BASE) \ + --pagesize $(BOARD_KERNEL_PAGESIZE) \ + $(BOARD_MKBOOTIMG_ARGS) \ + -o $(INSTALLED_RECOVERYIMAGE_TARGET) + $(hide) $(call assert-max-image-size,$@,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw) + @echo "------- Made recovery image: $@ -------" + +# Compress kernel ramdisk using LZMA LehKeda Edit +LZMA_BIN := $(shell which lzma) +LZMA_BOOT_RAMDISK := $(PRODUCT_OUT)/ramdisk-lzma.img + +$(LZMA_BOOT_RAMDISK): $(BUILT_RAMDISK_TARGET) + gunzip -f < $(BUILT_RAMDISK_TARGET) | lzma -e > $@ + +$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(LZMA_BOOT_RAMDISK) + $(call pretty,"Target boot image: $@") + $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --kernel $(KERNEL_IMAGE) --output $@ --ramdisk $(LZMA_BOOT_RAMDISK) + $(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw) + @echo -e ${CL_CYN}"Made boot image: $@"${CL_RST} diff --git a/msm8960-common/BoardConfigCommon.mk b/msm8960-common/BoardConfigCommon.mk index f27eb1a..7cb3b45 100644 --- a/msm8960-common/BoardConfigCommon.mk +++ b/msm8960-common/BoardConfigCommon.mk @@ -32,6 +32,8 @@ TARGET_BOOTLOADER_BOARD_NAME := MSM8960 TARGET_BOARD_PLATFORM := msm8960 # Kernel information +BOARD_CUSTOM_BOOTIMG_MK := device/pantech/ef44/mkbootimg.mk + BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.hardware=qcom androidboot.carrier=SKT-KOR user_debug=31 msm_rtb.filter=0x3F kgsl.mmutype=gpummu androidboot.emmc=true BOARD_KERNEL_BASE := 0x80200000 BOARD_KERNEL_PAGESIZE := 2048 @@ -148,4 +150,6 @@ SOMC_CFG_SENSORS_COMPASS_AK8972 := yes # updatemiscta.te # inherit from the proprietary version --include vendor/pantech/msm8960-common/BoardConfigVendor.mk +#-include vendor/pantech/msm8960-common/BoardConfigVendor.mk + +LZMA_RAMDISK_TARGETS := recovery