Changes in boot/generic/src/payload.c [b169619:df7dc9e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/generic/src/payload.c
rb169619 rdf7dc9e 36 36 #include <gzip.h> 37 37 #include <stdbool.h> 38 #include <mem .h>38 #include <memstr.h> 39 39 #include <errno.h> 40 40 #include <str.h> … … 61 61 { 62 62 char *e = (char *) ext(s); 63 if ( (e != NULL) && (str_cmp(e, ".gz") == 0))63 if (e != NULL && str_cmp(e, ".gz") == 0) 64 64 *e = '\0'; 65 } 66 67 static bool isgzip(const char *s) 68 { 69 const char *e = ext(s); 70 return e != NULL && str_cmp(e, ".gz") == 0; 65 71 } 66 72 … … 76 82 { 77 83 const char *name; 84 const uint8_t *data; 78 85 size_t packed_size; 86 size_t unpacked_size; 79 87 80 88 if (!tar_info(*cstart, cend, &name, &packed_size)) 81 89 return false; 82 90 83 const uint8_t *data = *cstart + TAR_BLOCK_SIZE;91 data = *cstart + TAR_BLOCK_SIZE; 84 92 *cstart += TAR_BLOCK_SIZE + ALIGN_UP(packed_size, TAR_BLOCK_SIZE); 85 93 86 bool gz = gzip_check(data, packed_size); 87 size_t unpacked_size = gz ? gzip_size(data, packed_size) : packed_size; 94 bool gz = isgzip(name); 95 96 unpacked_size = gz ? gzip_size(data, packed_size) : packed_size; 88 97 89 98 /* Components must be page-aligned. */ … … 147 156 while (tar_info(start, payload_end, &name, &packed_size)) { 148 157 sz = ALIGN_UP(sz, PAGE_SIZE); 149 if ( gzip_check(start + TAR_BLOCK_SIZE, packed_size))158 if (isgzip(name)) 150 159 sz += gzip_size(start + TAR_BLOCK_SIZE, packed_size); 151 160 else
Note:
See TracChangeset
for help on using the changeset viewer.