Skip to content

Commit b58e03c

Browse files
committed
kmod: update to 32
1 parent e89a08d commit b58e03c

File tree

6 files changed

+171
-16
lines changed

6 files changed

+171
-16
lines changed

net/wsdd2/Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
include $(TOPDIR)/rules.mk
22

33
PKG_NAME:=wsdd2
4-
PKG_RELEASE:=$(AUTORELEASE)
4+
PKG_RELEASE:=1
55

66
PKG_SOURCE_PROTO:=git
77
PKG_SOURCE_URL:=https://github.com/Netgear/wsdd2.git
8-
PKG_SOURCE_DATE:=2021-10-22
9-
PKG_SOURCE_VERSION:=9831daf2e14e0e112b5ad95224e9167072d52aa3
10-
PKG_MIRROR_HASH:=403d7d20bf2ae67e898db4543c61cc07f337cedf038a11c84a2af5504cfb82e9
8+
PKG_SOURCE_DATE:=2023-12-21
9+
PKG_SOURCE_VERSION:=b676d8ac8f1aef792cb0761fb68a0a589ded3207
10+
PKG_MIRROR_HASH:=f91c011746cab42dbc638f2c049d4be2e882b220adca7ba88c6d14fd2d0c3e7e
1111

12-
PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
1312
PKG_LICENSE:=GPL-3.0-only
1413
PKG_LICENSE_FILES:=COPYING
1514

