The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / fis / 0004-sorted_list.patch
diff --git a/cirros-testvm/src-cirros/buildroot-2015.05/package/fis/0004-sorted_list.patch b/cirros-testvm/src-cirros/buildroot-2015.05/package/fis/0004-sorted_list.patch
new file mode 100644 (file)
index 0000000..6854977
--- /dev/null
@@ -0,0 +1,30 @@
+--- fis.orig/fis.c     2010-05-12 11:09:22.000000000 -0700
++++ fis/fis.c  2010-05-12 11:05:45.000000000 -0700
+@@ -401,9 +401,24 @@
+   dir_t dir;
+   load_dir(fd,offset,&size,swap_endianness,&dir);
+   fprintf(stdout,"Name              FLASH addr  Mem addr    Length      Entry point Checksum\n");
+-  FOR_EACH_DIR_ENTRY(dir,i) {
+-    dump_desc(stdout,get(i));
+-  }
++  uint32_t last_addr = 0;
++  bool image_found;
++  do {
++    uint32_t lowest_addr = 0xffffffff;
++    iter_t index;
++    image_found = false;
++    FOR_EACH_DIR_ENTRY(dir,i) {
++      const struct fis_image_desc *d = get(i);
++      if ((d->flash_base >= last_addr) && (d->flash_base < lowest_addr)) {
++        lowest_addr = d->flash_base;
++        image_found = true;
++        index = i;
++      }
++    }
++    if (image_found)
++      dump_desc(stdout,get(index));
++    last_addr = lowest_addr + 1;
++  } while (image_found == true);
+ }