From 8e5db148e96be5d1f17b6babfd445727714fdffc Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 20 Nov 2025 16:59:55 -0800 Subject: [PATCH] apk: update to 3.0.0-rc8 Added compatibility patch for LibreSSL 4.0. Refreshed other patches. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/20851 Signed-off-by: Christian Marangi --- package/system/apk/Makefile | 6 ++-- ...openwrt-move-layer-db-to-temp-folder.patch | 2 +- .../system/apk/patches/010-libressl4.patch | 32 +++++++++++++++++++ .../apk/patches/999-small-scripts-tar.patch | 14 +++----- 4 files changed, 40 insertions(+), 14 deletions(-) create mode 100644 package/system/apk/patches/010-libressl4.patch diff --git a/package/system/apk/Makefile b/package/system/apk/Makefile index 3e4f0c1466..9627084f4e 100644 --- a/package/system/apk/Makefile +++ b/package/system/apk/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=2 PKG_SOURCE_URL=https://gitlab.alpinelinux.org/alpine/apk-tools.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2025-10-07 -PKG_SOURCE_VERSION:=6ffc65c63004b8d991ead4ea0f3d80e05b06b977 -PKG_MIRROR_HASH:=388e0210247a49099f49e783ff3d0753bed26bbb91acec2dd2d5722aca5daf6f +PKG_SOURCE_DATE:=2025-11-10 +PKG_SOURCE_VERSION:=2c027261492169783f6aaa2b7731a4e90dc7a5b0 +PKG_MIRROR_HASH:=177769a6b7a4b0a2117ed4326060eb08b19c1b930a8a92b7c25d2f56154f497e PKG_VERSION=3.0.0_pre$(subst -,,$(PKG_SOURCE_DATE)) diff --git a/package/system/apk/patches/0001-openwrt-move-layer-db-to-temp-folder.patch b/package/system/apk/patches/0001-openwrt-move-layer-db-to-temp-folder.patch index 62c3d56453..32aaa92fa5 100644 --- a/package/system/apk/patches/0001-openwrt-move-layer-db-to-temp-folder.patch +++ b/package/system/apk/patches/0001-openwrt-move-layer-db-to-temp-folder.patch @@ -10,7 +10,7 @@ Signed-off-by: Paul Spooren --- a/src/database.c +++ b/src/database.c -@@ -1856,7 +1856,7 @@ const char *apk_db_layer_name(int layer) +@@ -1937,7 +1937,7 @@ const char *apk_db_layer_name(int layer) { switch (layer) { case APK_DB_LAYER_ROOT: return "lib/apk/db"; diff --git a/package/system/apk/patches/010-libressl4.patch b/package/system/apk/patches/010-libressl4.patch new file mode 100644 index 0000000000..16e337e013 --- /dev/null +++ b/package/system/apk/patches/010-libressl4.patch @@ -0,0 +1,32 @@ +From aa71510f843d5cce5f75b6abfa3a70caeacbe36d Mon Sep 17 00:00:00 2001 +From: Rosen Penev +Date: Thu, 20 Nov 2025 18:26:52 -0800 +Subject: [PATCH] fix usage under LibreSSL > 3 + +crypto needs to be initialized as the context relies on it. + +Fixes crash in EVP_DigestInit_ex being called with a NULL digest. + +Signed-off-by: Rosen Penev +--- + src/apk.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/src/apk.c ++++ b/src/apk.c +@@ -571,6 +571,7 @@ int main(int argc, char **argv) + apk_argv[argc] = NULL; + apk_argv[argc+1] = NULL; + ++ apk_crypto_init(); + apk_ctx_init(&ctx); + umask(0); + setup_terminal(); +@@ -583,7 +584,6 @@ int main(int argc, char **argv) + if (applet->parse) applet->parse(applet_ctx, &ctx, APK_OPTIONS_INIT, NULL); + } + +- apk_crypto_init(); + apk_io_url_init(&ctx.out); + apk_io_url_set_timeout(60); + apk_io_url_set_redirect_callback(redirect_callback); diff --git a/package/system/apk/patches/999-small-scripts-tar.patch b/package/system/apk/patches/999-small-scripts-tar.patch index ff93e821eb..e690502ccf 100644 --- a/package/system/apk/patches/999-small-scripts-tar.patch +++ b/package/system/apk/patches/999-small-scripts-tar.patch @@ -1,8 +1,6 @@ -diff --git a/doc/apk.8.scd b/doc/apk.8.scd -index bd15fe75d7a4..cbac8c6c8b7b 100644 --- a/doc/apk.8.scd +++ b/doc/apk.8.scd -@@ -461,7 +461,8 @@ timeout 120 +@@ -462,7 +462,8 @@ timeout 120 */lib/apk/db/installed* Database of installed packages and their contents. @@ -12,11 +10,9 @@ index bd15fe75d7a4..cbac8c6c8b7b 100644 Collection of all package scripts from currently installed packages. */lib/apk/db/triggers* -diff --git a/src/apk_database.h b/src/apk_database.h -index 9f8670ac8ebb..10f1414c9e06 100644 --- a/src/apk_database.h +++ b/src/apk_database.h -@@ -202,6 +202,7 @@ struct apk_database { +@@ -210,6 +210,7 @@ struct apk_database { unsigned int compat_depversions : 1; unsigned int sorted_names : 1; unsigned int sorted_installed_packages : 1; @@ -24,11 +20,9 @@ index 9f8670ac8ebb..10f1414c9e06 100644 struct apk_dependency_array *world; struct apk_id_cache *id_cache; -diff --git a/src/database.c b/src/database.c -index cbe58ebbf885..cb1b709140af 100644 --- a/src/database.c +++ b/src/database.c -@@ -1255,8 +1255,11 @@ static int apk_db_read_layer(struct apk_database *db, unsigned layer) +@@ -1338,8 +1338,11 @@ static int apk_db_read_layer(struct apk_ } if (!(flags & APK_OPENF_NO_SCRIPTS)) { @@ -42,7 +36,7 @@ index cbe58ebbf885..cb1b709140af 100644 if (!ret && r != -ENOENT) ret = r; } -@@ -2128,8 +2131,9 @@ static int apk_db_write_layers(struct apk_database *db) +@@ -2214,8 +2217,9 @@ static int apk_db_write_layers(struct ap continue; } ld->installed = apk_ostream_to_file(ld->fd, "installed", 0644); -- 2.30.2