From: Karel Zak Date: Thu, 2 Jun 2016 12:41:08 +0000 (+0200) Subject: lsblk: improve support for nvme X-Git-Tag: v2.28.1~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c39556aa7767bde12e6ff723278a83384f25c86d;p=thirdparty%2Futil-linux.git lsblk: improve support for nvme Signed-off-by: Karel Zak --- diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c index 5b239f183f..1e9d9b00e3 100644 --- a/misc-utils/lsblk.c +++ b/misc-utils/lsblk.c @@ -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: