Check dtb even if kernel is not available

By the flow of unpacking boot image of Chrome OS there will be no kernel file but an dtb image. In that case the dtb image won’t be added when repacking boot image.

Signed-off-by: Shaka Huang <shakalaca@gmail.com>
This commit is contained in:
Shaka Huang 2018-02-26 22:53:04 +08:00 committed by John Wu
parent 968e6237bd
commit 0b3192c4d5

View File

@ -320,13 +320,14 @@ void repack(const char* orig_image, const char* out_image) {
} else {
lheader(&boot, kernel_size, = restore(KERNEL_FILE, fd));
}
// dtb
if (access(DTB_FILE, R_OK) == 0) {
lheader(&boot, kernel_size, += restore(DTB_FILE, fd));
}
file_align();
}
// dtb
if (access(DTB_FILE, R_OK) == 0) {
lheader(&boot, kernel_size, += restore(DTB_FILE, fd));
}
file_align();
// ramdisk
ramdisk_off = lseek(fd, 0, SEEK_CUR);
if (boot.flags & MTK_RAMDISK) {