From: Karel Zak Date: Thu, 2 Jun 2016 12:41:08 +0000 (+0200) Subject: lsblk: improve support for nvme X-Git-Tag: v2.29-rc1~207 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d305170f0240feb804fa5075141751b5650e9c9;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 752783af1d..8e6e6c5acd 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: