summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2022-04-03 13:33:44 +0300
committerToomas Soome <tsoome@me.com>2022-05-11 19:15:34 +0300
commitdcc43656b5993828b48fbae35b5de53b9f05004e (patch)
tree1cd8ca67f06d4389cf73fbc41dd201121e50e0b4 /usr
parent2c65701281156d8db8fa6f6f9c5faa6ca021c621 (diff)
downloadillumos-joyent-dcc43656b5993828b48fbae35b5de53b9f05004e.tar.gz
14614 format: should recognize new nvme disk
Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Approved by: Dan McDonald <danmcd@mnx.io>
Diffstat (limited to 'usr')
-rw-r--r--usr/src/cmd/format/auto_sense.c14
-rw-r--r--usr/src/cmd/format/init_ci386.c4
-rw-r--r--usr/src/cmd/format/startup.c9
3 files changed, 20 insertions, 7 deletions
diff --git a/usr/src/cmd/format/auto_sense.c b/usr/src/cmd/format/auto_sense.c
index 709cde540f..19874145e4 100644
--- a/usr/src/cmd/format/auto_sense.c
+++ b/usr/src/cmd/format/auto_sense.c
@@ -250,6 +250,7 @@ auto_efi_sense(int fd, struct efi_info *label)
struct dk_cinfo dkinfo;
struct partition_info *part;
uint64_t reserved;
+ uint16_t type;
if (ioctl(fd, DKIOCINFO, &dkinfo) == -1) {
if (option_msg && diag_msg) {
@@ -257,11 +258,14 @@ auto_efi_sense(int fd, struct efi_info *label)
}
return (NULL);
}
- if ((cur_ctype != NULL) && (cur_ctype->ctype_ctype == DKC_DIRECT ||
- cur_ctype->ctype_ctype == DKC_VBD ||
- cur_ctype->ctype_ctype == DKC_BLKDEV)) {
- ctlr = find_ctlr_info(&dkinfo, cur_ctype->ctype_ctype);
- disk_info = find_disk_info(&dkinfo, cur_ctype->ctype_ctype);
+ if (cur_ctype != NULL)
+ type = cur_ctype->ctype_ctype;
+ else
+ type = dkinfo.dki_ctype;
+
+ if (type == DKC_DIRECT || type == DKC_VBD || type == DKC_BLKDEV) {
+ ctlr = find_ctlr_info(&dkinfo, type);
+ disk_info = find_disk_info(&dkinfo, type);
} else {
ctlr = find_scsi_ctlr_info(&dkinfo);
disk_info = find_scsi_disk_info(&dkinfo);
diff --git a/usr/src/cmd/format/init_ci386.c b/usr/src/cmd/format/init_ci386.c
index 9463cec72f..9d498d64e8 100644
--- a/usr/src/cmd/format/init_ci386.c
+++ b/usr/src/cmd/format/init_ci386.c
@@ -61,6 +61,10 @@ struct ctlr_type ctlr_types[] = {
&genericops,
CF_NOWLIST },
+ { DKC_BLKDEV,
+ "generic-block-device",
+ &genericops,
+ CF_NOWLIST }
};
/*
diff --git a/usr/src/cmd/format/startup.c b/usr/src/cmd/format/startup.c
index d01fb18b71..87b9e86cc5 100644
--- a/usr/src/cmd/format/startup.c
+++ b/usr/src/cmd/format/startup.c
@@ -1920,7 +1920,9 @@ add_device_to_disklist(char *devname, char *devpath)
* Configuration.
*/
ctlr = search_ctlr->ctlr_ctype;
- if ((status == -1) && (ctlr->ctype_ctype == DKC_SCSI_CCS)) {
+ if ((status == -1) &&
+ (ctlr->ctype_ctype == DKC_SCSI_CCS ||
+ ctlr->ctype_ctype == DKC_BLKDEV)) {
if (option_msg && diag_msg) {
err_print("%s: attempting auto configuration\n",
search_disk->disk_name);
@@ -1937,8 +1939,10 @@ add_device_to_disklist(char *devname, char *devpath)
status = 0;
search_disk->disk_flags |=
(DSK_LABEL_DIRTY | DSK_AUTO_CONFIG);
+ break;
}
- break;
+ /* With SOLARIS label type failed, try EFI. */
+ /* FALLTHROUGH */
case (L_TYPE_EFI):
efi_disk = auto_efi_sense(search_file, &efi_info);
if (efi_disk != NULL) {
@@ -1946,6 +1950,7 @@ add_device_to_disklist(char *devname, char *devpath)
* Auto config worked, so we now have
* a valid label for the disk.
*/
+ search_disk->label_type = L_TYPE_EFI;
status = 0;
search_disk->disk_flags |=
(DSK_LABEL_DIRTY | DSK_AUTO_CONFIG);