Linux-EROFS Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] AOSP: erofs-utils: avoid lzma inclusion when liblzma is disabled
@ 2021-11-10  6:49 Gao Xiang
  2021-11-10  6:50 ` [PATCH 2/2] erofs-utils: fsck: use "--extract" instead of "-c" Gao Xiang
  2021-11-10  9:51 ` [PATCH 1/2] AOSP: erofs-utils: avoid lzma inclusion when liblzma is disabled Yue Hu
  0 siblings, 2 replies; 4+ messages in thread
From: Gao Xiang @ 2021-11-10  6:49 UTC (permalink / raw)
  To: linux-erofs; +Cc: Gao Xiang, Daeho Jeong

As Daeho reported [1], erofs-utils will fail to build with the
current AOSP Android.bp:

external/erofs-utils/lib/compressor_liblzma.c:8:10: fatal error:
'lzma.h' file not found
         ^~~~~~~~
1 error generated.
16:13:47 ninja failed with: exit status 1

compressor_liblzma.c won't be compiled if ENABLE_LIBLZMA is not
defined according to lib/Makefile.am. Thus it doesn't have an impact
on non-Android scenarios.

[1] https://lore.kernel.org/r/CACOAw_wt+DX0D+Ps-K=oF+MgUxtVKbXpamShoZR7n4WwM+wODw@mail.gmail.com
Reported-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 lib/compressor_liblzma.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/compressor_liblzma.c b/lib/compressor_liblzma.c
index e9bfcc556c54..40a05efb11dc 100644
--- a/lib/compressor_liblzma.c
+++ b/lib/compressor_liblzma.c
@@ -5,6 +5,8 @@
  * Copyright (C) 2021 Gao Xiang <xiang@kernel.org>
  */
 #include <stdlib.h>
+#include "config.h"
+#ifdef HAVE_LIBLZMA
 #include <lzma.h>
 #include "erofs/config.h"
 #include "erofs/print.h"
@@ -103,3 +105,4 @@ struct erofs_compressor erofs_compressor_lzma = {
 	.setlevel = erofs_compressor_liblzma_setlevel,
 	.compress_destsize = erofs_liblzma_compress_destsize,
 };
+#endif
-- 
2.24.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] erofs-utils: fsck: use "--extract" instead of "-c"
  2021-11-10  6:49 [PATCH 1/2] AOSP: erofs-utils: avoid lzma inclusion when liblzma is disabled Gao Xiang
@ 2021-11-10  6:50 ` Gao Xiang
  2021-11-10  9:51 ` [PATCH 1/2] AOSP: erofs-utils: avoid lzma inclusion when liblzma is disabled Yue Hu
  1 sibling, 0 replies; 4+ messages in thread
From: Gao Xiang @ 2021-11-10  6:50 UTC (permalink / raw)
  To: linux-erofs; +Cc: Gao Xiang

Keep in sync with fsck.cramfs naming.

Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 fsck/main.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/fsck/main.c b/fsck/main.c
index d05dd55833aa..ae6c00202a69 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -23,6 +23,7 @@ static struct erofsfsck_cfg fsckcfg;
 
 static struct option long_options[] = {
 	{"help", no_argument, 0, 1},
+	{"extract", no_argument, 0, 2},
 	{0, 0, 0, 0},
 };
 
@@ -30,11 +31,11 @@ static void usage(void)
 {
 	fputs("usage: [options] IMAGE\n\n"
 	      "Check erofs filesystem integrity of IMAGE, and [options] are:\n"
-	      " -V      print the version number of fsck.erofs and exit.\n"
-	      " -d#     set output message level to # (maximum 9)\n"
-	      " -p      print total compression ratio of all files\n"
-	      " -c      check if all compressed files are well decompressed\n"
-	      " --help  display this help and exit.\n",
+	      " -V              print the version number of fsck.erofs and exit.\n"
+	      " -d#             set output message level to # (maximum 9)\n"
+	      " -p              print total compression ratio of all files\n"
+	      " --extract       check if all files are well decoded\n"
+	      " --help          display this help and exit.\n",
 	      stderr);
 }
 
