Lines Matching refs:part

240 	struct part *part;  in parse_part()  local
250 part = calloc(1, sizeof(struct part)); in parse_part()
251 if (part == NULL) in parse_part()
264 part->alias = malloc(len); in parse_part()
265 if (part->alias == NULL) { in parse_part()
269 strlcpy(part->alias, spec, len); in parse_part()
274 part->kind = PART_KIND_SIZE; in parse_part()
277 part->kind = PART_KIND_FILE; in parse_part()
280 part->kind = PART_KIND_PIPE; in parse_part()
288 part->contents = strdup(spec); in parse_part()
289 if (part->contents == NULL) { in parse_part()
294 spec = part->alias; in parse_part()
298 if (strlen(part->alias) == 0 || strlen(sep) == 0) { in parse_part()
302 part->label = strdup(sep); in parse_part()
303 if (part->label == NULL) { in parse_part()
309 part->index = nparts; in parse_part()
310 TAILQ_INSERT_TAIL(&partlist, part, link); in parse_part()
315 if (part->alias != NULL) in parse_part()
316 free(part->alias); in parse_part()
317 free(part); in parse_part()
403 struct part *part, *part2; in mkimg_validate() local
409 TAILQ_FOREACH(part, &partlist, link) { in mkimg_validate()
410 start = part->block; in mkimg_validate()
411 end = part->block + part->size; in mkimg_validate()
413 part2 = TAILQ_NEXT(part, link); in mkimg_validate()
438 struct part *part; in mkimg() local
446 TAILQ_FOREACH(part, &partlist, link) { in mkimg()
447 error = scheme_check_part(part); in mkimg()
449 errc(EX_DATAERR, error, "partition %d", part->index+1); in mkimg()
454 TAILQ_FOREACH(part, &partlist, link) { in mkimg()
459 switch (part->kind) { in mkimg()
462 offset = part->contents; in mkimg()
464 if (part->kind == PART_KIND_SIZE && in mkimg()
486 part->block = block; in mkimg()
490 "... ", part->index + 1, (long long)part->block); in mkimg()
493 switch (part->kind) { in mkimg()
495 fd = open(part->contents, O_RDONLY, 0); in mkimg()
503 fp = popen(part->contents, "r"); in mkimg()
513 errc(EX_IOERR, error, "partition %d", part->index + 1); in mkimg()
514 part->size = (bytesize + secsz - 1) / secsz; in mkimg()
516 bytesize = part->size * secsz; in mkimg()
518 (long long)bytesize, (long long)part->size); in mkimg()
532 part->block + part->size); in mkimg()