kmod-29_lzip-0.diff 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. diff -urdN kmod-29.orig/Makefile.am kmod-29/Makefile.am
  2. --- kmod-29.orig/Makefile.am 2021-05-21 00:37:20.553782500 +0200
  3. +++ kmod-29/Makefile.am 2022-02-27 13:55:12.910447392 +0100
  4. @@ -19,7 +19,7 @@
  5. -include $(top_builddir)/config.h \
  6. -I$(top_srcdir) \
  7. -DSYSCONFDIR=\""$(sysconfdir)"\" \
  8. - ${zlib_CFLAGS}
  9. + ${lzlib_CFLAGS} ${zlib_CFLAGS}
  10. AM_CFLAGS = $(OUR_CFLAGS)
  11. AM_LDFLAGS = $(OUR_LDFLAGS)
  12. @@ -35,6 +35,8 @@
  13. -e 's,@libzstd_LIBS\@,${libzstd_LIBS},g' \
  14. -e 's,@liblzma_CFLAGS\@,${liblzma_CFLAGS},g' \
  15. -e 's,@liblzma_LIBS\@,${liblzma_LIBS},g' \
  16. + -e 's,@lzlib_CFLAGS\@,${lzlib_CFLAGS},g' \
  17. + -e 's,@lzlib_LIBS\@,${lzlib_LIBS},g' \
  18. -e 's,@zlib_CFLAGS\@,${zlib_CFLAGS},g' \
  19. -e 's,@zlib_LIBS\@,${zlib_LIBS},g' \
  20. -e 's,@libcrypto_CFLAGS\@,${libcrypto_CFLAGS},g' \
  21. @@ -105,7 +107,7 @@
  22. ${top_srcdir}/libkmod/libkmod.sym
  23. libkmod_libkmod_la_LIBADD = \
  24. shared/libshared.la \
  25. - ${libzstd_LIBS} ${liblzma_LIBS} ${zlib_LIBS} ${libcrypto_LIBS}
  26. + ${libzstd_LIBS} ${liblzma_LIBS} ${lzlib_LIBS} ${zlib_LIBS} ${libcrypto_LIBS}
  27. noinst_LTLIBRARIES += libkmod/libkmod-internal.la
  28. libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES)
  29. diff -urdN kmod-29.orig/Makefile.in kmod-29/Makefile.in
  30. --- kmod-29.orig/Makefile.in 2021-05-21 01:02:52.645592794 +0200
  31. +++ kmod-29/Makefile.in 2022-02-27 13:55:12.920445685 +0100
  32. @@ -910,6 +910,8 @@
  33. libzstd_LIBS = @libzstd_LIBS@
  34. localedir = @localedir@
  35. localstatedir = @localstatedir@
  36. +lzlib_CFLAGS = @lzlib_CFLAGS@
  37. +lzlib_LIBS = @lzlib_LIBS@
  38. mandir = @mandir@
  39. mkdir_p = @mkdir_p@
  40. oldincludedir = @oldincludedir@
  41. @@ -981,7 +983,7 @@
  42. -include $(top_builddir)/config.h \
  43. -I$(top_srcdir) \
  44. -DSYSCONFDIR=\""$(sysconfdir)"\" \
  45. - ${zlib_CFLAGS}
  46. + ${lzlib_CFLAGS} ${zlib_CFLAGS}
  47. AM_CFLAGS = $(OUR_CFLAGS)
  48. AM_LDFLAGS = $(OUR_LDFLAGS)
  49. @@ -996,6 +998,8 @@
  50. -e 's,@libzstd_LIBS\@,${libzstd_LIBS},g' \
  51. -e 's,@liblzma_CFLAGS\@,${liblzma_CFLAGS},g' \
  52. -e 's,@liblzma_LIBS\@,${liblzma_LIBS},g' \
  53. + -e 's,@lzlib_CFLAGS\@,${lzlib_CFLAGS},g' \
  54. + -e 's,@lzlib_LIBS\@,${lzlib_LIBS},g' \
  55. -e 's,@zlib_CFLAGS\@,${zlib_CFLAGS},g' \
  56. -e 's,@zlib_LIBS\@,${zlib_LIBS},g' \
  57. -e 's,@libcrypto_CFLAGS\@,${libcrypto_CFLAGS},g' \
  58. @@ -1060,7 +1064,7 @@
  59. libkmod_libkmod_la_LIBADD = \
  60. shared/libshared.la \
  61. - ${libzstd_LIBS} ${liblzma_LIBS} ${zlib_LIBS} ${libcrypto_LIBS}
  62. + ${libzstd_LIBS} ${liblzma_LIBS} ${lzlib_LIBS} ${zlib_LIBS} ${libcrypto_LIBS}
  63. libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES)
  64. libkmod_libkmod_internal_la_LDFLAGS = $(AM_LDFLAGS) \
  65. diff -urdN kmod-29.orig/README kmod-29/README
  66. --- kmod-29.orig/README 2021-01-21 03:49:19.913366600 +0100
  67. +++ kmod-29/README 2022-02-27 13:55:12.920445685 +0100
  68. @@ -47,6 +47,7 @@
  69. Optional dependencies:
  70. - ZLIB library
  71. + - LZLIB library
  72. - LZMA library
  73. Typical configuration:
  74. diff -urdN kmod-29.orig/config.h.in kmod-29/config.h.in
  75. --- kmod-29.orig/config.h.in 2021-05-21 01:03:51.174335845 +0200
  76. +++ kmod-29/config.h.in 2022-02-27 13:55:12.920445685 +0100
  77. @@ -15,6 +15,9 @@
  78. /* Enable Xz for modules. */
  79. #undef ENABLE_XZ
  80. +/* Enable lzlib for modules. */
  81. +#undef ENABLE_LZLIB
  82. +
  83. /* Enable zlib for modules. */
  84. #undef ENABLE_ZLIB
  85. diff -urdN kmod-29.orig/configure.ac kmod-29/configure.ac
  86. --- kmod-29.orig/configure.ac 2021-05-21 00:37:39.438647859 +0200
  87. +++ kmod-29/configure.ac 2022-02-27 13:55:12.920445685 +0100
  88. @@ -105,6 +105,17 @@
  89. ])
  90. CC_FEATURE_APPEND([with_features], [with_xz], [XZ])
  91. +AC_ARG_WITH([lzlib],
  92. + AS_HELP_STRING([--with-lzlib], [handle lzipped modules @<:@default=disabled@:>@]),
  93. + [], [with_lzlib=no])
  94. +AS_IF([test "x$with_lzlib" != "xno"], [
  95. + PKG_CHECK_MODULES([lzlib], [lzlib])
  96. + AC_DEFINE([ENABLE_LZLIB], [1], [Enable lzlib for modules.])
  97. +], [
  98. + AC_MSG_NOTICE([lzlib support not requested])
  99. +])
  100. +CC_FEATURE_APPEND([with_features], [with_lzlib], [LZLIB])
  101. +
  102. AC_ARG_WITH([zlib],
  103. AS_HELP_STRING([--with-zlib], [handle gzipped modules @<:@default=disabled@:>@]),
  104. [], [with_zlib=no])
  105. @@ -320,7 +331,7 @@
  106. tools: ${enable_tools}
  107. python bindings: ${enable_python}
  108. logging: ${enable_logging}
  109. - compression: zstd=${with_zstd} xz=${with_xz} zlib=${with_zlib}
  110. + compression: zstd=${with_zstd} xz=${with_xz} lzlib=${with_lzlib} zlib=${with_zlib}
  111. debug: ${enable_debug}
  112. coverage: ${enable_coverage}
  113. doc: ${enable_gtk_doc}
  114. diff -urdN kmod-29.orig/configure kmod-29/configure
  115. --- kmod-29.orig/configure 2021-05-21 01:02:52.949057874 +0200
  116. +++ kmod-29/configure 2022-02-27 19:34:02.380431023 +0100
  117. @@ -701,6 +701,8 @@
  118. libcrypto_CFLAGS
  119. zlib_LIBS
  120. zlib_CFLAGS
  121. +lzlib_LIBS
  122. +lzlib_CFLAGS
  123. liblzma_LIBS
  124. liblzma_CFLAGS
  125. libzstd_LIBS
  126. @@ -845,6 +847,7 @@
  127. with_rootlibdir
  128. with_zstd
  129. with_xz
  130. +with_lzlib
  131. with_zlib
  132. with_openssl
  133. with_bashcompletiondir
  134. @@ -873,6 +876,8 @@
  135. libzstd_LIBS
  136. liblzma_CFLAGS
  137. liblzma_LIBS
  138. +lzlib_CFLAGS
  139. +lzlib_LIBS
  140. zlib_CFLAGS
  141. zlib_LIBS
  142. libcrypto_CFLAGS
  143. @@ -1550,6 +1555,7 @@
  144. --with-zstd handle Zstandard-compressed modules
  145. [default=disabled]
  146. --with-xz handle Xz-compressed modules [default=disabled]
  147. + --with-lzlib handle lzipped modules [default=disabled]
  148. --with-zlib handle gzipped modules [default=disabled]
  149. --with-openssl handle PKCS7 signatures [default=disabled]
  150. --with-bashcompletiondir=DIR
  151. @@ -1578,6 +1584,9 @@
  152. C compiler flags for liblzma, overriding pkg-config
  153. liblzma_LIBS
  154. linker flags for liblzma, overriding pkg-config
  155. + lzlib_CFLAGS
  156. + C compiler flags for lzlib, overriding pkg-config
  157. + lzlib_LIBS linker flags for lzlib, overriding pkg-config
  158. zlib_CFLAGS C compiler flags for zlib, overriding pkg-config
  159. zlib_LIBS linker flags for zlib, overriding pkg-config
  160. libcrypto_CFLAGS
  161. @@ -14174,6 +14183,146 @@
  162. +# Check whether --with-lzlib was given.
  163. +if test ${with_lzlib+y}
  164. +then :
  165. + withval=$with_lzlib;
  166. +else $as_nop
  167. + with_lzlib=no
  168. +fi
  169. +
  170. +if test "x$with_lzlib" != "xno"
  171. +then :
  172. +
  173. +
  174. +pkg_failed=no
  175. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lzlib" >&5
  176. +printf %s "checking for lzlib... " >&6; }
  177. +
  178. +if test -n "$lzlib_CFLAGS"; then
  179. + pkg_cv_lzlib_CFLAGS="$lzlib_CFLAGS"
  180. + elif test -n "$PKG_CONFIG"; then
  181. + if test -n "$PKG_CONFIG" && \
  182. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lzlib\""; } >&5
  183. + ($PKG_CONFIG --exists --print-errors "lzlib") 2>&5
  184. + ac_status=$?
  185. + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  186. + test $ac_status = 0; }; then
  187. + pkg_cv_lzlib_CFLAGS=`$PKG_CONFIG --cflags "lzlib" 2>/dev/null`
  188. + test "x$?" != "x0" && pkg_failed=yes
  189. +else
  190. + pkg_failed=yes
  191. +fi
  192. + else
  193. + pkg_failed=untried
  194. +fi
  195. +if test -n "$lzlib_LIBS"; then
  196. + pkg_cv_lzlib_LIBS="$lzlib_LIBS"
  197. + elif test -n "$PKG_CONFIG"; then
  198. + if test -n "$PKG_CONFIG" && \
  199. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lzlib\""; } >&5
  200. + ($PKG_CONFIG --exists --print-errors "lzlib") 2>&5
  201. + ac_status=$?
  202. + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  203. + test $ac_status = 0; }; then
  204. + pkg_cv_lzlib_LIBS=`$PKG_CONFIG --libs "lzlib" 2>/dev/null`
  205. + test "x$?" != "x0" && pkg_failed=yes
  206. +else
  207. + pkg_failed=yes
  208. +fi
  209. + else
  210. + pkg_failed=untried
  211. +fi
  212. +
  213. +
  214. +
  215. +if test $pkg_failed = yes; then
  216. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
  217. +printf "%s\n" "no" >&6; }
  218. +
  219. +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
  220. + _pkg_short_errors_supported=yes
  221. +else
  222. + _pkg_short_errors_supported=no
  223. +fi
  224. + if test $_pkg_short_errors_supported = yes; then
  225. + lzlib_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lzlib" 2>&1`
  226. + else
  227. + lzlib_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lzlib" 2>&1`
  228. + fi
  229. + # Put the nasty error message in config.log where it belongs
  230. + echo "$lzlib_PKG_ERRORS" >&5
  231. +
  232. + as_fn_error $? "Package requirements (lzlib) were not met:
  233. +
  234. +$lzlib_PKG_ERRORS
  235. +
  236. +Consider adjusting the PKG_CONFIG_PATH environment variable if you
  237. +installed software in a non-standard prefix.
  238. +
  239. +Alternatively, you may set the environment variables lzlib_CFLAGS
  240. +and lzlib_LIBS to avoid the need to call pkg-config.
  241. +See the pkg-config man page for more details." "$LINENO" 5
  242. +elif test $pkg_failed = untried; then
  243. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
  244. +printf "%s\n" "no" >&6; }
  245. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
  246. +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
  247. +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
  248. +is in your PATH or set the PKG_CONFIG environment variable to the full
  249. +path to pkg-config.
  250. +
  251. +Alternatively, you may set the environment variables lzlib_CFLAGS
  252. +and lzlib_LIBS to avoid the need to call pkg-config.
  253. +See the pkg-config man page for more details.
  254. +
  255. +To get pkg-config, see <http://pkg-config.freedesktop.org/>.
  256. +See \`config.log' for more details" "$LINENO" 5; }
  257. +else
  258. + lzlib_CFLAGS=$pkg_cv_lzlib_CFLAGS
  259. + lzlib_LIBS=$pkg_cv_lzlib_LIBS
  260. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
  261. +printf "%s\n" "yes" >&6; }
  262. +
  263. +fi
  264. +
  265. +printf "%s\n" "#define ENABLE_LZLIB 1" >>confdefs.h
  266. +
  267. +
  268. +else $as_nop
  269. +
  270. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: lzlib support not requested" >&5
  271. +printf "%s\n" "$as_me: lzlib support not requested" >&6;}
  272. +
  273. +fi
  274. +
  275. +
  276. + case " $with_features " in #(
  277. + *" LZLIB "*) :
  278. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : with_features already contains LZLIB"; } >&5
  279. + (: with_features already contains LZLIB) 2>&5
  280. + ac_status=$?
  281. + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  282. + test $ac_status = 0; } ;; #(
  283. + *) :
  284. +
  285. + if test "x$with_features" != "x"
  286. +then :
  287. + as_fn_append with_features " "
  288. +fi
  289. + if test "x$with_lzlib" = "xyes"
  290. +then :
  291. + as_fn_append with_features "+LZLIB"
  292. +else $as_nop
  293. + as_fn_append with_features "-LZLIB"
  294. +fi
  295. +
  296. + ;;
  297. +esac
  298. +
  299. +
  300. +
  301. +
  302. # Check whether --with-zlib was given.
  303. if test ${with_zlib+y}
  304. then :
  305. @@ -17743,7 +17892,7 @@
  306. tools: ${enable_tools}
  307. python bindings: ${enable_python}
  308. logging: ${enable_logging}
  309. - compression: zstd=${with_zstd} xz=${with_xz} zlib=${with_zlib}
  310. + compression: zstd=${with_zstd} xz=${with_xz} lzlib=${with_lzlib} zlib=${with_zlib}
  311. debug: ${enable_debug}
  312. coverage: ${enable_coverage}
  313. doc: ${enable_gtk_doc}
  314. @@ -17772,7 +17921,7 @@
  315. tools: ${enable_tools}
  316. python bindings: ${enable_python}
  317. logging: ${enable_logging}
  318. - compression: zstd=${with_zstd} xz=${with_xz} zlib=${with_zlib}
  319. + compression: zstd=${with_zstd} xz=${with_xz} lzlib=${with_lzlib} zlib=${with_zlib}
  320. debug: ${enable_debug}
  321. coverage: ${enable_coverage}
  322. doc: ${enable_gtk_doc}
  323. diff -urdN kmod-29.orig/libkmod/docs/Makefile.in kmod-29/libkmod/docs/Makefile.in
  324. --- kmod-29.orig/libkmod/docs/Makefile.in 2021-05-21 01:02:52.655597137 +0200
  325. +++ kmod-29/libkmod/docs/Makefile.in 2022-02-27 13:55:12.920445685 +0100
  326. @@ -248,6 +248,8 @@
  327. libzstd_LIBS = @libzstd_LIBS@
  328. localedir = @localedir@
  329. localstatedir = @localstatedir@
  330. +lzlib_CFLAGS = @lzlib_CFLAGS@
  331. +lzlib_LIBS = @lzlib_LIBS@
  332. mandir = @mandir@
  333. mkdir_p = @mkdir_p@
  334. oldincludedir = @oldincludedir@
  335. diff -urdN kmod-29.orig/libkmod/libkmod-file.c kmod-29/libkmod/libkmod-file.c
  336. --- kmod-29.orig/libkmod/libkmod-file.c 2020-09-11 06:55:01.331987063 +0200
  337. +++ kmod-29/libkmod/libkmod-file.c 2022-02-27 13:55:12.920445685 +0100
  338. @@ -37,6 +37,9 @@
  339. #endif
  340. #include <shared/util.h>
  341. +#ifdef ENABLE_LZLIB
  342. +#include <lzlib.h>
  343. +#endif
  344. #include "libkmod.h"
  345. #include "libkmod-internal.h"
  346. @@ -54,6 +57,9 @@
  347. #ifdef ENABLE_XZ
  348. bool xz_used;
  349. #endif
  350. +#ifdef ENABLE_LZLIB
  351. + bool lz_used;
  352. +#endif
  353. #ifdef ENABLE_ZLIB
  354. gzFile gzf;
  355. #endif
  356. @@ -310,6 +316,88 @@
  357. static const char magic_xz[] = {0xfd, '7', 'z', 'X', 'Z', 0};
  358. #endif
  359. +#ifdef ENABLE_LZLIB
  360. +#ifndef min
  361. + #define min(x,y) ((x) <= (y) ? (x) : (y))
  362. +#endif
  363. +
  364. +static int load_lzlib(struct kmod_file *file)
  365. +{
  366. + uint8_t in_buf[16384];
  367. + int err = 0;
  368. + off_t did = 0, total = 0;
  369. + _cleanup_free_ unsigned char *p = NULL;
  370. +
  371. + struct LZ_Decoder *lzd = LZ_decompress_open();
  372. + if (!lzd || LZ_decompress_errno( lzd ) != LZ_ok)
  373. + { LZ_decompress_close(lzd); return -ENOMEM; }
  374. +
  375. + for (;;) {
  376. + int rd;
  377. + const int size = min(LZ_decompress_write_size(lzd),
  378. + (int)sizeof in_buf);
  379. +
  380. + if (did == total) {
  381. + const int realloc_step = 4 * 1024 * 1024;
  382. + void *tmp = realloc(p, total + realloc_step);
  383. + if (tmp == NULL) {
  384. + err = -ENOMEM;
  385. + goto error;
  386. + }
  387. + total += realloc_step;
  388. + p = tmp;
  389. + }
  390. +
  391. + if (size > 0) {
  392. + rd = read(file->fd, in_buf, size);
  393. + if (rd < 0) {
  394. + err = -errno;
  395. + goto error;
  396. + }
  397. + if (rd == 0)
  398. + LZ_decompress_finish(lzd);
  399. + else if (LZ_decompress_write(lzd, in_buf, rd) != rd) {
  400. + err = -EINVAL;
  401. + goto error;
  402. + }
  403. + }
  404. + rd = LZ_decompress_read(lzd, p + did, total - did);
  405. + if (rd < 0) {
  406. + const char *lz_errmsg =
  407. + LZ_strerror(LZ_decompress_errno(lzd));
  408. +
  409. + ERR(file->ctx, "lzip: %s\n", lz_errmsg);
  410. + err = -EINVAL;
  411. + goto error;
  412. + }
  413. + did += rd;
  414. + if (LZ_decompress_finished(lzd) == 1)
  415. + break;
  416. + }
  417. +
  418. + if (LZ_decompress_close(lzd) < 0)
  419. + return -EINVAL;
  420. + file->lz_used = true;
  421. + file->memory = p;
  422. + file->size = did;
  423. + p = NULL;
  424. + return 0;
  425. +
  426. +error:
  427. + LZ_decompress_close(lzd);
  428. + return err;
  429. +}
  430. +
  431. +static void unload_lzlib(struct kmod_file *file)
  432. +{
  433. + if (!file->lz_used)
  434. + return;
  435. + free(file->memory);
  436. +}
  437. +
  438. +static const char magic_lzlib[] = { 0x4C, 0x5A, 0x49, 0x50 }; /* "LZIP" */
  439. +#endif
  440. +
  441. #ifdef ENABLE_ZLIB
  442. #define READ_STEP (4 * 1024 * 1024)
  443. static int load_zlib(struct kmod_file *file)
  444. @@ -385,6 +473,9 @@
  445. #ifdef ENABLE_XZ
  446. {sizeof(magic_xz), magic_xz, {load_xz, unload_xz}},
  447. #endif
  448. +#ifdef ENABLE_LZLIB
  449. + {sizeof(magic_lzlib), magic_lzlib, {load_lzlib, unload_lzlib}},
  450. +#endif
  451. #ifdef ENABLE_ZLIB
  452. {sizeof(magic_zlib), magic_zlib, {load_zlib, unload_zlib}},
  453. #endif
  454. diff -urdN kmod-29.orig/libkmod/libkmod.pc.in kmod-29/libkmod/libkmod.pc.in
  455. --- kmod-29.orig/libkmod/libkmod.pc.in 2020-09-11 06:55:01.331987063 +0200
  456. +++ kmod-29/libkmod/libkmod.pc.in 2022-02-27 13:55:12.920445685 +0100
  457. @@ -7,5 +7,5 @@
  458. Description: Library to deal with kernel modules
  459. Version: @VERSION@
  460. Libs: -L${libdir} -lkmod
  461. -Libs.private: @libzstd_LIBS@ @liblzma_LIBS@ @zlib_LIBS@
  462. +Libs.private: @libzstd_LIBS@ @liblzma_LIBS@ @lzlib_LIBS@ @zlib_LIBS@
  463. Cflags: -I${includedir}
  464. diff -urdN kmod-29.orig/man/Makefile.in kmod-29/man/Makefile.in
  465. --- kmod-29.orig/man/Makefile.in 2021-05-21 01:02:52.665601480 +0200
  466. +++ kmod-29/man/Makefile.in 2022-02-27 13:55:12.920445685 +0100
  467. @@ -278,6 +278,8 @@
  468. libzstd_LIBS = @libzstd_LIBS@
  469. localedir = @localedir@
  470. localstatedir = @localstatedir@
  471. +lzlib_CFLAGS = @lzlib_CFLAGS@
  472. +lzlib_LIBS = @lzlib_LIBS@
  473. mandir = @mandir@
  474. mkdir_p = @mkdir_p@
  475. oldincludedir = @oldincludedir@
  476. diff -urdN kmod-29.orig/shared/util.c kmod-29/shared/util.c
  477. --- kmod-29.orig/shared/util.c 2020-09-11 06:55:01.331987063 +0200
  478. +++ kmod-29/shared/util.c 2022-02-27 13:55:12.920445685 +0100
  479. @@ -43,6 +43,9 @@
  480. #ifdef ENABLE_ZLIB
  481. {".ko.gz", sizeof(".ko.gz") - 1},
  482. #endif
  483. +#ifdef ENABLE_LZLIB
  484. + {".ko.lz", sizeof(".ko.lz") - 1},
  485. +#endif
  486. #ifdef ENABLE_XZ
  487. {".ko.xz", sizeof(".ko.xz") - 1},
  488. #endif
  489. diff -urdN kmod-29.orig/testsuite/test-util.c kmod-29/testsuite/test-util.c
  490. --- kmod-29.orig/testsuite/test-util.c 2020-09-11 06:55:01.331987063 +0200
  491. +++ kmod-29/testsuite/test-util.c 2022-02-27 13:55:12.920445685 +0100
  492. @@ -154,6 +154,9 @@
  493. #ifdef ENABLE_ZLIB
  494. { "/bla.ko.gz", true },
  495. #endif
  496. +#ifdef ENABLE_LZLIB
  497. + { "/bla.ko.lz", true },
  498. +#endif
  499. #ifdef ENABLE_XZ
  500. { "/bla.ko.xz", true },
  501. #endif