All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: linux-erofs@lists.ozlabs.org
Cc: Gao Xiang <hsiangkao@linux.alibaba.com>
Subject: [PATCH] erofs-utils: add missing help for multiple algorithms
Date: Sat, 11 Mar 2023 12:12:45 +0800	[thread overview]
Message-ID: <20230311041245.27006-1-hsiangkao@linux.alibaba.com> (raw)

Users can try this with the detailed instructions.

Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 docs/compress-hints.example |  7 +++++++
 man/mkfs.erofs.1            | 13 ++++++++-----
 mkfs/main.c                 |  3 ++-
 3 files changed, 17 insertions(+), 6 deletions(-)
 create mode 100644 docs/compress-hints.example

diff --git a/docs/compress-hints.example b/docs/compress-hints.example
new file mode 100644
index 0000000..4f481ff
--- /dev/null
+++ b/docs/compress-hints.example
@@ -0,0 +1,7 @@
+# https://github.com/debuerreotype/docker-debian-artifacts/blob/dist-amd64/bullseye/rootfs.tar.xz?raw=true
+# -zlzma:lz4hc,12:lzma,109 -C131072 --compress-hints=compress-hints.example  image size: 66M
+# -zlz4hc,12                                                                 image size: 76M
+4096     1 .*\.so.*$
+4096     1 bin/
+4096     1 sbin/
+131072   2 etc/
diff --git a/man/mkfs.erofs.1 b/man/mkfs.erofs.1
index e237877..82ef138 100644
--- a/man/mkfs.erofs.1
+++ b/man/mkfs.erofs.1
@@ -20,10 +20,11 @@ mkfs.erofs is used to create such EROFS filesystem \fIDESTINATION\fR image file
 from \fISOURCE\fR directory.
 .SH OPTIONS
 .TP
-.BI "\-z " compression-algorithm " [" ",#" "]"
-Set an algorithm for file compression, which can be set with an optional
+.BI "\-z " compression-algorithm " [" ",#" "]" " [:" " ... " "]"
+Set a primary algorithm for data compression, which can be set with an optional
 compression level (1 to 12 for LZ4HC, 0 to 9 for LZMA and 100 to 109 for LZMA
-extreme compression) separated by a comma.
+extreme compression) separated by a comma.  Alternative algorithms could be
+specified and separated by colons.
 .TP
 .BI "\-C " max-pcluster-size
 Specify the maximum size of compress physical cluster in bytes. It may enable
@@ -112,9 +113,11 @@ If the optional
 argument is given,
 .B mkfs.erofs
 uses it to apply the per-file compression strategy. Each line is defined by
-tokens separated by spaces in the following form:
+tokens separated by spaces in the following form.  Optionally, instead of
+the given primary algorithm, alternative algorithms could be specified with
+\fIalgorithm-index\fR by hand:
 .RS 1.2i
-<pcluster-in-bytes> <match-pattern>
+<pcluster-in-bytes> [algorithm-index] <match-pattern>
 .RE
 .TP
 .BI "\-\-exclude-path=" path
diff --git a/mkfs/main.c b/mkfs/main.c
index a3b0c34..94f51df 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -84,7 +84,8 @@ static void usage(void)
 	      "Generate erofs image from DIRECTORY to FILE, and [options] are:\n"
 	      " -d#                   set output message level to # (maximum 9)\n"
 	      " -x#                   set xattr tolerance to # (< 0, disable xattrs; default 2)\n"
-	      " -zX[,Y]               X=compressor (Y=compression level, optional)\n"
+	      " -zX[,Y][:..]          X=compressor (Y=compression level, optional)\n"
+	      "                       alternative algorithms can be separated by colons(:)\n"
 	      " -C#                   specify the size of compress physical cluster in bytes\n"
 	      " -EX[,...]             X=extended options\n"
 	      " -L volume-label       set the volume label (maximum 16)\n"
-- 
2.36.1


                 reply	other threads:[~2023-03-11  4:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230311041245.27006-1-hsiangkao@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.