Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • firmware/gluon
  • 0x4A6F/gluon
  • patrick/gluon
3 results
Select Git revision
Loading items
Show changes
Showing
with 1175 additions and 525 deletions
From: David Bauer <mail@david-bauer.net>
Date: Mon, 11 Dec 2023 14:46:12 +0100
Subject: build: include size-limits to device-metadata
Include the image and kernel size limitations defined for each device to
the device metadata JSON.
These informations are only added if defined.
Signed-off-by: David Bauer <mail@david-bauer.net>
diff --git a/include/image.mk b/include/image.mk
index 6408719bdc48e3e3eed91b8aa97e58aa1b5e42ec..bab5f6b53ec7dffac92576be517c1a48e7b9dadb 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -658,6 +658,8 @@ define Device/Build/initramfs
VERSION_NUMBER="$(VERSION_NUMBER)" \
VERSION_CODE="$(VERSION_CODE)" \
SUPPORTED_DEVICES="$$(SUPPORTED_DEVICES)" \
+ KERNEL_SIZE="$$(KERNEL_SIZE)" \
+ IMAGE_SIZE="$$(IMAGE_SIZE)" \
$(TOPDIR)/scripts/json_add_image_info.py $$@
endef
endif
@@ -792,6 +794,8 @@ define Device/Build/image
VERSION_NUMBER="$(VERSION_NUMBER)" \
VERSION_CODE="$(VERSION_CODE)" \
SUPPORTED_DEVICES="$(SUPPORTED_DEVICES)" \
+ KERNEL_SIZE="$(KERNEL_SIZE)" \
+ IMAGE_SIZE="$(IMAGE_SIZE)" \
$(TOPDIR)/scripts/json_add_image_info.py $$@
endef
@@ -846,6 +850,8 @@ define Device/Build/artifact
VERSION_NUMBER="$(VERSION_NUMBER)" \
VERSION_CODE="$(VERSION_CODE)" \
SUPPORTED_DEVICES="$(SUPPORTED_DEVICES)" \
+ KERNEL_SIZE="$(KERNEL_SIZE)" \
+ IMAGE_SIZE="$(IMAGE_SIZE)" \
$(TOPDIR)/scripts/json_add_image_info.py $$@
endef
diff --git a/scripts/json_add_image_info.py b/scripts/json_add_image_info.py
index 915e5f61812578ec9e4e92c5aead2da190a7d8b5..3478cdbf226923433b52129428ac278e390b0ea7 100755
--- a/scripts/json_add_image_info.py
+++ b/scripts/json_add_image_info.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-from os import getenv
+from os import getenv, path
from pathlib import Path
from sys import argv
import hashlib
@@ -35,6 +35,17 @@ def get_titles():
return titles
+def get_numerical_size(image_size):
+ if image_size.endswith("g"):
+ return int(image_size[:-1]) * 1024 * 1024 * 1024
+ elif image_size.endswith("m"):
+ return int(image_size[:-1]) * 1024 * 1024
+ elif image_size.endswith("k"):
+ return int(image_size[:-1]) * 1024
+ else:
+ return int(image_size)
+
+
device_id = getenv("DEVICE_ID")
sha256_hash = hashlib.sha256()
@@ -52,6 +63,8 @@ if file_path.with_suffix(file_path.suffix + ".sha256sum").exists():
else:
hash_unsigned = hash_file
+file_size = path.getsize(file_path)
+
file_info = {
"metadata_version": 1,
"target": "{}/{}".format(getenv("TARGET"), getenv("SUBTARGET")),
@@ -67,6 +80,7 @@ file_info = {
"name": getenv("FILE_NAME"),
"sha256": hash_file,
"sha256_unsigned": hash_unsigned,
+ "size": file_size,
}
],
"device_packages": getenv("DEVICE_PACKAGES").split(),
@@ -76,6 +90,17 @@ file_info = {
},
}
+if getenv("IMAGE_SIZE") or getenv("KERNEL_SIZE"):
+ file_info["profiles"][device_id]["file_size_limits"] = {}
+ if getenv("IMAGE_SIZE"):
+ file_info["profiles"][device_id]["file_size_limits"]["image"] = get_numerical_size(
+ getenv("IMAGE_SIZE")
+ )
+ if getenv("KERNEL_SIZE"):
+ file_info["profiles"][device_id]["file_size_limits"]["kernel"] = get_numerical_size(
+ getenv("KERNEL_SIZE")
+ )
+
if getenv("FILE_FILESYSTEM"):
file_info["profiles"][device_id]["images"][0]["filesystem"] = getenv(
"FILE_FILESYSTEM"
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 13 May 2020 20:22:12 +0200
Subject: tools: add zstd
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 258dc0d0fd3aae47add9b7dca40848a92d03a4ea)
diff --git a/tools/Makefile b/tools/Makefile
index d7207ba89dd91df558eaf970961fdef225aa1f37..14fe4fb4b5f4e0c745cb8592a39bcf238dcc5444 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -33,7 +33,7 @@ tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
tools-$(CONFIG_TARGET_ar71xx) += lzma-old
tools-$(CONFIG_TARGET_ar71xx)$(CONFIG_TARGET_ath79) += squashfs
tools-$(CONFIG_USES_MINOR) += kernel2minor
-tools-y += lzma squashfskit4 zip
+tools-y += lzma squashfskit4 zip zstd
tools-$(BUILD_B43_TOOLS) += b43-tools
tools-$(BUILD_ISL) += isl
tools-$(CONFIG_USE_SPARSE) += sparse
diff --git a/tools/zstd/Makefile b/tools/zstd/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..7459725e8e79b846ed96551753d07fdd02459598
--- /dev/null
+++ b/tools/zstd/Makefile
@@ -0,0 +1,20 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=zstd
+PKG_VERSION:=1.4.4
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@GITHUB/facebook/zstd/releases/download/v$(PKG_VERSION)
+PKG_HASH:=a364f5162c7d1a455cc915e8e3cf5f4bd8b75d09bc0f53965b0c9ca1383c52c8
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+PKG_CPE_ID:=cpe:/a:facebook:zstandard
+
+HOST_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/host-build.mk
+
+HOST_MAKE_FLAGS = PREFIX=$(HOST_BUILD_PREFIX) HAVE_ZLIB=0 HAVE_LZMA=0 HAVE_LZ4=0
+
+$(eval $(call HostBuild))
diff --git a/tools/zstd/patches/0001-build-issue-More-portable-header-prefix-usage-1987.patch b/tools/zstd/patches/0001-build-issue-More-portable-header-prefix-usage-1987.patch
new file mode 100644
index 0000000000000000000000000000000000000000..6d743aa3855262c2a0956f70ec99588ce9ebe53b
--- /dev/null
+++ b/tools/zstd/patches/0001-build-issue-More-portable-header-prefix-usage-1987.patch
@@ -0,0 +1,61 @@
+From 06a57cf57e3c4e887cadcf688e3081154f3f6db4 Mon Sep 17 00:00:00 2001
+Message-Id: <06a57cf57e3c4e887cadcf688e3081154f3f6db4.1589392463.git.mschiffer@universe-factory.net>
+From: Bimba Shrestha <bimbashrestha@fb.com>
+Date: Thu, 6 Feb 2020 14:10:51 -0800
+Subject: [PATCH] [build-issue] More portable header prefix usage (#) (#1987)
+
+* make 4.3 build issue fix
+
+* Changing header name and adding comment
+---
+ programs/Makefile | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/programs/Makefile b/programs/Makefile
+index b75314a83f43..a9ee3cb5311b 100644
+--- a/programs/Makefile
++++ b/programs/Makefile
+@@ -94,9 +94,12 @@ endif
+
+ VOID = /dev/null
+
++# Make 4.3 doesn't support '\#' anymore (https://lwn.net/Articles/810071/)
++NUM_SYMBOL := \#
++
+ # thread detection
+ NO_THREAD_MSG := ==> no threads, building without multithreading support
+-HAVE_PTHREAD := $(shell printf '\#include <pthread.h>\nint main(void) { return 0; }' > have_pthread.c && $(CC) $(FLAGS) -o have_pthread$(EXT) have_pthread.c -pthread 2> $(VOID) && rm have_pthread$(EXT) && echo 1 || echo 0; rm have_pthread.c)
++HAVE_PTHREAD := $(shell printf '$(NUM_SYMBOL)include <pthread.h>\nint main(void) { return 0; }' > have_pthread.c && $(CC) $(FLAGS) -o have_pthread$(EXT) have_pthread.c -pthread 2> $(VOID) && rm have_pthread$(EXT) && echo 1 || echo 0; rm have_pthread.c)
+ HAVE_THREAD := $(shell [ "$(HAVE_PTHREAD)" -eq "1" -o -n "$(filter Windows%,$(OS))" ] && echo 1 || echo 0)
+ ifeq ($(HAVE_THREAD), 1)
+ THREAD_MSG := ==> building with threading support
+@@ -108,7 +111,7 @@ endif
+
+ # zlib detection
+ NO_ZLIB_MSG := ==> no zlib, building zstd without .gz support
+-HAVE_ZLIB := $(shell printf '\#include <zlib.h>\nint main(void) { return 0; }' > have_zlib.c && $(CC) $(FLAGS) -o have_zlib$(EXT) have_zlib.c -lz 2> $(VOID) && rm have_zlib$(EXT) && echo 1 || echo 0; rm have_zlib.c)
++HAVE_ZLIB := $(shell printf '$(NUM_SYMBOL)include <zlib.h>\nint main(void) { return 0; }' > have_zlib.c && $(CC) $(FLAGS) -o have_zlib$(EXT) have_zlib.c -lz 2> $(VOID) && rm have_zlib$(EXT) && echo 1 || echo 0; rm have_zlib.c)
+ ifeq ($(HAVE_ZLIB), 1)
+ ZLIB_MSG := ==> building zstd with .gz compression support
+ ZLIBCPP = -DZSTD_GZCOMPRESS -DZSTD_GZDECOMPRESS
+@@ -119,7 +122,7 @@ endif
+
+ # lzma detection
+ NO_LZMA_MSG := ==> no liblzma, building zstd without .xz/.lzma support
+-HAVE_LZMA := $(shell printf '\#include <lzma.h>\nint main(void) { return 0; }' > have_lzma.c && $(CC) $(FLAGS) -o have_lzma$(EXT) have_lzma.c -llzma 2> $(VOID) && rm have_lzma$(EXT) && echo 1 || echo 0; rm have_lzma.c)
++HAVE_LZMA := $(shell printf '$(NUM_SYMBOL)include <lzma.h>\nint main(void) { return 0; }' > have_lzma.c && $(CC) $(FLAGS) -o have_lzma$(EXT) have_lzma.c -llzma 2> $(VOID) && rm have_lzma$(EXT) && echo 1 || echo 0; rm have_lzma.c)
+ ifeq ($(HAVE_LZMA), 1)
+ LZMA_MSG := ==> building zstd with .xz/.lzma compression support
+ LZMACPP = -DZSTD_LZMACOMPRESS -DZSTD_LZMADECOMPRESS
+@@ -130,7 +133,7 @@ endif
+
+ # lz4 detection
+ NO_LZ4_MSG := ==> no liblz4, building zstd without .lz4 support
+-HAVE_LZ4 := $(shell printf '\#include <lz4frame.h>\n\#include <lz4.h>\nint main(void) { return 0; }' > have_lz4.c && $(CC) $(FLAGS) -o have_lz4$(EXT) have_lz4.c -llz4 2> $(VOID) && rm have_lz4$(EXT) && echo 1 || echo 0; rm have_lz4.c)
++HAVE_LZ4 := $(shell printf '$(NUM_SYMBOL)include <lz4frame.h>\n\#include <lz4.h>\nint main(void) { return 0; }' > have_lz4.c && $(CC) $(FLAGS) -o have_lz4$(EXT) have_lz4.c -llz4 2> $(VOID) && rm have_lz4$(EXT) && echo 1 || echo 0; rm have_lz4.c)
+ ifeq ($(HAVE_LZ4), 1)
+ LZ4_MSG := ==> building zstd with .lz4 compression support
+ LZ4CPP = -DZSTD_LZ4COMPRESS -DZSTD_LZ4DECOMPRESS
+--
+2.26.2
+
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 13 May 2020 20:33:46 +0200
Subject: build: compress kernel debuginfo using zstd
zstd with its default settings (compression level -3) compresses better
than bzip2 -9 (which is the default setting), and is an order of magnitude
faster.
I made the following measurements for the most common compression tools
(all standard Debian Buster versions, default flags unless noted
otherwise), using the debug information of a large x86-64 kernel with
ALL_KMODS:
* kernel-debug.tar: 376M
* kernel-debug.tar.gz: 101M, compressed in ~12s
* kernel-debug.tar.bz2: 91M, compressed in ~15s
* kernel-debug.tar.xz: 57M, compressed in ~101s
* kernel-debug.tar.zst: 86M, compressed in ~1s
With zstd, there is still some room for improvement by increasing the
compression, but the slight increase in compression ratio
(22.83% -> 19.46%) does not justify the significant increase in
compression time (about 5 times on my machine) in my opinion.
Note that multithreaded compression (-T argument) does not affect
reproducibility with zstd.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 4bd7990488b0ca7b5cae16f0a9147a4146759053)
diff --git a/include/kernel-build.mk b/include/kernel-build.mk
index 3fdf7efc52857a5184348cc1261848f75751b8a9..af7c3a8f0bb15c7e0d7072876705ff0bf4f9c8d1 100644
--- a/include/kernel-build.mk
+++ b/include/kernel-build.mk
@@ -70,7 +70,7 @@ ifdef CONFIG_COLLECT_KERNEL_DEBUG
$(FIND) $(KERNEL_BUILD_DIR)/debug -type f | $(XARGS) $(KERNEL_CROSS)strip --only-keep-debug
$(TAR) c -C $(KERNEL_BUILD_DIR) debug \
$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
- | bzip2 -c -9 > $(BIN_DIR)/kernel-debug.tar.bz2
+ | zstd -T0 -f -o $(BIN_DIR)/kernel-debug.tar.zst
endef
endif
From: Rui Salvaterra <rsalvaterra@gmail.com>
Date: Mon, 25 May 2020 14:49:07 +0100
Subject: mac80211: rt2800: enable MFP support unconditionally
This gives us WPA3 support out of the box without having to manually disable
hardware crypto. The driver will fall back to software crypto if the connection
requires management frame protection.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[apply to openwrt-1907]
Signed-off-by: David Bauer <mail@david-bauer.net>
diff --git a/package/kernel/mac80211/patches/rt2x00/080-rt2800-enable-MFP-support-unconditionally.patch b/package/kernel/mac80211/patches/rt2x00/080-rt2800-enable-MFP-support-unconditionally.patch
new file mode 100644
index 0000000000000000000000000000000000000000..1d55b2756c365a13b2315e874809e2397fb35855
--- /dev/null
+++ b/package/kernel/mac80211/patches/rt2x00/080-rt2800-enable-MFP-support-unconditionally.patch
@@ -0,0 +1,44 @@
+From b6b15e20421fefae9f78274f9fef80bc97bf5d5c Mon Sep 17 00:00:00 2001
+From: Rui Salvaterra <rsalvaterra@gmail.com>
+Date: Mon, 25 May 2020 14:49:07 +0100
+Subject: [PATCH] rt2800: enable MFP support unconditionally
+
+This gives us WPA3 support out of the box without having to manually disable
+hardware crypto. The driver will fall back to software crypto if the connection
+requires management frame protection.
+
+Suggested-by: Stanislaw Gruszka <stf_xl@wp.pl>
+Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
+Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
+Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+Link: https://lore.kernel.org/r/20200525134906.1672-1-rsalvaterra@gmail.com
+---
+ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 4 +---
+ drivers/net/wireless/ralink/rt2x00/rt2x00mac.c | 3 ++-
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+@@ -9985,9 +9985,7 @@ static int rt2800_probe_hw_mode(struct r
+ if (!rt2x00_is_usb(rt2x00dev))
+ ieee80211_hw_set(rt2x00dev->hw, HOST_BROADCAST_PS_BUFFERING);
+
+- /* Set MFP if HW crypto is disabled. */
+- if (rt2800_hwcrypt_disabled(rt2x00dev))
+- ieee80211_hw_set(rt2x00dev->hw, MFP_CAPABLE);
++ ieee80211_hw_set(rt2x00dev->hw, MFP_CAPABLE);
+
+ SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev);
+ SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
+--- a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
+@@ -459,7 +459,8 @@ int rt2x00mac_set_key(struct ieee80211_h
+ if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
+ return 0;
+
+- if (!rt2x00_has_cap_hw_crypto(rt2x00dev))
++ /* The hardware can't do MFP */
++ if (!rt2x00_has_cap_hw_crypto(rt2x00dev) || (sta && sta->mfp))
+ return -EOPNOTSUPP;
+
+ /*
From: David Bauer <mail@david-bauer.net>
Date: Sat, 13 Jun 2020 19:19:17 +0200
Subject: mt76: mt76x0: disable GTK offloading
When the GTK is offloaded, MT7610 won't transmit any multicast frames.
This is most likely due to a bug in the offloading datapath. MT7612 is
not affected.
Disable GTK offloading for now. It can be re-enabled once the bug in the
offloading path is fixed.
Signed-off-by: David Bauer <mail@david-bauer.net>
diff --git a/package/kernel/mt76/patches/001-mt76-mt76x0-disable-gtk-offloading.patch b/package/kernel/mt76/patches/001-mt76-mt76x0-disable-gtk-offloading.patch
new file mode 100644
index 0000000000000000000000000000000000000000..e7e19ac957dbfaa9510016d3387abe9eed353538
--- /dev/null
+++ b/package/kernel/mt76/patches/001-mt76-mt76x0-disable-gtk-offloading.patch
@@ -0,0 +1,30 @@
+From ae01717951013fbc8bb0315d902d5b9f5873631a Mon Sep 17 00:00:00 2001
+From: David Bauer <mail@david-bauer.net>
+Date: Fri, 12 Jun 2020 01:09:57 +0200
+Subject: [PATCH] mt76: mt76x0: disable GTK offloading
+
+When the GTK is offloaded, MT7610 won't transmit any multicast frames.
+This is most likely due to a bug in the offloading datapath. MT7612 is
+not affected.
+
+Disable GTK offloading for now. It can be re-enabled once the bug in the
+offloading path is fixed.
+
+Signed-off-by: David Bauer <mail@david-bauer.net>
+---
+ drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/mt76x02_util.c
++++ b/mt76x02_util.c
+@@ -432,6 +432,10 @@ int mt76x02_set_key(struct ieee80211_hw
+ !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE))
+ return -EOPNOTSUPP;
+
++ /* MT76x0 GTK offloading is currently broken */
++ if (is_mt76x0(dev) && !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE))
++ return -EOPNOTSUPP;
++
+ /*
+ * In USB AP mode, broadcast/multicast frames are setup in beacon
+ * data registers and sent via HW beacons engine, they require to
From: Nico <github@nicoboehr.de>
Date: Mon, 26 Apr 2021 14:12:43 +0000
Subject: fastd: remove random delay on inital handshake
When a peer limit is defined, fastd will by default randomly delay
the inital handshake. As our gateways delay their handshake to
better distribute their load, this is undesireable.
diff --git a/net/fastd/patches/0100-remove-random-delay-on-inital-handshake.patch b/net/fastd/patches/0100-remove-random-delay-on-inital-handshake.patch
new file mode 100644
index 0000000000000000000000000000000000000000..40ca26812bda65d8b08a1034e23d1b2335c77259
--- /dev/null
+++ b/net/fastd/patches/0100-remove-random-delay-on-inital-handshake.patch
@@ -0,0 +1,23 @@
+--- a/src/peer.c
++++ b/src/peer.c
+@@ -322,19 +322,11 @@ static void reset_peer(fastd_peer_t *pee
+
+ /**
+ Starts the first handshake with a newly setup peer
+-
+- If a peer group has a peer limit the handshakes will be delayed between 0 and 3 seconds
+- make the choice of peers random (it will be biased by the latency, which might or might not be
+- what a user wants)
+ */
+ static void init_handshake(fastd_peer_t *peer) {
+- unsigned delay = 0;
+- if (has_group_config_constraints(peer->group))
+- delay = fastd_rand(0, 3000);
+-
+ peer->state = STATE_HANDSHAKE;
+
+- fastd_peer_schedule_handshake(peer, delay);
++ fastd_peer_schedule_handshake(peer, 0);
+ }
+
+ /** Handles an asynchronous DNS resolve response */
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 22 May 2020 21:09:21 +0200
Subject: fastd: update to v19
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/net/fastd/Config.in b/net/fastd/Config.in
index 3350eb3099a26c870d70373c0712a8b59881ee5c..e6440075e561093c86543943cb982d010a4ef0e0 100644
--- a/net/fastd/Config.in
+++ b/net/fastd/Config.in
@@ -36,16 +36,6 @@ config FASTD_ENABLE_METHOD_NULL
depends on PACKAGE_fastd
default y
-config FASTD_ENABLE_METHOD_XSALSA20_POLY1305
- bool "Enable xsalsa20-poly1305 method"
- depends on PACKAGE_fastd
- default n
-
-
-config FASTD_ENABLE_CIPHER_AES128_CTR
- bool "Enable the AES128-CTR cipher"
- depends on PACKAGE_fastd
- default n
config FASTD_ENABLE_CIPHER_NULL
bool "Enable the null cipher"
diff --git a/net/fastd/Makefile b/net/fastd/Makefile
index 44b37b6ca300ba43f15d7a116fb654ccd0a69e99..8eabc34db6f3b906ddb1b5df5c232309e85d2ffb 100644
--- a/net/fastd/Makefile
+++ b/net/fastd/Makefile
@@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fastd
-PKG_VERSION:=18
-PKG_RELEASE:=4
+PKG_VERSION:=19
+PKG_RELEASE:=1
PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/NeoRaider/fastd/releases/download/v$(PKG_VERSION)
-PKG_HASH:=714ff09d7bd75f79783f744f6f8c5af2fe456c8cf876feaa704c205a73e043c9
+PKG_HASH:=6054608e2103b634c9d19ecd1ae058d4ec694747047130719db180578729783a
PKG_LICENSE:=BSD-2-Clause
PKG_LICENSE_FILES:=COPYRIGHT
@@ -27,8 +27,6 @@ PKG_CONFIG_DEPENDS:=\
CONFIG_FASTD_ENABLE_METHOD_GENERIC_POLY1305 \
CONFIG_FASTD_ENABLE_METHOD_GENERIC_UMAC \
CONFIG_FASTD_ENABLE_METHOD_NULL \
- CONFIG_FASTD_ENABLE_METHOD_XSALSA20_POLY1305 \
- CONFIG_FASTD_ENABLE_CIPHER_AES128_CTR \
CONFIG_FASTD_ENABLE_CIPHER_NULL \
CONFIG_FASTD_ENABLE_CIPHER_SALSA20 \
CONFIG_FASTD_ENABLE_CIPHER_SALSA2012 \
@@ -44,6 +42,7 @@ PKG_CONFIG_DEPENDS:=\
PKG_BUILD_DEPENDS:=nacl
+PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
@@ -73,7 +72,6 @@ CMAKE_OPTIONS += \
-DWITH_METHOD_GENERIC_POLY1305:BOOL=FALSE \
-DWITH_METHOD_GENERIC_UMAC:BOOL=FALSE \
-DWITH_METHOD_NULL:BOOL=FALSE \
- -DWITH_METHOD_XSALSA20_POLY1305:BOOL=FALSE \
-DWITH_CIPHER_AES128_CTR:BOOL=FALSE \
-DWITH_CIPHER_NULL:BOOL=FALSE \
-DWITH_CIPHER_SALSA20:BOOL=FALSE \
@@ -120,14 +118,6 @@ ifeq ($(CONFIG_FASTD_ENABLE_METHOD_NULL),y)
CMAKE_OPTIONS += -DWITH_METHOD_NULL:BOOL=TRUE
endif
-ifeq ($(CONFIG_FASTD_ENABLE_METHOD_XSALSA20_POLY1305),y)
-CMAKE_OPTIONS += -DWITH_METHOD_XSALSA20_POLY1305:BOOL=TRUE
-endif
-
-
-ifeq ($(CONFIG_FASTD_ENABLE_CIPHER_AES128_CTR),y)
-CMAKE_OPTIONS += -DWITH_CIPHER_AES128_CTR:BOOL=TRUE
-endif
ifeq ($(CONFIG_FASTD_ENABLE_CIPHER_NULL),y)
CMAKE_OPTIONS += -DWITH_CIPHER_NULL:BOOL=TRUE
diff --git a/net/fastd/patches/0001-resolve-fix-segmentation-fault-with-musl-1.1.20.patch b/net/fastd/patches/0001-resolve-fix-segmentation-fault-with-musl-1.1.20.patch
deleted file mode 100644
index 52c19174083c29e5da02cabb2ddc02474cf11b37..0000000000000000000000000000000000000000
--- a/net/fastd/patches/0001-resolve-fix-segmentation-fault-with-musl-1.1.20.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 9710132c04cd378bd36f16a2a3d98d9c4c5fdbac Mon Sep 17 00:00:00 2001
-From: David Bauer <mail@david-bauer.net>
-Date: Thu, 25 Jul 2019 18:51:25 +0200
-Subject: [PATCH] resolve: fix segmentation fault with musl >1.1.20
-
-When compiled with musl >1.1.20, fastd will crash in case it can't
-resolve a peers hostname. This is due to a changed implementation of
-freeaddrinfo in musl 1.1.21 onwards.
-
-This segfault is fixed by not calling freeaddrinfo in case the supplied
-pointer is null.
-
-Signed-off-by: David Bauer <mail@david-bauer.net>
----
- src/resolve.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/src/resolve.c b/src/resolve.c
-index 9bdfa1c..bfd2a59 100644
---- a/src/resolve.c
-+++ b/src/resolve.c
-@@ -104,7 +104,9 @@ static void * resolve_peer(void *varg) {
-
- fastd_async_enqueue(ASYNC_TYPE_RESOLVE_RETURN, ret, sizeof(fastd_async_resolve_return_t) + n_addr*sizeof(fastd_peer_address_t));
-
-- freeaddrinfo(res);
-+ if (res)
-+ freeaddrinfo(res);
-+
- free(arg->hostname);
- free(arg);
-
---
-2.20.1
-
diff --git a/net/fastd/patches/0002-doc-examples-openwrt-fix-init-script-wasn-t-working-.patch b/net/fastd/patches/0002-doc-examples-openwrt-fix-init-script-wasn-t-working-.patch
deleted file mode 100644
index b576a987369e93f3cd14fbc83f3c4bffe5cc97d1..0000000000000000000000000000000000000000
--- a/net/fastd/patches/0002-doc-examples-openwrt-fix-init-script-wasn-t-working-.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From c29b4b0e3cc5bf68129fd0f94f424950b7888deb Mon Sep 17 00:00:00 2001
-Message-Id: <c29b4b0e3cc5bf68129fd0f94f424950b7888deb.1567630068.git.mschiffer@universe-factory.net>
-From: Wilfried Klaebe <wklaebe@users.noreply.github.com>
-Date: Sat, 31 Aug 2019 21:44:13 +0200
-Subject: [PATCH] doc: examples/openwrt: fix init script, wasn't working with
- two VPNs
-
-If two VPNs were configured via uci, the init script complained about
-the peer group of its peers not matching its net.
----
- doc/examples/openwrt/fastd.init | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/doc/examples/openwrt/fastd.init b/doc/examples/openwrt/fastd.init
-index 15737b403ec2..4ba69ece9887 100644
---- a/doc/examples/openwrt/fastd.init
-+++ b/doc/examples/openwrt/fastd.init
-@@ -233,7 +233,7 @@ generate_peer_group_config() {
- config_get group_parent "$group" parent
- [ "$parent" = "$group_parent" ] || return 0
-
-- if [ "$net" != "$peer_net" ]; then
-+ if [ "$net" != "$group_net" ]; then
- [ -z "$parent" ] || error "warning: the parent of peer group '$group' doesn't match its net, the peer group will be ignored"
- return 0
- fi
---
-2.23.0
-
From: Nico <github@nicoboehr.de>
Date: Fri, 29 Dec 2023 23:17:27 +0000
Subject: uradvd: add patch to announce prefix with preferred lifetime 0
diff --git a/net/uradvd/patches/001-uradvd-announce-with-pref-0.patch b/net/uradvd/patches/001-uradvd-announce-with-pref-0.patch
new file mode 100644
index 0000000000000000000000000000000000000000..7882639d1bfec0923460c93f55fe9f44e58212c1
--- /dev/null
+++ b/net/uradvd/patches/001-uradvd-announce-with-pref-0.patch
@@ -0,0 +1,11 @@
+--- a/uradvd.c
++++ b/uradvd.c
+@@ -43,7 +43,7 @@
+
+ /* These are in seconds */
+ #define AdvValidLifetime 86400u
+-#define AdvPreferredLifetime 14400u
++#define AdvPreferredLifetime 0u
+ #define AdvDefaultLifetime 0u
+ #define AdvCurHopLimit 64u
+ #define AdvRDNSSLifetime 1200u
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 25 Apr 2025 02:06:17 +0200
Subject: perl: replace 910-miniperl-needs-inc-dot.patch with smaller scope fix
The patch was first introduced in commit 4a94479f9652 ("perl: update to
5.26.1") to fix the target build when the host perl has
default_inc_excludes_dot enabled. It just added back the `-I`. to every
call of miniperl; this solution is questionable however, as it adds `.` to
the beginning of the search path, not as a final fallback like perl did
before default_inc_excludes_dot (and like miniperl does).
It is also not necessary - only two scripts, write_buildcustomize.pl and
configpm, expect to be able to include a file from `.` (in both cases a
file the script just generated). Just fix the two scripts instead.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/lang/perl/patches/910-fix-default_inc_excludes_dot.patch b/lang/perl/patches/910-fix-default_inc_excludes_dot.patch
new file mode 100644
index 0000000000000000000000000000000000000000..ab3e6243bda314f137d1c328fbbf0e7f3bb34f36
--- /dev/null
+++ b/lang/perl/patches/910-fix-default_inc_excludes_dot.patch
@@ -0,0 +1,22 @@
+--- a/write_buildcustomize.pl
++++ b/write_buildcustomize.pl
+@@ -3,7 +3,7 @@
+ use strict;
+
+ my $osname = $^O;
+-my $file = 'lib/buildcustomize.pl';
++my $file = './lib/buildcustomize.pl';
+
+ if ( @ARGV % 2 ) {
+ my $dir = shift;
+--- a/configpm
++++ b/configpm
+@@ -129,7 +129,7 @@ if ($Opts{chdir}) {
+ my ($Config_SH, $Config_PM, $Config_heavy, $Config_POD);
+ my $Glossary = 'Porting/Glossary';
+
+-$Config_PM = "lib/Config.pm";
++$Config_PM = "./lib/Config.pm";
+ $Config_POD = "lib/Config.pod";
+ $Config_SH = "config.sh";
+
diff --git a/lang/perl/patches/910-miniperl-needs-inc-dot.patch b/lang/perl/patches/910-miniperl-needs-inc-dot.patch
deleted file mode 100644
index 6997f04d575e5bb92e78052cf693ae39bb464a20..0000000000000000000000000000000000000000
--- a/lang/perl/patches/910-miniperl-needs-inc-dot.patch
+++ /dev/null
@@ -1,38 +0,0 @@
---- a/Makefile.SH
-+++ b/Makefile.SH
-@@ -346,7 +346,7 @@ OBJ_EXT = $_o
- # Macros to invoke a copy of miniperl during the build. Targets which
- # are built using these macros should depend on \$(MINIPERL_EXE)
- MINIPERL_EXE = miniperl\$(EXE_EXT)
--MINIPERL = \$(LDLIBPTH) ./miniperl\$(EXE_EXT) -Ilib
-+MINIPERL = \$(LDLIBPTH) ./miniperl\$(EXE_EXT) -Ilib -I.
-
- # Macros to invoke sort the MANIFEST during build
- MANIFEST_SRT = MANIFEST.srt
-@@ -1001,7 +1001,7 @@ lib/buildcustomize.pl: $& $(miniperl_obj
- @$(RMS) miniperl.xok
- $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \
- $(miniperl_objs) $(libs)
-- $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
-+ $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -I. -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
- $(MINIPERL) -f write_buildcustomize.pl
- !NO!SUBS!
- ;;
-@@ -1012,7 +1012,7 @@ lib/buildcustomize.pl: \$& \$(miniperl_d
- @\$(RMS) miniperl.xok
- @\$(RMS) \$(MINIPERL_EXE)
- \$(LNS) \$(HOST_PERL) \$(MINIPERL_EXE)
-- \$(LDLIBPTH) ./miniperl\$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
-+ \$(LDLIBPTH) ./miniperl\$(HOST_EXE_EXT) -w -Ilib -I. -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
- \$(MINIPERL) -f write_buildcustomize.pl 'osname' "$osname"
- !GROK!THIS!
- else
-@@ -1021,7 +1021,7 @@ lib/buildcustomize.pl: $& $(miniperl_dep
- @$(RMS) miniperl.xok
- $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
- $(miniperl_objs) $(libs)
-- $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
-+ $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -I. -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
- $(MINIPERL) -f write_buildcustomize.pl
- !NO!SUBS!
- fi
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 25 Apr 2025 12:35:23 +0200
Subject: perl: drop 110-always_use_miniperl.patch
The patch was introduced in commit 4c57844f0f04 ("lang/perl: Add hack to
make perl always use miniperl during build"), but it is not actually
necessary. By setting $perl to a non-empty value (using 'perl' as is
common on desktop distros), the logic works as intended and selects the
correct perl binary for host and target builds.
As miniperl just symlinks to host perl for target builds, the main
effect of this change is not unconditionally passing `-Ilib -I.`
anymore. This seems like a good thing; host libraries should be used
with host perl by default.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/lang/perl/files/base.config b/lang/perl/files/base.config
index 67232b6d83e70505e7e85ad6893a2661f4571f7f..7d8b88b200f589b0efad7b301d26c6f9b77dfb33 100644
--- a/lang/perl/files/base.config
+++ b/lang/perl/files/base.config
@@ -864,7 +864,7 @@ package='perl5'
pager='/usr/bin/less'
passcat='cat /etc/passwd'
path_sep=':'
-perl=''
+perl='perl'
perl5=''
perl_patchlevel=''
perl_static_inline='static __inline__'
diff --git a/lang/perl/patches/110-always_use_miniperl.patch b/lang/perl/patches/110-always_use_miniperl.patch
deleted file mode 100644
index 806a31256b2007ee5f2c36d75261fac0d176cc21..0000000000000000000000000000000000000000
--- a/lang/perl/patches/110-always_use_miniperl.patch
+++ /dev/null
@@ -1,27 +0,0 @@
---- a/Makefile.SH
-+++ b/Makefile.SH
-@@ -360,22 +360,11 @@ PERL_EXE_LDFLAGS=$exeldflags
- ;;
- esac
-
--case "$usecrosscompile$perl" in
--define?*)
-- $spitshell >>$Makefile <<!GROK!THIS!
--# Macros to invoke a copy of our fully operational perl during the build.
--PERL_EXE = perl\$(EXE_EXT)
--RUN_PERL = \$(LDLIBPTH) \$(RUN) $perl\$(EXE_EXT)
--!GROK!THIS!
-- ;;
--*)
-- $spitshell >>$Makefile <<!GROK!THIS!
-+$spitshell >>$Makefile <<!GROK!THIS!
- # Macros to invoke a copy of our fully operational perl during the build.
- PERL_EXE = perl\$(EXE_EXT)
--RUN_PERL = \$(LDLIBPTH) \$(RUN) ./perl\$(EXE_EXT) -Ilib -I.
-+RUN_PERL = \$(LDLIBPTH) \$(RUN) ./miniperl\$(EXE_EXT) -Ilib -I.
- !GROK!THIS!
-- ;;
--esac
-
- $spitshell >>$Makefile <<!GROK!THIS!
- # Macros to run our tests
diff --git a/lang/perl/patches/900-use-rm-force.patch b/lang/perl/patches/900-use-rm-force.patch
index 9e44f5402f184445dcf4e9c75d96d2e412e5c4e0..baff506f6427f0b16712c252b0159ad80db20243 100644
--- a/lang/perl/patches/900-use-rm-force.patch
+++ b/lang/perl/patches/900-use-rm-force.patch
@@ -8,7 +8,7 @@
ranlib = $ranlib
ECHO = $echo
-@@ -791,7 +792,7 @@ bitcount.h: generate_uudmap$(HOST_EXE_EX
+@@ -802,7 +803,7 @@ bitcount.h: generate_uudmap$(HOST_EXE_EX
./generate_uudmap$(HOST_EXE_EXT) $(generated_headers)
generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT)
@@ -17,7 +17,7 @@
$(LNS) $(HOST_GENERATE) generate_uudmap$(HOST_EXE_EXT)
!NO!SUBS!
-@@ -896,26 +897,26 @@ mydtrace.h: $(DTRACE_H)
+@@ -907,26 +908,26 @@ mydtrace.h: $(DTRACE_H)
define)
$spitshell >>$Makefile <<'!NO!SUBS!'
$(DTRACE_MINI_O): perldtrace.d $(miniperl_objs_nodt)
@@ -48,7 +48,7 @@
!NO!SUBS!
;;
-@@ -926,13 +927,13 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOAD
+@@ -937,13 +938,13 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOAD
case "$useshrplib" in
true)
$spitshell >>$Makefile <<'!NO!SUBS!'
@@ -64,7 +64,7 @@
mv $@ libperl$(OBJ_EXT)
$(AR) qv $(LIBPERL) libperl$(OBJ_EXT)
!NO!SUBS!
-@@ -941,7 +942,7 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOAD
+@@ -952,7 +953,7 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOAD
;;
*)
$spitshell >>$Makefile <<'!NO!SUBS!'
@@ -73,7 +73,7 @@
$(AR) rc $(LIBPERL) $(perllib_objs) $(DYNALOADER)
@$(ranlib) $(LIBPERL)
!NO!SUBS!
-@@ -975,7 +976,7 @@ $(MINIPERL_EXE): lib/buildcustomize.pl
+@@ -986,7 +987,7 @@ $(MINIPERL_EXE): lib/buildcustomize.pl
amigaos*)
$spitshell >>$Makefile <<'!NO!SUBS!'
lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl
@@ -82,7 +82,7 @@
$(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
$(miniperl_objs) $(libs)
# $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
-@@ -997,7 +998,7 @@ NAMESPACEFLAGS = -force_flat_namespace
+@@ -1008,7 +1009,7 @@ NAMESPACEFLAGS = -force_flat_namespace
esac
$spitshell >>$Makefile <<'!NO!SUBS!'
lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl
@@ -91,7 +91,7 @@
$(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \
$(miniperl_objs) $(libs)
$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
-@@ -1008,8 +1009,8 @@ lib/buildcustomize.pl: $& $(miniperl_obj
+@@ -1019,8 +1020,8 @@ lib/buildcustomize.pl: $& $(miniperl_obj
if test "X$hostperl" != X; then
$spitshell >>$Makefile <<!GROK!THIS!
lib/buildcustomize.pl: \$& \$(miniperl_dep) write_buildcustomize.pl
@@ -102,7 +102,7 @@
\$(LNS) \$(HOST_PERL) \$(MINIPERL_EXE)
\$(LDLIBPTH) ./miniperl\$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
\$(MINIPERL) -f write_buildcustomize.pl 'osname' "$osname"
-@@ -1017,7 +1018,7 @@ lib/buildcustomize.pl: \$& \$(miniperl_d
+@@ -1028,7 +1029,7 @@ lib/buildcustomize.pl: \$& \$(miniperl_d
else
$spitshell >>$Makefile <<'!NO!SUBS!'
lib/buildcustomize.pl: $& $(miniperl_dep) write_buildcustomize.pl
@@ -111,7 +111,7 @@
$(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
$(miniperl_objs) $(libs)
$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
-@@ -1030,7 +1031,7 @@ lib/buildcustomize.pl: $& $(miniperl_dep
+@@ -1041,7 +1042,7 @@ lib/buildcustomize.pl: $& $(miniperl_dep
$spitshell >>$Makefile <<'!NO!SUBS!'
$(PERL_EXE): $& $(perlmain_dep) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) write_buildcustomize.pl
@@ -120,7 +120,7 @@
!NO!SUBS!
case "$osname" in
-@@ -1130,8 +1131,8 @@ pod/perl5400delta.pod: pod/perldelta.pod
+@@ -1141,8 +1142,8 @@ pod/perl5400delta.pod: pod/perldelta.pod
$(LNS) perldelta.pod pod/perl5400delta.pod
extra.pods: $(MINIPERL_EXE)
@@ -131,7 +131,7 @@
-@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \
nx=`echo $$x | sed -e "s/README\.//"`; \
$(LNS) ../$$x "pod/perl"$$nx".pod" ; \
-@@ -1330,11 +1331,11 @@ realclean: _realcleaner _mopup
+@@ -1341,11 +1342,11 @@ realclean: _realcleaner _mopup
@echo "Note that '$(MAKE) realclean' does not delete config.sh or Policy.sh"
_clobber:
@@ -148,7 +148,7 @@
clobber: _realcleaner _mopup _clobber
-@@ -1342,24 +1343,24 @@ distclean: clobber
+@@ -1353,24 +1354,24 @@ distclean: clobber
# Like distclean but also removes emacs backups and *.orig.
veryclean: _verycleaner _mopup _clobber
@@ -184,7 +184,7 @@
-cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN)
-cd utils; $(LDLIBPTH) $(MAKE) $(CLEAN)
-@if test -f $(MINIPERL_EXE) ; then \
-@@ -1369,8 +1370,8 @@ _cleaner1:
+@@ -1380,8 +1381,8 @@ _cleaner1:
else \
sh $(CLEAN).sh ; \
fi
@@ -195,7 +195,7 @@
# Dear POSIX, thanks for making the default to xargs to be
# run once if nothing is passed in. It is such a great help.
-@@ -1385,24 +1386,24 @@ _cleaner1:
+@@ -1396,24 +1397,24 @@ _cleaner1:
# Add new rules before that line - the next line (rm -f so_locations ...) is
# used as a placeholder by a regen script.
_cleaner2:
@@ -237,7 +237,7 @@
-rmdir lib/version lib/threads lib/inc/ExtUtils lib/inc lib/encoding
-rmdir lib/autodie/exception lib/autodie/Scope lib/autodie lib/XS
-rmdir lib/Win32API lib/VMS lib/Unicode/Collate/Locale
-@@ -1459,11 +1460,11 @@ _realcleaner:
+@@ -1470,11 +1471,11 @@ _realcleaner:
_verycleaner:
@$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=veryclean
@$(LDLIBPTH) $(MAKE) _cleaner2
@@ -251,7 +251,7 @@
lint $(lintflags) -DPERL_CORE -D_REENTRANT -DDEBUGGING -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(c)
cscopeflags = -Rb # Recursive, build-only.
-@@ -1524,7 +1525,7 @@ case "$targethost" in
+@@ -1535,7 +1536,7 @@ case "$targethost" in
'') $spitshell >>$Makefile <<'!NO!SUBS!'
test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \
$(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods) common_build
@@ -260,7 +260,7 @@
!NO!SUBS!
;;
-@@ -1574,7 +1575,7 @@ test_prep test-prep: test_prep_pre \$(MI
+@@ -1585,7 +1586,7 @@ test_prep test-prep: test_prep_pre \$(MI
$to config.sh
# --- For lib/diagnostics.t with -Duseshrplib
$to \$(PERL_EXE)
@@ -269,7 +269,7 @@
$to t/\$(PERL_EXE)
!GROK!THIS!
-@@ -1592,7 +1593,7 @@ else
+@@ -1603,7 +1604,7 @@ else
$spitshell >>$Makefile <<'!NO!SUBS!'
test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL)
$(MINIPERL) make_ext.pl $(dynamic_ext_re) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic
@@ -278,7 +278,7 @@
!NO!SUBS!
fi
-@@ -1648,7 +1649,7 @@ minitest_prep: $(MINIPERL_EXE)
+@@ -1659,7 +1660,7 @@ minitest_prep: $(MINIPERL_EXE)
@echo "You may see some irrelevant test failures if you have been unable"
@echo "to build lib/Config.pm, or the Unicode data files."
@echo " "
diff --git a/lang/perl/patches/920-Revert-perl-127606-adjust-dependency-paths-on-instal.patch b/lang/perl/patches/920-Revert-perl-127606-adjust-dependency-paths-on-instal.patch
index e9e5688e475e810f45acbda5cd579c65e484b8b7..6436a8ea027f46a8ce1c41b13323b625cc51eb4d 100644
--- a/lang/perl/patches/920-Revert-perl-127606-adjust-dependency-paths-on-instal.patch
+++ b/lang/perl/patches/920-Revert-perl-127606-adjust-dependency-paths-on-instal.patch
@@ -42,10 +42,10 @@ Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
- ;;
-esac
-
- $spitshell >>$Makefile <<!GROK!THIS!
- # Macros to invoke a copy of our fully operational perl during the build.
- PERL_EXE = perl\$(EXE_EXT)
-@@ -1045,20 +1029,6 @@ $(PERL_EXE): $& $(perlmain_dep) $(LIBPER
+ case "$usecrosscompile$perl" in
+ define?*)
+ $spitshell >>$Makefile <<!GROK!THIS!
+@@ -1056,20 +1040,6 @@ $(PERL_EXE): $& $(perlmain_dep) $(LIBPER
$(SHRPENV) $(CC) -o perl $(CLDFLAGS) $(CCDLFLAGS) $(perlmain_objs) $(LLIBPERL) $(static_ext) `cat ext.libs` $(libs)
!NO!SUBS!
;;
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sat, 26 Apr 2025 22:37:16 +0200
Subject: perl: fix parallel build race condition in target build
We have received reports of builds of perl occasionally failing when
building with many parallel jobs, with a log like the following:
LD_LIBRARY_PATH=[...]/perl/perl-5.40.0 ./miniperl -Ilib make_ext.pl \
dist/constant/pm_to_blib MAKE="make" LIBPERL_A=libperl.so
File/Path.pm did not return a true value at [...]/hostpkg/usr/lib/perl5/5.40.0/ExtUtils/MakeMaker.pm line 13.
BEGIN failed--compilation aborted at [...]/hostpkg/usr/lib/perl5/5.40.0/ExtUtils/MakeMaker.pm line 13.
Compilation failed in require at Makefile.PL line 3.
BEGIN failed--compilation aborted at Makefile.PL line 3.
Unsuccessful Makefile.PL(dist/constant): code=65280 at make_ext.pl line 532.
The failing extension (dist/constant in the above log) would differ
between runs.
The cause of the issue is the `-Ilib` in the command line of miniperl.
In the host build, `./miniperl -I lib` will use the following include
path:
[..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/AutoLoader/lib
[..]/build_dir/hostpkg/perl/perl-5.40.0/dist/Carp/lib
[..]/build_dir/hostpkg/perl/perl-5.40.0/dist/PathTools
[..]/build_dir/hostpkg/perl/perl-5.40.0/dist/PathTools/lib
[..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/ExtUtils-Install/lib
[..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/ExtUtils-MakeMaker/lib
[..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/ExtUtils-Manifest/lib
[..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/File-Path/lib
[..]/build_dir/hostpkg/perl/perl-5.40.0/ext/re
[..]/build_dir/hostpkg/perl/perl-5.40.0/dist/Term-ReadLine/lib
[..]/build_dir/hostpkg/perl/perl-5.40.0/dist/Exporter/lib
[..]/build_dir/hostpkg/perl/perl-5.40.0/ext/File-Find/lib
[..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/Text-Tabs/lib
[..]/build_dir/hostpkg/perl/perl-5.40.0/dist/constant/lib
[..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/version/lib
[..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/Getopt-Long/lib
[..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/Text-ParseWords/lib
[..]/build_dir/hostpkg/perl/perl-5.40.0/cpan/ExtUtils-PL2Bat/lib
[..]/build_dir/hostpkg/perl/perl-5.40.0/lib
.
Various dependencies of the extension build scripts (Makefile.PL) -
including File-Path, which failed to be loaded in the error log - are
included in the path by buildcustomize.pl, as these extensions are only
installed to `lib` as the build proceeds.
However, in a target build, miniperl is just a symlink to the previously
built host perl. As the host perl does not implicitly load
`buildcustomize.pl`, we get the following include path for
`./miniperl -Ilib`:
lib
[..]/staging_dir/hostpkg/usr/lib/perl5/site_perl/5.40.0/x86_64-linux
[..]/staging_dir/hostpkg/usr/lib/perl5/site_perl/5.40.0
[..]/staging_dir/hostpkg/usr/lib/perl5/5.40.0/x86_64-linux
[..]/staging_dir/hostpkg/usr/lib/perl5/5.40.0
The host perl's install location is used as the default include path
which provides File-Path etc. for the target build; however, as more
and more libraries get installed into `lib` during the extension build,
they may get loaded from there instead, as `lib` is at the beginning of
the include path. When multiple extensions are built in parallel, a
Makefile.PL may attempt to load File/Path from `lib` after the file has
been created, but before its contents have been written fully, resulting
in the build to fail.
In fact, we should not load anything from `lib` during the target build,
as it is the staging directory for the target, including native
extensions built for the target architecture - with one exception: The
build scripts expect to find target information in the `Config` module,
so simply removing `lib` from the include path completely would break
the build.
Solve the issue by creating an alternative lib directory `lib_build`,
symlinking `Config.pm` and its dependencies in it, and replacing the
`-Ilib` argument with `-Ilib_build` using a wrapper script around the
host perl executable. This is similar to the approach seen in perl's own
obsolete/broken cross compile scripts (`Cross/Makefile`).
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/lang/perl/Makefile b/lang/perl/Makefile
index 6a6dd5ea86798e7e95e3657a94cca829dbd0924b..6ad27818e17c211abc1530eb0d1b1e7c1238bf28 100644
--- a/lang/perl/Makefile
+++ b/lang/perl/Makefile
@@ -92,6 +92,21 @@ endef
# Target perl
define Build/Configure
+ # We don't want to pass -Ilib to host perl in the target build (as lib
+ # contains the target libraries, and files may currently be written
+ # while being imported in parallel builds). We do however need the
+ # target versions of the Config modules at the beginning of the include
+ # path for the build scripts' use.
+ #
+ # Create an alternative lib_build directory that will be added to the
+ # include path instead of lib (using hostperl-wrapper), containing only
+ # the config modules.
+ $(INSTALL_DIR) $(PKG_BUILD_DIR)/lib_build
+ ln -sf ../lib/Config.pm ../lib/Config_heavy.pl ../lib/Config_git.pl $(PKG_BUILD_DIR)/lib_build/
+
+ install -m0755 files/hostperl-wrapper $(PKG_BUILD_DIR)/hostperl-wrapper
+ sed -i "s'@HOST_PERL@'$(HOST_PERL_PREFIX)/bin/perl'g" $(PKG_BUILD_DIR)/hostperl-wrapper
+
$(PERL_CMD) files/perlconfig.pl -Dowrt:target_cc='$(TARGET_CC)' \
-Dowrt:gccversion=$(CONFIG_GCC_VERSION) \
-Dowrt:target_cross='$(TARGET_CROSS)' \
diff --git a/lang/perl/files/base.config b/lang/perl/files/base.config
index 7d8b88b200f589b0efad7b301d26c6f9b77dfb33..1cadfc10ac20c3b2bb05bed3c2cc8e946ba24eef 100644
--- a/lang/perl/files/base.config
+++ b/lang/perl/files/base.config
@@ -650,7 +650,7 @@ hint='recommended'
hostcat='cat /etc/hosts'
hostgenerate="$owrt:host_perl_prefix/bin/generate_uudmap"
hostosname=''
-hostperl="$owrt:host_perl_prefix/bin/perl"
+hostperl="./hostperl-wrapper"
html1dir=' '
html1direxp=''
html3dir=' '
diff --git a/lang/perl/files/hostperl-wrapper b/lang/perl/files/hostperl-wrapper
new file mode 100644
index 0000000000000000000000000000000000000000..e31ef1cf8fe37a7a90ee9dd7cc60d3ca947e7600
--- /dev/null
+++ b/lang/perl/files/hostperl-wrapper
@@ -0,0 +1,14 @@
+#!@HOST_PERL@
+
+foreach (@ARGV) {
+ # Stop parsing options if we encounter a non-option argument or --
+ last if $_ eq '--' || $_ !~ m/^-/;
+
+ # Modify first option of the form -Ilib, -I../lib, ... to refer to lib_build instead
+ if ($_ =~ m@-I(.*/)?lib@) {
+ $_ .= '_build';
+ last;
+ }
+}
+
+exec '@HOST_PERL@', @ARGV
From: Linus Lüssing <linus.luessing@c0d3.blue>
Date: Sun, 10 Nov 2024 19:34:26 +0100
Subject: batman-adv: Introduce no noflood mark
This mark prevents a multicast packet being flooded through the whole
mesh. The advantage of marking certain multicast packets via e.g.
ebtables instead of dropping is then the following:
This allows an administrator to let specific multicast packets pass as
long as they are forwarded to a limited number of nodes only and are
therefore creating no burdon to unrelated nodes.
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
diff --git a/batman-adv/patches/2002-batman-adv-Introduce-no-noflood-mark.patch b/batman-adv/patches/2002-batman-adv-Introduce-no-noflood-mark.patch
new file mode 100644
index 0000000000000000000000000000000000000000..6058bff5bb4d07c78a82f59b47213a52b04d6a1e
--- /dev/null
+++ b/batman-adv/patches/2002-batman-adv-Introduce-no-noflood-mark.patch
@@ -0,0 +1,137 @@
+From: Linus Lüssing <linus.luessing@c0d3.blue>
+Date: Sat, 31 Mar 2018 03:36:19 +0200
+Subject: batman-adv: Introduce no noflood mark
+
+This mark prevents a multicast packet being flooded through the whole
+mesh. The advantage of marking certain multicast packets via e.g.
+ebtables instead of dropping is then the following:
+
+This allows an administrator to let specific multicast packets pass as
+long as they are forwarded to a limited number of nodes only and are
+therefore creating no burdon to unrelated nodes.
+
+Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
+
+--- a/include/uapi/linux/batman_adv.h
++++ b/include/uapi/linux/batman_adv.h
+@@ -481,6 +481,18 @@ enum batadv_nl_attrs {
+ */
+ BATADV_ATTR_MULTICAST_FANOUT,
+
++ /**
++ * @BATADV_ATTR_NOFLOOD_MARK: the noflood mark which allows to tag
++ * frames which should never be broadcast flooded through the mesh.
++ */
++ BATADV_ATTR_NOFLOOD_MARK,
++
++ /**
++ * @BATADV_ATTR_NOFLOOD_MASK: the noflood (bit)mask which allows to tag
++ * frames which should never be broadcast flooded through the mesh.
++ */
++ BATADV_ATTR_NOFLOOD_MASK,
++
+ /* add attributes above here, update the policy in netlink.c */
+
+ /**
+--- a/net/batman-adv/netlink.c
++++ b/net/batman-adv/netlink.c
+@@ -133,6 +133,8 @@ static const struct nla_policy batadv_ne
+ [BATADV_ATTR_AP_ISOLATION_ENABLED] = { .type = NLA_U8 },
+ [BATADV_ATTR_ISOLATION_MARK] = { .type = NLA_U32 },
+ [BATADV_ATTR_ISOLATION_MASK] = { .type = NLA_U32 },
++ [BATADV_ATTR_NOFLOOD_MARK] = { .type = NLA_U32 },
++ [BATADV_ATTR_NOFLOOD_MASK] = { .type = NLA_U32 },
+ [BATADV_ATTR_BONDING_ENABLED] = { .type = NLA_U8 },
+ [BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE_ENABLED] = { .type = NLA_U8 },
+ [BATADV_ATTR_DISTRIBUTED_ARP_TABLE_ENABLED] = { .type = NLA_U8 },
+@@ -285,6 +287,14 @@ static int batadv_netlink_mesh_fill(stru
+ bat_priv->isolation_mark_mask))
+ goto nla_put_failure;
+
++ if (nla_put_u32(msg, BATADV_ATTR_NOFLOOD_MARK,
++ bat_priv->noflood_mark))
++ goto nla_put_failure;
++
++ if (nla_put_u32(msg, BATADV_ATTR_NOFLOOD_MASK,
++ bat_priv->noflood_mark_mask))
++ goto nla_put_failure;
++
+ if (nla_put_u8(msg, BATADV_ATTR_BONDING_ENABLED,
+ !!atomic_read(&bat_priv->bonding)))
+ goto nla_put_failure;
+@@ -463,6 +473,18 @@ static int batadv_netlink_set_mesh(struc
+ bat_priv->isolation_mark_mask = nla_get_u32(attr);
+ }
+
++ if (info->attrs[BATADV_ATTR_NOFLOOD_MARK]) {
++ attr = info->attrs[BATADV_ATTR_NOFLOOD_MARK];
++
++ bat_priv->noflood_mark = nla_get_u32(attr);
++ }
++
++ if (info->attrs[BATADV_ATTR_NOFLOOD_MASK]) {
++ attr = info->attrs[BATADV_ATTR_NOFLOOD_MASK];
++
++ bat_priv->noflood_mark_mask = nla_get_u32(attr);
++ }
++
+ if (info->attrs[BATADV_ATTR_BONDING_ENABLED]) {
+ attr = info->attrs[BATADV_ATTR_BONDING_ENABLED];
+
+--- a/net/batman-adv/soft-interface.c
++++ b/net/batman-adv/soft-interface.c
+@@ -177,6 +177,23 @@ static void batadv_interface_set_rx_mode
+ {
+ }
+
++/**
++ * batadv_send_skb_has_noflood_mark() - check if packet has a noflood mark
++ * @bat_priv: the bat priv with all the soft interface information
++ * @skb: the packet to check
++ *
++ * Return: True if the skb's mark matches a configured noflood mark and
++ * noflood mark mask. False otherwise.
++ */
++static bool
++batadv_skb_has_noflood_mark(struct batadv_priv *bat_priv, struct sk_buff *skb)
++{
++ u32 match_mark = skb->mark & bat_priv->noflood_mark_mask;
++
++ return bat_priv->noflood_mark_mask &&
++ match_mark == bat_priv->noflood_mark;
++}
++
+ static netdev_tx_t batadv_interface_tx(struct sk_buff *skb,
+ struct net_device *soft_iface)
+ {
+@@ -333,6 +350,9 @@ send:
+ if (batadv_dat_snoop_outgoing_arp_request(bat_priv, skb))
+ brd_delay = msecs_to_jiffies(ARP_REQ_DELAY);
+
++ if (batadv_skb_has_noflood_mark(bat_priv, skb))
++ goto dropped;
++
+ if (batadv_skb_head_push(skb, sizeof(*bcast_packet)) < 0)
+ goto dropped;
+
+--- a/net/batman-adv/types.h
++++ b/net/batman-adv/types.h
+@@ -1711,6 +1711,18 @@ struct batadv_priv {
+ */
+ u32 isolation_mark_mask;
+
++ /**
++ * @noflood_mark: the skb->mark value used to allow directed targeting
++ * only
++ */
++ u32 noflood_mark;
++
++ /**
++ * @noflood_mark_mask: bitmask identifying the bits in skb->mark to be
++ * used for the noflood mark
++ */
++ u32 noflood_mark_mask;
++
+ /** @bcast_seqno: last sent broadcast packet sequence number */
+ atomic_t bcast_seqno;
+
From: Linus Lüssing <linus.luessing@c0d3.blue>
Date: Sun, 10 Nov 2024 19:35:52 +0100
Subject: batctl: Add noflood_mark command
Adds support for the new 'noflood_mark' setting in batman-adv.
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
diff --git a/batctl/patches/2002-batctl-Add-noflood_mark-command.patch b/batctl/patches/2002-batctl-Add-noflood_mark-command.patch
new file mode 100644
index 0000000000000000000000000000000000000000..d4498603785a21a71951a6195cd96661be44d685
--- /dev/null
+++ b/batctl/patches/2002-batctl-Add-noflood_mark-command.patch
@@ -0,0 +1,217 @@
+From 12884631753aa24d9e36c5d65950320ecab61384 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>
+Date: Fri, 26 Apr 2019 19:27:38 +0200
+Subject: [PATCH] batctl: Add noflood_mark command
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Adds support for the new 'noflood_mark' setting in batman-adv.
+
+Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
+---
+ Makefile | 1 +
+ README.rst | 15 ++++++
+ batman_adv.h | 12 +++++
+ noflood_mark.c | 140 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 168 insertions(+)
+ create mode 100644 noflood_mark.c
+
+--- a/Makefile
++++ b/Makefile
+@@ -69,6 +69,7 @@ $(eval $(call add_command,multicast_mode
+ $(eval $(call add_command,neighbors,y))
+ $(eval $(call add_command,neighbors_json,y))
+ $(eval $(call add_command,network_coding,y))
++$(eval $(call add_command,noflood_mark,y))
+ $(eval $(call add_command,orig_interval,y))
+ $(eval $(call add_command,originators,y))
+ $(eval $(call add_command,originators_json,y))
+--- a/README.rst
++++ b/README.rst
+@@ -430,6 +430,21 @@ Example::
+
+
+
++batctl noflood_mark
++=======================
++
++display or modify noflood_mark setting
++
++Usage::
++
++ batctl noflood_mark|nf $value[/0x$mask]
++
++* Example 1: ``batctl nf 0x00000001/0xffffffff``
++* Example 2: ``batctl nf 0x00040000/0xffff0000``
++* Example 3: ``batctl nf 16``
++* Example 4: ``batctl nf 0x0f``
++
++
+ batctl translocal
+ -----------------
+
+--- a/batman_adv.h
++++ b/batman_adv.h
+@@ -481,6 +481,18 @@ enum batadv_nl_attrs {
+ */
+ BATADV_ATTR_MULTICAST_FANOUT,
+
++ /**
++ * @BATADV_ATTR_NOFLOOD_MARK: the noflood mark which allows to tag
++ * frames which should never be broadcast flooded through the mesh.
++ */
++ BATADV_ATTR_NOFLOOD_MARK,
++
++ /**
++ * @BATADV_ATTR_NOFLOOD_MASK: the noflood (bit)mask which allows to tag
++ * frames which should never be broadcast flooded through the mesh.
++ */
++ BATADV_ATTR_NOFLOOD_MASK,
++
+ /* add attributes above here, update the policy in netlink.c */
+
+ /**
+--- /dev/null
++++ b/noflood_mark.c
+@@ -0,0 +1,140 @@
++// SPDX-License-Identifier: GPL-2.0
++/* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors:
++ *
++ * Antonio Quartulli <a@unstable.cc>
++ * Linus Lüssing <linus.luessing@c0d3.blue>
++ *
++ * License-Filename: LICENSES/preferred/GPL-2.0
++ */
++
++#include <errno.h>
++#include <stddef.h>
++#include <stdint.h>
++#include <string.h>
++
++#include "main.h"
++#include "sys.h"
++
++static struct noflood_mark_data {
++ uint32_t noflood_mark;
++ uint32_t noflood_mask;
++} noflood_mark;
++
++static int parse_noflood_mark(struct state *state, int argc, char *argv[])
++{
++ struct settings_data *settings = state->cmd->arg;
++ struct noflood_mark_data *data = settings->data;
++ char *mask_ptr;
++ char buff[256];
++ uint32_t mark;
++ uint32_t mask;
++ char *endptr;
++
++ if (argc != 2) {
++ fprintf(stderr, "Error - incorrect number of arguments (expected 1)\n");
++ return -EINVAL;
++ }
++
++ strncpy(buff, argv[1], sizeof(buff));
++ buff[sizeof(buff) - 1] = '\0';
++
++ /* parse the mask if it has been specified, otherwise assume the mask is
++ * the biggest possible
++ */
++ mask = 0xFFFFFFFF;
++ mask_ptr = strchr(buff, '/');
++ if (mask_ptr) {
++ *mask_ptr = '\0';
++ mask_ptr++;
++
++ /* the mask must be entered in hex base as it is going to be a
++ * bitmask and not a prefix length
++ */
++ mask = strtoul(mask_ptr, &endptr, 16);
++ if (!endptr || *endptr != '\0')
++ goto inval_format;
++ }
++
++ /* the mark can be entered in any base */
++ mark = strtoul(buff, &endptr, 0);
++ if (!endptr || *endptr != '\0')
++ goto inval_format;
++
++ data->noflood_mask = mask;
++ /* erase bits not covered by the mask */
++ data->noflood_mark = mark & mask;
++
++ return 0;
++
++inval_format:
++ fprintf(stderr, "Error - incorrect number of arguments (expected 1)\n");
++ fprintf(stderr, "The following formats for mark(/mask) are allowed:\n");
++ fprintf(stderr, " * 0x12345678\n");
++ fprintf(stderr, " * 0x12345678/0xabcdef09\n");
++ return -EINVAL;
++}
++
++static int print_noflood_mark(struct nl_msg *msg, void *arg)
++{
++ struct nlattr *attrs[BATADV_ATTR_MAX + 1];
++ struct nlmsghdr *nlh = nlmsg_hdr(msg);
++ struct genlmsghdr *ghdr;
++ int *result = arg;
++
++ if (!genlmsg_valid_hdr(nlh, 0))
++ return NL_OK;
++
++ ghdr = nlmsg_data(nlh);
++
++ if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
++ genlmsg_len(ghdr), batadv_netlink_policy)) {
++ return NL_OK;
++ }
++
++ if (!attrs[BATADV_ATTR_NOFLOOD_MARK] ||
++ !attrs[BATADV_ATTR_NOFLOOD_MASK])
++ return NL_OK;
++
++ printf("0x%08x/0x%08x\n",
++ nla_get_u32(attrs[BATADV_ATTR_NOFLOOD_MARK]),
++ nla_get_u32(attrs[BATADV_ATTR_NOFLOOD_MASK]));
++
++ *result = 0;
++ return NL_STOP;
++}
++
++static int get_noflood_mark(struct state *state)
++{
++ return sys_simple_nlquery(state, BATADV_CMD_GET_MESH,
++ NULL, print_noflood_mark);
++}
++
++static int set_attrs_noflood_mark(struct nl_msg *msg, void *arg)
++{
++ struct state *state = arg;
++ struct settings_data *settings = state->cmd->arg;
++ struct noflood_mark_data *data = settings->data;
++
++ nla_put_u32(msg, BATADV_ATTR_NOFLOOD_MARK, data->noflood_mark);
++ nla_put_u32(msg, BATADV_ATTR_NOFLOOD_MASK, data->noflood_mask);
++
++ return 0;
++}
++
++static int set_noflood_mark(struct state *state)
++{
++ return sys_simple_nlquery(state, BATADV_CMD_SET_MESH,
++ set_attrs_noflood_mark, NULL);
++}
++
++static struct settings_data batctl_settings_noflood_mark = {
++ .data = &noflood_mark,
++ .parse = parse_noflood_mark,
++ .netlink_get = get_noflood_mark,
++ .netlink_set = set_noflood_mark,
++};
++
++COMMAND_NAMED(SUBCOMMAND, noflood_mark, "nf", handle_sys_setting,
++ COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK,
++ &batctl_settings_noflood_mark,
++ "[mark] \tdisplay or modify noflood_mark setting");
#!/usr/bin/env bash
set -euo pipefail
echo "CONFIG_DEVEL=y"
if [ "$GLUON_AUTOREMOVE" != "0" ]; then
echo "CONFIG_AUTOREMOVE=y"
else
echo "# CONFIG_AUTOREMOVE is not set"
fi
#!/usr/bin/env bash
# shellcheck enable=check-unassigned-uppercase
set -euo pipefail
# move into base directory, in case this script is not executed via `make container`
cd "$(dirname "$0")/.."
# normalize branch name to reflect a valid image name
BRANCH=$(git branch --show-current 2>/dev/null | sed 's/[^a-z0-9-]/_/ig')
TAG="gluon:${BRANCH:-latest}"
if [ "$(command -v podman)" ]
then
podman build -t "${TAG}" contrib/docker
podman run -it --rm -u "$(id -u):$(id -g)" --userns=keep-id --volume="$(pwd):/gluon:z" "${TAG}"
elif [ "$(command -v docker)" ]
then
docker build -t "${TAG}" contrib/docker
docker run -it --rm -u "$(id -u):$(id -g)" --volume="$(pwd):/gluon" -e HOME=/gluon "${TAG}"
else
echo "Please install either podman or docker. Exiting" >&2
exit 1
fi
......@@ -28,6 +28,7 @@ mkdir(env.GLUON_IMAGEDIR..'/factory')
mkdir(env.GLUON_IMAGEDIR..'/sysupgrade')
mkdir(env.GLUON_IMAGEDIR..'/other')
mkdir(env.GLUON_DEBUGDIR)
mkdir(env.GLUON_METADIR..'/openwrt-profiles')
lib.include(target)
......@@ -81,9 +82,16 @@ local kernel_debug_dest = string.format('%s/gluon-%s-%s-%s-kernel-debug.tar.zst'
target)
lib.exec {'cp', kernel_debug_source, kernel_debug_dest}
-- copy OpenWrt profile JSON
local profile_json_source = string.format('openwrt/bin/targets/%s/profiles.json',
bindir)
local profile_json_dest = string.format('%s/openwrt-profiles/%s.json',
env.GLUON_METADIR,
target)
lib.exec {'cp', profile_json_source, profile_json_dest}
-- Copy opkg repo
if lib.opkg and (env.GLUON_DEVICES or '') == '' then
if (env.GLUON_DEVICES or '') == '' then
local package_prefix = string.format('gluon-%s-%s', lib.site_code, env.GLUON_RELEASE)
local function dest_dir(prefix)
return env.GLUON_PACKAGEDIR..'/'..prefix..'/'..bindir
......@@ -92,5 +100,6 @@ if lib.opkg and (env.GLUON_DEVICES or '') == '' then
lib.exec {'rm', '-f', dest_dir('\0')..'/\0'}
lib.exec({'rmdir', '-p', dest_dir('\0')}, true, '2>/dev/null')
mkdir(dest_dir(package_prefix))
lib.exec {'rm', '-rf', 'openwrt/bin/targets/'..bindir..'/packages/tmp'}
lib.exec {'cp', 'openwrt/bin/targets/'..bindir..'/packages/\0', dest_dir(package_prefix)}
end
#!/bin/sh
# list feeds which don't start with #
DEFAULT_FEEDS="$(awk '!/^#/ {print $2}' openwrt/feeds.conf.default)"
export DEFAULT_FEEDS
local cjson = require 'cjson'
local json = require 'jsonc'
local function load_json(filename)
local f = assert(io.open(filename))
local json = cjson.decode(f:read('*a'))
f:close()
return json
end
local domain = load_json(arg[1])
local domain = assert(json.load(arg[1]))
for k, _ in pairs(domain.domain_names) do
print(k)
end
local M = {}
local function to_keys(t)
local ret = {}
for _, v in ipairs(t) do
ret[v] = true
end
return ret
end
local function collect_keys(t)
local ret = {}
for v in pairs(t) do
table.insert(ret, v)
end
return ret
end
function M.get_packages(files, features)
local enabled_features = to_keys(features)
local handled_features = {}
local packages = {}
local funcs = {}
local function add_pkgs(pkgs)
for _, pkg in ipairs(pkgs or {}) do
packages[pkg] = true
end
end
function funcs._(feature)
return enabled_features[feature] ~= nil
end
function funcs.feature(feature, pkgs)
assert(
type(feature) == 'string',
'Incorrect use of feature(): pass a feature name without _ as first argument')
if enabled_features[feature] then
handled_features[feature] = true
add_pkgs(pkgs)
end
end
function funcs.when(cond, pkgs)
assert(
type(cond) == 'boolean',
'Incorrect use of when(): pass a locical expression of _-prefixed strings as first argument')
if cond then
add_pkgs(pkgs)
end
end
-- Evaluate the feature definition files
for _, file in ipairs(files) do
local f, err = loadfile(file)
if not f then
error('Failed to parse feature definition: ' .. err)
end
setfenv(f, funcs)
f()
end
-- Handle default packages
for _, feature in ipairs(features) do
if not handled_features[feature] then
packages['gluon-' .. feature] = true
end
end
return collect_keys(packages)
end
return M
#!/bin/bash --norc
set -e
shopt -s nullglob
nodefault() {
# We define a function instead of a variable, as variables could
# be predefined in the environment (in theory)
eval "gluon_feature_nodefault_$1() {
:
}"
}
packages() {
:
}
for f in package/features packages/*/features; do
. "$f"
done
# Shell variables can't contain minus signs, so we escape them
# using underscores (and also escape underscores to avoid mapping
# multiple inputs to the same output)
sanitize() {
local v="$1"
v="${v//_/_1}"
v="${v//-/_2}"
echo -n "$v"
}
vars=()
for feature in $1; do
if [ "$(type -t "gluon_feature_nodefault_${feature}")" != 'function' ]; then
echo "gluon-${feature}"
fi
vars+=("$(sanitize "$feature")=1")
done
nodefault() {
:
}
# shellcheck disable=SC2086
packages() {
local cond="$(sanitize "$1")"
shift
# We only allow variable names, parentheses and the operators: & | !
if grep -q '[^A-Za-z0-9_()&|! ]' <<< "$cond"; then
exit 1
fi
# Let will return false when the result of the passed expression is 0,
# so we always add 1. This way false is only returned for syntax errors.
local ret="$(env -i "${vars[@]}" bash --norc -ec "let _result_='1+($cond)'; echo -n \"\$_result_\"" 2>/dev/null)"
case "$ret" in
2)
for pkg in "$@"; do
echo "$pkg"
done
;;
1)
;;
*)
exit 1
esac
}
for f in package/features packages/*/features; do
. "$f"
done