diff options
author | Milan Broz | 2012-08-17 20:25:26 +0200 |
---|---|---|
committer | Karel Zak | 2012-09-04 17:21:53 +0200 |
commit | 12b06c3dfcc74fd843975b9cb70aaa3c7951d8e7 (patch) | |
tree | 2dcf748da2a04253af376223c5cd918118495686 /misc-utils/lsblk.c | |
parent | runuser: add note about PAM to man page (diff) | |
download | kernel-qcow2-util-linux-12b06c3dfcc74fd843975b9cb70aaa3c7951d8e7.tar.gz kernel-qcow2-util-linux-12b06c3dfcc74fd843975b9cb70aaa3c7951d8e7.tar.xz kernel-qcow2-util-linux-12b06c3dfcc74fd843975b9cb70aaa3c7951d8e7.zip |
lsblk: add add_random columns
Allow printing of queue/add_random attribute which describes
if device adds randomness to kernel RNG pool.
Signed-off-by: Milan Broz <mbroz@redhat.com>
Diffstat (limited to 'misc-utils/lsblk.c')
-rw-r--r-- | misc-utils/lsblk.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c index 2410de4cf..3a980db3a 100644 --- a/misc-utils/lsblk.c +++ b/misc-utils/lsblk.c @@ -96,6 +96,7 @@ enum { COL_DMAX, COL_DZERO, COL_WWN, + COL_RAND, }; /* column names */ @@ -123,6 +124,7 @@ static struct colinfo infos[] = { [COL_RO] = { "RO", 1, TT_FL_RIGHT, N_("read-only device") }, [COL_RM] = { "RM", 1, TT_FL_RIGHT, N_("removable device") }, [COL_ROTA] = { "ROTA", 1, TT_FL_RIGHT, N_("rotational device") }, + [COL_RAND] = { "RAND", 1, TT_FL_RIGHT, N_("adds randomness") }, [COL_MODEL] = { "MODEL", 0.1, TT_FL_TRUNC, N_("device identifier") }, [COL_SIZE] = { "SIZE", 5, TT_FL_RIGHT, N_("size of the device") }, [COL_STATE] = { "STATE", 7, TT_FL_TRUNC, N_("state of the device") }, @@ -690,6 +692,11 @@ static void set_tt_data(struct blkdev_cxt *cxt, int col, int id, struct tt_line if (p) tt_line_set_data(ln, col, p); break; + case COL_RAND: + p = sysfs_strdup(&cxt->sysfs, "queue/add_random"); + if (p) + tt_line_set_data(ln, col, p); + break; case COL_MODEL: if (!cxt->partition && cxt->nslaves == 0) { p = sysfs_strdup(&cxt->sysfs, "device/model"); |