From c39556aa7767bde12e6ff723278a83384f25c86d Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 2 Jun 2016 14:41:08 +0200 Subject: [PATCH] lsblk: improve support for nvme Signed-off-by: Karel Zak --- misc-utils/lsblk.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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: -- 2.47.2