-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcustombootimg.mk
26 lines (23 loc) · 1.66 KB
/
custombootimg.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
LOCAL_PATH := $(call my-dir)
INSTALLED_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img
$(INSTALLED_BOOTIMAGE_TARGET): $(TARGET_PREBUILT_KERNEL) $(recovery_ramdisk) $(INSTALLED_RAMDISK_TARGET) $(PRODUCT_OUT)/utilities/flash_image $(PRODUCT_OUT)/utilities/busybox $(PRODUCT_OUT)/utilities/erase_image $(MKBOOTIMG) $(MINIGZIP) $(INTERNAL_BOOTIMAGE_FILES)
$(call pretty,"Boot image: $@")
$(hide) mkdir -p $(PRODUCT_OUT)/combinedroot/
$(hide) cp -r $(PRODUCT_OUT)/root/* $(PRODUCT_OUT)/combinedroot/
$(hide) cp -r $(PRODUCT_OUT)/recovery/root/sbin/* $(PRODUCT_OUT)/combinedroot/sbin/
$(hide) $(MKBOOTFS) $(PRODUCT_OUT)/combinedroot/ > $(PRODUCT_OUT)/combinedroot.cpio
$(hide) cat $(PRODUCT_OUT)/combinedroot.cpio | $(MINIGZIP) > $(PRODUCT_OUT)/combinedroot.fs
$(hide) $(MKBOOTIMG) --kernel $(TARGET_PREBUILT_KERNEL) --ramdisk $(PRODUCT_OUT)/combinedroot.fs --base $(BOARD_KERNEL_BASE) --output $@
$(hide) device/semc/shakira/releasetools/bin2elf 2 0x208000 $(TARGET_PREBUILT_KERNEL) 0x208000 0x0 $(PRODUCT_OUT)/combinedroot.fs 0x1000000 0x80000000
$(hide) mv result.elf $(PRODUCT_OUT)/result.elf
$(hide) device/semc/shakira/releasetools/bin2sin $(PRODUCT_OUT)/result.elf 03000000010000402001000040000000
$(hide) mv $(PRODUCT_OUT)/result.elf.sin $(PRODUCT_OUT)/kernel.sin
$(hide) rm $(PRODUCT_OUT)/result.elf
INSTALLED_RECOVERYIMAGE_TARGET := $(PRODUCT_OUT)/recovery.img
$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) \
$(recovery_ramdisk) \
$(recovery_kernel)
@echo ----- Making recovery image ------
$(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) --output $@
@echo ----- Made recovery image -------- $@
$(hide) $(call assert-max-image-size,$@,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw)