From 686e1d0941abcd37b365d0f91aa64a2567b58cf7 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 12 May 2024 19:54:33 -0700 Subject: [PATCH] kmod: update to 32 Add patch to fix compilation with GCC 14. Signed-off-by: Rosen Penev --- utils/kmod/Makefile | 4 +- utils/kmod/patches/010-basename.patch | 91 +++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 utils/kmod/patches/010-basename.patch diff --git a/utils/kmod/Makefile b/utils/kmod/Makefile index f8d441a046..3abd2892a3 100644 --- a/utils/kmod/Makefile +++ b/utils/kmod/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=kmod -PKG_VERSION:=31 +PKG_VERSION:=32 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kmod -PKG_HASH:=f5a6949043cc72c001b728d8c218609c5a15f3c33d75614b78c79418fcf00d80 +PKG_HASH:=630ed0d92275a88cb9a7bf68f5700e911fdadaf02e051cf2e4680ff8480bd492 PKG_MAINTAINER:=Jeff Waugh PKG_LICENSE:=LGPL-2.1-or-later diff --git a/utils/kmod/patches/010-basename.patch b/utils/kmod/patches/010-basename.patch new file mode 100644 index 0000000000..0c0468560b --- /dev/null +++ b/utils/kmod/patches/010-basename.patch @@ -0,0 +1,91 @@ +--- a/libkmod/libkmod-config.c ++++ b/libkmod/libkmod-config.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -794,7 +795,9 @@ static int conf_files_insert_sorted(stru + bool is_single = false; + + if (name == NULL) { +- name = basename(path); ++ char *pathc = strdup(path); ++ name = basename(pathc); ++ free(pathc); + is_single = true; + } + +--- a/shared/util.c ++++ b/shared/util.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -173,8 +174,10 @@ char *modname_normalize(const char *modn + char *path_to_modname(const char *path, char buf[static PATH_MAX], size_t *len) + { + char *modname; ++ char *pathc = strdup(path); + +- modname = basename(path); ++ modname = basename(pathc); ++ free(pathc); + if (modname == NULL || modname[0] == '\0') + return NULL; + +--- a/tools/depmod.c ++++ b/tools/depmod.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -757,14 +758,17 @@ static int cfg_files_insert_sorted(struc + struct cfg_file **files, *f; + size_t i, n_files, namelen, dirlen; + void *tmp; ++ char *dirc; + + dirlen = strlen(dir); + if (name != NULL) + namelen = strlen(name); + else { +- name = basename(dir); ++ dirc = strdup(dir); ++ name = basename(dirc); + namelen = strlen(name); + dirlen -= namelen + 1; ++ free(dirc); + } + + n_files = *p_n_files; +@@ -2613,7 +2617,7 @@ static int depmod_output(struct depmod * + int mode = 0644; + int fd; + +- snprintf(tmp, sizeof(tmp), "%s.%i.%li.%li", itr->name, getpid(), ++ snprintf(tmp, sizeof(tmp), "%s.%i.%" PRId64 ".%" PRId64, itr->name, getpid(), + tv.tv_usec, tv.tv_sec); + fd = openat(dfd, tmp, flags, mode); + if (fd < 0) { +--- a/tools/kmod.c ++++ b/tools/kmod.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + #include + -- 2.30.2