diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2011-02-19 14:49:49 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2011-02-19 14:49:49 +0000 |
commit | a9f4af7420d3fbea7aad9077d852ec6f3ef4429c (patch) | |
tree | daa5186f3e5b6f43db8477ae8fee445bec97fc69 | |
parent | d4c0c6675e49cad63379c70ad9009fee79ac872c (diff) | |
download | FreeBSD-src-a9f4af7420d3fbea7aad9077d852ec6f3ef4429c.zip FreeBSD-src-a9f4af7420d3fbea7aad9077d852ec6f3ef4429c.tar.gz |
The PC98 gpart module supports labels now.
-rw-r--r-- | usr.sbin/bsdinstall/partedit/gpart_ops.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/usr.sbin/bsdinstall/partedit/gpart_ops.c b/usr.sbin/bsdinstall/partedit/gpart_ops.c index f6fcc08..9626bf0 100644 --- a/usr.sbin/bsdinstall/partedit/gpart_ops.c +++ b/usr.sbin/bsdinstall/partedit/gpart_ops.c @@ -65,6 +65,19 @@ gpart_show_error(const char *title, const char *explanation, const char *errstr) dialog_msgbox(title, message, 0, 0, TRUE); } +static int +scheme_supports_labels(const char *scheme) +{ + if (strcmp(scheme, "APM") == 0) + return (1); + if (strcmp(scheme, "GPT") == 0) + return (1); + if (strcmp(scheme, "PC98") == 0) + return (1); + + return (0); +} + int gpart_partition(const char *lg_name, const char *scheme) { @@ -389,11 +402,7 @@ gpart_edit(struct gprovider *pp) } } - /* Labels only supported on GPT and APM */ - if (strcmp(scheme, "GPT") == 0 || strcmp(scheme, "APM") == 0) - nitems = 4; - else - nitems = 3; + nitems = scheme_supports_labels(scheme) ? 4 : 3; /* Edit editable parameters of a partition */ hadlabel = 0; @@ -738,11 +747,7 @@ gpart_create(struct gprovider *pp, char *default_type, char *default_size, if (strcmp(scheme, "MBR") == 0 || strcmp(scheme, "PC98") == 0) items[0].text = "freebsd"; - /* Labels only supported on GPT and APM */ - if (strcmp(scheme, "GPT") == 0 || strcmp(scheme, "APM") == 0) - nitems = 4; - else - nitems = 3; + nitems = scheme_supports_labels(scheme) ? 4 : 3; if (default_type != NULL) items[0].text = default_type; |