summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"));