[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#994066: flash-kernel: kernel size check doesn't take appended device tree into account



Package: flash-kernel
Version: 3.104
Severity: normal

Hello,

when the active machine entry has an "Mtd-Kernel" field, flash-kernel
checks if the kernel fits into the specified mtd partition. However if
the machine entry also has "DTB-Append: yes" the image written to said
partition is a combination of kernel and dtb, and so the check must
include the dtb's size, too.

Here is an untested patch:

diff --git a/functions b/functions
index 260be2ba2b3d..d5fd0f714300 100644
--- a/functions
+++ b/functions
@@ -842,6 +842,12 @@ if [ -n "$dtb_append_from" ]; then
     fi
 fi
 
+if [ "$dtb_append" = "yes" ]; then
+	dtb=$(find_dtb_file)
+	dfilesize=$(stat -c '%s' "$dtb")
+	kfilesize=$(($kfilesize + $dfilesize))
+fi
+
 if [ -n "$mtd_kernel" ] || [ -n "$mtd_initrd" ]; then
 	if [ ! -e "$PROC_MTD" ]; then
 		error "$PROC_MTD doesn't exist"

Best regards
Uwe


Reply to: