summaryrefslogtreecommitdiffstats
path: root/libfdisk/src/sgi.c
diff options
context:
space:
mode:
authorKarel Zak2014-03-07 13:44:12 +0100
committerKarel Zak2014-03-11 11:35:15 +0100
commit7e241236fc00408e6f76d0e0560e0b89e74e140c (patch)
tree3919c1c40d7598b1e66a4f01efd8e2c7119530f5 /libfdisk/src/sgi.c
parentlibfdisk: don't count special whole-disk partitions (diff)
downloadkernel-qcow2-util-linux-7e241236fc00408e6f76d0e0560e0b89e74e140c.tar.gz
kernel-qcow2-util-linux-7e241236fc00408e6f76d0e0560e0b89e74e140c.tar.xz
kernel-qcow2-util-linux-7e241236fc00408e6f76d0e0560e0b89e74e140c.zip
libfdisk: (sgi) cleanup, add infor about whole-disk partition
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/sgi.c')
-rw-r--r--libfdisk/src/sgi.c46
1 files changed, 3 insertions, 43 deletions
diff --git a/libfdisk/src/sgi.c b/libfdisk/src/sgi.c
index 19daf3ad4..c782ef3fa 100644
--- a/libfdisk/src/sgi.c
+++ b/libfdisk/src/sgi.c
@@ -261,49 +261,6 @@ static int sgi_list_table(struct fdisk_context *cxt)
cxt->geom.cylinders, be16_to_cpu(sgiparam->pcylcount),
(int) sgiparam->sparecyl, be16_to_cpu(sgiparam->ilfact));
-#ifdef UNWANTED
- char *p;
- size_t i, used;
- struct tt *tb = NULL;
-
- /*
- * Volumes
- */
- tb = tt_new_table(TT_FL_FREEDATA);
- if (!tb)
- return -ENOMEM;
-
- tt_define_column(tb, _("#"), 3, TT_FL_RIGHT);
- tt_define_column(tb, _("Name"), 0.2, 0);
- tt_define_column(tb, _("Sector"), 2, TT_FL_RIGHT);
- tt_define_column(tb, _("Size"), 9, TT_FL_RIGHT);
-
- for (i = 0, used = 0; i < SGI_MAXVOLUMES; i++) {
- struct tt_line *ln;
- uint32_t start = be32_to_cpu(sgilabel->volume[i].block_num),
- len = be32_to_cpu(sgilabel->volume[i].num_bytes);
- if (!len)
- continue;
- ln = tt_add_line(tb, NULL);
- if (!ln)
- continue;
- if (asprintf(&p, "%zu:", i) > 0)
- tt_line_set_data(ln, 0, p); /* # */
- if (*sgilabel->volume[i].name)
- tt_line_set_data(ln, 1,
- strndup((char *) sgilabel->volume[i].name,
- sizeof(sgilabel->volume[i].name))); /* Name */
- if (asprintf(&p, "%ju", (uintmax_t) start) > 0)
- tt_line_set_data(ln, 2, p); /* Sector */
- if (asprintf(&p, "%ju", (uintmax_t) len) > 0)
- tt_line_set_data(ln, 3, p); /* Size */
- used++;
- }
-
- if (used)
- rc = fdisk_print_table(cxt, tb);
- tt_free_table(tb);
-#endif
fdisk_colon(cxt, _("Bootfile: %s"), sgilabel->boot_file);
return rc;
}
@@ -371,6 +328,9 @@ static int sgi_get_partition(struct fdisk_context *cxt, size_t n, struct fdisk_p
pa->start = start;
pa->end = start + len - (len ? 1 : 0);
+ if (pa->type && pa->type->type == SGI_TYPE_ENTIRE_DISK)
+ pa->wholedisk = 1;
+
pa->attrs = sgi_get_swappartition(cxt) == (int) n ? "swap" :
sgi_get_bootpartition(cxt) == (int) n ? "boot" : NULL;
if (pa->attrs)