-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recovery will no longer require a custom vbmeta
- Loading branch information
1 parent
d26e94d
commit 616b15f
Showing
4 changed files
with
49 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,57 @@ | ||
MKBOOTIMG := device/samsung/a31/mkbootimg | ||
# Copyright (C) 2020 The LineageOS Project | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
FLASH_IMAGE_TARGET ?= $(PRODUCT_OUT)/recovery.tar | ||
LOCAL_PATH := $(call my-dir) | ||
|
||
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(BOOTIMAGE_EXTRA_DEPS) | ||
MKDTIMG := $(HOST_OUT_EXECUTABLES)/mkdtimg$(HOST_EXECUTABLE_SUFFIX) | ||
KERNEL_OUT := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ | ||
DTB_DIR := $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/dts/exynos | ||
DTB_CFG := $(COMMON_PATH)/kernel/exynos9610.cfg | ||
|
||
INSTALLED_DTBIMAGE_TARGET := $(PRODUCT_OUT)/dtb.img | ||
|
||
define build-dtbimage-target | ||
@echo "Building dtb.img" | ||
$(MKDTIMG) cfg_create $@ $(DTB_CFG) -d $(DTB_DIR) | ||
endef | ||
|
||
$(INSTALLED_DTBIMAGE_TARGET): $(INSTALLED_KERNEL_TARGET) $(MKDTIMG) | ||
$(build-dtbimage-target) | ||
|
||
.PHONY: dtbimage | ||
dtbimage: $(INSTALLED_DTBIMAGE_TARGET) | ||
|
||
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(AVBTOOL) $(INTERNAL_BOOTIMAGE_FILES) $(BOOTIMAGE_EXTRA_DEPS) $(INSTALLED_DTBIMAGE_TARGET) $(BOARD_AVB_BOOT_KEY_PATH) | ||
$(call pretty,"Target boot image: $@") | ||
$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@ | ||
$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --dtb $(INSTALLED_DTBIMAGE_TARGET) --output $@ | ||
$(hide) echo -n "SEANDROIDENFORCE" >> $@ | ||
$(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw) | ||
$(hide) $(AVBTOOL) add_hash_footer \ | ||
--image $@ \ | ||
--partition_size $(BOARD_BOOTIMAGE_PARTITION_SIZE) \ | ||
--partition_name boot $(INTERNAL_AVB_BOOT_SIGNING_ARGS) \ | ||
$(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS) | ||
@echo "Made boot image: $@" | ||
|
||
$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) $(recovery_ramdisk) $(recovery_kernel) $(RECOVERYIMAGE_EXTRA_DEPS) | ||
$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) $(AVBTOOL) $(recovery_ramdisk) $(recovery_kernel) $(RECOVERYIMAGE_EXTRA_DEPS) $(INSTALLED_DTBIMAGE_TARGET) $(BOARD_AVB_BOOT_KEY_PATH) $(BOARD_PREBUILT_DTBOIMAGE) | ||
@echo "----- Making recovery image ------" | ||
$(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@ | ||
@echo "----- Lying about SEAndroid state to Samsung bootloader ------" | ||
$(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --dtb $(INSTALLED_DTBIMAGE_TARGET) --output $@ | ||
$(hide) echo -n "SEANDROIDENFORCE" >> $@ | ||
@echo "Made recovery image: $@" | ||
$(hide) tar -C $(PRODUCT_OUT) -c recovery.img > $(FLASH_IMAGE_TARGET) | ||
@echo "Made flashable $(FLASH_IMAGE_TARGET): $@" | ||
$(hide) $(call assert-max-image-size,$@,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw) | ||
$(hide) $(AVBTOOL) add_hash_footer \ | ||
--image $@ \ | ||
--partition_size $(BOARD_RECOVERYIMAGE_PARTITION_SIZE) \ | ||
--partition_name recovery $(INTERNAL_AVB_RECOVERY_SIGNING_ARGS) \ | ||
$(BOARD_AVB_RECOVERY_ADD_HASH_FOOTER_ARGS) | ||
@echo "Made recovery image: $@" |