Lines Matching refs:label

246 	struct pxe_label *label;  in label_create()  local
248 label = malloc(sizeof(struct pxe_label)); in label_create()
250 if (!label) in label_create()
253 memset(label, 0, sizeof(struct pxe_label)); in label_create()
255 return label; in label_create()
266 static void label_destroy(struct pxe_label *label) in label_destroy() argument
268 if (label->name) in label_destroy()
269 free(label->name); in label_destroy()
271 if (label->kernel) in label_destroy()
272 free(label->kernel); in label_destroy()
274 if (label->config) in label_destroy()
275 free(label->config); in label_destroy()
277 if (label->append) in label_destroy()
278 free(label->append); in label_destroy()
280 if (label->initrd) in label_destroy()
281 free(label->initrd); in label_destroy()
283 if (label->fdt) in label_destroy()
284 free(label->fdt); in label_destroy()
286 if (label->fdtdir) in label_destroy()
287 free(label->fdtdir); in label_destroy()
289 if (label->fdtoverlays) in label_destroy()
290 free(label->fdtoverlays); in label_destroy()
292 free(label); in label_destroy()
303 struct pxe_label *label = data; in label_print() local
304 const char *c = label->menu ? label->menu : label->name; in label_print()
306 printf("%s:\t%s\n", label->num, c); in label_print()
318 static int label_localboot(struct pxe_label *label) in label_localboot() argument
327 if (label->append) { in label_localboot()
330 cli_simple_process_macros(label->append, bootargs, in label_localboot()
344 static void label_boot_fdtoverlay(struct cmd_tbl *cmdtp, struct pxe_label *label) in label_boot_fdtoverlay() argument
346 char *fdtoverlay = label->fdtoverlays; in label_boot_fdtoverlay()
441 static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label) in label_boot() argument
453 label_print(label); in label_boot()
455 label->attempted = 1; in label_boot()
457 if (label->localboot) { in label_boot()
458 if (label->localboot_val >= 0) in label_boot()
459 label_localboot(label); in label_boot()
463 if (!label->kernel) { in label_boot()
465 label->name); in label_boot()
469 if (label->initrd) { in label_boot()
470 if (get_relfile_envaddr(cmdtp, label->initrd, "ramdisk_addr_r") < 0) { in label_boot()
472 label->name); in label_boot()
483 if (get_relfile_envaddr(cmdtp, label->kernel, "kernel_addr_r") < 0) { in label_boot()
485 label->name); in label_boot()
489 if (label->ipappend & 0x1) { in label_boot()
496 if (label->ipappend & 0x2) { in label_boot()
506 if ((label->ipappend & 0x3) || label->append) { in label_boot()
510 if (strlen(label->append ?: "") + in label_boot()
513 strlen(label->append ?: ""), in label_boot()
519 if (label->append) in label_boot()
520 strncpy(bootargs, label->append, sizeof(bootargs)); in label_boot()
533 if (label->config) { in label_boot()
534 int len = strlen(bootm_argv[1]) + strlen(label->config) + 1; in label_boot()
541 snprintf(fit_addr, len, "%s%s", bootm_argv[1], label->config); in label_boot()
568 if (label->fdt) { in label_boot()
569 fdtfile = label->fdt; in label_boot()
570 } else if (label->fdtdir) { in label_boot()
592 len = strlen(label->fdtdir); in label_boot()
595 else if (label->fdtdir[len - 1] != '/') in label_boot()
600 len = strlen(label->fdtdir) + strlen(slash) + in label_boot()
610 label->fdtdir, slash, f1, f2, f3, f4); in label_boot()
622 if (label->fdt) { in label_boot()
624 label->name); in label_boot()
630 if (label->fdtoverlays) in label_boot()
631 label_boot_fdtoverlay(cmdtp, label); in label_boot()
1027 struct pxe_label *label) in parse_label_menu() argument
1039 cfg->default_label = strdup(label->name); in parse_label_menu()
1046 parse_sliteral(c, &label->menu); in parse_label_menu()
1062 static int parse_label_kernel(char **c, struct pxe_label *label) in parse_label_kernel() argument
1067 err = parse_sliteral(c, &label->kernel); in parse_label_kernel()
1071 s = strstr(label->kernel, "#"); in parse_label_kernel()
1075 label->config = malloc(strlen(s) + 1); in parse_label_kernel()
1076 if (!label->config) in parse_label_kernel()
1079 strcpy(label->config, s); in parse_label_kernel()
1098 struct pxe_label *label; in parse_label() local
1101 label = label_create(); in parse_label()
1102 if (!label) in parse_label()
1105 err = parse_sliteral(c, &label->name); in parse_label()
1108 label_destroy(label); in parse_label()
1112 list_add_tail(&label->list, &cfg->labels); in parse_label()
1121 err = parse_label_menu(c, cfg, label); in parse_label()
1126 err = parse_label_kernel(c, label); in parse_label()
1130 err = parse_sliteral(c, &label->append); in parse_label()
1131 if (label->initrd) in parse_label()
1133 s = strstr(label->append, "initrd="); in parse_label()
1138 label->initrd = malloc(len + 1); in parse_label()
1139 strncpy(label->initrd, s, len); in parse_label()
1140 label->initrd[len] = '\0'; in parse_label()
1145 if (!label->initrd) in parse_label()
1146 err = parse_sliteral(c, &label->initrd); in parse_label()
1150 if (!label->fdt) in parse_label()
1151 err = parse_sliteral(c, &label->fdt); in parse_label()
1155 if (!label->fdtdir) in parse_label()
1156 err = parse_sliteral(c, &label->fdtdir); in parse_label()
1160 if (!label->fdtoverlays) in parse_label()
1161 err = parse_sliteral(c, &label->fdtoverlays); in parse_label()
1165 label->localboot = 1; in parse_label()
1166 err = parse_integer(c, &label->localboot_val); in parse_label()
1170 err = parse_integer(c, &label->ipappend); in parse_label()
1287 struct pxe_label *label; in destroy_pxe_menu() local
1296 label = list_entry(pos, struct pxe_label, list); in destroy_pxe_menu()
1298 label_destroy(label); in destroy_pxe_menu()
1346 struct pxe_label *label; in pxe_menu_to_menu() local
1363 label = list_entry(pos, struct pxe_label, list); in pxe_menu_to_menu()
1365 sprintf(label->num, "%d", i++); in pxe_menu_to_menu()
1366 if (menu_item_add(m, label->num, label) != 1) { in pxe_menu_to_menu()
1371 (strcmp(label->name, cfg->default_label) == 0)) in pxe_menu_to_menu()
1372 default_num = label->num; in pxe_menu_to_menu()
1400 struct pxe_label *label; in boot_unattempted_labels() local
1403 label = list_entry(pos, struct pxe_label, list); in boot_unattempted_labels()
1405 if (!label->attempted) in boot_unattempted_labels()
1406 label_boot(cmdtp, label); in boot_unattempted_labels()