diff options
| author | Karel Zak <kzak@redhat.com> | 2023-01-02 13:04:38 +0100 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2023-01-02 13:04:38 +0100 |
| commit | 71a56541832b5e574d690819545cae67479e04c0 (patch) | |
| tree | 4ae884bc03b4f5911ddfdd72ef889a4510b4e852 /misc-utils/lsblk.c | |
| parent | dd501125f31adb3747ca9f55eca2581b00d7329b (diff) | |
| parent | 67b8731fa6073f063e75b230e8f532b8eec455e3 (diff) | |
| download | util-linux-71a56541832b5e574d690819545cae67479e04c0.tar.gz | |
Merge branch 'lsblk-nvme' of https://github.com/mbroz/util-linux
* 'lsblk-nvme' of https://github.com/mbroz/util-linux:
Update email.
lsblk: add revision output to --nvme list
lsblk: read firmware revision from udev
Diffstat (limited to 'misc-utils/lsblk.c')
| -rw-r--r-- | misc-utils/lsblk.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c index 96a94f73c5..cbe307a74b 100644 --- a/misc-utils/lsblk.c +++ b/misc-utils/lsblk.c @@ -2,7 +2,7 @@ * lsblk(8) - list block devices * * Copyright (C) 2010-2018 Red Hat, Inc. All rights reserved. - * Written by Milan Broz <mbroz@redhat.com> + * Written by Milan Broz <gmazyland@gmail.com> * Karel Zak <kzak@redhat.com> * * This program is free software; you can redistribute it and/or modify @@ -1015,8 +1015,13 @@ static char *device_get_data( } break; case COL_REV: - if (!device_is_partition(dev) && dev->nslaves == 0) - ul_path_read_string(dev->sysfs, &str, "device/rev"); + if (!device_is_partition(dev) && dev->nslaves == 0) { + prop = lsblk_device_get_properties(dev); + if (prop && prop->revision) + str = xstrdup(prop->revision); + else + ul_path_read_string(dev->sysfs, &str, "device/rev"); + } break; case COL_VENDOR: if (!device_is_partition(dev) && dev->nslaves == 0) @@ -2240,6 +2245,7 @@ int main(int argc, char *argv[]) add_uniq_column(COL_TYPE); add_uniq_column(COL_MODEL); add_uniq_column(COL_SERIAL); + add_uniq_column(COL_REV); add_uniq_column(COL_TRANSPORT); add_uniq_column(COL_RQ_SIZE); add_uniq_column(COL_MQ); |
