kmod: update to 32
authorRosen Penev <rosenp@gmail.com>
Mon, 13 May 2024 02:54:33 +0000 (19:54 -0700)
committerRosen Penev <rosenp@gmail.com>
Tue, 14 May 2024 23:38:05 +0000 (16:38 -0700)
Add patch to fix compilation with GCC 14.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
utils/kmod/Makefile
utils/kmod/patches/010-basename.patch [new file with mode: 0644]

index f8d441a046109ffb4ee29f84e3fcc500e2b74c2e..3abd2892a34db8159897f5340644cc319525d606 100644 (file)
@@ -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 <jdub@bethesignal.org>
 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 (file)
index 0000000..0c04685
--- /dev/null
@@ -0,0 +1,91 @@
+--- a/libkmod/libkmod-config.c
++++ b/libkmod/libkmod-config.c
+@@ -21,6 +21,7 @@
+ #include <ctype.h>
+ #include <dirent.h>
+ #include <errno.h>
++#include <libgen.h>
+ #include <stdarg.h>
+ #include <stddef.h>
+ #include <stdio.h>
+@@ -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 <assert.h>
+ #include <ctype.h>
+ #include <errno.h>
++#include <libgen.h>
+ #include <stdarg.h>
+ #include <stddef.h>
+ #include <stdio.h>
+@@ -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 <dirent.h>
+ #include <errno.h>
+ #include <getopt.h>
++#include <libgen.h>
+ #include <limits.h>
+ #include <regex.h>
+ #include <stdio.h>
+@@ -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 <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <libgen.h>
+ #include <shared/util.h>