net/wsdd2/files/wsdd2.init

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ start_service() {
1616
# needs long delay, otherwise service may not register correctly on stratup/reboot (not sure what the issues is?)
1717
sleep 5
1818

19-
if [ -e /etc/ksmbd/ksmbd.conf ] && [ -e /etc/init.d/ksmbd ] ; then
19+
if [ -e /etc/ksmbd/ksmbd.conf ] && [ -e /etc/init.d/ksmbd ] && /etc/init.d/ksmbd running; then
2020
SMB_CONF="/etc/ksmbd/ksmbd.conf"
2121
fi
2222

2323
[ -e /etc/samba/smb.conf ] && {
24-
if [ -e /etc/init.d/samba4 ] ; then
24+
if [ -e /etc/init.d/samba4 ] && /etc/init.d/samba4 running; then
2525
SMB_CONF="/etc/samba/smb.conf"
26-
elif [ -e /etc/init.d/samba ] ; then
26+
elif [ -e /etc/init.d/samba ] && /etc/init.d/samba running; then
2727
SMB_CONF="/etc/samba/smb.conf"
2828
fi
2929
}
3030

3131
[ -z "$SMB_CONF" ] && {
32-
logger -p daemon.error -t 'wsdd2' "samba36/4 or ksmbd is not running, can't start wsdd2!"
33-
exit 1
32+
logger -p daemon.info -t 'wsdd2' "samba36/4 or ksmbd is not running"
33+
return
3434
}
3535

3636
# cleanup comments
@@ -59,12 +59,12 @@ start_service() {
5959
local board_sku
6060

6161
[ -e /tmp/sysinfo/board_name ] && {
62-
board_vendor="$(awk -F',' '{print $1}' /tmp/sysinfo/board_name | tr ' ' '_' | tr -d ' \n')"
63-
board_sku="$(awk -F',' '{print $2}' /tmp/sysinfo/board_name | tr ' ' '_' | tr -d ' \n')"
62+
board_vendor="$(awk -F',' '{print $1}' /tmp/sysinfo/board_name | tr ' ' '_' | tr ',' '-' | tr -d ' \n')"
63+
board_sku="$(awk -F',' '{print $2}' /tmp/sysinfo/board_name | tr ' ' '_' | tr ',' '-' | tr -d ' \n')"
6464
}
6565

6666
[ -e /tmp/sysinfo/model ] && {
67-
board_model="$(awk -F':' '{print $1}' /tmp/sysinfo/model | tr ' ' '_' | tr -d ' \n')"
67+
board_model="$(awk -F':' '{print $1}' /tmp/sysinfo/model | tr ' ' '_' | tr ',' '-' | tr -d ' \n')"
6868
}
6969

7070
[ -n "$board_vendor" ] && [ -n "$board_model" ] && {

net/wsdd2/patches/010-gcc14.patch

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--- a/wsdd2.c
2+
+++ b/wsdd2.c
3+
@@ -543,7 +543,15 @@ static int netlink_recv(struct endpoint
4+
char buf[PAGE_SIZE];
5+
struct sockaddr_nl sa;
6+
struct iovec iov = { buf, sizeof buf };
7+
- struct msghdr msg = { &sa, sizeof sa, &iov, 1, NULL, 0, 0 };
8+
+ struct msghdr msg = {
9+
+ .msg_name = &sa,
10+
+ .msg_namelen = sizeof(sa),
11+
+ .msg_iov = &iov,
12+
+ .msg_iovlen = 1,
13+
+ .msg_control = NULL,
14+
+ .msg_controllen = 0,
15+
+ .msg_flags = 0,
16+
+ };
17+
ssize_t msglen = recvmsg(ep->sock, &msg, 0);
18+
19+
DEBUG(2, W, "%s: %zd bytes", __func__, msglen);

utils/kmod/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@
88
include $(TOPDIR)/rules.mk
99

1010
PKG_NAME:=kmod
11-
PKG_VERSION:=27
12-
PKG_RELEASE:=2
11+
PKG_VERSION:=32
12+
PKG_RELEASE:=1
1313

1414
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
1515
PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kmod
16-
PKG_HASH:=c1d3fbf16ca24b95f334c1de1b46f17bbe5a10b0e81e72668bdc922ebffbbc0c
16+
PKG_HASH:=630ed0d92275a88cb9a7bf68f5700e911fdadaf02e051cf2e4680ff8480bd492
1717

1818
PKG_MAINTAINER:=Jeff Waugh <jdub@bethesignal.org>
1919
PKG_LICENSE:=LGPL-2.1-or-later
2020
PKG_LICENSE_FILES:=COPYING
21+
PKG_CPE_ID:=cpe:/a:kernel:kmod
2122

2223
PKG_FIXUP:=autoreconf
2324
PKG_INSTALL:=1
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
--- a/libkmod/libkmod-config.c
2+
+++ b/libkmod/libkmod-config.c
3+
@@ -21,6 +21,7 @@
4+
#include <ctype.h>
5+
#include <dirent.h>
6+
#include <errno.h>
7+
+#include <libgen.h>
8+
#include <stdarg.h>
9+
#include <stddef.h>
10+
#include <stdio.h>
11+
@@ -794,7 +795,9 @@ static int conf_files_insert_sorted(stru
12+
bool is_single = false;
13+
14+
if (name == NULL) {
15+
- name = basename(path);
16+
+ char *pathc = strdup(path);
17+
+ name = basename(pathc);
18+
+ free(pathc);
19+
is_single = true;
20+
}
21+
22+
--- a/shared/util.c
23+
+++ b/shared/util.c
24+
@@ -22,6 +22,7 @@
25+
#include <assert.h>
26+
#include <ctype.h>
27+
#include <errno.h>
28+
+#include <libgen.h>
29+
#include <stdarg.h>
30+
#include <stddef.h>
31+
#include <stdio.h>
32+
@@ -173,8 +174,10 @@ char *modname_normalize(const char *modn
33+
char *path_to_modname(const char *path, char buf[static PATH_MAX], size_t *len)
34+
{
35+
char *modname;
36+
+ char *pathc = strdup(path);
37+
38+
- modname = basename(path);
39+
+ modname = basename(pathc);
40+
+ free(pathc);
41+
if (modname == NULL || modname[0] == '\0')
42+
return NULL;
43+
44+
--- a/tools/depmod.c
45+
+++ b/tools/depmod.c
46+
@@ -22,6 +22,7 @@
47+
#include <dirent.h>
48+
#include <errno.h>
49+
#include <getopt.h>
50+
+#include <libgen.h>
51+
#include <limits.h>
52+
#include <regex.h>
53+
#include <stdio.h>
54+
@@ -757,14 +758,17 @@ static int cfg_files_insert_sorted(struc
55+
struct cfg_file **files, *f;
56+
size_t i, n_files, namelen, dirlen;
57+
void *tmp;
58+
+ char *dirc;
59+
60+
dirlen = strlen(dir);
61+
if (name != NULL)
62+
namelen = strlen(name);
63+
else {
64+
- name = basename(dir);
65+
+ dirc = strdup(dir);
66+
+ name = basename(dirc);
67+
namelen = strlen(name);
68+
dirlen -= namelen + 1;
69+
+ free(dirc);
70+
}
71+
72+
n_files = *p_n_files;
73+
@@ -2613,7 +2617,7 @@ static int depmod_output(struct depmod *
74+
int mode = 0644;
75+
int fd;
76+
77+
- snprintf(tmp, sizeof(tmp), "%s.%i.%li.%li", itr->name, getpid(),
78+
+ snprintf(tmp, sizeof(tmp), "%s.%i.%" PRId64 ".%" PRId64, itr->name, getpid(),
79+
tv.tv_usec, tv.tv_sec);
80+
fd = openat(dfd, tmp, flags, mode);
81+
if (fd < 0) {
82+
--- a/tools/kmod.c
83+
+++ b/tools/kmod.c
84+
@@ -22,6 +22,7 @@
85+
#include <stdio.h>
86+
#include <stdlib.h>
87+
#include <string.h>
88+
+#include <libgen.h>
89+
90+
#include <shared/util.h>
91+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
From c5054b215089f9e3cdc9602232649c2b5b1de743 Mon Sep 17 00:00:00 2001
2+
From: Lucas De Marchi <lucas.de.marchi@gmail.com>
3+
Date: Wed, 6 Mar 2024 08:58:04 -0600
4+
Subject: [PATCH] build: Allow to install over dirty dir
5+
6+
Before commit e98cef6f3f8c ("make: install/uninstall tools symlinks to
7+
kmod") it was possible to call `make install DESTDIR=<dir>` multiple
8+
times. Use `ln -sf` so the symlink is always re-created.
9+
10+
It would be preferred to remove install in an empty dir, but there's
11+
not a bad consequence of re-using the same, so let the user decide.
12+
Fixes the following errors while installing for the second time:
13+
14+
ln: failed to create symbolic link '/tmp/inst/usr/bin/insmod': File exists
15+
ln: failed to create symbolic link '/tmp/inst/usr/bin/lsmod': File exists
16+
ln: failed to create symbolic link '/tmp/inst/usr/bin/rmmod': File exists
17+
ln: failed to create symbolic link '/tmp/inst/usr/bin/depmod': File exists
18+
ln: failed to create symbolic link '/tmp/inst/usr/bin/modprobe': File exists
19+
ln: failed to create symbolic link '/tmp/inst/usr/bin/modinfo': File exists
20+
make[3]: *** [Makefile:2679: install-exec-hook] Error 1
21+
make[2]: *** [Makefile:2553: install-exec-am] Error 2
22+
make[1]: *** [Makefile:2439: install-am] Error 2
23+
make: *** [Makefile:1848: install-recursive] Error 1
24+
25+
Cc: Emil Velikov <emil.l.velikov@gmail.com>
26+
Closes: https://github.com/kmod-project/kmod/issues/35
27+
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
28+
Link: https://lore.kernel.org/r/20240306145804.135709-1-lucas.de.marchi@gmail.com
29+
Upstream-Status: Backport [https://github.com/kmod-project/kmod/commit/c5054b215089f9e3cdc9602232649c2b5b1de743]
30+
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
31+
---
32+
Makefile.am | 2 +-
33+
1 file changed, 1 insertion(+), 1 deletion(-)
34+
35+
--- a/Makefile.am
36+
+++ b/Makefile.am
37+
@@ -113,7 +113,7 @@ install-exec-hook:
38+
fi
39+
if BUILD_TOOLS
40+
for tool in insmod lsmod rmmod depmod modprobe modinfo; do \
41+
- $(LN_S) kmod $(DESTDIR)$(bindir)/$$tool; \
42+
+ $(LN_S) -f kmod $(DESTDIR)$(bindir)/$$tool; \
43+
done
44+
endif
45+

0 commit comments

Comments
 (0)