summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-02-16 01:58:08 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-02-17 22:57:09 +0400
commit1a3c909a5fdd5eaa13ccf60086f3373d04e30a33 (patch)
treee80f8ddeaf04bea978d0d7c5a649ac9100771ac8
parent38ae67bdcca49b174b4629bab7c2ed26a6c400bf (diff)
downloadutil-linux-1a3c909a5fdd5eaa13ccf60086f3373d04e30a33.tar.gz
cfdisk: support for illumos disks (/dev/rdsk/c0t0d0p0)HEADmaster
-rw-r--r--fdisks/cfdisk.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/fdisks/cfdisk.c b/fdisks/cfdisk.c
index 1a95c1e0..cdd56f06 100644
--- a/fdisks/cfdisk.c
+++ b/fdisks/cfdisk.c
@@ -120,6 +120,9 @@ static struct systypes i386_sys_types[] = {
#elif defined(__FreeBSD__)
#define DEFAULT_DEVICE "/dev/ad0"
#define ALTERNATE_DEVICE "/dev/da0"
+#elif defined(__sun__)
+#define DEFAULT_DEVICE "/dev/rdsk/c0d0p0"
+#define ALTERNATE_DEVICE "/dev/rdsk/c0t0d0p0"
#else
#define DEFAULT_DEVICE "/dev/hda"
#define ALTERNATE_DEVICE "/dev/sda"
@@ -2391,11 +2394,21 @@ draw_partition(int i) {
if (p_info[i].id > 0) {
char *dbn = my_basename(disk_device);
int l = strlen(dbn);
+#ifdef __sun__
+ /*
+ * XXX: Whole disk is c0t0d0p0, but patitions are c0t0d0p1, c0t0d0p2, etc.
+ * disk_device (and dbn) could be read-only, so we just overwrite the last 0
+ * on the screen
+ */
+ mvprintw(y, NAME_START, "%s", dbn);
+ mvprintw(y, NAME_START+l-1, "%d", p_info[i].num+1);
+#else
int digit_last = isdigit(dbn[l-1]);
mvprintw(y, NAME_START,
"%s%s%d", dbn, (digit_last ? "p" : ""),
p_info[i].num+1);
+#endif
if (p_info[i].flags) {
if (p_info[i].flags == ACTIVE_FLAG)
mvaddstr(y, FLAGS_START, _("Boot"));