]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsblk: improve support for nvme
authorKarel Zak <kzak@redhat.com>
Thu, 2 Jun 2016 12:41:08 +0000 (14:41 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 2 Jun 2016 12:41:08 +0000 (14:41 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/lsblk.c

index 752783af1d7cef6f566c708d058f105b201a70bc..8e6e6c5acd0ca58de3bb9f20210aa62009584230 100644 (file)
@@ -758,7 +758,9 @@ static char *get_transport(struct blkdev_cxt *cxt)
                else if (strstr(attr, "ata"))
                        trans = "ata";
                free(attr);
-       }
+
+       } else if (strncmp(cxt->name, "nvme", 4) == 0)
+               trans = "nvme";
 
        return trans ? xstrdup(trans) : NULL;
 }
@@ -1001,6 +1003,8 @@ static void set_scols_data(struct blkdev_cxt *cxt, int col, int id, struct libsc
                        get_udev_properties(cxt);
                        if (cxt->serial)
                                str = xstrdup(cxt->serial);
+                       else
+                               str = sysfs_strdup(&cxt->sysfs, "device/serial");
                }
                break;
        case COL_REV: