1 # Copyright (C) 2017 The LineageOS Project
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 LOCAL_PATH
:= $(call my-dir
)
17 ifeq ($(strip $(BOARD_KERNEL_SEPARATED_DT
)),true
)
18 ifneq ($(strip $(BOARD_KERNEL_PREBUILT_DT
)),true
)
19 ifeq ($(strip $(BUILD_TINY_ANDROID
)),true
)
20 include system
/tools
/dtbtool
/Android.mk
23 ifeq ($(strip $(TARGET_CUSTOM_DTBTOOL
)),)
24 DTBTOOL_NAME
:= dtbToolLineage
26 DTBTOOL_NAME
:= $(TARGET_CUSTOM_DTBTOOL
)
29 DTBTOOL
:= $(HOST_OUT_EXECUTABLES
)/$(DTBTOOL_NAME
)$(HOST_EXECUTABLE_SUFFIX
)
31 INSTALLED_DTIMAGE_TARGET
:= $(PRODUCT_OUT
)/dt.img
33 ifeq ($(strip $(TARGET_CUSTOM_DTBTOOL
)),)
34 # dtbToolCM will search subdirectories
35 possible_dtb_dirs
= $(KERNEL_OUT
)/arch
/$(KERNEL_ARCH
)/boot
/
37 # Most specific paths must come first in possible_dtb_dirs
38 possible_dtb_dirs
= $(KERNEL_OUT
)/arch
/$(KERNEL_ARCH
)/boot
/dts
/exynos
/ $(KERNEL_OUT
)/arch
/$(KERNEL_ARCH
)/boot
/dts
/ $(KERNEL_OUT
)/arch
/$(KERNEL_ARCH
)/boot
/
41 define build-dtimage-target
42 $(call pretty
,"Target dt image: $@")
43 $(hide
) for
dir in
$(possible_dtb_dirs
); do \
44 if
[ -d
"$$dir" ]; then \
49 $(DTBTOOL
) $(BOARD_DTBTOOL_ARGS
) -o
$@
-s
$(BOARD_KERNEL_PAGESIZE
) -p
$(KERNEL_OUT
)/scripts
/dtc
/ "$$dtb_dir";
53 $(INSTALLED_DTIMAGE_TARGET
): $(DTBTOOL
) $(INSTALLED_KERNEL_TARGET
)
54 $(build-dtimage-target
)
55 @echo
"Made DT image: $@"
58 dtimage
: $(INSTALLED_DTIMAGE_TARGET
)
63 ifeq ($(strip $(TARGET_NEEDS_LOKI
)),true
)
64 LOKI_TOOL
:= loki_tool
67 TARGET_LOKI_ABOOT_IMAGE
:=
70 $(INSTALLED_BOOTIMAGE_TARGET
): $(MKBOOTIMG
) $(INTERNAL_BOOTIMAGE_FILES
) $(BOOTIMAGE_EXTRA_DEPS
)
71 $(call pretty
,"Target boot image: $@")
72 $(hide
) $(MKBOOTIMG
) $(INTERNAL_BOOTIMAGE_ARGS
) $(INTERNAL_MKBOOTIMG_VERSION_ARGS
) $(BOARD_MKBOOTIMG_ARGS
) --output
$@
73 $(hide
) echo
-n
"SEANDROIDENFORCE" >> $@
74 $(hide
) $(LOKI_TOOL
) patch boot
$(TARGET_LOKI_ABOOT_IMAGE
) $@
$@.lok
75 $(hide
) cp
$@.lok
$@ || true
76 $(hide
) $(call assert-max-image-size
,$@
,$(BOARD_BOOTIMAGE_PARTITION_SIZE
),raw
)
77 @echo
"Made boot image: $@"
79 $(INSTALLED_RECOVERYIMAGE_TARGET
): $(MKBOOTIMG
) $(recovery_ramdisk
) $(recovery_kernel
) $(RECOVERYIMAGE_EXTRA_DEPS
)
80 @echo
"----- Making recovery image ------"
81 $(hide
) $(MKBOOTIMG
) $(INTERNAL_RECOVERYIMAGE_ARGS
) $(INTERNAL_MKBOOTIMG_VERSION_ARGS
) $(BOARD_MKBOOTIMG_ARGS
) --output
$@
--id
> $(RECOVERYIMAGE_ID_FILE
)
82 $(hide
) echo
-n
"SEANDROIDENFORCE" >> $@
83 $(hide
) $(LOKI_TOOL
) patch recovery
$(TARGET_LOKI_ABOOT_IMAGE
) $@
$@.lok
84 $(hide
) cp
$@.lok
$@ || true
85 $(hide
) $(call assert-max-image-size
,$@
,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE
),raw
)
86 @echo
"Made recovery image: $@"