-
Notifications
You must be signed in to change notification settings - Fork 4
/
boot.mk
32 lines (27 loc) · 1.41 KB
/
boot.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
26
27
28
29
30
31
32
# Source code Thanks to RD chrmhoffmann@XDA
# https://github.com/chrmhoffmann/android_device_wiko_stairway/blob/cm-11.0/boot.mk
define make_header
perl -e 'print pack("a4 L a32 a472", "\x88\x16\x88\x58", $$ARGV[0], $$ARGV[1], "\xFF"x472)' $(1) $(2) > $(3)
endef
# Dummy mkbootimg required or build error about boot.img on latter CM repo
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES)
$(call pretty,"Target boot image: $@")
$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) --output $@
$(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw)
$(recovery_ramdisk).mtk.header: $(recovery_ramdisk)
size=$$($(call get-file-size,$(recovery_ramdisk))); \
$(call make_header, $$((size)), "RECOVERY", $@)
$(recovery_ramdisk).mtk: $(MKBOOTIMG) $(recovery_ramdisk).mtk.header
$(call pretty,"Adding MTK header to recovery ramdisk.")
cat $(recovery_ramdisk).mtk.header $(recovery_ramdisk) > $@
INTERNAL_MTK_RECOVERYIMAGE_ARGS := \
--kernel $(PRODUCT_OUT)/kernel \
--ramdisk $(recovery_ramdisk).mtk
$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) \
$(recovery_ramdisk).mtk $(PRODUCT_OUT)/kernel
@echo -e ${CL_CYN}"----- Making recovery image ------"${CL_RST}
$(MKBOOTIMG) $(INTERNAL_MTK_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}