@@ -47,7 +48,7 @@ static int erofsfsck_parse_options_cfg(int argc, char **argv)
 {
 	int opt, i;
 
-	while ((opt = getopt_long(argc, argv, "Vd:pc",
+	while ((opt = getopt_long(argc, argv, "Vd:p",
 				  long_options, NULL)) != -1) {
 		switch (opt) {
 		case 'V':
@@ -64,12 +65,12 @@ static int erofsfsck_parse_options_cfg(int argc, char **argv)
 		case 'p':
 			fsckcfg.print_comp_ratio = true;
 			break;
-		case 'c':
-			fsckcfg.check_decomp = true;
-			break;
 		case 1:
 			usage();
 			exit(0);
+		case 2:
+			fsckcfg.check_decomp = true;
+			break;
 		default:
 			return -EINVAL;
 		}
-- 
2.24.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] AOSP: erofs-utils: avoid lzma inclusion when liblzma is disabled
  2021-11-10  6:49 [PATCH 1/2] AOSP: erofs-utils: avoid lzma inclusion when liblzma is disabled Gao Xiang
  2021-11-10  6:50 ` [PATCH 2/2] erofs-utils: fsck: use "--extract" instead of "-c" Gao Xiang
@ 2021-11-10  9:51 ` Yue Hu
  2021-11-10 15:52   ` Daeho Jeong via Linux-erofs
  1 sibling, 1 reply; 4+ messages in thread
From: Yue Hu @ 2021-11-10  9:51 UTC (permalink / raw)
  To: Gao Xiang; +Cc: linux-erofs, Daeho Jeong

On Wed, 10 Nov 2021 14:49:31 +0800
Gao Xiang <hsiangkao@linux.alibaba.com> wrote:

> As Daeho reported [1], erofs-utils will fail to build with the
> current AOSP Android.bp:
> 
> external/erofs-utils/lib/compressor_liblzma.c:8:10: fatal error:
> 'lzma.h' file not found
>          ^~~~~~~~
> 1 error generated.
> 16:13:47 ninja failed with: exit status 1
> 
> compressor_liblzma.c won't be compiled if ENABLE_LIBLZMA is not
> defined according to lib/Makefile.am. Thus it doesn't have an impact
> on non-Android scenarios.
> 
> [1] https://lore.kernel.org/r/CACOAw_wt+DX0D+Ps-K=oF+MgUxtVKbXpamShoZR7n4WwM+wODw@mail.gmail.com
> Reported-by: Daeho Jeong <daehojeong@google.com>
> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
> ---
>  lib/compressor_liblzma.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib/compressor_liblzma.c b/lib/compressor_liblzma.c
> index e9bfcc556c54..40a05efb11dc 100644
> --- a/lib/compressor_liblzma.c
> +++ b/lib/compressor_liblzma.c
> @@ -5,6 +5,8 @@
>   * Copyright (C) 2021 Gao Xiang <xiang@kernel.org>
>   */
>  #include <stdlib.h>
> +#include "config.h"
> +#ifdef HAVE_LIBLZMA
>  #include <lzma.h>
>  #include "erofs/config.h"
>  #include "erofs/print.h"
> @@ -103,3 +105,4 @@ struct erofs_compressor erofs_compressor_lzma = {
>  	.setlevel = erofs_compressor_liblzma_setlevel,
>  	.compress_destsize = erofs_liblzma_compress_destsize,
>  };
> +#endif

Reviewed-by: Yue Hu <huyue2@yulong.com>

Thanks.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] AOSP: erofs-utils: avoid lzma inclusion when liblzma is disabled
  2021-11-10  9:51 ` [PATCH 1/2] AOSP: erofs-utils: avoid lzma inclusion when liblzma is disabled Yue Hu
@ 2021-11-10 15:52   ` Daeho Jeong via Linux-erofs
  0 siblings, 0 replies; 4+ messages in thread
From: Daeho Jeong via Linux-erofs @ 2021-11-10 15:52 UTC (permalink / raw)
  To: Yue Hu; +Cc: Gao Xiang, linux-erofs

Thanks for the patch!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-10 15:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-10  6:49 [PATCH 1/2] AOSP: erofs-utils: avoid lzma inclusion when liblzma is disabled Gao Xiang
2021-11-10  6:50 ` [PATCH 2/2] erofs-utils: fsck: use "--extract" instead of "-c" Gao Xiang
2021-11-10  9:51 ` [PATCH 1/2] AOSP: erofs-utils: avoid lzma inclusion when liblzma is disabled Yue Hu
2021-11-10 15:52   ` Daeho Jeong via Linux-erofs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox