summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-bsp/fwupd/fwupd/0001-fu-lzma-common.c-reduce-lzma-compression-level-from-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-bsp/fwupd/fwupd/0001-fu-lzma-common.c-reduce-lzma-compression-level-from-.patch')
-rw-r--r--meta-oe/recipes-bsp/fwupd/fwupd/0001-fu-lzma-common.c-reduce-lzma-compression-level-from-.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/meta-oe/recipes-bsp/fwupd/fwupd/0001-fu-lzma-common.c-reduce-lzma-compression-level-from-.patch b/meta-oe/recipes-bsp/fwupd/fwupd/0001-fu-lzma-common.c-reduce-lzma-compression-level-from-.patch
new file mode 100644
index 0000000000..b0d3863eaa
--- /dev/null
+++ b/meta-oe/recipes-bsp/fwupd/fwupd/0001-fu-lzma-common.c-reduce-lzma-compression-level-from-.patch
@@ -0,0 +1,47 @@
1From c96668ab830d016eeff977d5ca4f99d288cf38c0 Mon Sep 17 00:00:00 2001
2From: Mikko Rapeli <mikko.rapeli@linaro.org>
3Date: Tue, 8 Jul 2025 07:05:02 +0000
4Subject: [PATCH] fu-lzma-common.c: reduce lzma compression level from 9 to
5 default 6
6
7xz manual page says default is 6 and levels higher than that can cause
8huge CPU and memory usage. On yocto qemu target, the fwupd tests
9fail to run with compression level 9:
10
11FuSelfTest:ERROR:../sources/fwupd-2.0.12/libfwupdplugin/fu-self-test.c:6342:fu_lzma_func: assertion failed (error == NULL): failed to set up LZMA encoder rc=5 (FwupdError, 10)
12not ok /fwupd/lzma - FuSelfTest:ERROR:../sources/fwupd-2.0.12/libfwupdplugin/fu-self-test.c:6342:fu_lzma_func: assertion failed (error == NULL): failed to set up LZMA encoder rc=5 (FwupdError, 10)
13
14With default compression level 6 the tests pass.
15
16https://linux.die.net/man/1/xz
17
18 -6 ... -9
19 Excellent compression with medium to high memory usage.
20 These are also slower than the lower preset levels.
21 The default is -6. Unless you want to maximize the compression ratio,
22 you probably don't want a higher preset level than -7 due to
23 speed and memory usage.
24
25Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
26---
27 libfwupdplugin/fu-lzma-common.c | 2 +-
28 1 file changed, 1 insertion(+), 1 deletion(-)
29
30Upstream-Status: Submitted [https://github.com/fwupd/fwupd/pull/9019]
31
32diff --git a/libfwupdplugin/fu-lzma-common.c b/libfwupdplugin/fu-lzma-common.c
33index a64ec773da91..d381ed52e135 100644
34--- a/libfwupdplugin/fu-lzma-common.c
35+++ b/libfwupdplugin/fu-lzma-common.c
36@@ -89,7 +89,7 @@ fu_lzma_compress_bytes(GBytes *blob, GError **error)
37 strm.next_in = g_bytes_get_data(blob, NULL);
38 strm.avail_in = g_bytes_get_size(blob);
39
40- rc = lzma_easy_encoder(&strm, 9, LZMA_CHECK_CRC64);
41+ rc = lzma_easy_encoder(&strm, 6, LZMA_CHECK_CRC64);
42 if (rc != LZMA_OK) {
43 lzma_end(&strm);
44 g_set_error(error,
45--
462.43.0
47