dtbhtool: Print better warnings for PLATFORM/SUBTYPE mismatch
authorChristopher N. Hesse <raymanfx@gmail.com>
Mon, 29 Jan 2018 21:47:52 +0000 (22:47 +0100)
committerChristopher N. Hesse <raymanfx@gmail.com>
Mon, 5 Feb 2018 14:04:17 +0000 (14:04 +0000)
Change-Id: I486239d47255d5a5347e7b8ac7348afb8bc5bddb
(cherry picked from commit 8f74f0a7e9839d4f6f499aecdcc6c042ca4671a0)

dtbhtool/dtbimg.c

index a85c9016a22d664fe4acc8a336e1f63ffedf6e39..744222fe0c14a77f580d6400d5e3f432621dc2ac 100644 (file)
@@ -170,14 +170,16 @@ void *load_dtbh_block(const char *dtb_path, unsigned pagesize, unsigned *_sz)
 
         prop_platform = fdt_getprop(dtb, offset, "model_info-platform", &len);
         if (strcmp((char *)&prop_platform[0], DTBH_PLATFORM)) {
-            warnx("model_info-platform of %s is invalid, skipping", fname);
+            warnx("model_info-platform of %s is invalid, skipping (expected %s but got %s)",
+                  fname, DTBH_PLATFORM, (char *)&prop_platform[0]);
             free(dtb);
             continue;
         }
 
         prop_subtype = fdt_getprop(dtb, offset, "model_info-subtype", &len);
         if (strcmp((char *)&prop_subtype[0], DTBH_SUBTYPE)) {
-            warnx("model_info-subtype of %s is invalid, skipping", fname);
+            warnx("model_info-subtype of %s is invalid, skipping (expected %s but got %s)",
+                  fname, DTBH_SUBTYPE, (char *)&prop_subtype[0]);
             free(dtb);
             continue;
         }