diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2011-02-26 15:44:03 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2011-02-26 15:44:03 +0000 |
commit | cad6ecb973c8f1cb86cc050879ccd6d47695ecc0 (patch) | |
tree | 0198bfa71b4ec6f2a490603bc48d1d41515004ec /usr.sbin/bsdinstall | |
parent | 5b16134320304358fdf7f5b37dc32e4703b65ce7 (diff) | |
download | FreeBSD-src-cad6ecb973c8f1cb86cc050879ccd6d47695ecc0.zip FreeBSD-src-cad6ecb973c8f1cb86cc050879ccd6d47695ecc0.tar.gz |
Show disk model numbers in partition wizard screen. Also, since da(4) disks
are probably more likely to be USB or Firewire these days than SCSI, just
call them and anyone unknown "Disk" instead of SCSI disk.
Diffstat (limited to 'usr.sbin/bsdinstall')
-rw-r--r-- | usr.sbin/bsdinstall/partedit/part_wizard.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/usr.sbin/bsdinstall/partedit/part_wizard.c b/usr.sbin/bsdinstall/partedit/part_wizard.c index 248e77c..6e255a4 100644 --- a/usr.sbin/bsdinstall/partedit/part_wizard.c +++ b/usr.sbin/bsdinstall/partedit/part_wizard.c @@ -89,7 +89,7 @@ boot_disk(struct gmesh *mesh) struct ggeom *gp; struct gprovider *pp; DIALOG_LISTITEM *disks = NULL; - const char *type; + const char *type, *desc; char diskdesc[512]; char *chosen; int i, err, selected, n = 0; @@ -104,15 +104,20 @@ boot_disk(struct gmesh *mesh) continue; LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { - type = NULL; - LIST_FOREACH(gc, &pp->lg_config, lg_config) + desc = type = NULL; + LIST_FOREACH(gc, &pp->lg_config, lg_config) { if (strcmp(gc->lg_name, "type") == 0) type = gc->lg_val; + if (strcmp(gc->lg_name, "descr") == 0) + desc = gc->lg_val; + } - /* Skip swap-backed md devices */ + /* Skip swap-backed md and WORM devices */ if (strcmp(classp->lg_name, "MD") == 0 && type != NULL && strcmp(type, "swap") == 0) continue; + if (strncmp(pp->lg_name, "cd", 2) == 0) + continue; disks = realloc(disks, (++n)*sizeof(disks[0])); disks[n-1].name = pp->lg_name; @@ -120,15 +125,15 @@ boot_disk(struct gmesh *mesh) "B", HN_AUTOSCALE, HN_DECIMAL); if (strncmp(pp->lg_name, "ad", 2) == 0) strcat(diskdesc, " ATA Hard Disk"); - else if (strncmp(pp->lg_name, "da", 2) == 0) - strcat(diskdesc, " SCSI Hard Disk"); else if (strncmp(pp->lg_name, "md", 2) == 0) strcat(diskdesc, " Memory Disk"); - else if (strncmp(pp->lg_name, "cd", 2) == 0) { - n--; - continue; - } else - strcat(diskdesc, " Hard Disk"); + else + strcat(diskdesc, " Disk"); + + if (desc != NULL) + snprintf(diskdesc, sizeof(diskdesc), + "%s <%s>", diskdesc, desc); + disks[n-1].text = strdup(diskdesc); disks[n-1].help = NULL; disks[n-1].state = 0; |