[openwrt/openwrt] hostapd: replace "argument list too long" fix with a simpler version
LEDE Commits
lede-commits at lists.infradead.org
Thu Apr 4 04:39:10 PDT 2024
nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/7b9996d107217393bac5b3edf6577b74991e02b4
commit 7b9996d107217393bac5b3edf6577b74991e02b4
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Apr 4 13:06:29 2024 +0200
hostapd: replace "argument list too long" fix with a simpler version
Less convoluted and more robust
Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
...d-de-duplicate-_DIRS-before-calling-mkdir.patch | 23 ++++++++++++++++++
..._make_dirs-robust-against-too-long-argume.patch | 27 ----------------------
2 files changed, 23 insertions(+), 27 deletions(-)
diff --git a/package/network/services/hostapd/patches/210-build-de-duplicate-_DIRS-before-calling-mkdir.patch b/package/network/services/hostapd/patches/210-build-de-duplicate-_DIRS-before-calling-mkdir.patch
new file mode 100644
index 0000000000..08d4393c90
--- /dev/null
+++ b/package/network/services/hostapd/patches/210-build-de-duplicate-_DIRS-before-calling-mkdir.patch
@@ -0,0 +1,23 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Thu, 4 Apr 2024 12:59:41 +0200
+Subject: [PATCH] build: de-duplicate _DIRS before calling mkdir
+
+If the build path is long, the contents of the _DIRS variable can be very long,
+since it repeats the same directories very often.
+In some cases, this has triggered an "Argument list too long" build error.
+
+Suggested-by: Eneas U de Queiroz <cotequeiroz at gmail.com>
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/src/build.rules
++++ b/src/build.rules
+@@ -80,7 +80,7 @@ endif
+ _DIRS := $(BUILDDIR)/$(PROJ)
+ .PHONY: _make_dirs
+ _make_dirs:
+- @mkdir -p $(_DIRS)
++ @mkdir -p $(sort $(_DIRS))
+
+ $(BUILDDIR)/$(PROJ)/src/%.o: $(ROOTDIR)src/%.c $(CONFIG_FILE) | _make_dirs
+ $(Q)$(CC) -c -o $@ $(CFLAGS) $<
diff --git a/package/network/services/hostapd/patches/999-build-make-_make_dirs-robust-against-too-long-argume.patch b/package/network/services/hostapd/patches/999-build-make-_make_dirs-robust-against-too-long-argume.patch
deleted file mode 100644
index cb8171551d..0000000000
--- a/package/network/services/hostapd/patches/999-build-make-_make_dirs-robust-against-too-long-argume.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From beeef79701082a82b2581a674e702ea60a358ce7 Mon Sep 17 00:00:00 2001
-From: Robert Marko <robimarko at gmail.com>
-Date: Sun, 24 Mar 2024 20:47:06 +0100
-Subject: [PATCH] build: make _make_dirs robust against too long argument error
-
-_make_dirs currently can fail as _DIRS can be really long and thus go over
-the MAX_ARG_STRLEN limit so it will fail with:
-/bin/sh: Argument list too long
-
-Lets avoid this by stripping the $(BUILDDIR) prefix and then restoring it.
-
-Signed-off-by: Robert Marko <robimarko at gmail.com>
----
- src/build.rules | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/src/build.rules
-+++ b/src/build.rules
-@@ -80,7 +80,7 @@ endif
- _DIRS := $(BUILDDIR)/$(PROJ)
- .PHONY: _make_dirs
- _make_dirs:
-- @mkdir -p $(_DIRS)
-+ @printf '$(BUILDDIR)/%s ' $(patsubst $(BUILDDIR)/%,%,$(_DIRS)) | xargs mkdir -p
-
- $(BUILDDIR)/$(PROJ)/src/%.o: $(ROOTDIR)src/%.c $(CONFIG_FILE) | _make_dirs
- $(Q)$(CC) -c -o $@ $(CFLAGS) $<
More information about the lede-commits
mailing list