BSD is nested within DOS partition, so for disk without any partition
table it does not make any sense to offer BSD label.
Signed-off-by: Karel Zak <kzak@redhat.com>
nitems = fdisk_context_get_nlabels(cf->cxt);
cm = xcalloc(nitems + 1, sizeof(struct cfdisk_menuitem));
- for (i = 0; i < nitems; i++) {
- if (fdisk_context_next_label(cf->cxt, &lb))
- break;
- cm[i].name = lb->name;
+ while (fdisk_context_next_label(cf->cxt, &lb) == 0) {
+ if (fdisk_label_is_disabled(lb) || strcmp(lb->name, "bsd") == 0)
+ continue;
+ cm[i++].name = lb->name;
}
erase();