From 2d7549b79f2b32f33cec3a5b518cddfe9a63506b Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 9 Aug 2023 11:26:28 +0200 Subject: [PATCH] zramctl: add hint about supported algorithms It seems the current list of the algorithms is confusing for end-users, because it's inaccurate in many cases. Let's explain why the list cannot be "perfect". Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2203324 Signed-off-by: Karel Zak --- sys-utils/zramctl.8.adoc | 2 ++ sys-utils/zramctl.c | 1 + 2 files changed, 3 insertions(+) diff --git a/sys-utils/zramctl.8.adoc b/sys-utils/zramctl.8.adoc index 576701ed30..ef525a6333 100644 --- a/sys-utils/zramctl.8.adoc +++ b/sys-utils/zramctl.8.adoc @@ -40,6 +40,8 @@ Note that _zramdev_ node specified on command line has to already exist. The com *-a*, **--algorithm lzo**|**lz4**|**lz4hc**|**deflate**|**842**|**zstd**:: Set the compression algorithm to be used for compressing data in the zram device. ++ +The *list of supported algorithms could be inaccurate* as it depends on the current kernel configuration. A basic overview can be obtained by using the command "cat /sys/block/zram0/comp_algorithm"; however, please note that this list might also be incomplete. This is due to the fact that ZRAM utilizes the Crypto API, and if certain algorithms were built as modules, it becomes impossible to enumerate all of them. *-f*, *--find*:: Find the first unused zram device. If a *--size* argument is present, then initialize the device. diff --git a/sys-utils/zramctl.c b/sys-utils/zramctl.c index 0c321b8cc7..a84ce665bc 100644 --- a/sys-utils/zramctl.c +++ b/sys-utils/zramctl.c @@ -566,6 +566,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" specify algorithm, supported are:\n"), out); fputs(_(" lzo, lz4, lz4hc, deflate, 842 and zstd\n"), out); + fputs(_(" (List may be inaccurate, consult man page.)\n"), out); fputs(USAGE_COLUMNS, out); for (i = 0; i < ARRAY_SIZE(infos); i++) -- 2.47.2