From f10371334b48649b6bbc2cc21e5401143af9cc81 Mon Sep 17 00:00:00 2001 From: ValdikSS ValdikSS Date: Sun, 15 Jan 2023 01:32:19 +0300 Subject: [PATCH 001/102] miredo: add miredo.conf conffile Keep miredo.conf modified configuration upon upgrades Signed-off-by: ValdikSS ValdikSS --- ipv6/miredo/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ipv6/miredo/Makefile b/ipv6/miredo/Makefile index f25a86df..9e1390a2 100644 --- a/ipv6/miredo/Makefile +++ b/ipv6/miredo/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=miredo PKG_VERSION:=1.2.6 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=miredo-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://www.remlab.net/files/miredo/ @@ -36,6 +36,10 @@ define Package/miredo/description IPv6 connectivity even from behind NAT devices. endef +define Package/miredo/conffiles +/etc/miredo/miredo.conf +endef + CONFIGURE_ARGS+= \ --enable-shared \ --enable-static \ From 0a98dc5515d8d35080030a234c9ef931c9428257 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Wed, 11 Jan 2023 11:36:27 +0800 Subject: [PATCH 002/102] golang: Update to 1.19.5 Go1.19.5 (released 2023-01-10) includes fixes to the compiler, the linker, and the crypto/x509, net/http, sync/atomic, and syscall packages. Removed upstreamed patch. Signed-off-by: Tianling Shen --- lang/golang/golang/Makefile | 4 +- ...jump-tables-when-spectre-retpolines-.patch | 67 ------------------- 2 files changed, 2 insertions(+), 69 deletions(-) delete mode 100644 lang/golang/golang/patches/010-cmd-compile-turn-off-jump-tables-when-spectre-retpolines-.patch diff --git a/lang/golang/golang/Makefile b/lang/golang/golang/Makefile index 4377965c..8bea7695 100644 --- a/lang/golang/golang/Makefile +++ b/lang/golang/golang/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk GO_VERSION_MAJOR_MINOR:=1.19 -GO_VERSION_PATCH:=4 +GO_VERSION_PATCH:=5 PKG_NAME:=golang PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH)) @@ -20,7 +20,7 @@ GO_SOURCE_URLS:=https://dl.google.com/go/ \ PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz PKG_SOURCE_URL:=$(GO_SOURCE_URLS) -PKG_HASH:=eda74db4ac494800a3e66ee784e495bfbb9b8e535df924a8b01b1a8028b7f368 +PKG_HASH:=8e486e8e85a281fc5ce3f0bedc5b9d2dbf6276d7db0b25d3ec034f313da0375f PKG_MAINTAINER:=Jeffery To PKG_LICENSE:=BSD-3-Clause diff --git a/lang/golang/golang/patches/010-cmd-compile-turn-off-jump-tables-when-spectre-retpolines-.patch b/lang/golang/golang/patches/010-cmd-compile-turn-off-jump-tables-when-spectre-retpolines-.patch deleted file mode 100644 index 18995717..00000000 --- a/lang/golang/golang/patches/010-cmd-compile-turn-off-jump-tables-when-spectre-retpolines-.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 156578067111742b55718066c91b8ec66d35e03d Mon Sep 17 00:00:00 2001 -From: Keith Randall -Date: Mon, 5 Dec 2022 16:26:26 -0800 -Subject: [PATCH] [release-branch.go1.19] cmd/compile: turn off jump tables - when spectre retpolines are on - -Fixes #57100 - -Change-Id: I6ab659abbca1ae0ac8710674d39aec116fab0baa -Reviewed-on: https://go-review.googlesource.com/c/go/+/455336 -Reviewed-by: Keith Randall -Reviewed-by: Cherry Mui -TryBot-Result: Gopher Robot -Run-TryBot: Keith Randall -(cherry picked from commit 1eb0465fa596a2d6e9c1a632499989544f0d7e68) -Reviewed-on: https://go-review.googlesource.com/c/go/+/455416 -Reviewed-by: Michael Pratt ---- - src/cmd/compile/internal/walk/switch.go | 2 +- - test/codegen/retpoline.go | 28 +++++++++++++++++++++++++ - 2 files changed, 29 insertions(+), 1 deletion(-) - ---- a/src/cmd/compile/internal/walk/switch.go -+++ b/src/cmd/compile/internal/walk/switch.go -@@ -289,7 +289,7 @@ func (s *exprSwitch) tryJumpTable(cc []e - const minCases = 8 // have at least minCases cases in the switch - const minDensity = 4 // use at least 1 out of every minDensity entries - -- if !go119UseJumpTables || base.Flag.N != 0 || !ssagen.Arch.LinkArch.CanJumpTable { -+ if !go119UseJumpTables || base.Flag.N != 0 || !ssagen.Arch.LinkArch.CanJumpTable || base.Ctxt.Retpoline { - return false - } - if len(cc) < minCases { ---- a/test/codegen/retpoline.go -+++ b/test/codegen/retpoline.go -@@ -12,3 +12,31 @@ func CallInterface(x interface{ M() }) { - // amd64:`CALL\truntime.retpoline` - x.M() - } -+ -+// Check to make sure that jump tables are disabled -+// when retpoline is on. See issue 57097. -+func noJumpTables(x int) int { -+ switch x { -+ case 0: -+ return 0 -+ case 1: -+ return 1 -+ case 2: -+ return 2 -+ case 3: -+ return 3 -+ case 4: -+ return 4 -+ case 5: -+ return 5 -+ case 6: -+ return 6 -+ case 7: -+ return 7 -+ case 8: -+ return 8 -+ case 9: -+ return 9 -+ } -+ return 10 -+} From a847d7d37b61e2fcd8efac330118f5a821febe7f Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 14 Jan 2023 12:58:01 -0800 Subject: [PATCH 003/102] perl-compress-bzip2: update to 2.28 Signed-off-by: Rosen Penev --- lang/perl-compress-bzip2/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/perl-compress-bzip2/Makefile b/lang/perl-compress-bzip2/Makefile index 123ce95f..d726a46d 100644 --- a/lang/perl-compress-bzip2/Makefile +++ b/lang/perl-compress-bzip2/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=perl-compress-bzip2 -PKG_VERSION:=2.26 +PKG_VERSION:=2.28 PKG_RELEASE:=1 PKG_SOURCE:=Compress-Bzip2-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.cpan.org/authors/id/R/RU/RURBAN/ -PKG_HASH:=5132f0c5f377a54d77ee36d332aa0ece585c22a40f2c31f2619e40262f5c4f0c +PKG_HASH:=859f835c3f5c998810d8b2a6f9e282ff99d6cb66ccfa55cae7e66dafb035116e PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Compress-Bzip2-$(PKG_VERSION) PKG_MAINTAINER:=Marcel Denia From 28981df8a68b1ef55867584a034109deb9848b3e Mon Sep 17 00:00:00 2001 From: Julien Malik Date: Tue, 3 Jan 2023 11:42:45 +0100 Subject: [PATCH 004/102] borgbackup: bump to 1.2.3 Signed-off-by: Julien Malik --- lang/python/borgbackup/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/python/borgbackup/Makefile b/lang/python/borgbackup/Makefile index 8c6a8a92..0637d1b0 100644 --- a/lang/python/borgbackup/Makefile +++ b/lang/python/borgbackup/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=borgbackup -PKG_VERSION:=1.2.2 +PKG_VERSION:=1.2.3 PKG_RELEASE:=1 PYPI_NAME:=borgbackup -PKG_HASH:=d730687443f1beb602b1d72bae36318f6f9654818fcdc50458540ec579e57260 +PKG_HASH:=e32418f8633c96fa9681352a56eb63b98e294203472c114a5242709d36966785 PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=LICENSE From 720dfab65a6de4bcfde1ddec5e651d1fa4c07f93 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 14 Jan 2023 13:27:36 -0800 Subject: [PATCH 005/102] python3-libselinux: fix URL Signed-off-by: Rosen Penev --- lang/python/python3-libselinux/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/python/python3-libselinux/Makefile b/lang/python/python3-libselinux/Makefile index d51c4035..95cb2a81 100644 --- a/lang/python/python3-libselinux/Makefile +++ b/lang/python/python3-libselinux/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk SRC_NAME:=libselinux PKG_NAME:=python3-$(SRC_NAME) PKG_VERSION:=3.3 -PKG_RELEASE:=$(AUTORELEASE) +PKG_RELEASE:=2 PKG_BUILD_DIR:=$(BUILD_DIR)/python-libselinux/$(SRC_NAME)-$(PKG_VERSION) PKG_SOURCE:=$(SRC_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/20200710 +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) PKG_HASH:=acfdee27633d2496508c28727c3d41d3748076f66d42fccde2e6b9f3463a7057 PKG_BUILD_DEPENDS:=swig/host From fa7b37cbdfbdd875383949cde43d62cb06ef539e Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 14 Jan 2023 13:41:37 -0800 Subject: [PATCH 006/102] python3-libsemanage: fix URL Signed-off-by: Rosen Penev --- lang/python/python3-libsemanage/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/python/python3-libsemanage/Makefile b/lang/python/python3-libsemanage/Makefile index 8c867f59..c1a82576 100644 --- a/lang/python/python3-libsemanage/Makefile +++ b/lang/python/python3-libsemanage/Makefile @@ -12,7 +12,7 @@ PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/python-libsemanage/$(SRC_NAME)-$(PKG_VERSION) PKG_SOURCE:=$(SRC_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) PKG_HASH:=d722a55ca4fe2d4e2b30527720db657e6238b28079e69e2e4affeb8e733ee511 PKG_BUILD_DEPENDS:=swig/host From d0ec3e33938b08fba5184d383a689792d863995a Mon Sep 17 00:00:00 2001 From: Julien Malik Date: Tue, 3 Jan 2023 11:41:21 +0100 Subject: [PATCH 007/102] python-exceptiongroup: bump to 1.1.0 Signed-off-by: Julien Malik --- lang/python/python-exceptiongroup/Makefile | 4 ++-- ...add-setup.py-to-avoid-depending-on-flit-for-building.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/python/python-exceptiongroup/Makefile b/lang/python/python-exceptiongroup/Makefile index dd64f921..7c096dc5 100644 --- a/lang/python/python-exceptiongroup/Makefile +++ b/lang/python/python-exceptiongroup/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-exceptiongroup -PKG_VERSION:=1.0.4 +PKG_VERSION:=1.1.0 PKG_RELEASE:=1 PYPI_NAME:=exceptiongroup -PKG_HASH:=bd14967b79cd9bdb54d97323216f8fdf533e278df937aa2a90089e7d6e06e5ec +PKG_HASH:=bcb67d800a4497e1b404c2dd44fca47d3b7a5e5433dbab67f96c1a685cdfdf23 PKG_LICENSE:=MIT,Python-2.0 PKG_LICENSE_FILES:=LICENSE diff --git a/lang/python/python-exceptiongroup/patches/0001-add-setup.py-to-avoid-depending-on-flit-for-building.patch b/lang/python/python-exceptiongroup/patches/0001-add-setup.py-to-avoid-depending-on-flit-for-building.patch index ec276382..5c6cf251 100644 --- a/lang/python/python-exceptiongroup/patches/0001-add-setup.py-to-avoid-depending-on-flit-for-building.patch +++ b/lang/python/python-exceptiongroup/patches/0001-add-setup.py-to-avoid-depending-on-flit-for-building.patch @@ -1,4 +1,4 @@ -From 99e590f2177148420f3556bbb0dc2e493e94e45f Mon Sep 17 00:00:00 2001 +From d6a0c3045598597023ee2423144b134fc87f4b6f Mon Sep 17 00:00:00 2001 From: Julien Malik Date: Sat, 26 Nov 2022 13:05:20 +0100 Subject: [PATCH] add setup.py to avoid depending on flit for building @@ -17,7 +17,7 @@ Subject: [PATCH] add setup.py to avoid depending on flit for building + +setuptools.setup( + name='exceptiongroup', -+ version='1.0.4', ++ version='1.1.0', + description='Backport of PEP 654 (exception groups)', + author='Alex Grönholm', + author_email='Alex Grönholm ', From cc65f083f9a40a7c6a6568d20a98628a3f5ffe18 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Thu, 12 Jan 2023 12:14:53 +0000 Subject: [PATCH 008/102] python-requests: update URL The old 2.python-requests.org URL is not reachable on modern browsers, and is not the current canonical URL for the project. Update to the current best URL for the project. Signed-off-by: Karl Palsson --- lang/python/python-requests/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/python/python-requests/Makefile b/lang/python/python-requests/Makefile index 9fffa277..163c4983 100644 --- a/lang/python/python-requests/Makefile +++ b/lang/python/python-requests/Makefile @@ -28,7 +28,7 @@ define Package/python3-requests SECTION:=lang CATEGORY:=Languages TITLE:=HTTP library for Python - URL:=https://2.python-requests.org/ + URL:=https://requests.readthedocs.io DEPENDS:= \ +python3-light \ +python3-chardet \ From f4006698c541f9adff107022d68ade21e7f780b7 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 20 Nov 2022 20:28:45 -0800 Subject: [PATCH 009/102] vala: update to 0.56.3 Get rid of AUTORELEASE. This barely gets updated. Signed-off-by: Rosen Penev --- lang/vala/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/vala/Makefile b/lang/vala/Makefile index d0af5a1d..c61c86c2 100644 --- a/lang/vala/Makefile +++ b/lang/vala/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=vala -PKG_VERSION:=0.56.0 -PKG_RELEASE:=$(AUTORELEASE) +PKG_VERSION:=0.56.3 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=@GNOME/vala/0.56 -PKG_HASH:=d92bd13c5630905eeb6a983dcb702204da9731460c2a6e4e39f867996f371040 +PKG_SOURCE_URL:=@GNOME/vala/$(basename $(PKG_VERSION)) +PKG_HASH:=e1066221bf7b89cb1fa7327a3888645cb33b604de3bf45aa81132fd040b699bf PKG_MAINTAINER:= PKG_LICENSE:=LGPL-2.1-or-later From b380f19a324fb113bace1cdde757eaa9e0a203c4 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 27 Nov 2022 16:48:18 -0800 Subject: [PATCH 010/102] faad2: update to 2.10.1 Switch to local tarballs. Smaller and faster. Signed-off-by: Rosen Penev --- libs/faad2/Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libs/faad2/Makefile b/libs/faad2/Makefile index 90da2f7e..5bff3217 100644 --- a/libs/faad2/Makefile +++ b/libs/faad2/Makefile @@ -6,13 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=faad2 -PKG_VERSION:=2.10.0 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://codeload.github.com/knik0/faad2/tar.gz/2_10_0? -PKG_HASH:=0c6d9636c96f95c7d736f097d418829ced8ec6dbd899cc6cc82b728480a84bfb -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-2_10_0 +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=2.10.1 +PKG_SOURCE_URL:=https://github.com/knik0/faad2 +PKG_MIRROR_HASH:=8a42cbc5833bd3c076f92363f0cbbcf6f848231c59b2f17dbe5d151cb8684fe1 PKG_MAINTAINER:=Ted Hess PKG_LICENSE:=GPL-2.0-or-later From 05852dbc15e3dd66fa5d1f0bf49971d694cfa224 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 27 Nov 2022 17:46:15 -0800 Subject: [PATCH 011/102] hidapi: remove now obsolete iconv patch Signed-off-by: Rosen Penev --- libs/hidapi/Makefile | 2 +- libs/hidapi/patches/020-iconv.patch | 100 ---------------------------- 2 files changed, 1 insertion(+), 101 deletions(-) delete mode 100644 libs/hidapi/patches/020-iconv.patch diff --git a/libs/hidapi/Makefile b/libs/hidapi/Makefile index 59261bfe..b169a258 100644 --- a/libs/hidapi/Makefile +++ b/libs/hidapi/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hidapi PKG_VERSION:=0.12.0 -PKG_RELEASE:=$(AUTORELEASE) +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/libusb/hidapi/tar.gz/$(PKG_NAME)-$(PKG_VERSION)? diff --git a/libs/hidapi/patches/020-iconv.patch b/libs/hidapi/patches/020-iconv.patch deleted file mode 100644 index a30d540e..00000000 --- a/libs/hidapi/patches/020-iconv.patch +++ /dev/null @@ -1,100 +0,0 @@ -From cfcddf90ea6add9d4aaa99ee2decc5a9140bdf37 Mon Sep 17 00:00:00 2001 -From: Ihor Dutchak -Date: Sat, 18 Jun 2022 15:58:31 +0300 -Subject: [PATCH 1/3] Ensure Iconv is found when provided via CFLAGS/LDFLAGS - -- by default find_file/find_library doesn't respect CFLAGS/LDFLAGS, -and FindIconv fails to find Iconv; -- by explicitly trying to link against `-liconv` - we're checking if library is available in such way; -- additionally: if Iconv is detected as BUILT_IN, no need to explicitly depend on `Iconv::Iconv`; ---- - libusb/CMakeLists.txt | 41 +++++++++++++++++++++++++++++++++-------- - src/CMakeLists.txt | 3 --- - 2 files changed, 33 insertions(+), 11 deletions(-) - ---- a/libusb/CMakeLists.txt -+++ b/libusb/CMakeLists.txt -@@ -22,11 +22,53 @@ target_link_libraries(hidapi_libusb PRIV - if(HIDAPI_NO_ICONV) - target_compile_definitions(hidapi_libusb PRIVATE NO_ICONV) - else() -- if(NOT ANDROID AND NOT CMAKE_VERSION VERSION_LESS 3.11) -- find_package(Iconv REQUIRED) -+ if(NOT ANDROID) - include(CheckCSourceCompiles) -- target_link_libraries(hidapi_libusb PRIVATE Iconv::Iconv) -- set(CMAKE_REQUIRED_LIBRARIES "Iconv::Iconv") -+ -+ if(NOT CMAKE_VERSION VERSION_LESS 3.11) -+ message(STATUS "Check for Iconv") -+ find_package(Iconv) -+ if(Iconv_FOUND) -+ if(NOT Iconv_IS_BUILT_IN) -+ target_link_libraries(hidapi_libusb PRIVATE Iconv::Iconv) -+ set(CMAKE_REQUIRED_LIBRARIES "Iconv::Iconv") -+ if(NOT BUILD_SHARED_LIBS) -+ set(HIDAPI_NEED_EXPORT_ICONV TRUE PARENT_SCOPE) -+ endif() -+ endif() -+ else() -+ message(STATUS "Iconv Explicitly check '-liconv'") -+ # Sometime the build environment is not setup -+ # in a way CMake can find Iconv on its own by default. -+ # But if we simply link against iconv (-liconv), the build may succeed -+ # due to other compiler/link flags. -+ set(CMAKE_REQUIRED_LIBRARIES "iconv") -+ check_c_source_compiles(" -+ #include -+ #include -+ int main() { -+ char *a, *b; -+ size_t i, j; -+ iconv_t ic; -+ ic = iconv_open(\"to\", \"from\"); -+ iconv(ic, &a, &i, &b, &j); -+ iconv_close(ic); -+ } -+ " -+ Iconv_EXPLICITLY_AT_ENV) -+ if(Iconv_EXPLICITLY_AT_ENV) -+ message(STATUS "Iconv Explicitly check '-liconv' - Available") -+ target_link_libraries(hidapi_libusb PRIVATE iconv) -+ else() -+ message(FATAL_ERROR "Iconv is not found, make sure to provide it in the build environment") -+ endif() -+ endif() -+ else() -+ # otherwise there is 2 options: -+ # 1) iconv is provided by Standard C library and the build will be just fine -+ # 2) The _user_ has to provide additiona compilation options for this project/target -+ endif() -+ - # check for error: "conflicting types for 'iconv'" - check_c_source_compiles("#include - extern size_t iconv (iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); -@@ -35,11 +77,9 @@ else() - if(HIDAPI_ICONV_CONST) - target_compile_definitions(hidapi_libusb PRIVATE "ICONV_CONST=const") - endif() -+ else() -+ # On Android Iconv is disabled on the code level anyway, so no issue; - endif() -- # otherwise there is 3 options: -- # 1) On Android Iconv is disabled on the code level anyway, so no issue; -- # 2) iconv is provided by Standard C library and the build will be just fine; -- # 4) The _user_ has to provide additiona compilation options for this project/target. - endif() - - set_target_properties(hidapi_libusb ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -148,9 +148,6 @@ else() - if(NOT TARGET usb-1.0) - set(HIDAPI_NEED_EXPORT_LIBUSB TRUE) - endif() -- if(NOT HIDAPI_NO_ICONV AND NOT ANDROID AND NOT CMAKE_VERSION VERSION_LESS 3.11) -- set(HIDAPI_NEED_EXPORT_ICONV TRUE) -- endif() - endif() - elseif(NOT TARGET hidapi_hidraw) - message(FATAL_ERROR "Select at least one option to build: HIDAPI_WITH_LIBUSB or HIDAPI_WITH_HIDRAW") From 16bb930e26abc7438a88278eb862667d168993a5 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 19 Dec 2022 21:57:03 +0000 Subject: [PATCH 012/102] hiredis: update to version 1.1.0 See project release page[1] for more details. Switch build to use CMake instead of autotools, allows removal of local patch. [1]: https://github.com/redis/hiredis/releases Signed-off-by: Daniel Golle --- libs/hiredis/Makefile | 18 +++-------- .../patches/010-fix_pkconfig_file.patch | 32 ------------------- 2 files changed, 4 insertions(+), 46 deletions(-) delete mode 100644 libs/hiredis/patches/010-fix_pkconfig_file.patch diff --git a/libs/hiredis/Makefile b/libs/hiredis/Makefile index 01e6b864..4c278358 100644 --- a/libs/hiredis/Makefile +++ b/libs/hiredis/Makefile @@ -8,21 +8,22 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hiredis -PKG_VERSION:=1.0.2 +PKG_VERSION:=1.1.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/redis/hiredis/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=e0ab696e2f07deb4252dda45b703d09854e53b9703c7d52182ce5a22616c3819 +PKG_HASH:=fe6d21741ec7f3fc9df409d921f47dfc73a4d8ff64f4ac6f1d95f951bf7f53d6 PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=COPYING PKG_MAINTAINER:=Daniel Golle PKG_BUILD_PARALLEL:=1 -PKG_INSTALL:=1 +CMAKE_INSTALL:=1 include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk define Package/libhiredis SECTION:=libs @@ -35,17 +36,6 @@ define Package/libhiredis/description Hiredis is a minimalistic C client library for the Redis database. endef -MAKE_FLAGS += ARCH="" DEBUG="" PREFIX="/usr" uname_S="Linux" - -define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include/hiredis/adapters - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/hiredis/adapters/* $(1)/usr/include/hiredis/adapters - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/hiredis/*.h $(1)/usr/include/hiredis/ - $(INSTALL_DIR) $(1)/usr/lib/pkgconfig - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhiredis.{so*,a} $(1)/usr/lib/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/hiredis.pc $(1)/usr/lib/pkgconfig -endef - define Package/libhiredis/install $(INSTALL_DIR) $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhiredis.so* $(1)/usr/lib/ diff --git a/libs/hiredis/patches/010-fix_pkconfig_file.patch b/libs/hiredis/patches/010-fix_pkconfig_file.patch deleted file mode 100644 index 11d7e7fa..00000000 --- a/libs/hiredis/patches/010-fix_pkconfig_file.patch +++ /dev/null @@ -1,32 +0,0 @@ -commit f96d9f9d2e3ba39352035e6ac26463243484d404 -Author: Sebastian Kemper -Date: Sun Jan 13 19:25:52 2019 +0100 - - Setup .pc file to allow use for cross-compiling - - The Makefile is currently creating the pkg-config file using static lib - and include dir statements. Change that so that projects that - cross-compile hiredis can use pkg-config to setup other programs - depending on it. - - Note: these projects (like OpenWrt) call pkg-config with arguments to - overwrite some variables in the .pc file, namely: - - --define-variable=prefix=<...> - --define-variable=exec_prefix=<...> - - Signed-off-by: Sebastian Kemper - ---- a/Makefile -+++ b/Makefile -@@ -234,8 +234,8 @@ $(PKGCONFNAME): hiredis.h - @echo "Generating $@ for pkgconfig..." - @echo prefix=$(PREFIX) > $@ - @echo exec_prefix=\$${prefix} >> $@ -- @echo libdir=$(PREFIX)/$(LIBRARY_PATH) >> $@ -- @echo includedir=$(PREFIX)/$(INCLUDE_PATH) >> $@ -+ @echo libdir=\$${exec_prefix}/$(LIBRARY_PATH) >> $@ -+ @echo includedir=\$${prefix}/$(INCLUDE_PATH) >> $@ - @echo >> $@ - @echo Name: hiredis >> $@ - @echo Description: Minimalistic C client library for Redis. >> $@ From e686d9c0b1f6dbd701634c8ee42a07e5e5076c1b Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 19 Sep 2021 01:23:17 -0700 Subject: [PATCH 013/102] libgd: update to 2.3.3 Refresh patches. Signed-off-by: Rosen Penev --- libs/libgd/Makefile | 6 +++--- libs/libgd/patches/010-webp.patch | 4 ++-- libs/libgd/patches/100-no-cxx.patch | 12 +++++------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/libs/libgd/Makefile b/libs/libgd/Makefile index 4ca2eff2..9e010891 100644 --- a/libs/libgd/Makefile +++ b/libs/libgd/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libgd -PKG_VERSION:=2.3.2 -PKG_RELEASE:=$(AUTORELEASE) +PKG_VERSION:=2.3.3 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/$(PKG_NAME)/$(PKG_NAME)/releases/download/gd-$(PKG_VERSION)/ -PKG_HASH:=478a047084e0d89b83616e4c2cf3c9438175fb0cc55d8c8967f06e0427f7d7fb +PKG_HASH:=3fe822ece20796060af63b7c60acb151e5844204d289da0ce08f8fdf131e5a61 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=MIT diff --git a/libs/libgd/patches/010-webp.patch b/libs/libgd/patches/010-webp.patch index e68a8ac5..2b21bab8 100644 --- a/libs/libgd/patches/010-webp.patch +++ b/libs/libgd/patches/010-webp.patch @@ -1,6 +1,6 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -118,7 +118,7 @@ else (USE_EXT_GD) +@@ -134,7 +134,7 @@ else (USE_EXT_GD) endif (ENABLE_ICONV) IF (ENABLE_WEBP) @@ -9,7 +9,7 @@ ENDIF (ENABLE_WEBP) IF (ENABLE_HEIF) -@@ -179,10 +179,10 @@ else (USE_EXT_GD) +@@ -195,10 +195,10 @@ else (USE_EXT_GD) LIST(APPEND PKG_REQUIRES_PRIVATES zlib) ENDIF(ZLIB_FOUND) diff --git a/libs/libgd/patches/100-no-cxx.patch b/libs/libgd/patches/100-no-cxx.patch index 3deb6cc9..63c733ab 100644 --- a/libs/libgd/patches/100-no-cxx.patch +++ b/libs/libgd/patches/100-no-cxx.patch @@ -1,24 +1,22 @@ --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -24,8 +24,6 @@ SET (LIBGD_SRC_FILES +@@ -18,7 +18,6 @@ SET (LIBGD_SRC_FILES gd_io_dp.c gd_io_file.c gd_io_ss.c - gd_io_stream.cxx -- gd_io_stream.h gd_jpeg.c gd_matrix.c gd_nnquant.c -@@ -61,8 +59,6 @@ SET (LIBGD_SRC_FILES +@@ -44,7 +43,6 @@ SET (LIBGD_SRC_FILES + gdfx.c gdhelpers.c - gdhelpers.h gdkanji.c - gdpp.cxx -- gdpp.h gdtables.c gdxpm.c - jisx0208.h -@@ -203,7 +199,6 @@ install(FILES + wbmp.c +@@ -193,7 +191,6 @@ install(FILES gdfonts.h gdfontt.h gdfx.h From 4bc31916b4db0ede290ba72daf2ae008e8e7243b Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 13 Jan 2023 19:55:09 -0800 Subject: [PATCH 014/102] libmad: update URL to use codeberg Upstream abandoned GitHub. Signed-off-by: Rosen Penev --- libs/libmad/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/libmad/Makefile b/libs/libmad/Makefile index 934705fd..595c9607 100644 --- a/libs/libmad/Makefile +++ b/libs/libmad/Makefile @@ -9,11 +9,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libmad PKG_VERSION:=0.16.3 -PKG_RELEASE:=$(AUTORELEASE) +PKG_RELEASE:=2 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://codeload.github.com/tenacityteam/libmad/tar.gz/$(PKG_VERSION)? -PKG_HASH:=83ca48db60f480ae22234bae08e6ad651adec2667a68ad2df6fd61e6a50a32c7 +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=0.16.3 +PKG_SOURCE_URL:=https://codeberg.org/tenacityteam/libmad +PKG_MIRROR_HASH:=f2fa2a3c75ad1c58f0b6150482a3036408c8da79f0fcbf23bcf9e105f29079ee PKG_MAINTAINER:=Ted Hess PKG_LICENSE:=GPL-2.0-or-later From 26c94e2454e91918e2299e729471ce5a4827b01d Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 4 Nov 2022 21:27:14 -0700 Subject: [PATCH 015/102] libv4l: update to 1.22.1 Signed-off-by: Rosen Penev --- libs/libv4l/Makefile | 8 ++---- .../patches/020-add-missing-includes.patch | 10 ------- libs/libv4l/patches/030-getsubopt.patch | 28 ------------------- 3 files changed, 3 insertions(+), 43 deletions(-) delete mode 100644 libs/libv4l/patches/020-add-missing-includes.patch delete mode 100644 libs/libv4l/patches/030-getsubopt.patch diff --git a/libs/libv4l/Makefile b/libs/libv4l/Makefile index 60bac1d2..22b3cd15 100644 --- a/libs/libv4l/Makefile +++ b/libs/libv4l/Makefile @@ -6,17 +6,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=v4l-utils -PKG_VERSION:=1.20.0 -PKG_RELEASE:=5 +PKG_VERSION:=1.22.1 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://www.linuxtv.org/downloads/v4l-utils -PKG_HASH:=956118713f7ccb405c55c7088a6a2490c32d54300dd9a30d8d5008c28d3726f7 +PKG_HASH:=65c6fbe830a44ca105c443b027182c1b2c9053a91d1e72ad849dfab388b94e31 PKG_MAINTAINER:=Ted Hess PKG_USE_MIPS16:=0 -PKG_FIXUP:=autoreconf PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 @@ -75,7 +74,6 @@ define Package/v4l-utils/description endef TARGET_CFLAGS += -flto -TARGET_CXXFLAGS += -std=c++11 TARGET_LDFLAGS += \ $(if $(CONFIG_USE_GLIBC),,-largp) \ -Wl,--gc-sections,--as-needed diff --git a/libs/libv4l/patches/020-add-missing-includes.patch b/libs/libv4l/patches/020-add-missing-includes.patch deleted file mode 100644 index c5a83a97..00000000 --- a/libs/libv4l/patches/020-add-missing-includes.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/utils/libcecutil/cec-info.cpp -+++ b/utils/libcecutil/cec-info.cpp -@@ -5,6 +5,7 @@ - * Copyright 2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - */ - -+#include - #include - #include - #include diff --git a/libs/libv4l/patches/030-getsubopt.patch b/libs/libv4l/patches/030-getsubopt.patch deleted file mode 100644 index 3e48732f..00000000 --- a/libs/libv4l/patches/030-getsubopt.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/utils/v4l2-ctl/v4l2-ctl-common.cpp -+++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp -@@ -785,15 +785,17 @@ static bool parse_subset(char *optarg) - - static bool parse_next_subopt(char **subs, char **value) - { -- static char *const subopts[] = { -- NULL -- }; -- int opt = getsubopt(subs, subopts, value); -+ char *p = *subs; -+ *value = *subs; - -- if (opt < 0 || *value) -- return false; -- fprintf(stderr, "Missing suboption value\n"); -- return true; -+ while (*p && *p != ',') -+ p++; -+ -+ if (*p) -+ *p++ = '\0'; -+ -+ *subs = p; -+ return false; - } - - void common_cmd(const std::string &media_bus_info, int ch, char *optarg) From 3cb0bd35308938fd6e41199f22cc22cde521ac8e Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 20 Nov 2022 20:47:04 -0800 Subject: [PATCH 016/102] libxcrypt: update to 4.4.33 Signed-off-by: Rosen Penev --- libs/libxcrypt/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/libxcrypt/Makefile b/libs/libxcrypt/Makefile index fb1bc3c9..c6199824 100644 --- a/libs/libxcrypt/Makefile +++ b/libs/libxcrypt/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libxcrypt -PKG_VERSION:=4.4.28 -PKG_RELEASE:=$(AUTORELEASE) +PKG_VERSION:=4.4.33 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/besser82/libxcrypt/releases/download/v$(PKG_VERSION) -PKG_HASH:=9e936811f9fad11dbca33ca19bd97c55c52eb3ca15901f27ade046cc79e69e87 +PKG_HASH:=e87acf9c652c573a4713d5582159f98f305d56ed5f754ce64f57d4194d6b3a6f PKG_MAINTAINER:= PKG_LICENSE:=LGPL-2.1-or-later From 25bdfcb4e9b7f46913f1e34c0ae7a433ec65e5bb Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 5 Nov 2022 17:02:54 -0700 Subject: [PATCH 017/102] libxml2: build with cmake Signed-off-by: Rosen Penev --- libs/libxml2/Makefile | 156 +++++++++++++++------------ libs/libxml2/patches/010-iconv.patch | 12 +++ 2 files changed, 97 insertions(+), 71 deletions(-) create mode 100644 libs/libxml2/patches/010-iconv.patch diff --git a/libs/libxml2/Makefile b/libs/libxml2/Makefile index 76f93052..a726e78c 100644 --- a/libs/libxml2/Makefile +++ b/libs/libxml2/Makefile @@ -9,23 +9,20 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libxml2 PKG_VERSION:=2.10.3 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNOME/libxml2/$(basename $(PKG_VERSION)) PKG_HASH:=5d2cc3d78bec3dbe212a9d7fa629ada25a7da928af432c93060ff5c17ee28a9c +PKG_MAINTAINER:=Michael Heimpold PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING PKG_CPE_ID:=cpe:/a:xmlsoft:libxml2 -PKG_MAINTAINER:=Michael Heimpold - -PKG_INSTALL:=1 -PKG_BUILD_PARALLEL:=0 - include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk include $(INCLUDE_DIR)/nls.mk define Package/libxml2 @@ -68,70 +65,83 @@ define Package/libxml2-utils/description from libxml2, a library for manipulating XML and HTML resources. endef -TARGET_CFLAGS += $(FPIC) +CMAKE_HOST_OPTIONS += \ + -DBUILD_SHARED_LIBS=OFF \ + -DLIBXML2_WITH_C14N=ON \ + -DLIBXML2_WITH_CATALOG=OFF \ + -DLIBXML2_WITH_DEBUG=ON \ + -DLIBXML2_WITH_FTP=OFF \ + -DLIBXML2_WITH_HTML=ON \ + -DLIBXML2_WITH_HTTP=OFF \ + -DLIBXML2_WITH_ICONV=ON \ + -DLIBXML2_WITH_ICU=OFF \ + -DLIBXML2_WITH_ISO8859X=OFF \ + -DLIBXML2_WITH_LEGACY=OFF \ + -DLIBXML2_WITH_LZMA=OFF \ + -DLIBXML2_WITH_MEM_DEBUG=OFF \ + -DLIBXML2_WITH_MODULES=OFF \ + -DLIBXML2_WITH_OUTPUT=ON \ + -DLIBXML2_WITH_PATTERN=ON \ + -DLIBXML2_WITH_PROGRAMS=OFF \ + -DLIBXML2_WITH_PUSH=ON \ + -DLIBXML2_WITH_PYTHON=OFF \ + -DLIBXML2_WITH_READER=ON \ + -DLIBXML2_WITH_REGEXPS=ON \ + -DLIBXML2_WITH_RUN_DEBUG=OFF \ + -DLIBXML2_WITH_SAX1=ON \ + -DLIBXML2_WITH_SCHEMAS=ON \ + -DLIBXML2_WITH_SCHEMATRON=OFF \ + -DLIBXML2_WITH_TESTS=OFF \ + -DLIBXML2_WITH_THREADS=ON \ + -DLIBXML2_WITH_THREAD_ALLOC=OFF \ + -DLIBXML2_WITH_TREE=ON \ + -DLIBXML2_WITH_VALID=ON \ + -DLIBXML2_WITH_WRITER=ON \ + -DLIBXML2_WITH_XINCLUDE=ON \ + -DLIBXML2_WITH_XPATH=ON \ + -DLIBXML2_WITH_XPTR=ON \ + -DLIBXML2_WITH_XPTR_LOCS=ON \ + -DLIBXML2_WITH_ZLIB=ON -CONFIGURE_ARGS += \ - --enable-shared \ - --enable-static \ - --with-c14n \ - --without-catalog \ - --with-debug \ - --with-html \ - --without-ftp \ - --without-http \ - --without-iso8859x \ - --without-legacy \ - --with-output \ - --without-pattern \ - --without-push \ - --without-python \ - --with-reader \ - --without-readline \ - --without-regexps \ - --with-sax1 \ - --with-schemas \ - --with-threads \ - --with-tree \ - --with-valid \ - --with-writer \ - --with-xinclude \ - --with-xpath \ - --with-xptr \ - --with-zlib=$(STAGING_DIR)/usr \ - --with-iconv$(if $(ICONV_PREFIX),="$(ICONV_PREFIX)") \ - --without-lzma - -HOST_CONFIGURE_ARGS += \ - --disable-shared \ - --enable-static \ - --with-pic \ - --with-c14n \ - --without-catalog \ - --with-debug \ - --with-html \ - --without-ftp \ - --without-http \ - --without-iconv \ - --without-iso8859x \ - --without-legacy \ - --with-output \ - --without-pattern \ - --without-push \ - --without-python \ - --with-reader \ - --without-readline \ - --without-regexps \ - --with-sax1 \ - --with-schemas \ - --with-threads \ - --with-tree \ - --with-valid \ - --with-writer \ - --with-xinclude \ - --with-xpath \ - --with-xptr \ - --with-zlib \ - --without-lzma +CMAKE_OPTIONS += \ + -DBUILD_SHARED_LIBS=ON \ + -DLIBXML2_WITH_C14N=ON \ + -DLIBXML2_WITH_CATALOG=OFF \ + -DLIBXML2_WITH_DEBUG=ON \ + -DLIBXML2_WITH_FTP=OFF \ + -DLIBXML2_WITH_HTML=ON \ + -DLIBXML2_WITH_HTTP=OFF \ + -DLIBXML2_WITH_ICONV=ON \ + -DLIBXML2_WITH_ICU=OFF \ + -DLIBXML2_WITH_ISO8859X=OFF \ + -DLIBXML2_WITH_LEGACY=OFF \ + -DLIBXML2_WITH_LZMA=OFF \ + -DLIBXML2_WITH_MEM_DEBUG=OFF \ + -DLIBXML2_WITH_MODULES=OFF \ + -DLIBXML2_WITH_OUTPUT=ON \ + -DLIBXML2_WITH_PATTERN=ON \ + -DLIBXML2_WITH_PROGRAMS=ON \ + -DLIBXML2_WITH_PUSH=ON \ + -DLIBXML2_WITH_PYTHON=OFF \ + -DLIBXML2_WITH_READER=ON \ + -DLIBXML2_WITH_REGEXPS=ON \ + -DLIBXML2_WITH_RUN_DEBUG=OFF \ + -DLIBXML2_WITH_SAX1=ON \ + -DLIBXML2_WITH_SCHEMAS=ON \ + -DLIBXML2_WITH_SCHEMATRON=OFF \ + -DLIBXML2_WITH_TESTS=OFF \ + -DLIBXML2_WITH_THREADS=ON \ + -DLIBXML2_WITH_THREAD_ALLOC=OFF \ + -DLIBXML2_WITH_TREE=ON \ + -DLIBXML2_WITH_VALID=ON \ + -DLIBXML2_WITH_WRITER=ON \ + -DLIBXML2_WITH_XINCLUDE=ON \ + -DLIBXML2_WITH_XPATH=ON \ + -DLIBXML2_WITH_XPTR=ON \ + -DLIBXML2_WITH_XPTR_LOCS=ON \ + -DLIBXML2_WITH_ZLIB=ON \ + -DHAVE_LIBHISTORY=OFF \ + -DHAVE_LIBREADLINE=OFF define Build/InstallDev $(INSTALL_DIR) $(2)/bin @@ -141,14 +151,18 @@ define Build/InstallDev $(2)/bin/$(GNU_TARGET_NAME)-xml2-config $(LN) $(GNU_TARGET_NAME)-xml2-config $(2)/bin/xml2-config + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/xmlcatalog $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/xmllint $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/libxml2 $(1)/usr/include/ $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.{la,a,so*} $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.so* $(1)/usr/lib/ $(INSTALL_DIR) $(1)/usr/lib/cmake/libxml2 - $(CP) $(PKG_INSTALL_DIR)/usr/lib/cmake/libxml2/libxml2-config.cmake \ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/cmake/libxml2-$(PKG_VERSION)/*.cmake \ $(1)/usr/lib/cmake/libxml2 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig diff --git a/libs/libxml2/patches/010-iconv.patch b/libs/libxml2/patches/010-iconv.patch new file mode 100644 index 00000000..e35b7ce9 --- /dev/null +++ b/libs/libxml2/patches/010-iconv.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -496,6 +496,9 @@ if(LIBXML2_WITH_PROGRAMS) + add_executable(LibXml2::${PROGRAM} ALIAS ${PROGRAM}) + target_compile_definitions(${PROGRAM} PRIVATE SYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}") + target_link_libraries(${PROGRAM} LibXml2) ++ if(LIBXML2_WITH_ICONV AND NOT Iconv_IS_BUILT_IN) ++ target_link_libraries(${PROGRAM} iconv) ++ endif() + if(HAVE_LIBHISTORY) + target_link_libraries(${PROGRAM} history) + endif() From 52c4bc8d0e688d7ce4f94bf46e24754437aad634 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 19 Dec 2022 23:39:40 +0000 Subject: [PATCH 018/102] postgresql: update to version 15.1 https://www.postgresql.org/docs/release/15.0/ https://www.postgresql.org/docs/release/15.1/ A dump/restore using pg_dumpall or use of pg_upgrade or logical replication is required for those wishing to migrate data from any previous release. Do not backport to release branch which should remain on version 14. Signed-off-by: Daniel Golle --- libs/postgresql/Makefile | 4 +-- libs/postgresql/patches/200-ranlib.patch | 6 ++-- .../postgresql/patches/300-fix-includes.patch | 14 ++++++++ libs/postgresql/patches/300-fix-pc-file.patch | 33 ------------------- .../patches/700-no-arm-crc-march-change.patch | 2 +- .../patches/900-pg_ctl-setuid.patch | 12 +++---- 6 files changed, 26 insertions(+), 45 deletions(-) create mode 100644 libs/postgresql/patches/300-fix-includes.patch delete mode 100644 libs/postgresql/patches/300-fix-pc-file.patch diff --git a/libs/postgresql/Makefile b/libs/postgresql/Makefile index 793c0cfd..7450393b 100644 --- a/libs/postgresql/Makefile +++ b/libs/postgresql/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=postgresql -PKG_VERSION:=14.6 +PKG_VERSION:=15.1 PKG_RELEASE:=1 PKG_MAINTAINER:=Daniel Golle PKG_LICENSE:=PostgreSQL @@ -17,7 +17,7 @@ PKG_SOURCE_URL:=\ http://ftp.postgresql.org/pub/source/v$(PKG_VERSION) \ ftp://ftp.postgresql.org/pub/source/v$(PKG_VERSION) -PKG_HASH:=508840fc1809d39ab72274d5f137dabb9fd7fb4f933da4168aeebb20069edf22 +PKG_HASH:=64fdf23d734afad0dfe4077daca96ac51dcd697e68ae2d3d4ca6c45cb14e21ae PKG_USE_MIPS16:=0 PKG_FIXUP:=autoreconf diff --git a/libs/postgresql/patches/200-ranlib.patch b/libs/postgresql/patches/200-ranlib.patch index 3bf02efe..d4184a35 100644 --- a/libs/postgresql/patches/200-ranlib.patch +++ b/libs/postgresql/patches/200-ranlib.patch @@ -1,10 +1,10 @@ --- a/src/port/Makefile +++ b/src/port/Makefile -@@ -84,6 +84,7 @@ uninstall: +@@ -83,6 +83,7 @@ uninstall: libpgport.a: $(OBJS) rm -f $@ $(AR) $(AROPT) $@ $^ + $(RANLIB) libpgport.a - # thread.o and thread_shlib.o need PTHREAD_CFLAGS (but thread_srv.o does not) - thread.o: CFLAGS+=$(PTHREAD_CFLAGS) + # getaddrinfo.o and getaddrinfo_shlib.o need PTHREAD_CFLAGS (but getaddrinfo_srv.o does not) + getaddrinfo.o: CFLAGS+=$(PTHREAD_CFLAGS) diff --git a/libs/postgresql/patches/300-fix-includes.patch b/libs/postgresql/patches/300-fix-includes.patch new file mode 100644 index 00000000..3611c8e0 --- /dev/null +++ b/libs/postgresql/patches/300-fix-includes.patch @@ -0,0 +1,14 @@ +--- a/src/bin/pg_ctl/pg_ctl.c ++++ b/src/bin/pg_ctl/pg_ctl.c +@@ -12,9 +12,11 @@ + #include "postgres_fe.h" + + #include ++#include + #include + #include + #include ++#include + #include + #include + diff --git a/libs/postgresql/patches/300-fix-pc-file.patch b/libs/postgresql/patches/300-fix-pc-file.patch deleted file mode 100644 index 2d7eb97a..00000000 --- a/libs/postgresql/patches/300-fix-pc-file.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- a/src/Makefile.shlib -+++ b/src/Makefile.shlib -@@ -391,14 +391,27 @@ endif # PORTNAME == cygwin || PORTNAME = - - - %.pc: $(MAKEFILE_LIST) -- echo 'Name: lib$(NAME)' >$@ -+ echo 'prefix=$(prefix)' >$@ -+ echo 'exec_prefix=$(exec_prefix)' >>$@ -+ifeq ($(patsubst $(prefix)/%,,$(includedir)),) -+ echo 'includedir=$${prefix}/$(patsubst $(prefix)/%,%,$(includedir))' >>$@ -+else -+ echo 'includedir=$(includedir)' >>$@ -+endif -+ifeq ($(patsubst $(exec_prefix)/%,,$(libdir)),) -+ echo 'libdir=$${exec_prefix}/$(patsubst $(exec_prefix)/%,%,$(libdir))' >>$@ -+else -+ echo 'libdir=$(libdir)' >>$@ -+endif -+ echo >>$@ -+ echo 'Name: lib$(NAME)' >>$@ - echo 'Description: PostgreSQL lib$(NAME) library' >>$@ - echo 'Url: $(PACKAGE_URL)' >>$@ - echo 'Version: $(VERSION)' >>$@ - echo 'Requires: ' >>$@ - echo 'Requires.private: $(PKG_CONFIG_REQUIRES_PRIVATE)' >>$@ -- echo 'Cflags: -I$(includedir)' >>$@ -- echo 'Libs: -L$(libdir) -l$(NAME)' >>$@ -+ echo 'Cflags: -I$${includedir}' >>$@ -+ echo 'Libs: -L$${libdir} -l$(NAME)' >>$@ - # Record -L flags that the user might have passed in to the PostgreSQL - # build to locate third-party libraries (e.g., ldap, ssl). Filter out - # those that point inside the build or source tree. Use sort to diff --git a/libs/postgresql/patches/700-no-arm-crc-march-change.patch b/libs/postgresql/patches/700-no-arm-crc-march-change.patch index 9c4dcaae..31dccffb 100644 --- a/libs/postgresql/patches/700-no-arm-crc-march-change.patch +++ b/libs/postgresql/patches/700-no-arm-crc-march-change.patch @@ -1,6 +1,6 @@ --- a/configure.ac +++ b/configure.ac -@@ -2156,9 +2156,9 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [ +@@ -2236,9 +2236,9 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [ # flags. If not, check if adding -march=armv8-a+crc flag helps. # CFLAGS_ARMV8_CRC32C is set if the extra flag is required. PGAC_ARMV8_CRC32C_INTRINSICS([]) diff --git a/libs/postgresql/patches/900-pg_ctl-setuid.patch b/libs/postgresql/patches/900-pg_ctl-setuid.patch index d114a820..64d558fc 100644 --- a/libs/postgresql/patches/900-pg_ctl-setuid.patch +++ b/libs/postgresql/patches/900-pg_ctl-setuid.patch @@ -1,6 +1,6 @@ --- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c -@@ -94,6 +94,7 @@ static char *event_source = NULL; +@@ -96,6 +96,7 @@ static char *event_source = NULL; static char *register_servicename = "PostgreSQL"; /* FIXME: + version ID? */ static char *register_username = NULL; static char *register_password = NULL; @@ -8,7 +8,7 @@ static char *argv0 = NULL; static bool allow_core_files = false; static time_t start_time; -@@ -2081,6 +2082,9 @@ do_help(void) +@@ -2086,6 +2087,9 @@ do_help(void) #endif printf(_(" -s, --silent only print errors, no informational messages\n")); printf(_(" -t, --timeout=SECS seconds to wait when using -w option\n")); @@ -18,7 +18,7 @@ printf(_(" -V, --version output version information, then exit\n")); printf(_(" -w, --wait wait until operation completes (default)\n")); printf(_(" -W, --no-wait do not wait until operation completes\n")); -@@ -2293,6 +2297,7 @@ main(int argc, char **argv) +@@ -2298,6 +2302,7 @@ main(int argc, char **argv) {"options", required_argument, NULL, 'o'}, {"silent", no_argument, NULL, 's'}, {"timeout", required_argument, NULL, 't'}, @@ -26,7 +26,7 @@ {"core-files", no_argument, NULL, 'c'}, {"wait", no_argument, NULL, 'w'}, {"no-wait", no_argument, NULL, 'W'}, -@@ -2333,20 +2338,6 @@ main(int argc, char **argv) +@@ -2338,20 +2343,6 @@ main(int argc, char **argv) } } @@ -47,7 +47,7 @@ env_wait = getenv("PGCTLTIMEOUT"); if (env_wait != NULL) -@@ -2432,11 +2423,15 @@ main(int argc, char **argv) +@@ -2437,11 +2428,15 @@ main(int argc, char **argv) wait_seconds_arg = true; break; case 'U': @@ -63,7 +63,7 @@ break; case 'w': do_wait = true; -@@ -2518,6 +2513,41 @@ main(int argc, char **argv) +@@ -2523,6 +2518,41 @@ main(int argc, char **argv) exit(1); } From 3e2265dbd1b36548b367c48393c18287be9a8422 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 14 Jan 2023 02:49:12 +0000 Subject: [PATCH 019/102] sbc: update to version 2.0 Fixes issue with use of x86-specific compiler primitives on non-x86 systems which we had previously patched downstream, remove this patch. Signed-off-by: Daniel Golle --- libs/sbc/Makefile | 4 ++-- libs/sbc/patches/010-x86.patch | 12 ------------ 2 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 libs/sbc/patches/010-x86.patch diff --git a/libs/sbc/Makefile b/libs/sbc/Makefile index 4e656fb2..ca5b8488 100644 --- a/libs/sbc/Makefile +++ b/libs/sbc/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sbc -PKG_VERSION:=1.5 +PKG_VERSION:=2.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/ -PKG_HASH:=0cbad69823a99e8421fe0700e8cf9eeb8fa0c1ad28e8dbc2182b3353507931d2 +PKG_HASH:=8f12368e1dbbf55e14536520473cfb338c84b392939cc9b64298360fd4a07992 PKG_LICENSE:=LGPL-2.1-or-later PKG_LICENSE_FILES:=COPYING.LIB diff --git a/libs/sbc/patches/010-x86.patch b/libs/sbc/patches/010-x86.patch deleted file mode 100644 index 8b5d5aca..00000000 --- a/libs/sbc/patches/010-x86.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/sbc/sbc_primitives.c -+++ b/sbc/sbc_primitives.c -@@ -593,7 +593,9 @@ static int sbc_calc_scalefactors_j( - - static void sbc_init_primitives_x86(struct sbc_encoder_state *state) - { -+#ifdef __x86__ - __builtin_cpu_init(); -+#endif - - #ifdef SBC_BUILD_WITH_MMX_SUPPORT - if (__builtin_cpu_supports("mmx")) From 63b99add00ce42834bc46c38d9d7a7bd97e3e5ce Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 7 Nov 2022 17:17:10 -0800 Subject: [PATCH 020/102] tiff: don't use AUTORELEASE Seems upstream wants to get rid of it. Backport upstream patches fixing several CVEs. Signed-off-by: Rosen Penev --- libs/tiff/Makefile | 4 +- libs/tiff/patches/010-CVE-2022-2519.patch | 93 +++++++++++++++++++++++ libs/tiff/patches/020-CVE-2022-2520.patch | 28 +++++++ 3 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 libs/tiff/patches/010-CVE-2022-2519.patch create mode 100644 libs/tiff/patches/020-CVE-2022-2520.patch diff --git a/libs/tiff/Makefile b/libs/tiff/Makefile index 37539d94..3b65ca7c 100644 --- a/libs/tiff/Makefile +++ b/libs/tiff/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tiff PKG_VERSION:=4.4.0 -PKG_RELEASE:=$(AUTORELEASE) +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://download.osgeo.org/libtiff @@ -66,8 +66,6 @@ CMAKE_OPTIONS += \ -Djpeg12=OFF \ -Dcxx=OFF -TARGET_CFLAGS += $(TARGET_CPPFLAGS) - define Build/InstallDev $(call Build/InstallDev/cmake,$(1)) $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libtiff-4.pc diff --git a/libs/tiff/patches/010-CVE-2022-2519.patch b/libs/tiff/patches/010-CVE-2022-2519.patch new file mode 100644 index 00000000..6c61ed01 --- /dev/null +++ b/libs/tiff/patches/010-CVE-2022-2519.patch @@ -0,0 +1,93 @@ +From 8fe3735942ea1d90d8cef843b55b3efe8ab6feaf Mon Sep 17 00:00:00 2001 +From: Su_Laus +Date: Mon, 15 Aug 2022 22:11:03 +0200 +Subject: [PATCH] =?UTF-8?q?According=20to=20Richard=20Nolde=20https://gitl?= + =?UTF-8?q?ab.com/libtiff/libtiff/-/issues/401#note=5F877637400=20the=20ti?= + =?UTF-8?q?ffcrop=20option=20=E2=80=9E-S=E2=80=9C=20is=20also=20mutually?= + =?UTF-8?q?=20exclusive=20to=20the=20other=20crop=20options=20(-X|-Y),=20-?= + =?UTF-8?q?Z=20and=20-z.?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This is now checked and ends tiffcrop if those arguments are not mutually exclusive. + +This MR will fix the following tiffcrop issues: #349, #414, #422, #423, #424 +--- + tools/tiffcrop.c | 31 ++++++++++++++++--------------- + 1 file changed, 16 insertions(+), 15 deletions(-) + +--- a/tools/tiffcrop.c ++++ b/tools/tiffcrop.c +@@ -108,12 +108,12 @@ + * lower level, scanline level routines. Debug reports a limited set + * of messages to monitor progress without enabling dump logs. + * +- * Note: The (-X|-Y), -Z and -z options are mutually exclusive. ++ * Note: The (-X|-Y), -Z, -z and -S options are mutually exclusive. + * In no case should the options be applied to a given selection successively. + */ + +-static char tiffcrop_version_id[] = "2.5"; +-static char tiffcrop_rev_date[] = "02-09-2022"; ++static char tiffcrop_version_id[] = "2.5.1"; ++static char tiffcrop_rev_date[] = "15-08-2022"; + + #include "tif_config.h" + #include "libport.h" +@@ -173,12 +173,12 @@ static char tiffcrop_rev_date[] = "02- + #define ROTATECW_270 32 + #define ROTATE_ANY (ROTATECW_90 | ROTATECW_180 | ROTATECW_270) + +-#define CROP_NONE 0 +-#define CROP_MARGINS 1 +-#define CROP_WIDTH 2 +-#define CROP_LENGTH 4 +-#define CROP_ZONES 8 +-#define CROP_REGIONS 16 ++#define CROP_NONE 0 /* "-S" -> Page_MODE_ROWSCOLS and page->rows/->cols != 0 */ ++#define CROP_MARGINS 1 /* "-m" */ ++#define CROP_WIDTH 2 /* "-X" */ ++#define CROP_LENGTH 4 /* "-Y" */ ++#define CROP_ZONES 8 /* "-Z" */ ++#define CROP_REGIONS 16 /* "-z" */ + #define CROP_ROTATE 32 + #define CROP_MIRROR 64 + #define CROP_INVERT 128 +@@ -316,7 +316,7 @@ struct crop_mask { + #define PAGE_MODE_RESOLUTION 1 + #define PAGE_MODE_PAPERSIZE 2 + #define PAGE_MODE_MARGINS 4 +-#define PAGE_MODE_ROWSCOLS 8 ++#define PAGE_MODE_ROWSCOLS 8 /* for -S option */ + + #define INVERT_DATA_ONLY 10 + #define INVERT_DATA_AND_TAG 11 +@@ -781,7 +781,7 @@ static const char usage_info[] = + " The four debug/dump options are independent, though it makes little sense to\n" + " specify a dump file without specifying a detail level.\n" + "\n" +-"Note: The (-X|-Y), -Z and -z options are mutually exclusive.\n" ++"Note: The (-X|-Y), -Z, -z and -S options are mutually exclusive.\n" + " In no case should the options be applied to a given selection successively.\n" + "\n" + ; +@@ -2131,13 +2131,14 @@ void process_command_opts (int argc, ch + /*NOTREACHED*/ + } + } +- /*-- Check for not allowed combinations (e.g. -X, -Y and -Z and -z are mutually exclusive) --*/ +- char XY, Z, R; ++ /*-- Check for not allowed combinations (e.g. -X, -Y and -Z, -z and -S are mutually exclusive) --*/ ++ char XY, Z, R, S; + XY = ((crop_data->crop_mode & CROP_WIDTH) || (crop_data->crop_mode & CROP_LENGTH)); + Z = (crop_data->crop_mode & CROP_ZONES); + R = (crop_data->crop_mode & CROP_REGIONS); +- if ((XY && Z) || (XY && R) || (Z && R)) { +- TIFFError("tiffcrop input error", "The crop options(-X|-Y), -Z and -z are mutually exclusive.->Exit"); ++ S = (page->mode & PAGE_MODE_ROWSCOLS); ++ if ((XY && Z) || (XY && R) || (XY && S) || (Z && R) || (Z && S) || (R && S)) { ++ TIFFError("tiffcrop input error", "The crop options(-X|-Y), -Z, -z and -S are mutually exclusive.->Exit"); + exit(EXIT_FAILURE); + } + } /* end process_command_opts */ diff --git a/libs/tiff/patches/020-CVE-2022-2520.patch b/libs/tiff/patches/020-CVE-2022-2520.patch new file mode 100644 index 00000000..5cfa52e7 --- /dev/null +++ b/libs/tiff/patches/020-CVE-2022-2520.patch @@ -0,0 +1,28 @@ +From bad48e90b410df32172006c7876da449ba62cdba Mon Sep 17 00:00:00 2001 +From: Su_Laus +Date: Sat, 20 Aug 2022 23:35:26 +0200 +Subject: [PATCH] tiffcrop -S option: Make decision simpler. + +--- + tools/tiffcrop.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/tools/tiffcrop.c ++++ b/tools/tiffcrop.c +@@ -2133,11 +2133,11 @@ void process_command_opts (int argc, ch + } + /*-- Check for not allowed combinations (e.g. -X, -Y and -Z, -z and -S are mutually exclusive) --*/ + char XY, Z, R, S; +- XY = ((crop_data->crop_mode & CROP_WIDTH) || (crop_data->crop_mode & CROP_LENGTH)); +- Z = (crop_data->crop_mode & CROP_ZONES); +- R = (crop_data->crop_mode & CROP_REGIONS); +- S = (page->mode & PAGE_MODE_ROWSCOLS); +- if ((XY && Z) || (XY && R) || (XY && S) || (Z && R) || (Z && S) || (R && S)) { ++ XY = ((crop_data->crop_mode & CROP_WIDTH) || (crop_data->crop_mode & CROP_LENGTH)) ? 1 : 0; ++ Z = (crop_data->crop_mode & CROP_ZONES) ? 1 : 0; ++ R = (crop_data->crop_mode & CROP_REGIONS) ? 1 : 0; ++ S = (page->mode & PAGE_MODE_ROWSCOLS) ? 1 : 0; ++ if (XY + Z + R + S > 1) { + TIFFError("tiffcrop input error", "The crop options(-X|-Y), -Z, -z and -S are mutually exclusive.->Exit"); + exit(EXIT_FAILURE); + } From 944d71b1a3e3f974435daadb6523b26d41901e59 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 5 Nov 2022 15:05:00 -0700 Subject: [PATCH 021/102] libxslt: update to 1.1.37 Upstream URL changed. There's also a cmake build now. Signed-off-by: Rosen Penev --- libs/libxslt/Makefile | 69 +++++++++---------- .../patches/010-fix-xml2-config-check.patch | 11 --- 2 files changed, 33 insertions(+), 47 deletions(-) delete mode 100644 libs/libxslt/patches/010-fix-xml2-config-check.patch diff --git a/libs/libxslt/Makefile b/libs/libxslt/Makefile index c0db3e37..b4a3c574 100644 --- a/libs/libxslt/Makefile +++ b/libs/libxslt/Makefile @@ -8,27 +8,24 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libxslt -PKG_VERSION:=1.1.34 -PKG_RELEASE:=4 +PKG_VERSION:=1.1.37 +PKG_RELEASE:=$(AUTORELEASE) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:= \ - http://xmlsoft.org/sources/ \ - ftp://fr.rpmfind.net/pub/libxml/ -PKG_HASH:=98b1bd46d6792925ad2dfe9a87452ea2adebf69dcb9919ffd55bf926a7f93f7f +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@GNOME/libxslt/$(basename $(PKG_VERSION)) +PKG_HASH:=3a4b27dc8027ccd6146725950336f1ec520928f320f144eb5fa7990ae6123ab4 PKG_MAINTAINER:=Jiri Slachta PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING PKG_CPE_ID:=cpe:/a:xmlsoft:libxslt -PKG_FIXUP:=autoreconf -PKG_INSTALL:=1 -PKG_BUILD_PARALLEL:=1 HOST_BUILD_DEPENDS:=libxml2/host +CMAKE_BINARY_SUBDIR:=openwrt-build include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/cmake.mk include $(INCLUDE_DIR)/nls.mk define Package/libxslt @@ -67,36 +64,40 @@ define Package/xsltproc/description XSLT XML transformation utility. endef -CONFIGURE_ARGS += \ - --enable-shared \ - --enable-static \ - --without-python \ - --without-crypto \ - --without-debug \ - --without-mem-debug \ - --without-debugger \ - --without-plugins +CMAKE_HOST_OPTIONS += \ + -DBUILD_SHARED_LIBS=OFF \ + -DLIBXSLT_WITH_DEBUGGER=OFF \ + -DLIBXSLT_WITH_CRYPTO=OFF \ + -DLIBXSLT_WITH_MEM_DEBUG=OFF \ + -DLIBXSLT_WITH_MODULES=OFF \ + -DLIBXSLT_WITH_PROFILER=OFF \ + -DLIBXSLT_WITH_PYTHON=OFF \ + -DLIBXSLT_WITH_TESTS=OFF \ + -DLIBXSLT_WITH_THREADS=ON \ + -DLIBXSLT_WITH_XSLT_DEBUG=OFF -HOST_CONFIGURE_ARGS += \ - --with-libxml-prefix=$(STAGING_DIR_HOSTPKG) \ - --without-python \ - --without-crypto \ - --without-debug \ - --without-mem-debug \ - --without-debugger \ - --without-profiler \ - --without-plugins +CMAKE_OPTIONS += \ + -DBUILD_SHARED_LIBS=ON \ + -DLIBXSLT_WITH_DEBUGGER=OFF \ + -DLIBXSLT_WITH_CRYPTO=OFF \ + -DLIBXSLT_WITH_MEM_DEBUG=OFF \ + -DLIBXSLT_WITH_MODULES=OFF \ + -DLIBXSLT_WITH_PROFILER=ON \ + -DLIBXSLT_WITH_PYTHON=OFF \ + -DLIBXSLT_WITH_TESTS=OFF \ + -DLIBXSLT_WITH_THREADS=ON \ + -DLIBXSLT_WITH_XSLT_DEBUG=OFF define Build/InstallDev/Xslt $(INSTALL_DIR) $(1)/usr/bin $(2)/bin $(1)/usr/include/libxslt \ $(1)/usr/include/libexslt $(1)/usr/lib \ - $(1)/usr/lib/pkgconfig $(2)/share/aclocal + $(1)/usr/lib/pkgconfig $(INSTALL_BIN) \ $(PKG_INSTALL_DIR)/usr/bin/xslt-config \ $(2)/bin/ - ln -sf $(STAGING_DIR)/host/bin/xslt-config $(1)/usr/bin/xslt-config + $(LN) $(STAGING_DIR)/host/bin/xslt-config $(1)/usr/bin/xslt-config $(SED) \ 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \ @@ -107,16 +108,12 @@ define Build/InstallDev/Xslt $(1)/usr/include/libxslt/ $(CP) \ - $(PKG_INSTALL_DIR)/usr/lib/libxslt.{la,a,so*} \ + $(PKG_INSTALL_DIR)/usr/lib/libxslt.so* \ $(1)/usr/lib/ $(INSTALL_DATA) \ $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libxslt.pc \ $(1)/usr/lib/pkgconfig/ - - $(INSTALL_DATA) \ - $(PKG_INSTALL_DIR)/usr/share/aclocal/* \ - $(2)/share/aclocal endef define Build/InstallDev/Exslt @@ -126,7 +123,7 @@ define Build/InstallDev/Exslt $(1)/usr/include/libexslt/ $(CP) \ - $(PKG_INSTALL_DIR)/usr/lib/libexslt.{la,a,so*} \ + $(PKG_INSTALL_DIR)/usr/lib/libexslt.so* \ $(1)/usr/lib/ $(INSTALL_DATA) \ diff --git a/libs/libxslt/patches/010-fix-xml2-config-check.patch b/libs/libxslt/patches/010-fix-xml2-config-check.patch deleted file mode 100644 index 657705e9..00000000 --- a/libs/libxslt/patches/010-fix-xml2-config-check.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/configure.ac -+++ b/configure.ac -@@ -546,7 +546,7 @@ dnl make sure xml2-config is executable, - dnl test version and init our variables - dnl - --if test "x$LIBXML_LIBS" = "x" && ${XML_CONFIG} --libs print > /dev/null 2>&1 -+if test "x$LIBXML_LIBS" = "x" && ${XML_CONFIG} --libs > /dev/null 2>&1 - then - AC_MSG_CHECKING(for libxml libraries >= $LIBXML_REQUIRED_VERSION) - XMLVERS=`$XML_CONFIG --version` From 242fac287ff57ff8b674eba5a14fea20b692dd20 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 21 Nov 2022 17:49:09 -0800 Subject: [PATCH 022/102] elektra: get rid of pointless iconv patch A better solution was discovered. Signed-off-by: Rosen Penev --- libs/elektra/patches/010-iconv.patch | 121 --------------------------- 1 file changed, 121 deletions(-) delete mode 100644 libs/elektra/patches/010-iconv.patch diff --git a/libs/elektra/patches/010-iconv.patch b/libs/elektra/patches/010-iconv.patch deleted file mode 100644 index 96d5b727..00000000 --- a/libs/elektra/patches/010-iconv.patch +++ /dev/null @@ -1,121 +0,0 @@ ---- a/src/plugins/filecheck/CMakeLists.txt -+++ b/src/plugins/filecheck/CMakeLists.txt -@@ -1,20 +1,46 @@ - include (LibAddMacros) --if (DEPENDENCY_PHASE) -- find_package (Iconv QUIET) -- -- if (NOT Iconv_FOUND) -- remove_plugin (filecheck "Cannot find iconv library") -- endif () -+find_package (Iconv QUIET) - -+if (DEPENDENCY_PHASE) - if (ENABLE_ASAN AND CMAKE_SYSTEM_NAME MATCHES FreeBSD) - # See also: https://cirrus-ci.com/task/5751822404288512?command=tests#L237-L239 - remove_plugin (filecheck "the unit test of the plugin fails on FreeBSD if ASan is active") - endif (ENABLE_ASAN AND CMAKE_SYSTEM_NAME MATCHES FreeBSD) - endif () - --add_plugin ( -- filecheck -- SOURCES filecheck.h filecheck.c -- INCLUDE_DIRECTORIES ${Iconv_INCLUDE_DIRS} -- LINK_LIBRARIES ${Iconv_LIBRARIES} -- ADD_TEST INSTALL_TEST_DATA COMPONENT libelektra${SO_VERSION}-extra) -+if(Iconv_FOUND) -+ add_plugin ( -+ filecheck -+ SOURCES filecheck.h filecheck.c -+ INCLUDE_DIRECTORIES ${Iconv_INCLUDE_DIRS} -+ LINK_LIBRARIES ${Iconv_LIBRARIES} -+ ADD_TEST INSTALL_TEST_DATA COMPONENT libelektra${SO_VERSION}-extra) -+else() -+ # Sometime the build environment is not setup -+ # in a way CMake can find Iconv on its own by default. -+ # But if we simply link against iconv (-liconv), the build may succeed -+ # due to other compiler/link flags. -+ set(CMAKE_REQUIRED_LIBRARIES "iconv") -+ check_c_source_compiles(" -+ #include -+ #include -+ int main() { -+ char *a, *b; -+ size_t i, j; -+ iconv_t ic; -+ ic = iconv_open(\"to\", \"from\"); -+ iconv(ic, &a, &i, &b, &j); -+ iconv_close(ic); -+ } -+ " -+ Iconv_EXPLICITLY_AT_ENV) -+ if(Iconv_EXPLICITLY_AT_ENV) -+ add_plugin ( -+ filecheck -+ SOURCES filecheck.h filecheck.c -+ LINK_LIBRARIES iconv -+ ADD_TEST INSTALL_TEST_DATA COMPONENT libelektra${SO_VERSION}-extra) -+ else() -+ message(FATAL_ERROR "Cannot find iconv library") -+ endif() -+endif() ---- a/src/plugins/iconv/CMakeLists.txt -+++ b/src/plugins/iconv/CMakeLists.txt -@@ -1,19 +1,45 @@ --if (DEPENDENCY_PHASE) -- find_package (Iconv QUIET) -+find_package (Iconv QUIET) - -+if (DEPENDENCY_PHASE) - if (ENABLE_ASAN AND CMAKE_SYSTEM_NAME MATCHES FreeBSD) - # See also: https://cirrus-ci.com/task/5751822404288512?command=tests#L253-L255 - remove_plugin (iconv "the unit test of the plugin fails on FreeBSD if ASan is active") - endif (ENABLE_ASAN AND CMAKE_SYSTEM_NAME MATCHES FreeBSD) -- -- if (NOT Iconv_FOUND) -- remove_plugin (iconv "Cannot find iconv library") -- endif () - endif () - --add_plugin ( -- iconv -- SOURCES conv.h iconv.c -- INCLUDE_DIRECTORIES ${Iconv_INCLUDE_DIRS} -- LINK_LIBRARIES ${Iconv_LIBRARIES} -- ADD_TEST TEST_README COMPONENT libelektra${SO_VERSION}-extra) -+if(Iconv_FOUND) -+ add_plugin ( -+ iconv -+ SOURCES conv.h iconv.c -+ INCLUDE_DIRECTORIES ${Iconv_INCLUDE_DIRS} -+ LINK_LIBRARIES ${Iconv_LIBRARIES} -+ ADD_TEST TEST_README COMPONENT libelektra${SO_VERSION}-extra) -+else() -+ # Sometime the build environment is not setup -+ # in a way CMake can find Iconv on its own by default. -+ # But if we simply link against iconv (-liconv), the build may succeed -+ # due to other compiler/link flags. -+ set(CMAKE_REQUIRED_LIBRARIES "iconv") -+ check_c_source_compiles(" -+ #include -+ #include -+ int main() { -+ char *a, *b; -+ size_t i, j; -+ iconv_t ic; -+ ic = iconv_open(\"to\", \"from\"); -+ iconv(ic, &a, &i, &b, &j); -+ iconv_close(ic); -+ } -+ " -+ Iconv_EXPLICITLY_AT_ENV) -+ if(Iconv_EXPLICITLY_AT_ENV) -+ add_plugin ( -+ iconv -+ SOURCES conv.h iconv.c -+ LINK_LIBRARIES iconv -+ ADD_TEST TEST_README COMPONENT libelektra${SO_VERSION}-extra) -+ else() -+ message(FATAL_ERROR "Cannot find iconv library") -+ endif() -+endif() From 5259806b4ed694e0b4430d8f0e478977f9c124d3 Mon Sep 17 00:00:00 2001 From: Oskari Rauta Date: Thu, 12 Jan 2023 10:49:49 +0200 Subject: [PATCH 023/102] efivar: new package Co-authored-by: Tianling Shen Signed-off-by: Oskari Rauta --- libs/efivar/Makefile | 66 +++++++ libs/efivar/patches/002-musl-compat.patch | 199 ++++++++++++++++++++++ libs/efivar/patches/005-skip-docs.patch | 11 ++ 3 files changed, 276 insertions(+) create mode 100644 libs/efivar/Makefile create mode 100644 libs/efivar/patches/002-musl-compat.patch create mode 100644 libs/efivar/patches/005-skip-docs.patch diff --git a/libs/efivar/Makefile b/libs/efivar/Makefile new file mode 100644 index 00000000..63c2abe5 --- /dev/null +++ b/libs/efivar/Makefile @@ -0,0 +1,66 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=efivar +PKG_VERSION:=38 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=https://github.com/rhboot/efivar/releases/download/$(PKG_VERSION) +PKG_HASH:=f018ed6e49c5f1c16d336d9fd7687ce87023276591921db1e49a314ad6515349 + +PKG_LICENSE:=LGPL-2.1-only +PKG_LICENSE_FILES:=COPYING + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/efivar + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Tools and libraries to work with EFI variables + DEPENDS:=@TARGET_x86_64 + URL:=https://github.com/rhboot/efibootmgr +endef + +define Package/efivar/description + Tools and libraries to work with EFI variables +endef + +MAKE_VARS += \ + ERRORS= \ + HOSTCC="$(HOSTCC)" \ + HOST_CFLAGS="$(HOST_CFLAGS)" \ + HOST_LDFLAGS="$(HOST_LDFLAGS)" \ + LIBDIR="/usr/lib" + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libefiboot.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libefisec.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libefivar.so* $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/include/efivar + $(CP) $(PKG_INSTALL_DIR)/usr/include/efivar/*.h $(1)/usr/include/efivar/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/efivar/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/efisecdb $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/efivar $(1)/usr/bin/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libefiboot.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libefisec.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libefivar.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,efivar)) diff --git a/libs/efivar/patches/002-musl-compat.patch b/libs/efivar/patches/002-musl-compat.patch new file mode 100644 index 00000000..be3cfec4 --- /dev/null +++ b/libs/efivar/patches/002-musl-compat.patch @@ -0,0 +1,199 @@ +From cece3ffd5be2f8641eb694513f2b73e5eb97ffd3 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Fri, 28 Jan 2022 12:13:30 +0100 +Subject: [PATCH 1/2] efisecdb: fix build with musl libc + +Refactor code to use POSIX atexit(3) instead of the GNU specific +on_exit(3). + +Resolves: #197 +Resolves: #202 +Signed-off-by: Natanael Copa + +--- a/src/compiler.h ++++ b/src/compiler.h +@@ -7,8 +7,6 @@ + #ifndef COMPILER_H_ + #define COMPILER_H_ + +-#include +- + /* GCC version checking borrowed from glibc. */ + #if defined(__GNUC__) && defined(__GNUC_MINOR__) + # define GNUC_PREREQ(maj,min) \ +--- a/src/efisecdb.c ++++ b/src/efisecdb.c +@@ -25,6 +25,10 @@ + extern char *optarg; + extern int optind, opterr, optopt; + ++static efi_secdb_t *secdb = NULL; ++static list_t infiles; ++static list_t actions; ++ + struct hash_param { + char *name; + efi_secdb_type_t algorithm; +@@ -187,12 +191,11 @@ add_action(list_t *list, action_type_t a + } + + static void +-free_actions(int status UNUSED, void *actionsp) ++free_actions(void) + { +- list_t *actions = (list_t *)actionsp; + list_t *pos, *tmp; + +- for_each_action_safe(pos, tmp, actions) { ++ for_each_action_safe(pos, tmp, &actions) { + action_t *action = list_entry(pos, action_t, list); + + list_del(&action->list); +@@ -202,12 +205,11 @@ free_actions(int status UNUSED, void *ac + } + + static void +-free_infiles(int status UNUSED, void *infilesp) ++free_infiles(void) + { +- list_t *infiles = (list_t *)infilesp; + list_t *pos, *tmp; + +- for_each_ptr_safe(pos, tmp, infiles) { ++ for_each_ptr_safe(pos, tmp, &infiles) { + ptrlist_t *entry = list_entry(pos, ptrlist_t, list); + + list_del(&entry->list); +@@ -216,27 +218,12 @@ free_infiles(int status UNUSED, void *in + } + + static void +-maybe_free_secdb(int status UNUSED, void *voidp) ++maybe_free_secdb(void) + { +- efi_secdb_t **secdbp = (efi_secdb_t **)voidp; +- +- if (secdbp == NULL || *secdbp == NULL) ++ if (secdb == NULL) + return; + +- efi_secdb_free(*secdbp); +-} +- +-static void +-maybe_do_unlink(int status, void *filep) +-{ +- char **file = (char **)filep; +- +- if (status == 0) +- return; +- if (file == NULL || *file == NULL) +- return; +- +- unlink(*file); ++ efi_secdb_free(secdb); + } + + static void +@@ -268,8 +255,7 @@ list_guids(void) + * failure. + */ + static int +-parse_input_files(list_t *infiles, char **outfile, efi_secdb_t **secdb, +- bool dump) ++parse_input_files(list_t *infiles, efi_secdb_t **secdb, bool dump) + { + int status = 0; + list_t *pos, *tmp; +@@ -310,8 +296,6 @@ parse_input_files(list_t *infiles, char + if (!dump) + exit(1); + status = 1; +- xfree(*outfile); +- *outfile = NULL; + break; + } + } +@@ -323,15 +307,6 @@ parse_input_files(list_t *infiles, char + return status; + } + +-/* +- * These need to be static globals so that they're not on main's stack when +- * on_exit() fires. +- */ +-static efi_secdb_t *secdb = NULL; +-static list_t infiles; +-static list_t actions; +-static char *outfile = NULL; +- + int + main(int argc, char *argv[]) + { +@@ -351,6 +326,7 @@ main(int argc, char *argv[]) + bool do_sort_data = false; + bool sort_descending = false; + int status = 0; ++ char *outfile = NULL; + + const char sopts[] = ":aAc:dfg:h:i:Lo:rs:t:v?"; + const struct option lopts[] = { +@@ -376,10 +352,9 @@ main(int argc, char *argv[]) + INIT_LIST_HEAD(&infiles); + INIT_LIST_HEAD(&actions); + +- on_exit(free_actions, &actions); +- on_exit(free_infiles, &infiles); +- on_exit(maybe_free_secdb, &secdb); +- on_exit(maybe_do_unlink, &outfile); ++ atexit(free_actions); ++ atexit(free_infiles); ++ atexit(maybe_free_secdb); + + /* + * parse the command line. +@@ -550,7 +525,7 @@ sort_err: + efi_secdb_set_bool(secdb, EFI_SECDB_SORT_DATA, do_sort_data); + efi_secdb_set_bool(secdb, EFI_SECDB_SORT_DESCENDING, sort_descending); + +- status = parse_input_files(&infiles, &outfile, &secdb, dump); ++ status = parse_input_files(&infiles, &secdb, dump); + if (status == 0) { + for_each_action_safe(pos, tmp, &actions) { + action_t *action = list_entry(pos, action_t, list); +@@ -587,24 +562,30 @@ sort_err: + outfd = open(outfile, flags, 0600); + if (outfd < 0) { + char *tmpoutfile = outfile; +- if (errno == EEXIST) +- outfile = NULL; ++ if (errno != EEXIST) ++ unlink(outfile); + err(1, "could not open \"%s\"", tmpoutfile); + } + + rc = ftruncate(outfd, 0); +- if (rc < 0) ++ if (rc < 0) { ++ unlink(outfile); + err(1, "could not truncate output file \"%s\"", outfile); ++ } + + void *output; + size_t size = 0; + rc = efi_secdb_realize(secdb, &output, &size); +- if (rc < 0) ++ if (rc < 0) { ++ unlink(outfile); + secdb_err(1, "could not realize signature list"); ++ } + + rc = write(outfd, output, size); +- if (rc < 0) ++ if (rc < 0) { ++ unlink(outfile); + err(1, "could not write signature list"); ++ } + + close(outfd); + xfree(output); diff --git a/libs/efivar/patches/005-skip-docs.patch b/libs/efivar/patches/005-skip-docs.patch new file mode 100644 index 00000000..94e20d7f --- /dev/null +++ b/libs/efivar/patches/005-skip-docs.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -7,7 +7,7 @@ include $(TOPDIR)/src/include/defaults.m + include $(TOPDIR)/src/include/coverity.mk + include $(TOPDIR)/src/include/scan-build.mk + +-SUBDIRS := src docs ++SUBDIRS := src + + all : | efivar.spec src/include/version.mk prep + all clean install prep : From cfd42842a950351f3ac11bafa152376887f3da53 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 13 Jan 2023 17:08:21 -0800 Subject: [PATCH 024/102] alpine: fix old URL Signed-off-by: Rosen Penev --- mail/alpine/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mail/alpine/Makefile b/mail/alpine/Makefile index 97cb1ae3..b11d4aa3 100644 --- a/mail/alpine/Makefile +++ b/mail/alpine/Makefile @@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk PKG_NAME:=alpine PKG_VERSION:=2.25 -PKG_RELEASE:=$(AUTORELEASE) +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=http://alpine.x10host.com/alpine/release/src +PKG_SOURCE_URL:=https://alpineapp.email/alpine/release/src/Old PKG_HASH:=658a150982f6740bb4128e6dd81188eaa1212ca0bf689b83c2093bb518ecf776 PKG_MAINTAINER:=Antti Seppälä From 8fd6c03978d033188c2ff80bc5d29c59661ca084 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 16 Oct 2022 12:00:28 -0700 Subject: [PATCH 025/102] opendkim: use pkgconfig for libbsd Allows using the overlay. Also remove the outdated uClibc patch. Signed-off-by: Rosen Penev --- mail/opendkim/Makefile | 8 +- mail/opendkim/patches/020-libbsd.patch | 2143 ++++++++++++++++++++++++ mail/opendkim/patches/020-uclibc.patch | 20 - 3 files changed, 2147 insertions(+), 24 deletions(-) create mode 100644 mail/opendkim/patches/020-libbsd.patch delete mode 100644 mail/opendkim/patches/020-uclibc.patch diff --git a/mail/opendkim/Makefile b/mail/opendkim/Makefile index d4c1c256..b25a955a 100644 --- a/mail/opendkim/Makefile +++ b/mail/opendkim/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=opendkim PKG_VERSION:=2.10.3 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/$(PKG_NAME) @@ -61,14 +61,14 @@ define Package/opendkim-tools/description opendkim-genzone, opendkim-testkey and opendkim-testmsg tools. endef -TARGET_CFLAGS += $(FPIC) - CONFIGURE_ARGS += \ --without-db \ --without-gcov \ --without-gprof \ --without-lcov \ - --with-milter=$(STAGING_DIR)/usr + $(if $(CONFIG_USE_GLIBC),,--without-libbsd) \ + --with-milter=$(STAGING_DIR)/usr \ + --with-pic define Build/InstallDev $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/sbin diff --git a/mail/opendkim/patches/020-libbsd.patch b/mail/opendkim/patches/020-libbsd.patch new file mode 100644 index 00000000..d9056b0c --- /dev/null +++ b/mail/opendkim/patches/020-libbsd.patch @@ -0,0 +1,2143 @@ +From f45f7d220e44477c2bc7d04735086e3d703f4b7f Mon Sep 17 00:00:00 2001 +From: Guilherme Janczak +Date: Mon, 2 May 2022 13:42:48 +0000 +Subject: [PATCH] use transparent strlcpy/strlcat fallback + +Using _libbsd-overlay_ through pkg-config allows accessing +`strlcpy`/`strlcat` by including ``, just like on BSD. This +simplifies compatibility code massively. +--- + INSTALL | 10 ++- + README | 6 +- + configure.ac | 127 +++++++++------------------------- + libopendkim/Makefile.am | 4 +- + libopendkim/dkim-cache.c | 10 --- + libopendkim/dkim-canon.c | 16 +---- + libopendkim/dkim-keys.c | 16 +---- + libopendkim/dkim-test.c | 12 +--- + libopendkim/dkim.c | 46 +++++------- + libopendkim/tests/t-test122.c | 10 --- + libopendkim/tests/t-test123.c | 10 --- + libopendkim/tests/t-test127.c | 10 --- + libopendkim/tests/t-test131.c | 10 --- + libopendkim/tests/t-test136.c | 10 --- + libopendkim/tests/t-test142.c | 10 --- + libopendkim/tests/t-test153.c | 10 --- + libopendkim/tests/t-test42.c | 10 --- + libopendkim/tests/t-test55.c | 10 --- + libopendkim/tests/t-test56.c | 10 --- + libopendkim/tests/t-test57.c | 10 --- + libopendkim/tests/t-test73.c | 12 +--- + libopendkim/tests/t-test84.c | 10 --- + libopendkim/tests/t-test88.c | 10 --- + libopendkim/util.c | 12 +--- + miltertest/Makefile.am | 4 +- + miltertest/miltertest.c | 40 ++++------- + opendkim/Makefile.am | 4 +- + opendkim/config.c | 12 +--- + opendkim/flowrate.c | 10 --- + opendkim/opendkim-ar.c | 12 +--- + opendkim/opendkim-db.c | 62 +++++++---------- + opendkim/opendkim-spam.c | 10 --- + opendkim/opendkim-testkey.c | 10 --- + opendkim/opendkim.c | 106 +++++++++++++--------------- + opendkim/reputation.c | 14 +--- + opendkim/stats.c | 10 --- + opendkim/test.c | 12 +--- + opendkim/util.c | 12 +--- + reprrd/reprrd.c | 13 ++-- + stats/Makefile.am | 4 +- + stats/opendkim-importstats.c | 10 --- + 41 files changed, 177 insertions(+), 569 deletions(-) + +--- a/INSTALL ++++ b/INSTALL +@@ -50,7 +50,7 @@ doesn't find it, you will need to specif + --with-db-libdir + --with-db-lib + These provide a finer control over the location of BerkeleyDB +- include, library path and libary name where the default ++ include, library path and libary name where the default + locations of --with-db are not enough. + + --with-domain Specifies the local domain name in use. Used only for +@@ -129,9 +129,9 @@ doesn't find it, you will need to specif + /usr directories will be searched for the required includes + and libraries. + +---with-unbound Location of the Unbound DNSSEC capable asynchronous resolver ++--with-unbound Location of the Unbound DNSSEC capable asynchronous resolver + library and include file. +- ++ + + + FEATURES +@@ -210,6 +210,10 @@ Steps to compiling the library and the m + system. + ./configure + ++ Note: When creating a package, pass `--without-libbsd` to the configure ++ script. If it fails, the program depends on either of libbsd or libobsd ++ in your system. ++ + (5) Compile the package. + make + +--- a/README ++++ b/README +@@ -59,8 +59,8 @@ o sendmail v8.13.0 (or later), or Postfi + + o Access to a working nameserver (required only for signature verification). + +-o On Linux systems, either libbsd (BSD compatibility library) or some other +- library that provides strlcat() and strlcpy(). ++o If `./configure --without-libbsd` fails, either of libbsd or libobsd are ++ required. This happens on glibc, for instance. + + o If you wish to interface the filter with SQL databases, or store statistical + information in a database, OpenDBX v1.3.7 or later is required. +@@ -229,7 +229,7 @@ Other OpenDKIM issues: + + Report any bugs to the email address opendkim-users@lists.opendkim.org or to + the sourceforge issue trackers accessible at: +- ++ + https://sourceforge.net/p/opendkim/_list/tickets + + +--- a/configure.ac ++++ b/configure.ac +@@ -2,7 +2,7 @@ + # Process this file with autoconf to produce a configure script. + # + # Copyright (c) 2009-2015, The Trusted Domain Project. All rights reserved. +-# ++# + + # + # Setup +@@ -47,13 +47,13 @@ AC_CONFIG_MACRO_DIR([m4]) + + # + # Hexadecimal version, for use in generating dkim.h +-# ++# + HEX_VERSION=$(printf %08x $(( ((VERSION_RELEASE << 8 | VERSION_MAJOR_REV) << 8 | VERSION_MINOR_REV) << 8| VERSION_PATCH ))) + AC_SUBST([HEX_VERSION]) + + # + # library version, passed to libtool +-# ++# + LIBOPENDKIM_VERSION_INFO=$(printf %d:%d:%d LIBVERSION_CURRENT LIBVERSION_REVISION LIBVERSION_AGE) + AC_SUBST([LIBOPENDKIM_VERSION_INFO]) + +@@ -130,11 +130,11 @@ AC_CHECK_TYPES([useconds_t]) + # See if libopendkim will need -lresolv + # + dnscheck=' +-#include "confdefs.h" ++#include "confdefs.h" + #include + #include + #include +-#include ++#include + int main() { + res_mkquery (0, 0, 0, 0, 0, 0, 0, 0, 0); + dn_expand (0, 0, 0, 0, 0); +@@ -165,7 +165,7 @@ $dnscheck + LIBS="$saved_LIBS" + ]) + AC_SUBST([LIBRESOLV]) +- ++ + # + # Checks for header files + # +@@ -196,78 +196,17 @@ AC_FUNC_REALLOC + + AC_CHECK_FUNCS([dup2 endpwent getcwd gethostname gethostbyname getaddrinfo gethostbyname2 gettimeofday isascii memchr memmove memset regcomp select socket strcasecmp strchr strdup strerror strncasecmp strrchr strstr strtol strtoul strtoull realpath strsep]) + +-bsdstrl_h_found="no" +-strl_found="no" +-libstrl_found="no" +-strl_h_found="no" +- +-AC_CHECK_HEADERS([bsd/string.h], [bsdstrl_h_found="yes"]) +- +-AC_CHECK_FUNCS([strlcat strlcpy], [strl_found="yes"], +- [ +- saved_LIBS="$LIBS" +- LIBS="$outer_LIBS" +- AC_SEARCH_LIBS([strlcat], +- [bsd strl], +- [libstrl_found="yes"], +- [strl_found="no"]) +- AC_SEARCH_LIBS([strlcpy], +- [bsd strl], +- [libstrl_found="yes"], +- [strl_found="no"]) +- STRL_LIBS="$LIBS" +- LIBS="$saved_LIBS" +- ]) +- +-if test x"$libstrl_found" = x"yes" +-then +- LIBS="$LIBS $STRL_LIBS" +-fi +- +-# we need something above to have worked +-if test x"$strl_found" != x"yes" -a x"$libstrl_found" != x"yes" +-then +- AC_MSG_ERROR(no strlcpy/strlcat found) +-fi +- +-AC_CHECK_HEADERS([strl.h], [strl_h_found="yes"]) +-if test x"$strl_h_found" != x"yes" +-then +- strldirs="/usr/local/include /usr/include" +- +- for d in $strldirs +- do +- AC_MSG_CHECKING([for strl.h in $d/strl]) +- if test -f $d/strl/strl.h +- then +- unset ac_cv_header_strl_h +- saved_CPPFLAGS="$CPPFLAGS" +- CPPFLAGS="$CPPFLAGS -I$d/strl" +- AC_CHECK_HEADERS([strl.h], [strl_h_found="yes"]) +- CPPFLAGS="$saved_CPPFLAGS" +- fi +- +- if test x"$strl_h_found" = x"yes" +- then +- CPPFLAGS="$CPPFLAGS -I$d/strl" +- break +- fi +- done +-fi +- +-# we need to include if an installed strl.h was found and no +-# bsd/string.h was found +-if test x"$strl_h_found" = x"yes" -a x"$bsdstrl_h_found" = x"no" +-then +- AC_DEFINE([USE_STRL_H], 1, +- [Define to 1 if you need to include to get the `strlcat()' and `strlcpy()' functions.]) +-fi +- +-if test x"$bsdstrl_h_found" = x"yes" +-then +- AC_DEFINE([USE_BSD_H], 1, +- [Define to 1 if you need to include to get the `strlcat()' and `strlcpy()' functions.]) +-fi ++AC_ARG_WITH([libbsd], AS_HELP_STRING([--without-libbsd], ++ [Error when BSD functions are not found])) ++AC_CHECK_FUNCS([strlcpy strlcat],, [LIBBSD_NEEDED=yes]) ++AS_IF([test "x$LIBBSD_NEEDED" = "xyes"], [ ++ AS_IF([test "x$with_libbsd" = "xno"], [ ++ AC_MSG_ERROR([BSD functions not found and --without-libbsd was used]) ++ ]) ++ PKG_CHECK_MODULES([LIBBSD], [libbsd-overlay],, ++ [AC_MSG_ERROR([BSD functions not found, ++ libbsd is required])]) ++]) + + # + # Checks for structure members +@@ -446,7 +385,7 @@ fi + + # + # test coverage/profiling stuff +-# ++# + AC_ARG_ENABLE([codecoverage], + AS_HELP_STRING([--enable-codecoverage], + [include code coverage/profiling code])) +@@ -574,7 +513,7 @@ AM_CONDITIONAL(GPROF_FILENAMES, test x"$ + + # + # opendkim +-# ++# + AC_ARG_ENABLE([filter], + AS_HELP_STRING([--disable-filter], + [do not compile the opendkim filter]), +@@ -732,7 +671,7 @@ then + + #if GNUTLS_VERSION_NUMBER < 0x020b07 + # error GnuTLS 2.11.7 or later required +- #endif ++ #endif + int main() + { + return 0; +@@ -1009,7 +948,7 @@ AC_SUBST(LIBMILTER_LIBS) + + # + # librrd +-# ++# + AC_ARG_WITH([librrd], + AS_HELP_STRING([--with-librrd], + [location of librrd includes and library]), +@@ -1023,7 +962,7 @@ fi + + if test \( x"$librrdpath" = x"auto" -o x"$librrdpath" = x"yes" \) -a x"$PKG_CONFIG" != x"" + then +- PKG_CHECK_MODULES([RRDTOOL], [librrd], ++ PKG_CHECK_MODULES([RRDTOOL], [librrd], + [ + librrd_found="yes" + ], +@@ -1085,7 +1024,7 @@ AC_SUBST(RRDTOOL_LIBS) + + # + # libmemcached +-# ++# + AC_ARG_WITH([libmemcached], + AS_HELP_STRING([--with-libmemcached], + [location of libmemcached includes and library]), +@@ -1095,7 +1034,7 @@ libmemcache_found="no" + + if test \( x"$libmcdpath" = x"auto" -o x"$libmcdpath" = x"yes" \) -a x"$PKG_CONFIG" != x"" + then +- PKG_CHECK_MODULES([LIBMEMCACHED], [libmemcached >= 0.36], ++ PKG_CHECK_MODULES([LIBMEMCACHED], [libmemcached >= 0.36], + [ + libmemcache_found="yes" + LIBMEMCACHED_INCDIRS="$LIBMEMCACHED_CFLAGS" +@@ -1159,7 +1098,7 @@ main() + return 0; + } + ])], +- AC_MSG_RESULT([ok]), ++ AC_MSG_RESULT([ok]), + AC_MSG_ERROR([libmemcached version 0.36 or later required])) + fi + +@@ -1383,7 +1322,7 @@ if test \( x"$trepath" = x"auto" -o x"$ + then + PKG_CHECK_MODULES([LIBTRE], [tre >= 0.8.0], [tre_found="yes"], + [ +- PKG_CHECK_MODULES([LIBTRE], [tre >= 0.7.5], ++ PKG_CHECK_MODULES([LIBTRE], [tre >= 0.7.5], + [ + tre_found="yes" + AC_DEFINE([TRE_PRE_080], 1, +@@ -1626,7 +1565,7 @@ main() + return 0; + } + ])], +- AC_MSG_RESULT([ok]), ++ AC_MSG_RESULT([ok]), + AC_MSG_ERROR([Lua version 5.1 or later required])) + CPPFLAGS="$saved_CPPFLAGS" + AC_DEFINE([USE_LUA], 1, [support for Lua scripting]) +@@ -1836,7 +1775,7 @@ main() + return 0; + } + ])], +- AC_MSG_RESULT([ok]), ++ AC_MSG_RESULT([ok]), + AC_MSG_ERROR([OpenLDAP version 2.1.3 or later required])) + CPPFLAGS="$saved_CPPFLAGS" + AC_DEFINE([USE_LDAP], 1, [OpenLDAP support for datasets enabled]) +@@ -2086,7 +2025,7 @@ fi + + # + # reputation requires libjansson +-# ++# + + AC_ARG_WITH([libjansson], + AS_HELP_STRING([--with-libjansson], +@@ -2418,7 +2357,7 @@ AC_DEFINE_UNQUOTED([LIBOPENDKIM_FEATURE_ + + # + # setup for testing +-# ++# + + AC_ARG_ENABLE([live-testing], + AS_HELP_STRING([--disable-live-testing], +@@ -2428,7 +2367,7 @@ AM_CONDITIONAL(LIVE_TESTS, test x"$live_ + + # + # specify test socket +-# ++# + + AC_ARG_WITH([test-socket], + AS_HELP_STRING([--with-test-socket], +@@ -2535,7 +2474,7 @@ AC_SUBST(LIBERL_LIBS) + + CPPFLAGS="$CPPFLAGS -DCONFIG_BASE=\\\"$sysconfdir\\\"" + +-test "x$prefix" = xNONE && prefix=$ac_default_prefix ++test "x$prefix" = xNONE && prefix=$ac_default_prefix + SYSCONFDIR=`eval echo "$sysconfdir"` + AC_SUBST([SYSCONFDIR]) + +@@ -2645,7 +2584,7 @@ AC_OUTPUT([ Makefile + miltertest/Makefile + opendkim/Makefile opendkim/opendkim.8 opendkim/opendkim-genkey + opendkim/opendkim-genkey.8 opendkim/opendkim-genzone.8 +- opendkim/opendkim-lua.3 ++ opendkim/opendkim-lua.3 + opendkim/opendkim-testkey.8 opendkim/opendkim-stats.8 + opendkim/opendkim-testmsg.8 opendkim/opendkim.conf.5 + opendkim/opendkim.conf.simple +--- a/libopendkim/Makefile.am ++++ b/libopendkim/Makefile.am +@@ -9,9 +9,9 @@ LDADD = ./libopendkim.la + + lib_LTLIBRARIES = libopendkim.la + libopendkim_la_SOURCES = base32.c base64.c dkim-atps.c dkim-cache.c dkim-canon.c dkim-dns.c dkim-keys.c dkim-mailparse.c dkim-report.c dkim-tables.c dkim-test.c dkim-util.c dkim.c util.c base64.h dkim-cache.h dkim-canon.h dkim-dns.h dkim-internal.h dkim-keys.h dkim-mailparse.h dkim-report.h dkim-tables.h dkim-test.h dkim-types.h dkim-util.h dkim.h util.h +-libopendkim_la_CPPFLAGS = $(LIBCRYPTO_CPPFLAGS) ++libopendkim_la_CPPFLAGS = $(LIBCRYPTO_CPPFLAGS) $(LIBBSD_CFLAGS) + libopendkim_la_CFLAGS = $(LIBCRYPTO_INCDIRS) $(LIBOPENDKIM_INC) $(COV_CFLAGS) +-libopendkim_la_LDFLAGS = -no-undefined $(LIBCRYPTO_LIBDIRS) $(COV_LDFLAGS) -version-info $(LIBOPENDKIM_VERSION_INFO) ++libopendkim_la_LDFLAGS = -no-undefined $(LIBCRYPTO_LIBDIRS) $(COV_LDFLAGS) -version-info $(LIBOPENDKIM_VERSION_INFO) $(LIBBSD_LIBS) + libopendkim_la_LIBADD = $(LIBOPENDKIM_LIBS) $(LIBCRYPTO_LDADD) $(COV_LIBADD) + if !ALL_SYMBOLS + libopendkim_la_DEPENDENCIES = symbols.map +--- a/libopendkim/dkim-cache.c ++++ b/libopendkim/dkim-cache.c +@@ -29,16 +29,6 @@ + #include "dkim-internal.h" + #include "dkim-cache.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* limits, macros, etc. */ + #define BUFRSZ 1024 + #define DB_MODE (S_IRUSR|S_IWUSR) +--- a/libopendkim/dkim-canon.c ++++ b/libopendkim/dkim-canon.c +@@ -45,16 +45,6 @@ + #include "dkim-util.h" + #include "util.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* definitions */ + #define CRLF (u_char *) "\r\n" + #define SP (u_char *) " " +@@ -379,7 +369,7 @@ dkim_canon_header_string(struct dkim_dst + + tmp = tmpbuf; + } +- ++ + if (*p == ':') + { + p++; +@@ -681,7 +671,7 @@ dkim_canon_init(DKIM *dkim, _Bool tmp, _ + DKIM_FREE(dkim, sha); + return DKIM_STAT_INTERNAL; + } +- ++ + if (tmp) + { + status = dkim_tmpfile(dkim, &fd, keep); +@@ -1512,7 +1502,7 @@ dkim_canon_signature(DKIM *dkim, struct + tmphdr.hdr_next = NULL; + if (cur->canon_canon == DKIM_CANON_RELAXED) + dkim_lowerhdr(tmphdr.hdr_text); +- ++ + /* canonicalize the signature */ + status = dkim_canon_header(dkim, cur, &tmphdr, FALSE); + if (status != DKIM_STAT_OK) +--- a/libopendkim/dkim-keys.c ++++ b/libopendkim/dkim-keys.c +@@ -29,16 +29,6 @@ + #include "dkim-test.h" + #include "util.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* prototypes */ + extern void dkim_error __P((DKIM *, const char *, ...)); + +@@ -156,7 +146,7 @@ dkim_get_key_dns(DKIM *dkim, DKIM_SIGINF + dkim_error(dkim, "'%s' query failed", qname); + return DKIM_STAT_KEYFAIL; + } +- ++ + if (lib->dkiml_dns_callback == NULL) + { + timeout.tv_sec = dkim->dkim_timeout; +@@ -240,7 +230,7 @@ dkim_get_key_dns(DKIM *dkim, DKIM_SIGINF + /* copy it first */ + (void) dn_expand((unsigned char *) &ansbuf, eom, cp, + (char *) qname, sizeof qname); +- ++ + if ((n = dn_skipname(cp, eom)) < 0) + { + dkim_error(dkim, "'%s' reply corrupt", qname); +@@ -420,7 +410,7 @@ dkim_get_key_dns(DKIM *dkim, DKIM_SIGINF + ** and must be set prior to use of this function. Failing to do + ** so will cause this function to return DKIM_STAT_KEYFAIL every time. + ** The file should contain lines of the form: +-** ++** + ** ._domainkey. key-data + ** + ** Case matching on the left is case-sensitive, but libopendkim already +--- a/libopendkim/dkim-test.c ++++ b/libopendkim/dkim-test.c +@@ -36,16 +36,6 @@ + #include "dkim-util.h" + #include "dkim-test.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* definitions */ + #define TESTTTL 300 + #define MAXPACKET 8192 +@@ -443,7 +433,7 @@ dkim_test_key(DKIM_LIB *lib, char *selec + } + return -1; + } +- ++ + rsa->rsa_keysize = RSA_size(rsa->rsa_rsa); + rsa->rsa_pad = RSA_PKCS1_PADDING; + +--- a/libopendkim/dkim.c ++++ b/libopendkim/dkim.c +@@ -91,16 +91,6 @@ + #include "util.h" + #include "base64.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* prototypes */ + void dkim_error __P((DKIM *, const char *, ...)); + +@@ -264,7 +254,7 @@ const u_char *dkim_required_signhdrs[] = + /* ========================= PRIVATE SECTION ========================= */ + + /* +-** DKIM_SET_FREE -- destroy a DKIM_SET ++** DKIM_SET_FREE -- destroy a DKIM_SET + ** + ** Parameters: + ** dkim -- DKIM context +@@ -744,7 +734,7 @@ dkim_process_set(DKIM *dkim, dkim_set_t + } + } + break; +- ++ + case DKIM_SETTYPE_SIGNATURE: + /* make sure required stuff is here */ + if (dkim_param_get(set, (u_char *) "s") == NULL || +@@ -881,7 +871,7 @@ dkim_process_set(DKIM *dkim, dkim_set_t + } + + break; +- ++ + default: + assert(0); + } +@@ -1081,7 +1071,7 @@ dkim_privkey_load(DKIM *dkim) + } + #endif /* USE_GNUTLS */ + +-#ifdef USE_GNUTLS ++#ifdef USE_GNUTLS + status = gnutls_x509_privkey_init(&rsa->rsa_key); + if (status != GNUTLS_E_SUCCESS) + { +@@ -2386,7 +2376,7 @@ dkim_gensighdr(DKIM *dkim, DKIM_SIGINFO + format = "v=%s;%sa=%s;%sc=%s/%s;%sd=%s;%ss=%s;%st=%llu"; + else if (sizeof(sig->sig_timestamp) == sizeof(unsigned long)) + format = "v=%s;%sa=%s;%sc=%s/%s;%sd=%s;%ss=%s;%st=%lu"; +- else ++ else + format = "v=%s;%sa=%s;%sc=%s/%s;%sd=%s;%ss=%s;%st=%u"; + + (void) dkim_dstring_printf(dstr, format, +@@ -3141,7 +3131,7 @@ dkim_headercheck(DKIM *dkim) + + /* + ** DKIM_EOH_SIGN -- declare end-of-headers; prepare for signing +-** ++** + ** Parameters: + ** dkim -- DKIM handle + ** +@@ -3289,7 +3279,7 @@ dkim_eoh_sign(DKIM *dkim) + + /* + ** DKIM_EOH_VERIFY -- declare end-of-headers; set up verification +-** ++** + ** Parameters: + ** dkim -- DKIM handle + ** +@@ -4273,7 +4263,7 @@ dkim_init(void *(*caller_mallocf)(void * + libhandle->dkiml_skipre = FALSE; + libhandle->dkiml_malloc = caller_mallocf; + libhandle->dkiml_free = caller_freef; +- strlcpy((char *) libhandle->dkiml_tmpdir, (char *) td, ++ strlcpy((char *) libhandle->dkiml_tmpdir, (char *) td, + sizeof libhandle->dkiml_tmpdir); + libhandle->dkiml_flags = DKIM_LIBFLAGS_DEFAULT; + libhandle->dkiml_timeout = DEFTIMEOUT; +@@ -4305,7 +4295,7 @@ dkim_init(void *(*caller_mallocf)(void * + libhandle->dkiml_dns_start = dkim_res_query; + libhandle->dkiml_dns_cancel = dkim_res_cancel; + libhandle->dkiml_dns_waitreply = dkim_res_waitreply; +- ++ + #define FEATURE_INDEX(x) ((x) / (8 * sizeof(u_int))) + #define FEATURE_OFFSET(x) ((x) % (8 * sizeof(u_int))) + #define FEATURE_ADD(lib,x) (lib)->dkiml_flist[FEATURE_INDEX((x))] |= (1 << FEATURE_OFFSET(x)) +@@ -4369,7 +4359,7 @@ dkim_close(DKIM_LIB *lib) + + if (lib->dkiml_skipre) + (void) regfree(&lib->dkiml_skiphdrre); +- ++ + if (lib->dkiml_signre) + (void) regfree(&lib->dkiml_hdrre); + +@@ -4386,7 +4376,7 @@ dkim_close(DKIM_LIB *lib) + + if (lib->dkiml_dns_close != NULL && lib->dkiml_dns_service != NULL) + lib->dkiml_dns_close(lib->dkiml_dns_service); +- ++ + free((void *) lib); + + #ifndef USE_GNUTLS +@@ -6206,7 +6196,7 @@ dkim_header(DKIM *dkim, u_char *hdr, siz + + /* + ** DKIM_EOH -- declare end-of-headers +-** ++** + ** Parameters: + ** dkim -- DKIM handle + ** +@@ -6449,7 +6439,7 @@ dkim_chunk(DKIM *dkim, u_char *buf, size + dkim->dkim_chunksm = 0; + } + break; +- ++ + case 2: + if (DKIM_ISLWSP(*p)) + { +@@ -6479,7 +6469,7 @@ dkim_chunk(DKIM *dkim, u_char *buf, size + break; + } + /* FALLTHROUGH */ +- ++ + case 3: + if (*p == '\n') + { +@@ -6898,7 +6888,7 @@ dkim_getsighdr_d(DKIM *dkim, size_t init + n); + x += n; + len += n; +- ++ + } + } + else +@@ -7015,7 +7005,7 @@ dkim_sig_hdrsigned(DKIM_SIGINFO *sig, u_ + if (c1 == NULL) + { + start = hdrlist; +- len = c2 - start; ++ len = c2 - start; + } + else + { +@@ -7087,7 +7077,7 @@ dkim_sig_setdnssec(DKIM_SIGINFO *sig, in + { + assert(sig != NULL); + +- switch (dnssec_status) ++ switch (dnssec_status) + { + case DKIM_DNSSEC_BOGUS: + case DKIM_DNSSEC_INSECURE: +@@ -8923,7 +8913,7 @@ dkim_add_querymethod(DKIM *dkim, const c + strlen(type) + 1); + return DKIM_STAT_NORESOURCE; + } +- ++ + if (options != NULL) + { + q->qm_options = dkim_strdup(dkim, tmp, 0); +--- a/libopendkim/tests/t-test122.c ++++ b/libopendkim/tests/t-test122.c +@@ -22,16 +22,6 @@ + #include "../dkim.h" + #include "t-testdata.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + #define MAXHEADER 4096 + + #define GIBBERISHLEN (sizeof(GIBBERISH) - 1) +--- a/libopendkim/tests/t-test123.c ++++ b/libopendkim/tests/t-test123.c +@@ -22,16 +22,6 @@ + #include "../dkim.h" + #include "t-testdata.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + #define MAXHEADER 4096 + + #define GIBBERISHLEN (sizeof(GIBBERISH) - 1) +--- a/libopendkim/tests/t-test127.c ++++ b/libopendkim/tests/t-test127.c +@@ -22,16 +22,6 @@ + #include "../dkim.h" + #include "t-testdata.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + #define MAXHEADER 4096 + + #define MAXMSGSIZE 16384 +--- a/libopendkim/tests/t-test131.c ++++ b/libopendkim/tests/t-test131.c +@@ -23,16 +23,6 @@ + #include "../dkim.h" + #include "t-testdata.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + #define MAXHEADER 4096 + + #define NULLBH "bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=" +--- a/libopendkim/tests/t-test136.c ++++ b/libopendkim/tests/t-test136.c +@@ -22,16 +22,6 @@ + #include "../dkim.h" + #include "t-testdata.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + #define MAXHEADER 4096 + + #define SIG2 "v=1; a=rsa-sha1; c=relaxed/relaxed; d=example.com; s=test;\r\n\tt=1172620939; bh=Z9ONHHsBrKN0pbfrOu025VfbdR4=;\r\n\th=Received:Received:Received:From:To:Date:Subject:Message-ID;\r\n\tb=Jf+j2RDZRkpIF1KaL5ByhHFPWj5RMeX5764IVlwIc11equjQND51K9FfL5pyjXvwj\r\n\t FoFPW0PGJb3liej6iDDEHgYpXR4p5qqlGx/C1Q9gf/MQN/Xlkv6ZXgR38QnWAfZxh5\r\n\t N1f5xUg+SJb5yBDoXklG62IRdia1Hq9MuiGumrGM=" +--- a/libopendkim/tests/t-test142.c ++++ b/libopendkim/tests/t-test142.c +@@ -22,16 +22,6 @@ + #include "../dkim.h" + #include "t-testdata.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + #define MAXHEADER 4096 + #define MAXMSGSIZE 16384 + +--- a/libopendkim/tests/t-test153.c ++++ b/libopendkim/tests/t-test153.c +@@ -18,16 +18,6 @@ + # include + #endif /* USE_GNUTLS */ + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* libopendkim includes */ + #include "../dkim.h" + #include "t-testdata.h" +--- a/libopendkim/tests/t-test42.c ++++ b/libopendkim/tests/t-test42.c +@@ -26,16 +26,6 @@ + #include "../dkim.h" + #include "t-testdata.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + #define MAXHEADER 4096 + + #define SIG2 "v=1; a=rsa-sha256; c=simple/simple; d=example.com; s=test;\r\n\tt=1172620939; bh=yHBAX+3IwxTZIynBuB/5tlsBInJq9n8qz5fgAycHi80=;\r\n\th=Received:Received:Received:From:To:Date:Subject:Message-ID; b=Y3y\r\n\tVeA3WZdCZl1sGuOZNC3BBRhtGCOExkZdw5xQoGPvSX/q6AC1SAJvOUWOri95AZAUGs0\r\n\t/bIDzzt23ei9jc+rptlavrl/5ijMrl6ShmvkACk6It62KPkJcDpoGfi5AZkrfX1Ou/z\r\n\tqGg5xJX86Kqd7FgNolMg7PbfyWliK2Yb84=" +--- a/libopendkim/tests/t-test55.c ++++ b/libopendkim/tests/t-test55.c +@@ -22,16 +22,6 @@ + #include "../dkim.h" + #include "t-testdata.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + #define MAXHEADER 4096 + + #define GIBBERISHLEN (sizeof(GIBBERISH) - 1) +--- a/libopendkim/tests/t-test56.c ++++ b/libopendkim/tests/t-test56.c +@@ -22,16 +22,6 @@ + #include "../dkim.h" + #include "t-testdata.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + #define MAXHEADER 4096 + + #define GIBBERISHLEN (sizeof(GIBBERISH) - 1) +--- a/libopendkim/tests/t-test57.c ++++ b/libopendkim/tests/t-test57.c +@@ -24,16 +24,6 @@ + #include "../dkim.h" + #include "t-testdata.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + #define MAXHEADER 4096 + + #define SIG2 "v=1; a=rsa-sha256; c=relaxed/simple; d=example.com; s=test;\r\n\tt=1172620939; bh=TRy6u0KYixKENCPL95G1Y1uwclQ9rWthX6rFgE7gWb8=;\r\n\th=Received:Received:Received:From:To:Date:Subject:Message-ID;\r\n\tb=aMDMwcz08Na0zYLrEZnUMBUipMh3blE+pWiBSvX+t2ynaDUGTqd27xuR5JddL9y1T\r\n\t 6h0LkUMIcijsPBWa1WWfKL23QceksV75Y1/Tt6gmVi3SdVAoJbbZImrOaAQ3YQAn64\r\n\t dp1vI0Z8gSashYlwy+7gtmVSLAj/fpcAF6yNDPuE=" +--- a/libopendkim/tests/t-test73.c ++++ b/libopendkim/tests/t-test73.c +@@ -27,16 +27,6 @@ + #include "../dkim.h" + #include "t-testdata.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + #define BUFRSZ 1024 + #define MAXADDRESS 256 + #define MAXHEADER 4096 +@@ -85,7 +75,7 @@ stub_dns_waitreply(void *srv, void *qh, + + memset(&newhdr, '\0', sizeof newhdr); + memset(&dnptrs, '\0', sizeof dnptrs); +- ++ + newhdr.qdcount = htons(1); + newhdr.ancount = htons(1); + newhdr.rcode = NOERROR; +--- a/libopendkim/tests/t-test84.c ++++ b/libopendkim/tests/t-test84.c +@@ -26,16 +26,6 @@ + #include "../dkim.h" + #include "t-testdata.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + #define MAXHEADER 4096 + + #define SIG1 "v=1; a=rsa-sha256; c=relaxed/simple; d=sendmail.com; s=test; t=1172620939; i=@eng.sendmail.com; bh=yHBAX+3IwxTZIynBuB/5tlsBInJq9n8qz5fgAycHi80=; h=Received:Received:Received:From:To:Date:Subject:Message-ID; b=r5DyHh4oxZcCBcIzpKTnEk6yvWDI9g9DI+UUIwl2ZAcZ6P0BbsOQ8MEjmUdwlZitqoFLa25/Re8/rC5kHasOb3vs0T37vkasoTb1rGR7y/bcMnY4hRkPAyC7NoLoTjneJMTQ/WQYnZe3DJ8lVuDRYvY9BeV2EjH8kiGsa9QttiA=" +--- a/libopendkim/tests/t-test88.c ++++ b/libopendkim/tests/t-test88.c +@@ -22,16 +22,6 @@ + #include "../dkim.h" + #include "t-testdata.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + #define MAXHEADER 4096 + + #define MAXMSGSIZE 16384 +--- a/libopendkim/util.c ++++ b/libopendkim/util.c +@@ -27,16 +27,6 @@ + #include "dkim-internal.h" + #include "util.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + #if defined(__RES) && (__RES >= 19940415) + # define RES_UNC_T char * + #else /* __RES && __RES >= 19940415 */ +@@ -198,7 +188,7 @@ dkim_lowerhdr(unsigned char *str) + + /* + ** DKIM_HEXCHAR -- translate a hexadecimal character +-** ++** + ** Parameters: + ** c -- character to translate + ** +--- a/miltertest/Makefile.am ++++ b/miltertest/Makefile.am +@@ -10,8 +10,8 @@ if LUA + bin_PROGRAMS = miltertest + + miltertest_SOURCES = miltertest.c +-miltertest_CPPFLAGS = -I$(srcdir)/../libopendkim $(LIBMILTER_INCDIRS) $(LIBLUA_INCDIRS) +-miltertest_LDFLAGS = ../libopendkim/libopendkim.la $(LIBLUA_LIBDIRS) ++miltertest_CPPFLAGS = -I$(srcdir)/../libopendkim $(LIBMILTER_INCDIRS) $(LIBLUA_INCDIRS) $(LIBBSD_CFLAGS) ++miltertest_LDFLAGS = ../libopendkim/libopendkim.la $(LIBLUA_LIBDIRS) $(LIBBSD_LIBS) + miltertest_LDADD = $(LIBLUA_LIBS) $(LIBNSL_LIBS) + + man_MANS = miltertest.8 +--- a/miltertest/miltertest.c ++++ b/miltertest/miltertest.c +@@ -37,16 +37,6 @@ + /* libopendkim includes */ + #include + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* Lua includes */ + #include + #include +@@ -410,7 +400,7 @@ mt_eom_request(struct mt_context *ctx, c + ** cmd -- milter command received (returned) + ** buf -- where to write data + ** buflen -- bytes available at "buf" (updated) +-** ++** + ** Return value: + ** TRUE iff successful. + */ +@@ -618,7 +608,7 @@ mt_assert_state(struct mt_context *ctx, + if (verbose > 0) + { + fprintf(stdout, +- "%s: filter returned status %d to option negotiation on fd %d\n", ++ "%s: filter returned status %d to option negotiation on fd %d\n", + progname, rcmd, ctx->ctx_fd); + } + +@@ -679,7 +669,7 @@ mt_assert_state(struct mt_context *ctx, + if (verbose > 0) + { + fprintf(stdout, +- "%s: filter returned status %d to connection information on fd %d\n", ++ "%s: filter returned status %d to connection information on fd %d\n", + progname, rcmd, ctx->ctx_fd); + } + +@@ -722,7 +712,7 @@ mt_assert_state(struct mt_context *ctx, + if (verbose > 0) + { + fprintf(stdout, +- "%s: filter returned status %d to HELO on fd %d\n", ++ "%s: filter returned status %d to HELO on fd %d\n", + progname, rcmd, ctx->ctx_fd); + } + +@@ -765,7 +755,7 @@ mt_assert_state(struct mt_context *ctx, + if (verbose > 0) + { + fprintf(stdout, +- "%s: filter returned status %d to MAIL on fd %d\n", ++ "%s: filter returned status %d to MAIL on fd %d\n", + progname, rcmd, ctx->ctx_fd); + } + +@@ -808,7 +798,7 @@ mt_assert_state(struct mt_context *ctx, + if (verbose > 0) + { + fprintf(stdout, +- "%s: filter returned status %d to RCPT on fd %d\n", ++ "%s: filter returned status %d to RCPT on fd %d\n", + progname, rcmd, ctx->ctx_fd); + } + +@@ -848,7 +838,7 @@ mt_assert_state(struct mt_context *ctx, + if (verbose > 0) + { + fprintf(stdout, +- "%s: filter returned status %d to DATA on fd %d\n", ++ "%s: filter returned status %d to DATA on fd %d\n", + progname, rcmd, ctx->ctx_fd); + } + +@@ -894,7 +884,7 @@ mt_assert_state(struct mt_context *ctx, + if (verbose > 0) + { + fprintf(stdout, +- "%s: filter returned status %d to header on fd %d\n", ++ "%s: filter returned status %d to header on fd %d\n", + progname, rcmd, ctx->ctx_fd); + } + +@@ -933,10 +923,10 @@ mt_assert_state(struct mt_context *ctx, + if (verbose > 0) + { + fprintf(stdout, +- "%s: filter returned status %d to EOH on fd %d\n", ++ "%s: filter returned status %d to EOH on fd %d\n", + progname, rcmd, ctx->ctx_fd); + } +- ++ + ctx->ctx_state = STATE_DEAD; + } + } +@@ -973,10 +963,10 @@ mt_assert_state(struct mt_context *ctx, + if (verbose > 0) + { + fprintf(stdout, +- "%s: filter returned status %d to body on fd %d\n", ++ "%s: filter returned status %d to body on fd %d\n", + progname, rcmd, ctx->ctx_fd); + } +- ++ + ctx->ctx_state = STATE_DEAD; + } + } +@@ -1623,7 +1613,7 @@ mt_disconnect(lua_State *l) + { + _Bool polite = TRUE; + int top; +- ++ + struct mt_context *ctx; + + assert(l != NULL); +@@ -1820,7 +1810,7 @@ mt_negotiate(lua_State *l) + if (verbose > 0) + { + fprintf(stdout, +- "%s: filter returned status %d to option negotiation on fd %d\n", ++ "%s: filter returned status %d to option negotiation on fd %d\n", + progname, rcmd, ctx->ctx_fd); + } + +@@ -3828,7 +3818,7 @@ mt_getheader(lua_State *l) + + /* + ** USAGE -- print usage message +-** ++** + ** Parameters: + ** Not now. Maybe later. + ** +--- a/opendkim/Makefile.am ++++ b/opendkim/Makefile.am +@@ -25,8 +25,8 @@ sbin_PROGRAMS += opendkim + opendkim_SOURCES = opendkim.c opendkim.h opendkim-ar.c opendkim-ar.h opendkim-arf.c opendkim-arf.h opendkim-config.h opendkim-crypto.c opendkim-crypto.h opendkim-db.c opendkim-db.h opendkim-dns.c opendkim-dns.h opendkim-lua.c opendkim-lua.h config.c config.h flowrate.c flowrate.h reputation.c reputation.h stats.c stats.h test.c test.h util.c util.h + opendkim_CC = $(PTHREAD_CC) + opendkim_CFLAGS = $(PTHREAD_CFLAGS) $(LIBCRYPTO_CFLAGS) $(COV_CFLAGS) +-opendkim_CPPFLAGS = -I$(srcdir)/../libopendkim $(LIBCRYPTO_CPPFLAGS) +-opendkim_LDFLAGS = $(LIBCRYPTO_LIBDIRS) $(LIBMILTER_LIBDIRS) $(PTHREAD_CFLAGS) $(COV_LDFLAGS) ++opendkim_CPPFLAGS = -I$(srcdir)/../libopendkim $(LIBCRYPTO_CPPFLAGS) $(LIBBSD_CFLAGS) ++opendkim_LDFLAGS = $(LIBCRYPTO_LIBDIRS) $(LIBMILTER_LIBDIRS) $(PTHREAD_CFLAGS) $(COV_LDFLAGS) $(LIBBSD_LIBS) + opendkim_LDADD = ../libopendkim/libopendkim.la $(LIBMILTER_LIBS) $(LIBCRYPTO_LIBS) $(PTHREAD_LIBS) $(COV_LIBADD) $(LIBRESOLV) + if USE_DB_OPENDKIM + opendkim_CPPFLAGS += $(LIBDB_INCDIRS) +--- a/opendkim/config.c ++++ b/opendkim/config.c +@@ -22,16 +22,6 @@ + /* libopendkim includes */ + #include + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* opendkim includes */ + #include "config.h" + +@@ -304,7 +294,7 @@ config_load_level(char *file, struct con + size_t newlen; + + oldlen = strlen(*deprecated); +- newlen = oldlen + 2 + ++ newlen = oldlen + 2 + + strlen(def[n].cd_name); + new = realloc(*deprecated, + newlen); +--- a/opendkim/flowrate.c ++++ b/opendkim/flowrate.c +@@ -16,16 +16,6 @@ + #include + #include + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* opendkim includes */ + #include "flowrate.h" + #include "opendkim.h" +--- a/opendkim/opendkim-ar.c ++++ b/opendkim/opendkim-ar.c +@@ -21,16 +21,6 @@ + # include + #endif /* ARTEST */ + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* opendkim includes */ + #include "opendkim-ar.h" + +@@ -377,7 +367,7 @@ ares_dedup(struct authres *ar, int n) + ** hdr -- NULL-terminated contents of an Authentication-Results: + ** header field + ** ar -- a pointer to a (struct authres) loaded by values after parsing +-** ++** + ** Return value: + ** 0 on success, -1 on failure. + */ +--- a/opendkim/opendkim-db.c ++++ b/opendkim/opendkim-db.c +@@ -36,16 +36,6 @@ + /* libopendkim includes */ + #include + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* repute includes */ + #ifdef _FFR_REPUTATION + # include +@@ -854,7 +844,7 @@ dkimf_db_datasplit(char *buf, size_t buf + ** + ** Notes: + ** Expands "$d" and "$D" as defined in opendkim.conf(5). +-** ++** + ** Should report overflows. + */ + +@@ -1002,7 +992,7 @@ dkimf_db_list_free(struct dkimf_db_list + list = next; + } + } +- ++ + /* + ** DKIMF_DB_RELIST_FREE -- destroy a linked regex list + ** +@@ -1312,7 +1302,7 @@ dkimf_db_open_sql(struct dkimf_db_dsn *d + ** + ** Parameters: + ** db -- DKIMF_DB handle +-** ++** + ** Return value: + ** A DKIMF_DB_TYPE_* constant. + */ +@@ -2174,7 +2164,7 @@ dkimf_db_open(DKIMF_DB *db, char *name, + } + + assert(key != NULL); +- ++ + if (value != NULL && + (new->db_flags & DKIMF_DB_FLAG_VALLIST) != 0) + { +@@ -2230,7 +2220,7 @@ dkimf_db_open(DKIMF_DB *db, char *name, + list = newl; + else + next->db_list_next = newl; +- ++ + next = newl; + n++; + } +@@ -2536,7 +2526,7 @@ dkimf_db_open(DKIMF_DB *db, char *name, + /* + ** General format of a DSN: + ** ://[user[:pwd]@][port+]host/dbase[/key=val[?...]] +- ** ++ ** + ** "table", "keycol" and "datacol" will be set in one of the + ** key-value pairs. "filter" is optional. + */ +@@ -2763,7 +2753,7 @@ dkimf_db_open(DKIMF_DB *db, char *name, + free(new); + return -1; + } +- ++ + new->db_iflags |= DKIMF_DB_IFLAG_RECONNECT; + odbx = NULL; + } +@@ -2858,10 +2848,10 @@ dkimf_db_open(DKIMF_DB *db, char *name, + ** General format of an LDAP specification: + ** scheme://host[:port][/dn[?attrs[?scope[?filter[?exts]]]]] + ** (see RFC4516) +- ** ++ ** + ** "bindpass", "authmech" and "usetls" will be set in + ** other config values. +- ** ++ ** + ** Take the descriptive values (e.g. attributes) from the + ** first one. + */ +@@ -3063,7 +3053,7 @@ dkimf_db_open(DKIMF_DB *db, char *name, + close(fd); + + /* try to compile it */ +- if (dkimf_lua_db_hook(tmp, 0, NULL, &lres, ++ if (dkimf_lua_db_hook(tmp, 0, NULL, &lres, + (void *) &lua->lua_script, + &lua->lua_scriptlen) != 0) + { +@@ -3707,12 +3697,12 @@ dkimf_db_delete(DKIMF_DB db, void *buf, + assert(buf != NULL); + + if (db->db_type == DKIMF_DB_TYPE_FILE || +- db->db_type == DKIMF_DB_TYPE_CSL || +- db->db_type == DKIMF_DB_TYPE_DSN || +- db->db_type == DKIMF_DB_TYPE_LDAP || +- db->db_type == DKIMF_DB_TYPE_LUA || +- db->db_type == DKIMF_DB_TYPE_MEMCACHE || +- db->db_type == DKIMF_DB_TYPE_REPUTE || ++ db->db_type == DKIMF_DB_TYPE_CSL || ++ db->db_type == DKIMF_DB_TYPE_DSN || ++ db->db_type == DKIMF_DB_TYPE_LDAP || ++ db->db_type == DKIMF_DB_TYPE_LUA || ++ db->db_type == DKIMF_DB_TYPE_MEMCACHE || ++ db->db_type == DKIMF_DB_TYPE_REPUTE || + db->db_type == DKIMF_DB_TYPE_REFILE || + db->db_type == DKIMF_DB_TYPE_ERLANG) + return EINVAL; +@@ -3865,11 +3855,11 @@ dkimf_db_put(DKIMF_DB db, void *buf, siz + assert(outbuf != NULL); + + if (db->db_type == DKIMF_DB_TYPE_FILE || +- db->db_type == DKIMF_DB_TYPE_CSL || +- db->db_type == DKIMF_DB_TYPE_DSN || +- db->db_type == DKIMF_DB_TYPE_LDAP || +- db->db_type == DKIMF_DB_TYPE_LUA || +- db->db_type == DKIMF_DB_TYPE_REPUTE || ++ db->db_type == DKIMF_DB_TYPE_CSL || ++ db->db_type == DKIMF_DB_TYPE_DSN || ++ db->db_type == DKIMF_DB_TYPE_LDAP || ++ db->db_type == DKIMF_DB_TYPE_LUA || ++ db->db_type == DKIMF_DB_TYPE_REPUTE || + db->db_type == DKIMF_DB_TYPE_REFILE) + return EINVAL; + +@@ -5114,7 +5104,7 @@ dkimf_db_get(DKIMF_DB db, void *buf, siz + key = (char *) db->db_data; + + snprintf(query, sizeof query, "%s:%s", key, (char *) buf); +- ++ + out = memcached_get(mcs, query, strlen(query), &vlen, + &flags, &ret); + +@@ -5600,7 +5590,7 @@ dkimf_db_close(DKIMF_DB db) + + first = FALSE; + } +- ++ + (void) dkimf_db_close(ldap->ldap_cache); + } + # endif /* USE_DB */ +@@ -5983,7 +5973,7 @@ dkimf_db_walk(DKIMF_DB db, _Bool first, + (void) odbx_result_finish(result); + result = NULL; + } +- ++ + /* run a query and start results cursor if needed */ + if (result == NULL) + { +@@ -6234,7 +6224,7 @@ dkimf_db_walk(DKIMF_DB db, _Bool first, + if (ldap->ldap_descr->lud_attrs[c] == NULL) + noattrs = TRUE; + +- if (noattrs) ++ if (noattrs) + { + if ((req[c].dbdata_flags & DKIMF_DB_DATA_OPTIONAL) == 0) + status = -1; +@@ -6439,7 +6429,7 @@ dkimf_db_walk(DKIMF_DB db, _Bool first, + ** db -- a DKIMF_DB handle + ** a -- array (returned) + ** base -- base array +-** ++** + ** Return value: + ** Length of the created array, or -1 on error/empty. + */ +--- a/opendkim/opendkim-spam.c ++++ b/opendkim/opendkim-spam.c +@@ -25,16 +25,6 @@ + # include + #endif /* USE_ODBX */ + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* opendkim includes */ + #include "config.h" + #include "stats.h" +--- a/opendkim/opendkim-testkey.c ++++ b/opendkim/opendkim-testkey.c +@@ -36,16 +36,6 @@ + #include + #include + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* opendkim includes */ + #include "opendkim-db.h" + #include "opendkim-dns.h" +--- a/opendkim/opendkim.c ++++ b/opendkim/opendkim.c +@@ -92,16 +92,6 @@ + # include "vbr.h" + #endif /* _FFR_VBR */ + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + #ifdef _FFR_REPUTATION + /* reputation includes */ + # include +@@ -803,7 +793,7 @@ pthread_mutex_t pwdb_lock; /* passwd/g + ** An sfsistat. + */ + +-sfsistat ++sfsistat + smfi_insheader(SMFICTX *ctx, int idx, char *hname, char *hvalue) + { + assert(ctx != NULL); +@@ -1413,7 +1403,7 @@ dkimf_xs_rblcheck(lua_State *l) + ctx = (SMFICTX *) lua_touserdata(l, 1); + if (ctx != NULL) + cc = (struct connctx *) dkimf_getpriv(ctx); +- ++ + query = lua_tostring(l, 2); + qroot = lua_tostring(l, 3); + if (lua_gettop(l) == 4) +@@ -2715,7 +2705,7 @@ dkimf_xs_rcptcount(lua_State *l) + dfc = cc->cctx_msg; + + rcnt = 0; +- ++ + for (addr = dfc->mctx_rcptlist; addr != NULL; addr = addr->a_next) + rcnt++; + +@@ -2767,7 +2757,7 @@ dkimf_xs_rcpt(lua_State *l) + lua_pushstring(l, "dkimf_xs_rcpt"); + return 1; + } +- ++ + cc = (struct connctx *) dkimf_getpriv(ctx); + dfc = cc->cctx_msg; + +@@ -3090,7 +3080,7 @@ dkimf_xs_getsigarray(lua_State *l) + { + lua_pushnil(l); + } +- ++ + return 1; + } + +@@ -3156,7 +3146,7 @@ dkimf_xs_getsigcount(lua_State *l) + { + lua_pushnumber(l, 1); + } +- ++ + return 1; + } + +@@ -4762,7 +4752,7 @@ dkimf_securefile(const char *path, ino_t + return status; + + if (partial[1] != '\0') +- strlcat(partial, "/", sizeof partial); ++ strlcat(partial, "/", sizeof partial); + } + + return 1; +@@ -4818,7 +4808,7 @@ dkimf_securefile(const char *path, ino_t + + pthread_mutex_unlock(&pwdb_lock); + } +- ++ + /* guess we're okay... */ + *ino = s.st_ino; + return 1; +@@ -6208,7 +6198,7 @@ dkimf_config_load(struct config *data, s + { + if (strcmp(str, "HOSTNAME") == 0) + conf->conf_authservid = strdup(myhostname); +- else ++ else + conf->conf_authservid = strdup(str); + } + +@@ -6317,7 +6307,7 @@ dkimf_config_load(struct config *data, s + + #ifdef _FFR_IDENTITY_HEADER + (void) config_get(data, "IdentityHeader", +- &conf->conf_identityhdr, ++ &conf->conf_identityhdr, + sizeof conf->conf_identityhdr); + + (void) config_get(data, "IdentityHeaderRemove", +@@ -6991,7 +6981,7 @@ dkimf_config_load(struct config *data, s + char *dberr = NULL; + + status = dkimf_db_open(&conf->conf_peerdb, str, +- (dbflags | ++ (dbflags | + DKIMF_DB_FLAG_ICASE | + DKIMF_DB_FLAG_READONLY), + NULL, &dberr); +@@ -7010,7 +7000,7 @@ dkimf_config_load(struct config *data, s + + status = dkimf_db_open(&conf->conf_testdnsdb, + conf->conf_testdnsdata, +- (dbflags | ++ (dbflags | + DKIMF_DB_FLAG_ICASE | + DKIMF_DB_FLAG_READONLY), + NULL, &dberr); +@@ -7038,7 +7028,7 @@ dkimf_config_load(struct config *data, s + char *dberr = NULL; + + status = dkimf_db_open(&conf->conf_internal, str, +- (dbflags | ++ (dbflags | + DKIMF_DB_FLAG_ICASE | + DKIMF_DB_FLAG_READONLY), + NULL, &dberr); +@@ -7055,7 +7045,7 @@ dkimf_config_load(struct config *data, s + char *dberr = NULL; + + status = dkimf_db_open(&conf->conf_internal, DEFINTERNAL, +- (dbflags | ++ (dbflags | + DKIMF_DB_FLAG_ICASE | + DKIMF_DB_FLAG_READONLY), + NULL, &dberr); +@@ -7084,7 +7074,7 @@ dkimf_config_load(struct config *data, s + char *dberr = NULL; + + status = dkimf_db_open(&conf->conf_exignore, str, +- (dbflags | ++ (dbflags | + DKIMF_DB_FLAG_ICASE | + DKIMF_DB_FLAG_READONLY), + NULL, &dberr); +@@ -7112,7 +7102,7 @@ dkimf_config_load(struct config *data, s + char *dberr = NULL; + + status = dkimf_db_open(&conf->conf_exemptdb, str, +- (dbflags | ++ (dbflags | + DKIMF_DB_FLAG_ICASE | + DKIMF_DB_FLAG_READONLY), + NULL, &dberr); +@@ -7134,7 +7124,7 @@ dkimf_config_load(struct config *data, s + char *dberr = NULL; + + status = dkimf_db_open(&conf->conf_bldb, str, +- (dbflags | ++ (dbflags | + DKIMF_DB_FLAG_ICASE | + DKIMF_DB_FLAG_READONLY), + NULL, &dberr); +@@ -7155,7 +7145,7 @@ dkimf_config_load(struct config *data, s + char *dberr = NULL; + + status = dkimf_db_open(&conf->conf_signhdrsdb, str, +- (dbflags | ++ (dbflags | + DKIMF_DB_FLAG_ICASE | + DKIMF_DB_FLAG_READONLY), + NULL, &dberr); +@@ -7176,7 +7166,7 @@ dkimf_config_load(struct config *data, s + char *dberr = NULL; + + status = dkimf_db_open(&conf->conf_remardb, str, +- (dbflags | ++ (dbflags | + DKIMF_DB_FLAG_ICASE | + DKIMF_DB_FLAG_READONLY), + NULL, &dberr); +@@ -7211,7 +7201,7 @@ dkimf_config_load(struct config *data, s + char *dberr = NULL; + + status = dkimf_db_open(&conf->conf_atpsdb, str, +- (dbflags | ++ (dbflags | + DKIMF_DB_FLAG_ICASE | + DKIMF_DB_FLAG_READONLY), + NULL, &dberr); +@@ -7233,7 +7223,7 @@ dkimf_config_load(struct config *data, s + char *dberr = NULL; + + status = dkimf_db_open(&conf->conf_dontsigntodb, str, +- (dbflags | ++ (dbflags | + DKIMF_DB_FLAG_ICASE | + DKIMF_DB_FLAG_READONLY), + NULL, &dberr); +@@ -8179,7 +8169,7 @@ dkimf_config_load(struct config *data, s + + saveerrno = errno; + +- syslog(LOG_ERR, "malloc(): %s", ++ syslog(LOG_ERR, "malloc(): %s", + strerror(errno)); + + errno = saveerrno; +@@ -8299,7 +8289,7 @@ dkimf_config_load(struct config *data, s + char signer[BUFRSZ + 1]; + + dbd[0].dbdata_flags = 0; +- ++ + memset(keyname, '\0', sizeof keyname); + + dbd[0].dbdata_buffer = keyname; +@@ -8324,7 +8314,7 @@ dkimf_config_load(struct config *data, s + dbd[2].dbdata_buflen = sizeof keydata - 1; + dbd[2].dbdata_flags = DKIMF_DB_DATA_BINARY; + +- if (dkimf_db_get(conf->conf_keytabledb, ++ if (dkimf_db_get(conf->conf_keytabledb, + keyname, strlen(keyname), + dbd, 3, &found) != 0 || + !found || +@@ -8437,7 +8427,7 @@ dkimf_dns_init(DKIM_LIB *lib, struct dki + { + if (err != NULL) + *err = "failed to add resolver configuration file"; +- ++ + return FALSE; + } + } +@@ -9247,7 +9237,7 @@ dkimf_cleanup(SMFICTX *ctx) + while (cur != NULL) + { + next = cur->se_next; +- ++ + free(cur); + + cur = next; +@@ -10261,7 +10251,7 @@ dkimf_sigreport(connctx cc, struct dkimf + syslog(LOG_ERR, "%s: fdopen(): %s", + dfc->mctx_jobid, strerror(errno)); + } +- ++ + close(fd); + return; + } +@@ -10276,7 +10266,7 @@ dkimf_sigreport(connctx cc, struct dkimf + syslog(LOG_ERR, "%s: popen(): %s", + dfc->mctx_jobid, strerror(errno)); + } +- ++ + return; + } + } +@@ -11362,7 +11352,7 @@ mlfi_header(SMFICTX *ctx, char *headerf, + ** feed to the canonicalization algorithms the headers + ** exactly as the MTA will modify them, so verification + ** should still work. +- ** ++ ** + ** This is based on experimentation and on reading + ** sendmail/headers.c, and may require more tweaking before + ** it's precisely right. There are other munges the +@@ -11433,7 +11423,7 @@ mlfi_header(SMFICTX *ctx, char *headerf, + + return SMFIS_TEMPFAIL; + } +- ++ + for (rep = conf->conf_replist; + rep != NULL; + rep = rep->repl_next) +@@ -11629,7 +11619,7 @@ mlfi_eoh(SMFICTX *ctx) + if (from == NULL && !didfrom) + from = dkimf_findheader(dfc, "from", 0); + } +- ++ + if (from != NULL) + dkimf_dstring_copy(addr, from->hdr_val); + +@@ -12140,7 +12130,7 @@ mlfi_eoh(SMFICTX *ctx) + + /* still no key selected; check the signing table (if any) */ + if (originok && dfc->mctx_srhead == NULL && +- (user != NULL && dfc->mctx_domain[0] != '\0') && ++ (user != NULL && dfc->mctx_domain[0] != '\0') && + #ifdef _FFR_LUA_ONLY_SIGNING + !conf->conf_luasigning && + #endif /* _FFR_LUA_ONLY_SIGNING */ +@@ -12299,7 +12289,7 @@ mlfi_eoh(SMFICTX *ctx) + */ + + /* signing requests with signing mode disabled */ +- if (dfc->mctx_srhead != NULL && ++ if (dfc->mctx_srhead != NULL && + (conf->conf_mode & DKIMF_MODE_SIGNER) == 0) + return SMFIS_ACCEPT; + +@@ -12619,7 +12609,7 @@ mlfi_eoh(SMFICTX *ctx) + idset = TRUE; + } + } +- ++ + if (!idset && conf->conf_dolog) + { + syslog(LOG_INFO, +@@ -12629,7 +12619,7 @@ mlfi_eoh(SMFICTX *ctx) + } + } + #endif /* _FFR_IDENTITY_HEADER */ +- ++ + if (!idset) + { + snprintf((char *) identity, sizeof identity, "@%s", +@@ -12803,7 +12793,7 @@ mlfi_eoh(SMFICTX *ctx) + + /* set the VBR transaction type */ + (void) vbr_settype(dfc->mctx_vbr, (u_char *) vbr_type); +- ++ + /* set the VBR certifier list */ + (void) vbr_setcert(dfc->mctx_vbr, (u_char *) vbr_cert); + +@@ -12915,7 +12905,7 @@ mlfi_eoh(SMFICTX *ctx) + + #ifdef _FFR_IDENTITY_HEADER + if (conf->conf_identityhdr != NULL && +- conf->conf_rmidentityhdr && ++ conf->conf_rmidentityhdr && + dfc->mctx_srhead != NULL && + strcasecmp(conf->conf_identityhdr, hdr->hdr_hdr) == 0) + continue; +@@ -12942,7 +12932,7 @@ mlfi_eoh(SMFICTX *ctx) + #ifdef _FFR_REPUTATION + /* check for spam flag */ + if (conf->conf_repspamcheck != NULL && +- regexec(&conf->conf_repspamre, ++ regexec(&conf->conf_repspamre, + dkimf_dstring_get(dfc->mctx_tmpstr), + 0, NULL, 0) == 0) + dfc->mctx_spam = TRUE; +@@ -13340,7 +13330,7 @@ mlfi_eom(SMFICTX *ctx) + dfc->mctx_srhead != NULL) + { + struct Header *hdr; +- ++ + hdr = dkimf_findheader(dfc, conf->conf_identityhdr, 0); + if (hdr != NULL) + { +@@ -13357,7 +13347,7 @@ mlfi_eom(SMFICTX *ctx) + } + } + #endif /* _FFR_IDENTITY_HEADER */ +- ++ + /* log something if the message was multiply signed */ + if (dfc->mctx_dkimv != NULL && conf->conf_dolog) + { +@@ -13482,7 +13472,7 @@ mlfi_eom(SMFICTX *ctx) + slash = strchr((char *) ares->ares_host, '/'); + if (slash != NULL) + *slash = '\0'; +- ++ + if (conf->conf_remardb != NULL) + { + status = dkimf_db_get(conf->conf_remardb, +@@ -13790,7 +13780,7 @@ mlfi_eom(SMFICTX *ctx) + fclose(f); + } + } +- } ++ } + + if (dfc->mctx_status == DKIMF_STATUS_GOOD) + { +@@ -14576,7 +14566,7 @@ mlfi_eom(SMFICTX *ctx) + vbr_certifier = NULL; + vbr_vouchers = NULL; + vbr_type = NULL; +- ++ + /* break out the VBR-Info header contents */ + strlcpy(tmp, vbr_header->hdr_val, sizeof tmp); + for (p = strtok_r(tmp, ";", &sctx); +@@ -14624,7 +14614,7 @@ mlfi_eom(SMFICTX *ctx) + vbr_vouchers = (char *) value; + } + } +- ++ + /* confirm a valid signature was there */ + if (dfc->mctx_dkimv != NULL && + dkim_getsiglist(dfc->mctx_dkimv, +@@ -14646,7 +14636,7 @@ mlfi_eom(SMFICTX *ctx) + } + } + } +- ++ + if (vbr_validsig) + { + /* use accessors to set parsed values */ +@@ -14656,7 +14646,7 @@ mlfi_eom(SMFICTX *ctx) + (u_char *) vbr_type); + vbr_setdomain(dfc->mctx_vbr, + (u_char *) vbr_domain); +- ++ + /* attempt the query */ + vbr_status = vbr_query(dfc->mctx_vbr, + (u_char **) &vbr_result, +@@ -14739,7 +14729,7 @@ mlfi_eom(SMFICTX *ctx) + vbr_certifier, + sizeof header); + } +- ++ + if (dkimf_insheader(ctx, 1, + AUTHRESULTSHDR, + (char *) header) == MI_FAILURE) +@@ -15827,7 +15817,7 @@ main(int argc, char **argv) + progname, query); + return EX_USAGE; + } +- ++ + result = (char **) malloc(sizeof(char *) * n); + if (result == NULL) + { +--- a/opendkim/reputation.c ++++ b/opendkim/reputation.c +@@ -21,16 +21,6 @@ + /* libopendkim includes */ + #include + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* opendkim includes */ + #include "reputation.h" + #include "opendkim.h" +@@ -223,7 +213,7 @@ dkimf_rep_check(DKIMF_REP rep, DKIM_SIGI + if (rep->rep_lastflush + rep->rep_ttl < now) + { + f = TRUE; +- ++ + req[0].dbdata_buffer = (void *) &when; + req[0].dbdata_buflen = sizeof when; + req[0].dbdata_flags = DKIMF_DB_DATA_BINARY; +@@ -341,7 +331,7 @@ dkimf_rep_check(DKIMF_REP rep, DKIM_SIGI + strlcpy(domain, DKIMF_REP_LOWTIME, sizeof domain); + dlen = strlen(domain); + } +- ++ + f = FALSE; + + /* get the total message limit */ +--- a/opendkim/stats.c ++++ b/opendkim/stats.c +@@ -40,16 +40,6 @@ + /* libopendkim includes */ + #include + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* opendkim includes */ + #include "stats.h" + #include "util.h" +--- a/opendkim/test.c ++++ b/opendkim/test.c +@@ -21,16 +21,6 @@ + #include "build-config.h" + #include + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* libmilter includes */ + #include + +@@ -712,7 +702,7 @@ dkimf_testfile(DKIM_LIB *libopendkim, st + #ifdef USE_UNBOUND + char *dnssec; + int dnsseccode = DKIM_DNSSEC_UNKNOWN; +- ++ + dnsseccode = dkim_sig_getdnssec(sig); + + switch (dnsseccode) +--- a/opendkim/util.c ++++ b/opendkim/util.c +@@ -46,16 +46,6 @@ + # endif /* SOLARIS <= 20600 */ + #endif /* SOLARIS */ + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* opendkim includes */ + #include "opendkim.h" + #include "util.h" +@@ -217,7 +207,7 @@ static unsigned char alphabet[64] = "ABC + + /* + ** DKIMF_ISBLANK -- return TRUE iff a string contains only whitespace +-** ++** + ** Parameters: + ** str -- string to check + ** +--- a/reprrd/reprrd.c ++++ b/reprrd/reprrd.c +@@ -22,11 +22,6 @@ + /* libreprrd includes */ + #include "reprrd.h" + +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* data types */ + struct reprrd_handle + { +@@ -250,7 +245,7 @@ reprrd_query(REPRRD r, const char *domai + end = now; + start = last_update - 1; + step = REPRRD_STEP; +- ++ + reprrd_mkpath(path, sizeof path, r, domain, + REPRRD_TYPE_MESSAGES); + +@@ -287,7 +282,7 @@ reprrd_query(REPRRD r, const char *domai + end = now; + start = last_update - 1; + step = REPRRD_STEP; +- ++ + rrd_clear_error(); + status = rrd_fetch_r(path, REPRRD_CF_AVERAGE, &start, &end, + &step, &ds_cnt, &ds_names, &data); +@@ -324,7 +319,7 @@ reprrd_query(REPRRD r, const char *domai + end = now; + start = last_update - 1; + step = REPRRD_STEP; +- ++ + reprrd_mkpath(path, sizeof path, r, domain, REPRRD_TYPE_SPAM); + + rrd_clear_error(); +@@ -407,7 +402,7 @@ reprrd_query(REPRRD r, const char *domai + end = now; + start = now - REPRRD_STEP * REPRRD_BACKSTEPS; + step = REPRRD_STEP; +- ++ + rrd_clear_error(); + status = rrd_fetch_r(path, REPRRD_CF_FAILURES, &start, &end, + &step, &ds_cnt, &ds_names, &data); +--- a/stats/Makefile.am ++++ b/stats/Makefile.am +@@ -14,9 +14,9 @@ if USE_ODBX + sbin_PROGRAMS = opendkim-importstats + + opendkim_importstats_SOURCES = opendkim-importstats.c +-opendkim_importstats_CPPFLAGS = $(LIBODBX_CPPFLAGS) -I$(srcdir)/../libopendkim -I$(srcdir)/../opendkim ++opendkim_importstats_CPPFLAGS = $(LIBODBX_CPPFLAGS) -I$(srcdir)/../libopendkim -I$(srcdir)/../opendkim $(LIBBSD_CFLAGS) + opendkim_importstats_CFLAGS = $(LIBODBX_CFLAGS) $(COV_CFLAGS) +-opendkim_importstats_LDFLAGS = $(LIBODBX_LDFLAGS) $(COV_LDFLAGS) ++opendkim_importstats_LDFLAGS = $(LIBODBX_LDFLAGS) $(COV_LDFLAGS) $(LIBBSD_LIBS) + opendkim_importstats_LDADD = $(LIBODBX_LIBS) $(LIBDL_LIBS) $(COV_LIBADD) + + man_MANS += opendkim-importstats.8 +--- a/stats/opendkim-importstats.c ++++ b/stats/opendkim-importstats.c +@@ -23,16 +23,6 @@ + /* OpenDKIM includes */ + #include "stats.h" + +-/* libbsd if found */ +-#ifdef USE_BSD_H +-# include +-#endif /* USE_BSD_H */ +- +-/* libstrl if needed */ +-#ifdef USE_STRL_H +-# include +-#endif /* USE_STRL_H */ +- + /* libodbx includes */ + #ifdef USE_ODBX + # include diff --git a/mail/opendkim/patches/020-uclibc.patch b/mail/opendkim/patches/020-uclibc.patch deleted file mode 100644 index 34da7f4b..00000000 --- a/mail/opendkim/patches/020-uclibc.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/libopendkim/dkim-dns.c -+++ b/libopendkim/dkim-dns.c -@@ -163,6 +163,9 @@ int - dkim_res_query(void *srv, int type, unsigned char *query, unsigned char *buf, - size_t buflen, void **qh) - { -+#ifdef __UCLIBC__ -+ return DKIM_DNS_ERROR; -+#else - int n; - int ret; - struct dkim_res_qh *rq; -@@ -209,6 +212,7 @@ dkim_res_query(void *srv, int type, unsi - *qh = (void *) rq; - - return DKIM_DNS_SUCCESS; -+#endif // __UCLIBC__ - } - - /* From 88f86f00b38ea6495585b5405bd240972f432fd4 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 27 Nov 2022 15:38:44 -0800 Subject: [PATCH 026/102] gphoto2: fix compilation with BUILD_NLS Signed-off-by: Rosen Penev --- .../gphoto2/patches/001-automake-compat.patch | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 multimedia/gphoto2/patches/001-automake-compat.patch diff --git a/multimedia/gphoto2/patches/001-automake-compat.patch b/multimedia/gphoto2/patches/001-automake-compat.patch new file mode 100644 index 00000000..ea9f5dd2 --- /dev/null +++ b/multimedia/gphoto2/patches/001-automake-compat.patch @@ -0,0 +1,66 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,4 +1,4 @@ +-SUBDIRS = gphoto-m4 contrib doc gphoto2 packaging po tests ++SUBDIRS = gphoto-m4 contrib doc gphoto2 packaging tests + + ACLOCAL_AMFLAGS = -I auto-m4 -I gphoto-m4 + EXTRA_DIST = README.md +--- a/configure.ac ++++ b/configure.ac +@@ -46,11 +46,8 @@ dnl i18n support + dnl --------------------------------------------------------------------------- + GP_GETTEXT_HACK([],[Lutz Müller and others],[${MAIL_GPHOTO_TRANSLATION}]) + ALL_LINGUAS="az cs da de en_GB es eu fi fr hu id is it ja nl pa pl pt_BR ro ru rw sk sr sv uk vi zh_CN zh_TW" +-AM_PO_SUBDIRS() + AM_GNU_GETTEXT_VERSION([0.14.1]) +-AM_GNU_GETTEXT([external]) + AM_ICONV() +-GP_GETTEXT_FLAGS() + + dnl We cannot use AC_DEFINE_UNQUOTED() for these definitions, as + dnl we require make to do insert the proper $(datadir) value +@@ -80,7 +77,7 @@ AC_CHECK_LIB(m,floor) + + + dnl --------------------------------------------------------------------------- +-dnl pthread: The gphoto2 shell (--shell) keeps up a connection to the ++dnl pthread: The gphoto2 shell (--shell) keeps up a connection to the + dnl camera. Some cameras need to be sent keep-alive-messages + dnl in order to prevent a shut-down. This is what we need + dnl pthread for. +@@ -97,7 +94,7 @@ if $try_pthread; then + AC_DEFINE(HAVE_PTHREAD,1,[Define if we use pthread.h.]) + pthread_msg="yes (-lpthread)" + PTHREAD_LIBS="-lpthread"],[ +- AC_CHECK_LIB(c_r, pthread_create, [ ++ AC_CHECK_LIB(c_r, pthread_create, [ + AC_DEFINE(HAVE_PTHREAD,1,[Define if we use pthread.h.]) + pthread_msg="yes (-pthread)" + PTHREAD_LIBS="-pthread" +@@ -267,7 +264,7 @@ GP_CONFIG_MSG([JPEG support],[$jpeg_msg] + dnl --------------------------------------------------------------------------- + dnl libexif: The CameraFilesystem can use libexif for extracting thumbnails + dnl out of EXIF data. Similarly, it can extract the mtime of +-dnl a file. ++dnl a file. + dnl libexif is available from + dnl http://www.sourceforge.net/projects/libexif + dnl --------------------------------------------------------------------------- +@@ -327,7 +324,7 @@ AC_MSG_ERROR([pkg-config could not find + + dnl --------------------------------------------------------------------------- + dnl readline: Readline is pretty cool - it allows you to use to complete +-dnl commands in the gphoto2 shell or to use or to ++dnl commands in the gphoto2 shell or to use or to + dnl navigate through the history. + dnl --------------------------------------------------------------------------- + rl_msg="no (http://cnswww.cns.cwru.edu/~chet/readline/rltop.html)" +@@ -396,7 +393,6 @@ AC_SUBST([AM_LDFLAGS]) + # Create output files + # --------------------------------------------------------------------------- + AC_CONFIG_FILES([ +-po/Makefile.in + Makefile + gphoto2/Makefile + gphoto-m4/Makefile From dfc27d0e9cf61c707d0ef3797b864782a2c29eb1 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Thu, 7 Oct 2021 16:50:04 -0300 Subject: [PATCH 027/102] atlas-probe: Fix compilation with gcc11 This uses some definitions from in gcc 8.4.0, not present in musl or gcc11. Also use clock_gettime() instead of syscall(__NR_clock_gettime,...), which is not currently defined. Signed-off-by: Eneas U de Queiroz --- ...02-Avoid-problems-with-64-bit-time_t.patch | 74 +++++++++++++++++ .../003-Fix-compilation-with-gcc11.patch | 82 +++++++++++++++++++ .../004-Comment-out-librt-testing.patch | 32 ++++++++ 3 files changed, 188 insertions(+) create mode 100644 net/atlas-probe/patches/002-Avoid-problems-with-64-bit-time_t.patch create mode 100644 net/atlas-probe/patches/003-Fix-compilation-with-gcc11.patch create mode 100644 net/atlas-probe/patches/004-Comment-out-librt-testing.patch diff --git a/net/atlas-probe/patches/002-Avoid-problems-with-64-bit-time_t.patch b/net/atlas-probe/patches/002-Avoid-problems-with-64-bit-time_t.patch new file mode 100644 index 00000000..a6f84958 --- /dev/null +++ b/net/atlas-probe/patches/002-Avoid-problems-with-64-bit-time_t.patch @@ -0,0 +1,74 @@ +From b83524b19ca6e5e58dded77fad37f17a177766ff Mon Sep 17 00:00:00 2001 +From: Eneas U de Queiroz +Date: Fri, 8 Oct 2021 14:39:52 -0300 +Subject: [PATCH 1/2] Avoid problems with 64-bit time_t + +The clock_gettime() calls are being handled by calling +syscall(__NR_clock_gettime, ...), which is not portable between systems +using 32-bit and 64-bit time_t. This is being done to avoid having to +link agains librt. + +So, use the standard function, and add a test to see if we can compile +a test without the library, including it otherwise. + +Signed-off-by: Eneas U de Queiroz + +--- a/Makefile.flags ++++ b/Makefile.flags +@@ -124,6 +124,12 @@ CFLAGS += --sysroot=$(CONFIG_SYSROOT) + export SYSROOT=$(CONFIG_SYSROOT) + endif + ++# glibc versions before 2.17 need to link with -rt to use clock_gettime ++RT_NEEDED := $(shell echo -e '#include \nint main(void){struct timespec tp; return clock_gettime(CLOCK_MONOTONIC, &tp);}' >rttest.c; $(CC) $(CFLAGS) -o /dev/null rttest.c >/dev/null 2>&1 || echo "y"; rm rttest.c) ++ifeq ($(RT_NEEDED),y) ++LDLIBS += rt ++endif ++ + # Android has no separate crypt library + # gcc-4.2.1 fails if we try to feed C source on stdin: + # echo 'int main(void){return 0;}' | $(CC) $(CFLAGS) -lcrypt -o /dev/null -xc - +--- a/coreutils/date.c ++++ b/coreutils/date.c +@@ -37,7 +37,7 @@ + //config:config FEATURE_DATE_NANO + //config: bool "Support %[num]N nanosecond format specifier" + //config: default n +-//config: depends on DATE # syscall(__NR_clock_gettime) ++//config: depends on DATE # clock_gettime() + //config: select PLATFORM_LINUX + //config: help + //config: Support %[num]N format specifier. Adds ~250 bytes of code. +@@ -265,9 +265,7 @@ int date_main(int argc UNUSED_PARAM, cha + #endif + } else { + #if ENABLE_FEATURE_DATE_NANO +- /* libc has incredibly messy way of doing this, +- * typically requiring -lrt. We just skip all this mess */ +- syscall(__NR_clock_gettime, CLOCK_REALTIME, &ts); ++ clock_gettime(CLOCK_REALTIME, &ts); + #else + time(&ts.tv_sec); + #endif +--- a/libbb/time.c ++++ b/libbb/time.c +@@ -243,7 +243,7 @@ char* FAST_FUNC strftime_YYYYMMDDHHMMSS( + * typically requiring -lrt. We just skip all this mess */ + static void get_mono(struct timespec *ts) + { +- if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, ts)) ++ if (clock_gettime(CLOCK_MONOTONIC, ts)) + bb_error_msg_and_die("clock_gettime(MONOTONIC) failed"); + } + unsigned long long FAST_FUNC monotonic_ns(void) +--- a/runit/runsv.c ++++ b/runit/runsv.c +@@ -55,7 +55,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAG + * typically requiring -lrt. We just skip all this mess */ + static void gettimeofday_ns(struct timespec *ts) + { +- syscall(__NR_clock_gettime, CLOCK_REALTIME, ts); ++ clock_gettime(CLOCK_REALTIME, ts); + } + #else + static void gettimeofday_ns(struct timespec *ts) diff --git a/net/atlas-probe/patches/003-Fix-compilation-with-gcc11.patch b/net/atlas-probe/patches/003-Fix-compilation-with-gcc11.patch new file mode 100644 index 00000000..0ce3f4b2 --- /dev/null +++ b/net/atlas-probe/patches/003-Fix-compilation-with-gcc11.patch @@ -0,0 +1,82 @@ +From b6b3cdc16eaa50b40623f1589ea51dd43ebb456d Mon Sep 17 00:00:00 2001 +From: Eneas U de Queiroz +Date: Fri, 8 Oct 2021 14:47:08 -0300 +Subject: [PATCH 2/2] Fix compilation with gcc11 + +Currently, libbb.h counts on __THROW and __inline being defined. They +are internal macros used by glibc not meant to be publicly used. This +causes trouble, at least with a combination of gcc11 and musl, where +nether have them defined. + +Use definitions from in gcc 8.4.0 if they're missing. + +Signed-off-by: Eneas U de Queiroz + +--- a/include/libbb.h ++++ b/include/libbb.h +@@ -120,6 +120,65 @@ + #ifdef DMALLOC + # include + #endif ++ ++/* Compatibility with musl & gcc 11. Taken from in gcc 8.4.0 */ ++#ifndef __THROW ++#ifdef __GNUC__ ++ ++/* All functions, except those with callbacks or those that ++ synchronize memory, are leaf functions. */ ++# if __GNUC_PREREQ (4, 6) && !defined _LIBC ++# define __LEAF , __leaf__ ++# define __LEAF_ATTR __attribute__ ((__leaf__)) ++# else ++# define __LEAF ++# define __LEAF_ATTR ++# endif ++ ++/* GCC can always grok prototypes. For C++ programs we add throw() ++ to help it optimize the function calls. But this works only with ++ gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions ++ as non-throwing using a function attribute since programs can use ++ the -fexceptions options for C code as well. */ ++# if !defined __cplusplus && __GNUC_PREREQ (3, 3) ++# define __THROW __attribute__ ((__nothrow__ __LEAF)) ++# define __THROWNL __attribute__ ((__nothrow__)) ++# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct ++# else ++# if defined __cplusplus && __GNUC_PREREQ (2,8) ++# define __THROW throw () ++# define __THROWNL throw () ++# define __NTH(fct) __LEAF_ATTR fct throw () ++# else ++# define __THROW ++# define __THROWNL ++# define __NTH(fct) fct ++# endif ++# endif ++ ++#else /* Not GCC. */ ++ ++# define __inline /* No inline functions. */ ++ ++# define __THROW ++# define __THROWNL ++# define __NTH(fct) fct ++ ++#endif /* GCC. */ ++#endif /* __THROW */ ++ ++#ifndef __nonnull ++/* The nonull function attribute allows to mark pointer parameters which ++ must not be NULL. */ ++#if __GNUC_PREREQ (3,3) ++# define __nonnull(params) __attribute__ ((__nonnull__ params)) ++#else ++# define __nonnull(params) ++#endif ++#endif /* __nonnull */ ++ ++/* End of compatibility with musl & gcc 11. */ ++ + /* Just in case libc doesn't define some of these... */ + #ifndef _PATH_PASSWD + #define _PATH_PASSWD "/etc/passwd" diff --git a/net/atlas-probe/patches/004-Comment-out-librt-testing.patch b/net/atlas-probe/patches/004-Comment-out-librt-testing.patch new file mode 100644 index 00000000..34448d20 --- /dev/null +++ b/net/atlas-probe/patches/004-Comment-out-librt-testing.patch @@ -0,0 +1,32 @@ +From df50c29210f18f959186bb974c33cefff2bcc15e Mon Sep 17 00:00:00 2001 +From: Eneas U de Queiroz +Date: Fri, 8 Oct 2021 22:34:37 -0300 +Subject: [PATCH] Comment out librt testing + +The packages feed Ci is apparently failing to execute the test: + +Makefile.flags:128: *** unterminated call to function 'shell': + missing ')'. Stop. + +The call appears to be correct, but we already know that the library +will not be needed for openwrt, so let's just leave it out. + +Signed-off-by: Eneas U de Queiroz + +--- a/Makefile.flags ++++ b/Makefile.flags +@@ -125,10 +125,10 @@ export SYSROOT=$(CONFIG_SYSROOT) + endif + + # glibc versions before 2.17 need to link with -rt to use clock_gettime +-RT_NEEDED := $(shell echo -e '#include \nint main(void){struct timespec tp; return clock_gettime(CLOCK_MONOTONIC, &tp);}' >rttest.c; $(CC) $(CFLAGS) -o /dev/null rttest.c >/dev/null 2>&1 || echo "y"; rm rttest.c) +-ifeq ($(RT_NEEDED),y) +-LDLIBS += rt +-endif ++#RT_NEEDED := $(shell echo -e '#include \nint main(void){struct timespec tp; return clock_gettime(CLOCK_MONOTONIC, &tp);}' >rttest.c; $(CC) $(CFLAGS) -o /dev/null rttest.c >/dev/null 2>&1 || echo "y"; rm rttest.c) ++#ifeq ($(RT_NEEDED),y) ++#LDLIBS += rt ++#endif + + # Android has no separate crypt library + # gcc-4.2.1 fails if we try to feed C source on stdin: From 6212c5e866846914cb01059c5f4e87b5bda1b59a Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Fri, 8 Oct 2021 21:38:25 -0300 Subject: [PATCH 028/102] atlas-probe: allow parallel build Set PKG_BUILD_PARALLEL:=1 Signed-off-by: Eneas U de Queiroz --- net/atlas-probe/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/atlas-probe/Makefile b/net/atlas-probe/Makefile index 4833328e..ad66cfdb 100644 --- a/net/atlas-probe/Makefile +++ b/net/atlas-probe/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=atlas-probe PKG_VERSION:=2.2.1 -PKG_RELEASE:=1 +PKG_RELEASE:=3 PKG_SOURCE:=ripe-atlas-probe-busybox-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/RIPE-NCC/ripe-atlas-probe-busybox/archive/v$(PKG_VERSION) @@ -22,6 +22,7 @@ PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=LICENSE PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk From 4dfb32a5c787883efb23b353ed170a8beea8a911 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Tue, 4 Jan 2022 12:26:52 +0100 Subject: [PATCH 029/102] atlas-probe: update to version 2.4.1 Removed patches: 001-fix-stime-glibc-remove.patch - it is included in upstream 003-Fix-compilation-with-gcc11.patch - no longer necessary Updated patches: 002-Avoid-problems-with-64-bit-time_t.patch Refreshed patches: 004-Comment-out-librt-testing.patch Signed-off-by: Josef Schlehofer --- net/atlas-probe/Makefile | 6 +- .../patches/001-fix-stime-glibc-remove.patch | 178 ------------------ ...02-Avoid-problems-with-64-bit-time_t.patch | 22 +-- .../003-Fix-compilation-with-gcc11.patch | 82 -------- .../004-Comment-out-librt-testing.patch | 4 +- 5 files changed, 13 insertions(+), 279 deletions(-) delete mode 100644 net/atlas-probe/patches/001-fix-stime-glibc-remove.patch delete mode 100644 net/atlas-probe/patches/003-Fix-compilation-with-gcc11.patch diff --git a/net/atlas-probe/Makefile b/net/atlas-probe/Makefile index ad66cfdb..61b00c98 100644 --- a/net/atlas-probe/Makefile +++ b/net/atlas-probe/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=atlas-probe -PKG_VERSION:=2.2.1 -PKG_RELEASE:=3 +PKG_VERSION:=2.4.1 +PKG_RELEASE:=1 PKG_SOURCE:=ripe-atlas-probe-busybox-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/RIPE-NCC/ripe-atlas-probe-busybox/archive/v$(PKG_VERSION) -PKG_HASH:=c5a3aca026cd1a3b93a77b159b36cd7a1098eb6d90e9ae4a69872cd7a419a87b +PKG_HASH:=e684bf617cdc502c20f97028726a93a4a0d21ad9f618b50eb07f999f1604ae65 PKG_BUILD_DIR:=$(BUILD_DIR)/ripe-atlas-probe-busybox-$(PKG_VERSION) diff --git a/net/atlas-probe/patches/001-fix-stime-glibc-remove.patch b/net/atlas-probe/patches/001-fix-stime-glibc-remove.patch deleted file mode 100644 index 8c410197..00000000 --- a/net/atlas-probe/patches/001-fix-stime-glibc-remove.patch +++ /dev/null @@ -1,178 +0,0 @@ -From 402150eed057fc9fa52c8471ae645e23913a2805 Mon Sep 17 00:00:00 2001 -From: Philip Homburg -Date: Tue, 23 Jun 2020 12:25:08 -0400 -Subject: [PATCH] replace stime with clock_settime - ---- - coreutils/date.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - ---- a/coreutils/date.c -+++ b/coreutils/date.c -@@ -246,6 +246,9 @@ int date_main(int argc UNUSED_PARAM, cha - if (*argv) - bb_show_usage(); - -+ /* Clear ts.tv_nsec, in case we need to set the time later */ -+ ts.tv_nsec= 0; -+ - /* Now we have parsed all the information except the date format - * which depends on whether the clock is being set or read */ - -@@ -310,7 +313,7 @@ int date_main(int argc UNUSED_PARAM, cha - } - - /* if setting time, set it */ -- if ((opt & OPT_SET) && stime(&ts.tv_sec) < 0) { -+ if ((opt & OPT_SET) && clock_settime(CLOCK_REALTIME, &ts) < 0) { - bb_perror_msg("can't set date"); - } - } ---- a/util-linux/rdate.c -+++ b/util-linux/rdate.c -@@ -65,27 +65,27 @@ static time_t askremotedate(const char * - int rdate_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; - int rdate_main(int argc UNUSED_PARAM, char **argv) - { -- time_t remote_time; -+ struct timespec remote_time; - unsigned flags; - - opt_complementary = "-1"; - flags = getopt32(argv, "sp"); - -- remote_time = askremotedate(argv[optind]); -+ remote_time.tv_sec = askremotedate(argv[optind]); - - if (!(flags & 2)) { /* no -p (-s may be present) */ - time_t current_time; - - time(¤t_time); -- if (current_time == remote_time) -+ if (current_time == remote_time.tv_sec) - bb_error_msg("current time matches remote time"); - else -- if (stime(&remote_time) < 0) -+ if (clock_settime(CLOCK_REALTIME,&remote_time) < 0) - bb_perror_msg_and_die("can't set time of day"); - } - - if (flags != 1) /* not lone -s */ -- printf("%s", ctime(&remote_time)); -+ printf("%s", ctime(&remote_time.tv_sec)); - - return EXIT_SUCCESS; - } ---- a/networking/httpget.c -+++ b/networking/httpget.c -@@ -947,8 +947,9 @@ static int eat_headers(FILE *tcp_file, i - if (time_tolerance && strncmp(line, "Date: ", 6) == 0) - { - /* Try to set time from server */ -- time_t now, tim, tolerance; -+ time_t now, tolerance; - struct tm tm; -+ struct timespec tim; - - tolerance= strtoul(time_tolerance, &cp, 10); - if (cp[0] != '\0') -@@ -966,16 +967,16 @@ static int eat_headers(FILE *tcp_file, i - line+6); - } - } -- tim= timegm(&tm); -+ tim.tv_sec= timegm(&tm); - now= time(NULL); -- if (now < tim-tolerance || now > tim+tolerance) -+ if (now < tim.tv_sec-tolerance || now > tim.tv_sec+tolerance) - { - if (debug) - { fprintf(stderr, - "setting time, time difference is %d\n", -- (int)(tim-now)); -+ (int)(tim.tv_sec-now)); - } -- stime(&tim); -+ clock_settime(CLOCK_REALTIME,&tim); - } - } - ---- a/networking/httppost.c -+++ b/networking/httppost.c -@@ -92,13 +92,14 @@ int httppost_main(int argc, char *argv[] - char *time_tolerance, *rebased_fn= NULL; - char *fn_new, *fn; - FILE *tcp_file, *out_file, *fh; -- time_t server_time, tolerance; -+ time_t tolerance; -+ struct timespec server_time; - struct stat sbF, sbH, sbS; - off_t cLength, dir_length, maxpostsize; - struct sigaction sa; - -- post_dir= NULL; -- post_file= NULL; -+ post_dir= NULL; -+ post_file= NULL; - post_footer=NULL; - post_header=NULL; - atlas_id= NULL; -@@ -470,12 +471,12 @@ int httppost_main(int argc, char *argv[] - if (!check_result(tcp_file)) - goto err; - fprintf(stderr, "httppost: getting reply headers \n"); -- server_time= 0; -+ server_time.tv_sec = 0; - content_length= -1; -- if (!eat_headers(tcp_file, &chunked, &content_length, &server_time)) -+ if (!eat_headers(tcp_file, &chunked, &content_length, &server_time.tv_sec)) - goto err; - -- if (tolerance && server_time > 0) -+ if (tolerance && server_time.tv_sec > 0) - { - /* Try to set time from server */ - int need_set_time; -@@ -486,35 +487,35 @@ int httppost_main(int argc, char *argv[] - rtt= now.tv_sec-start_time.tv_sec; - rtt += (now.tv_usec-start_time.tv_usec)/1e6; - if (rtt < 0) rtt= 0; -- need_set_time= (now.tv_sec < server_time-tolerance-rtt || -- now.tv_sec > server_time+tolerance+rtt); -+ need_set_time= (now.tv_sec < server_time.tv_sec-tolerance-rtt || -+ now.tv_sec > server_time.tv_sec+tolerance+rtt); - if (need_set_time && getenv("HTTPPOST_ALLOW_STIME")) - { - fprintf(stderr, - "setting time, time difference is %ld\n", -- (long)server_time-now.tv_sec); -- stime(&server_time); -+ (long)server_time.tv_sec-now.tv_sec); -+ clock_settime(CLOCK_REALTIME,&server_time); - if (atlas_id) - { - printf( - "RESULT %s ongoing %ld httppost setting time, local %ld, remote %ld\n", - atlas_id, (long)time(NULL), - (long)now.tv_sec, -- (long)server_time); -+ (long)server_time.tv_sec); - } - } - else if (need_set_time) - { - fprintf(stderr, - "not setting time, time difference is %ld\n", -- (long)server_time-now.tv_sec); -+ (long)server_time.tv_sec-now.tv_sec); - if (atlas_id) - { - printf( - "RESULT %s ongoing %ld httppost not in sync, local %ld, remote %ld\n", - atlas_id, (long)time(NULL), - (long)now.tv_sec, -- (long)server_time); -+ (long)server_time.tv_sec); - } - } - else if (rtt <= 1) diff --git a/net/atlas-probe/patches/002-Avoid-problems-with-64-bit-time_t.patch b/net/atlas-probe/patches/002-Avoid-problems-with-64-bit-time_t.patch index a6f84958..9b2e1311 100644 --- a/net/atlas-probe/patches/002-Avoid-problems-with-64-bit-time_t.patch +++ b/net/atlas-probe/patches/002-Avoid-problems-with-64-bit-time_t.patch @@ -1,7 +1,7 @@ -From b83524b19ca6e5e58dded77fad37f17a177766ff Mon Sep 17 00:00:00 2001 +From 46da4c4e090e0412cee0777f1e8b219964781da7 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Fri, 8 Oct 2021 14:39:52 -0300 -Subject: [PATCH 1/2] Avoid problems with 64-bit time_t +Subject: [PATCH] Avoid problems with 64-bit time_t The clock_gettime() calls are being handled by calling syscall(__NR_clock_gettime, ...), which is not portable between systems @@ -12,6 +12,11 @@ So, use the standard function, and add a test to see if we can compile a test without the library, including it otherwise. Signed-off-by: Eneas U de Queiroz +--- + Makefile.flags | 6 ++++++ + coreutils/date.c | 6 ++---- + libbb/time.c | 2 +- + 3 files changed, 9 insertions(+), 5 deletions(-) --- a/Makefile.flags +++ b/Makefile.flags @@ -20,7 +25,7 @@ Signed-off-by: Eneas U de Queiroz endif +# glibc versions before 2.17 need to link with -rt to use clock_gettime -+RT_NEEDED := $(shell echo -e '#include \nint main(void){struct timespec tp; return clock_gettime(CLOCK_MONOTONIC, &tp);}' >rttest.c; $(CC) $(CFLAGS) -o /dev/null rttest.c >/dev/null 2>&1 || echo "y"; rm rttest.c) ++RT_NEEDED := $(shell echo 'int main(void){struct timespec tp; return clock_gettime(CLOCK_MONOTONIC, &tp);}' >rttest.c; $(CC) $(CFLAGS) -include time.h -o /dev/null rttest.c >/dev/null 2>&1 || echo "y"; rm rttest.c) +ifeq ($(RT_NEEDED),y) +LDLIBS += rt +endif @@ -61,14 +66,3 @@ Signed-off-by: Eneas U de Queiroz bb_error_msg_and_die("clock_gettime(MONOTONIC) failed"); } unsigned long long FAST_FUNC monotonic_ns(void) ---- a/runit/runsv.c -+++ b/runit/runsv.c -@@ -55,7 +55,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAG - * typically requiring -lrt. We just skip all this mess */ - static void gettimeofday_ns(struct timespec *ts) - { -- syscall(__NR_clock_gettime, CLOCK_REALTIME, ts); -+ clock_gettime(CLOCK_REALTIME, ts); - } - #else - static void gettimeofday_ns(struct timespec *ts) diff --git a/net/atlas-probe/patches/003-Fix-compilation-with-gcc11.patch b/net/atlas-probe/patches/003-Fix-compilation-with-gcc11.patch deleted file mode 100644 index 0ce3f4b2..00000000 --- a/net/atlas-probe/patches/003-Fix-compilation-with-gcc11.patch +++ /dev/null @@ -1,82 +0,0 @@ -From b6b3cdc16eaa50b40623f1589ea51dd43ebb456d Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Fri, 8 Oct 2021 14:47:08 -0300 -Subject: [PATCH 2/2] Fix compilation with gcc11 - -Currently, libbb.h counts on __THROW and __inline being defined. They -are internal macros used by glibc not meant to be publicly used. This -causes trouble, at least with a combination of gcc11 and musl, where -nether have them defined. - -Use definitions from in gcc 8.4.0 if they're missing. - -Signed-off-by: Eneas U de Queiroz - ---- a/include/libbb.h -+++ b/include/libbb.h -@@ -120,6 +120,65 @@ - #ifdef DMALLOC - # include - #endif -+ -+/* Compatibility with musl & gcc 11. Taken from in gcc 8.4.0 */ -+#ifndef __THROW -+#ifdef __GNUC__ -+ -+/* All functions, except those with callbacks or those that -+ synchronize memory, are leaf functions. */ -+# if __GNUC_PREREQ (4, 6) && !defined _LIBC -+# define __LEAF , __leaf__ -+# define __LEAF_ATTR __attribute__ ((__leaf__)) -+# else -+# define __LEAF -+# define __LEAF_ATTR -+# endif -+ -+/* GCC can always grok prototypes. For C++ programs we add throw() -+ to help it optimize the function calls. But this works only with -+ gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions -+ as non-throwing using a function attribute since programs can use -+ the -fexceptions options for C code as well. */ -+# if !defined __cplusplus && __GNUC_PREREQ (3, 3) -+# define __THROW __attribute__ ((__nothrow__ __LEAF)) -+# define __THROWNL __attribute__ ((__nothrow__)) -+# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct -+# else -+# if defined __cplusplus && __GNUC_PREREQ (2,8) -+# define __THROW throw () -+# define __THROWNL throw () -+# define __NTH(fct) __LEAF_ATTR fct throw () -+# else -+# define __THROW -+# define __THROWNL -+# define __NTH(fct) fct -+# endif -+# endif -+ -+#else /* Not GCC. */ -+ -+# define __inline /* No inline functions. */ -+ -+# define __THROW -+# define __THROWNL -+# define __NTH(fct) fct -+ -+#endif /* GCC. */ -+#endif /* __THROW */ -+ -+#ifndef __nonnull -+/* The nonull function attribute allows to mark pointer parameters which -+ must not be NULL. */ -+#if __GNUC_PREREQ (3,3) -+# define __nonnull(params) __attribute__ ((__nonnull__ params)) -+#else -+# define __nonnull(params) -+#endif -+#endif /* __nonnull */ -+ -+/* End of compatibility with musl & gcc 11. */ -+ - /* Just in case libc doesn't define some of these... */ - #ifndef _PATH_PASSWD - #define _PATH_PASSWD "/etc/passwd" diff --git a/net/atlas-probe/patches/004-Comment-out-librt-testing.patch b/net/atlas-probe/patches/004-Comment-out-librt-testing.patch index 34448d20..c433f071 100644 --- a/net/atlas-probe/patches/004-Comment-out-librt-testing.patch +++ b/net/atlas-probe/patches/004-Comment-out-librt-testing.patch @@ -19,11 +19,11 @@ Signed-off-by: Eneas U de Queiroz endif # glibc versions before 2.17 need to link with -rt to use clock_gettime --RT_NEEDED := $(shell echo -e '#include \nint main(void){struct timespec tp; return clock_gettime(CLOCK_MONOTONIC, &tp);}' >rttest.c; $(CC) $(CFLAGS) -o /dev/null rttest.c >/dev/null 2>&1 || echo "y"; rm rttest.c) +-RT_NEEDED := $(shell echo 'int main(void){struct timespec tp; return clock_gettime(CLOCK_MONOTONIC, &tp);}' >rttest.c; $(CC) $(CFLAGS) -include time.h -o /dev/null rttest.c >/dev/null 2>&1 || echo "y"; rm rttest.c) -ifeq ($(RT_NEEDED),y) -LDLIBS += rt -endif -+#RT_NEEDED := $(shell echo -e '#include \nint main(void){struct timespec tp; return clock_gettime(CLOCK_MONOTONIC, &tp);}' >rttest.c; $(CC) $(CFLAGS) -o /dev/null rttest.c >/dev/null 2>&1 || echo "y"; rm rttest.c) ++#RT_NEEDED := $(shell echo 'int main(void){struct timespec tp; return clock_gettime(CLOCK_MONOTONIC, &tp);}' >rttest.c; $(CC) $(CFLAGS) -include time.h -o /dev/null rttest.c >/dev/null 2>&1 || echo "y"; rm rttest.c) +#ifeq ($(RT_NEEDED),y) +#LDLIBS += rt +#endif From 1c4adf66140a9fbd119c1dee37129bfea73c86e6 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Tue, 25 Oct 2022 10:29:42 +0200 Subject: [PATCH 030/102] atlas-probe: fix SIGSEGV error on 32bit system Changes to time_t cause SIGSEGV error on 32bit system and cause ripe atlas malfunction. (registration successful but no traffic) Also introduce minor patch to fix some compilation warning. While at it move PKG_RELEASE to AUTORELEASE macro. Signed-off-by: Christian Marangi --- net/atlas-probe/Makefile | 2 +- ...ed-by-time_t-casted-to-long-on-32bit.patch | 301 ++++++++++++++++++ ...evious-prototype-compilation-warning.patch | 43 +++ ...6-to-sockaddr-to-mute-compilation-wa.patch | 137 ++++++++ ...ong-to-mute-warning-on-32bit-systems.patch | 83 +++++ 5 files changed, 565 insertions(+), 1 deletion(-) create mode 100644 net/atlas-probe/patches/003-Fix-SIGSEGV-caused-by-time_t-casted-to-long-on-32bit.patch create mode 100644 net/atlas-probe/patches/005-Mute-some-no-previous-prototype-compilation-warning.patch create mode 100644 net/atlas-probe/patches/006-Cast-sockaddr_in6-to-sockaddr-to-mute-compilation-wa.patch create mode 100644 net/atlas-probe/patches/007-Cast-size_t-to-long-to-mute-warning-on-32bit-systems.patch diff --git a/net/atlas-probe/Makefile b/net/atlas-probe/Makefile index 61b00c98..7d793257 100644 --- a/net/atlas-probe/Makefile +++ b/net/atlas-probe/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=atlas-probe PKG_VERSION:=2.4.1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=ripe-atlas-probe-busybox-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/RIPE-NCC/ripe-atlas-probe-busybox/archive/v$(PKG_VERSION) diff --git a/net/atlas-probe/patches/003-Fix-SIGSEGV-caused-by-time_t-casted-to-long-on-32bit.patch b/net/atlas-probe/patches/003-Fix-SIGSEGV-caused-by-time_t-casted-to-long-on-32bit.patch new file mode 100644 index 00000000..5dbc56d1 --- /dev/null +++ b/net/atlas-probe/patches/003-Fix-SIGSEGV-caused-by-time_t-casted-to-long-on-32bit.patch @@ -0,0 +1,301 @@ +From 899efc5206d5985d0ae65500a1c0542ec2d58e58 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Mon, 17 Oct 2022 18:44:30 +0200 +Subject: [PATCH 1/4] Fix SIGSEGV caused by time_t casted to long on 32bit + systems + +32bit systems have time_t set to long long int while 64bit system have +time_t set to long int. This is problematic as in the busybox code this +is not handled correctly and we have some casted to long and some not +casted at all. + +Some arch (found this problem on a mt7621) may be restrictive about casting +and crash with segmentation fault if time_t is cast to %ld instead of the +correct %lld. + +This is the cause of https://github.com/RIPE-NCC/ripe-atlas-software-probe/issues/74 + +Use the correct type and cast every time_t to (unsigned long long) so that +eperd and condmv doesn't crash anymore and the measurement works correctly. + +Signed-off-by: Christian Marangi +--- + coreutils/condmv.c | 3 ++- + eperd/condmv.c | 7 ++++--- + eperd/evtdig.c | 12 ++++++------ + eperd/httpget.c | 8 ++++---- + eperd/ntp.c | 4 ++-- + eperd/sslgetcert.c | 8 ++++---- + eperd/traceroute.c | 8 ++++---- + miscutils/perd.c | 4 ++-- + networking/httppost.c | 30 +++++++++++++++--------------- + networking/rptaddrs.c | 2 +- + 10 files changed, 44 insertions(+), 42 deletions(-) + +--- a/coreutils/condmv.c ++++ b/coreutils/condmv.c +@@ -149,7 +149,8 @@ int condmv_main(int argc, char *argv[]) + rebased_from, strerror(errno)); + goto err; + } +- if (fprintf(file, "%s %lu %s\n", opt_add, mytime, from) < 0) ++ if (fprintf(file, "%s %llu %s\n", opt_add, ++ (unsigned long long)mytime, from) < 0) + { + fprintf(stderr, + "condmv: unable to append to '%s': %s\n", +--- a/eperd/condmv.c ++++ b/eperd/condmv.c +@@ -99,8 +99,8 @@ static void condmv_start(void *state) + + len= strlen(condmvstate->to) + 20; + to= malloc(len); +- snprintf(to, len, "%s.%ld", condmvstate->to, +- (long)time(NULL)/condmvstate->interval); ++ snprintf(to, len, "%s.%llu", condmvstate->to, ++ (unsigned long long)time(NULL)/condmvstate->interval); + + crondlog(LVL7 "condmv_start: destination '%s'\n", to); + +@@ -124,7 +124,8 @@ static void condmv_start(void *state) + free(to); + return; + } +- if (fprintf(file, "%s %lu %s\n", condmvstate->atlas, mytime, ++ if (fprintf(file, "%s %llu %s\n", condmvstate->atlas, ++ (unsigned long long)mytime, + condmvstate->from) < 0) + { + crondlog(LVL9 "condmv: unable to append to '%s': %s\n", +--- a/eperd/evtdig.c ++++ b/eperd/evtdig.c +@@ -1009,7 +1009,7 @@ static int mk_dns_buff(struct query_stat + lookup_prepend = xzalloc(DEFAULT_LINE_LENGTH + sizeof(qry->lookupname)); + snprintf(lookup_prepend, (sizeof(qry->lookupname) + + DEFAULT_LINE_LENGTH - 1), +- "%d.%lu.%s", probe_id, qry->xmit_time, ++ "%d.%llu.%s", probe_id, (unsigned long long)qry->xmit_time, + qry->lookupname); + + qnamelen= ChangetoDnsNameFormat(qname, qnamelen, +@@ -3081,7 +3081,7 @@ static void tdig_stats(int unusg_statsed + AS(atlas_get_version_json_str()); + AS(", "); + gettimeofday(&now, NULL); +- JS1(time, %ld, now.tv_sec); ++ JS1(time, %llu, (unsigned long long)now.tv_sec); + JU(sok , base->sentok); + JU(rok , base->recvok); + JU(sent , base->sentbytes); +@@ -3395,7 +3395,7 @@ void printErrorQuick (struct query_state + fprintf(fh, "RESULT { "); + fprintf(fh, "%s,", atlas_get_version_json_str()); + fprintf(fh, "\"id\" : 9202 ,"); +- fprintf(fh, "\"time\" : %ld ,", atlas_time()); ++ fprintf(fh, "\"time\" : %llu ,", (unsigned long long)atlas_time()); + + fprintf(fh, "\"error\" : [{ "); + fprintf(fh, "\"query busy\": \"not starting a new one. previous one is not done yet\"}"); +@@ -3405,7 +3405,7 @@ void printErrorQuick (struct query_state + fprintf(fh, "\"id\" : \"%s\"", qry->str_Atlas); + if (qry->str_bundle) + fprintf(fh, ",\"bundle\" : %s", qry->str_bundle); +- fprintf(fh, ",\"start time\" : %ld", qry->xmit_time); ++ fprintf(fh, ",\"start time\" : %llu", (unsigned long long)qry->xmit_time); + if(qry->retry) { + fprintf(fh, ",\"retry\": %d", qry->retry); + +@@ -3456,7 +3456,7 @@ void printReply(struct query_state *qry, + AS(atlas_get_version_json_str()); + AS(", "); + if (qry->opt_rset){ +- JS1(time, %ld, qry->xmit_time); ++ JS1(time, %llu, (unsigned long long)qry->xmit_time); + JD(lts,lts); + AS("\"resultset\" : [ {"); + } +@@ -3466,7 +3466,7 @@ void printReply(struct query_state *qry, + AS (",{"); + } + +- JS1(time, %ld, qry->xmit_time); ++ JS1(time, %llu, (unsigned long long)qry->xmit_time); + JD(lts,lts); + + if (qry->opt_do_tls && ssl_version != NULL) +--- a/eperd/httpget.c ++++ b/eperd/httpget.c +@@ -853,10 +853,10 @@ static void report(struct hgstate *state + fprintf(fh, DBQ(id) ":" DBQ(%s) ", " + "%s, " + DBQ(lts) ":%d, " +- DBQ(time) ":%ld, ", ++ DBQ(time) ":%llu, ", + state->atlas, atlas_get_version_json_str(), + get_timesync(), +- state->gstart); ++ (unsigned long long)state->gstart); + if (state->bundle) + { + fprintf(fh, DBQ(bundle) ":%s, ", +@@ -876,8 +876,8 @@ static void report(struct hgstate *state + { + if (state->do_combine) + { +- snprintf(line, sizeof(line), DBQ(time) ":%ld, ", +- state->start.tv_sec); ++ snprintf(line, sizeof(line), DBQ(time) ":%llu, ", ++ (unsigned long long)state->start.tv_sec); + } + else + { +--- a/eperd/ntp.c ++++ b/eperd/ntp.c +@@ -366,10 +366,10 @@ static void report(struct ntpstate *stat + fprintf(fh, DBQ(id) ":" DBQ(%s) + ", %s" + ", " DBQ(lts) ":%d" +- ", " DBQ(time) ":%ld, ", ++ ", " DBQ(time) ":%llu, ", + state->atlas, atlas_get_version_json_str(), + get_timesync(), +- state->starttime); ++ (unsigned long long)state->starttime); + if (state->bundle) + fprintf(fh, DBQ(bundle) ":%s, ", state->bundle); + } +--- a/eperd/sslgetcert.c ++++ b/eperd/sslgetcert.c +@@ -1026,9 +1026,9 @@ static void report(struct state *state) + fprintf(fh, DBQ(id) ":" DBQ(%s) ", " + "%s, " + DBQ(lts) ":%d, " +- DBQ(time) ":%ld, ", ++ DBQ(time) ":%llu, ", + state->atlas, atlas_get_version_json_str(), +- get_timesync(), state->gstart); ++ get_timesync(), (unsigned long long)state->gstart); + if (state->bundle) + fprintf(fh, DBQ(bundle) ":%s, ", state->bundle); + } +@@ -1185,8 +1185,8 @@ static FILE *report_head(struct state *s + fprintf(fh, DBQ(bundle) ":%s, ", state->bundle); + } + +- fprintf(fh, "%s" DBQ(time) ":%ld", +- state->atlas ? ", " : "", atlas_time()); ++ fprintf(fh, "%s" DBQ(time) ":%llu", ++ state->atlas ? ", " : "", (unsigned long long)atlas_time()); + fprintf(fh, ", " DBQ(dst_name) ":" DBQ(%s) ", " + DBQ(dst_port) ":" DBQ(%s), + state->hostname, state->portname); +--- a/eperd/traceroute.c ++++ b/eperd/traceroute.c +@@ -362,12 +362,12 @@ static void report(struct trtstate *stat + fprintf(fh, DBQ(id) ":" DBQ(%s) + ", %s" + ", " DBQ(lts) ":%d" +- ", " DBQ(time) ":%ld" +- ", " DBQ(endtime) ":%ld, ", ++ ", " DBQ(time) ":%llu" ++ ", " DBQ(endtime) ":%llu, ", + state->atlas, atlas_get_version_json_str(), + get_timesync(), +- state->starttime, +- (long)atlas_time()); ++ (unsigned long long)state->starttime, ++ (unsigned long long)atlas_time()); + if (state->bundle_id) + fprintf(fh, DBQ(bundle) ":%s, ", state->bundle_id); + } +--- a/miscutils/perd.c ++++ b/miscutils/perd.c +@@ -1197,8 +1197,8 @@ error: + fprintf(fn, "RESULT { "); + if (atlas_id) + fprintf(fn, DBQ(id) ":" DBQ(%s) ", ", atlas_id); +- fprintf(fn, "%s, " DBQ(time) ":%d, ", +- atlas_get_version_json_str(), time(NULL)); ++ fprintf(fn, "%s, " DBQ(time) ":%llu, ", ++ atlas_get_version_json_str(), (unsigned long long)time(NULL)); + if (reason != NULL) + fprintf(fn, DBQ(reason) ":" DBQ(%s) ", ", reason); + fprintf(fn, DBQ(err) ":%d, " DBQ(cmd) ": \"", r); +--- a/networking/httppost.c ++++ b/networking/httppost.c +@@ -492,32 +492,32 @@ int httppost_main(int argc, char *argv[] + if (need_set_time && getenv("HTTPPOST_ALLOW_STIME")) + { + fprintf(stderr, +- "setting time, time difference is %ld\n", +- (long)server_time-now.tv_sec); ++ "setting time, time difference is %llu\n", ++ (unsigned long long)server_time-now.tv_sec); + ts.tv_sec= server_time; + ts.tv_nsec= 0; + clock_settime(CLOCK_REALTIME, &ts); + if (atlas_id) + { + printf( +- "RESULT %s ongoing %ld httppost setting time, local %ld, remote %ld\n", +- atlas_id, (long)time(NULL), +- (long)now.tv_sec, +- (long)server_time); ++ "RESULT %s ongoing %llu httppost setting time, local %llu, remote %llu\n", ++ atlas_id, (unsigned long long)time(NULL), ++ (unsigned long long)now.tv_sec, ++ (unsigned long long)server_time); + } + } + else if (need_set_time) + { + fprintf(stderr, +- "not setting time, time difference is %ld\n", +- (long)server_time-now.tv_sec); ++ "not setting time, time difference is %llu\n", ++ (unsigned long long)server_time-now.tv_sec); + if (atlas_id) + { + printf( +- "RESULT %s ongoing %ld httppost not in sync, local %ld, remote %ld\n", +- atlas_id, (long)time(NULL), +- (long)now.tv_sec, +- (long)server_time); ++ "RESULT %s ongoing %llu httppost not in sync, local %llu, remote %llu\n", ++ atlas_id, (unsigned long long)time(NULL), ++ (unsigned long long)now.tv_sec, ++ (unsigned long long)server_time); + } + } + else if (rtt <= 1) +@@ -528,7 +528,7 @@ int httppost_main(int argc, char *argv[] + fh= fopen(fn_new, "wt"); + if (fh) + { +- fprintf(fh, "%ld\n", (long)now.tv_sec); ++ fprintf(fh, "%llu\n", (unsigned long long)now.tv_sec); + fclose(fh); + rename(fn_new, fn); + } +@@ -537,8 +537,8 @@ int httppost_main(int argc, char *argv[] + } + else if (atlas_id) + { +- printf("RESULT %s ongoing %ld httppost rtt %g ms\n", +- atlas_id, (long)time(NULL), rtt*1000); ++ printf("RESULT %s ongoing %llu httppost rtt %g ms\n", ++ atlas_id, (unsigned long long)time(NULL), rtt*1000); + } + } + +--- a/networking/rptaddrs.c ++++ b/networking/rptaddrs.c +@@ -802,7 +802,7 @@ static int rpt_ipv6(char *cache_name, ch + JS(id, opt_atlas); + } + gettimeofday(&now, NULL); +- JS1(time, %ld, now.tv_sec); ++ JS1(time, %llu, (unsigned long long)now.tv_sec); + + /* Copy all lines */ + while (fgets(buf, sizeof(buf), file) != NULL) diff --git a/net/atlas-probe/patches/005-Mute-some-no-previous-prototype-compilation-warning.patch b/net/atlas-probe/patches/005-Mute-some-no-previous-prototype-compilation-warning.patch new file mode 100644 index 00000000..3a1d7649 --- /dev/null +++ b/net/atlas-probe/patches/005-Mute-some-no-previous-prototype-compilation-warning.patch @@ -0,0 +1,43 @@ +From 25f131be221c5b2f8cb4f0c2a32f522415bb3bbf Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Mon, 17 Oct 2022 20:15:30 +0200 +Subject: [PATCH] Mute some no previous prototype compilation warning + +Mute some no previous prototype compilation warning found in +atlas_unsafe, rxtxrpt_main and route_set_flags. + +Signed-off-by: Christian Marangi +--- + include/libbb.h | 2 ++ + libbb/route_set_flags.c | 2 ++ + 2 files changed, 4 insertions(+) + +--- a/include/libbb.h ++++ b/include/libbb.h +@@ -463,6 +463,7 @@ char *is_suffixed_with(const char *strin + #define ATLAS_TIMESYNC_FILE_REL ATLAS_DATA_NEW_REL "/timesync.vol" + #define ATLAS_FUZZING_REL "data" + ++extern int atlas_unsafe(void); + extern char *rebased_validated_filename(const char *path, const char *prefix); + extern char *rebased_validated_dir(const char *path, const char *prefix); + extern int validate_atlas_id(const char *atlas_id); +@@ -484,6 +485,7 @@ extern void read_response(int fd, int ty + extern void read_response_file(FILE *file, int type, size_t *sizep, + void *data); + extern void write_response(FILE *file, int type, size_t size, void *data); ++extern int rxtxrpt_main(int argc, char *argv[]); + + int ndelay_on(int fd) FAST_FUNC; + int ndelay_off(int fd) FAST_FUNC; +--- a/libbb/route_set_flags.c ++++ b/libbb/route_set_flags.c +@@ -1,6 +1,8 @@ + #include + #include + ++#include "libbb.h" ++ + static const + IF_NOT_FEATURE_IPV6(uint16_t) + IF_FEATURE_IPV6(unsigned) diff --git a/net/atlas-probe/patches/006-Cast-sockaddr_in6-to-sockaddr-to-mute-compilation-wa.patch b/net/atlas-probe/patches/006-Cast-sockaddr_in6-to-sockaddr-to-mute-compilation-wa.patch new file mode 100644 index 00000000..24b164b3 --- /dev/null +++ b/net/atlas-probe/patches/006-Cast-sockaddr_in6-to-sockaddr-to-mute-compilation-wa.patch @@ -0,0 +1,137 @@ +From dba9e1b7707c9cc9f5804b7a5cbda32a08e9e18f Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Mon, 17 Oct 2022 20:00:24 +0200 +Subject: [PATCH] Cast sockaddr_in6 to sockaddr to mute compilation warning + +Cast sockaddr_in6 to sockaddr to mute compilation warning as +documentation say for getsockname. + +Signed-off-by: Christian Marangi +--- + eperd/evtdig.c | 3 ++- + eperd/httpget.c | 3 ++- + eperd/ntp.c | 4 ++-- + eperd/ping.c | 12 ++++++++---- + eperd/sslgetcert.c | 3 ++- + eperd/traceroute.c | 2 +- + networking/rptra6.c | 2 +- + 7 files changed, 18 insertions(+), 11 deletions(-) + +--- a/eperd/evtdig.c ++++ b/eperd/evtdig.c +@@ -1612,7 +1612,8 @@ static void tcp_connected(struct tu_env + } + else + { +- getsockname(bufferevent_getfd(bev), &qry->loc_sin6, &qry->loc_socklen); ++ getsockname(bufferevent_getfd(bev), ++ (struct sockaddr *)&qry->loc_sin6, &qry->loc_socklen); + if (qry->response_out) + { + write_response(qry->resp_file, RESP_SOCKNAME, +--- a/eperd/httpget.c ++++ b/eperd/httpget.c +@@ -2103,7 +2103,8 @@ static void connected(struct tu_env *env + else + { + getsockname(bufferevent_getfd(bev), +- &state->loc_sin6, &state->loc_socklen); ++ (struct sockaddr *)&state->loc_sin6, ++ &state->loc_socklen); + if (state->response_out) + { + write_response(state->resp_file, RESP_SOCKNAME, +--- a/eperd/ntp.c ++++ b/eperd/ntp.c +@@ -1218,13 +1218,13 @@ static int create_socket(struct ntpstate + + len= sizeof(state->loc_sin6); + read_response(state->socket, RESP_SOCKNAME, +- &len, &state->loc_sin6); ++ &len, (struct sockaddr *)&state->loc_sin6); + state->loc_socklen= len; + } + else + { + if (getsockname(state->socket, +- &state->loc_sin6, ++ (struct sockaddr*)&state->loc_sin6, + &state->loc_socklen) == -1) + { + crondlog(DIE9 "getsockname failed"); +--- a/eperd/ping.c ++++ b/eperd/ping.c +@@ -703,7 +703,8 @@ static void ping_xmit(struct pingstate * + } + else + { +- getsockname(host->socket, &host->loc_sin6, ++ getsockname(host->socket, ++ (struct sockaddr *)&host->loc_sin6, + &host->loc_socklen); + if (host->resp_file_out) + { +@@ -735,7 +736,8 @@ static void ping_xmit(struct pingstate * + host->include_probe_id); + + host->loc_socklen= sizeof(host->loc_sin6); +- getsockname(host->socket, &host->loc_sin6, &host->loc_socklen); ++ getsockname(host->socket, (struct sockaddr *)&host->loc_sin6, ++ &host->loc_socklen); + + if (host->response_in) + { +@@ -1567,7 +1569,8 @@ static void ping_start2(void *state) + } + + if (!pingstate->response_in && +- connect(pingstate->socket, &pingstate->sin6, ++ connect(pingstate->socket, ++ (struct sockaddr *)&pingstate->sin6, + pingstate->socklen) == -1) + { + snprintf(line, sizeof(line), +@@ -1592,7 +1595,8 @@ static void ping_start2(void *state) + } + else + { +- getsockname(pingstate->socket, &pingstate->loc_sin6, ++ getsockname(pingstate->socket, ++ (struct sockaddr *)&pingstate->loc_sin6, + &pingstate->loc_socklen); + if (pingstate->resp_file_out) + { +--- a/eperd/sslgetcert.c ++++ b/eperd/sslgetcert.c +@@ -1801,7 +1801,8 @@ static void connected(struct tu_env *env + else + { + getsockname(bufferevent_getfd(bev), +- &state->loc_sin6, &state->loc_socklen); ++ (struct sockaddr *)&state->loc_sin6, ++ &state->loc_socklen); + if (state->response_out) + { + write_response(state->resp_file, RESP_SOCKNAME, +--- a/eperd/traceroute.c ++++ b/eperd/traceroute.c +@@ -4631,7 +4631,7 @@ static int create_socket(struct trtstate + { + state->loc_socklen= sizeof(state->loc_sin6); + if (!state->response_in && getsockname(state->socket_icmp, +- &state->loc_sin6, ++ (struct sockaddr *)&state->loc_sin6, + &state->loc_socklen) == -1) + { + crondlog(DIE9 "getsockname failed"); +--- a/networking/rptra6.c ++++ b/networking/rptra6.c +@@ -441,7 +441,7 @@ static int send_sol(int sock) + inet_pton(AF_INET6, "FF02::2", &sin6.sin6_addr); + sin6.sin6_family= AF_INET6; + +- sendto(sock, &pkt, sizeof(pkt), 0, &sin6, sizeof(sin6)); ++ sendto(sock, &pkt, sizeof(pkt), 0, (struct sockaddr*)&sin6, sizeof(sin6)); + + alarm(RTR_SOLICITATION_INTERVAL); + diff --git a/net/atlas-probe/patches/007-Cast-size_t-to-long-to-mute-warning-on-32bit-systems.patch b/net/atlas-probe/patches/007-Cast-size_t-to-long-to-mute-warning-on-32bit-systems.patch new file mode 100644 index 00000000..0e2d3cb7 --- /dev/null +++ b/net/atlas-probe/patches/007-Cast-size_t-to-long-to-mute-warning-on-32bit-systems.patch @@ -0,0 +1,83 @@ +From d8bd85fba865508c0c6dff57b14c98f3ca70bbfc Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Mon, 17 Oct 2022 19:18:06 +0200 +Subject: [PATCH] Cast size_t to long to mute warning on 32bit systems + +Cast size_t to long to mute warning on 32bit systems. + +Signed-off-by: Christian Marangi +--- + eperd/evtdig.c | 10 +++++----- + eperd/sslgetcert.c | 2 +- + libbb/atlas_bb64.c | 2 +- + 3 files changed, 7 insertions(+), 7 deletions(-) + +--- a/eperd/evtdig.c ++++ b/eperd/evtdig.c +@@ -3792,7 +3792,7 @@ unsigned char* ReadName(unsigned char *b + /* Bad format */ + snprintf((char *)name, sizeof(name), + "format-error at %lu: value 0x%x", +- offset, len); ++ (unsigned long)offset, len); + *count= -1; + free(name); name= NULL; + return name; +@@ -3803,7 +3803,7 @@ unsigned char* ReadName(unsigned char *b + { + snprintf((char *)name, sizeof(name), + "offset-error at %lu: offset %lu", +- offset, noffset); ++ (unsigned long)offset, (unsigned long)noffset); + *count= -1; + free(name); name= NULL; + return name; +@@ -3814,7 +3814,7 @@ unsigned char* ReadName(unsigned char *b + /* Too many */ + snprintf((char *)name, sizeof(name), + "too many redirects at %lu", +- offset); ++ (unsigned long)offset); + *count= -1; + free(name); name= NULL; + return name; +@@ -3836,7 +3836,7 @@ unsigned char* ReadName(unsigned char *b + { + snprintf((char *)name, sizeof(name), + "buf-bounds-error at %lu: len %d", +- offset, len); ++ (unsigned long)offset, len); + *count= -1; + free(name); name= NULL; + return name; +@@ -3846,7 +3846,7 @@ unsigned char* ReadName(unsigned char *b + { + snprintf((char *)name, sizeof(name), + "name-length-error at %lu: len %d", +- offset, p+len+1); ++ (unsigned long)offset, p+len+1); + *count= -1; + free(name); name= NULL; + return name; +--- a/eperd/sslgetcert.c ++++ b/eperd/sslgetcert.c +@@ -182,7 +182,7 @@ static void buf_add(struct buf *buf, con + newbuf= malloc(maxsize); + if (!newbuf) + { +- fprintf(stderr, "unable to allocate %ld bytes\n", maxsize); ++ fprintf(stderr, "unable to allocate %ld bytes\n", (long)maxsize); + exit(1); + } + +--- a/libbb/atlas_bb64.c ++++ b/libbb/atlas_bb64.c +@@ -43,7 +43,7 @@ int buf_add(struct buf *buf, const void + newbuf= malloc(maxsize); + if (!newbuf) + { +- fprintf(stderr, "unable to allocate %ld bytes\n", maxsize); ++ fprintf(stderr, "unable to allocate %ld bytes\n", (long)maxsize); + return (1); + } + From 125232acea1539deaa5351d55ae59838a6615629 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 13 Jan 2023 17:08:54 -0800 Subject: [PATCH 031/102] atlas-probe: update to 2.6.3 Switch to git tarballs. Remove upstreamed patches and add OpenSSL patch. Signed-off-by: Rosen Penev --- net/atlas-probe/Makefile | 12 +- ...02-Avoid-problems-with-64-bit-time_t.patch | 68 ---- ...ed-by-time_t-casted-to-long-on-32bit.patch | 301 ------------------ ...evious-prototype-compilation-warning.patch | 43 --- ...6-to-sockaddr-to-mute-compilation-wa.patch | 137 -------- ...ong-to-mute-warning-on-32bit-systems.patch | 83 ----- net/atlas-probe/patches/010-openssl.patch | 25 ++ 7 files changed, 30 insertions(+), 639 deletions(-) delete mode 100644 net/atlas-probe/patches/002-Avoid-problems-with-64-bit-time_t.patch delete mode 100644 net/atlas-probe/patches/003-Fix-SIGSEGV-caused-by-time_t-casted-to-long-on-32bit.patch delete mode 100644 net/atlas-probe/patches/005-Mute-some-no-previous-prototype-compilation-warning.patch delete mode 100644 net/atlas-probe/patches/006-Cast-sockaddr_in6-to-sockaddr-to-mute-compilation-wa.patch delete mode 100644 net/atlas-probe/patches/007-Cast-size_t-to-long-to-mute-warning-on-32bit-systems.patch create mode 100644 net/atlas-probe/patches/010-openssl.patch diff --git a/net/atlas-probe/Makefile b/net/atlas-probe/Makefile index 7d793257..a5dfd34a 100644 --- a/net/atlas-probe/Makefile +++ b/net/atlas-probe/Makefile @@ -8,14 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=atlas-probe -PKG_VERSION:=2.4.1 -PKG_RELEASE:=$(AUTORELEASE) +PKG_RELEASE:=1 -PKG_SOURCE:=ripe-atlas-probe-busybox-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/RIPE-NCC/ripe-atlas-probe-busybox/archive/v$(PKG_VERSION) -PKG_HASH:=e684bf617cdc502c20f97028726a93a4a0d21ad9f618b50eb07f999f1604ae65 - -PKG_BUILD_DIR:=$(BUILD_DIR)/ripe-atlas-probe-busybox-$(PKG_VERSION) +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=2.6.3 +PKG_SOURCE_URL:=https://github.com/RIPE-NCC/ripe-atlas-probe-busybox +PKG_MIRROR_HASH:=f53a2b29fedc2b6a44880b6f75b433e7cc0a51d6dc643bff86539f78b5aa653e PKG_MAINTAINER:=Jan Pavlinec PKG_LICENSE:=GPL-2.0-or-later diff --git a/net/atlas-probe/patches/002-Avoid-problems-with-64-bit-time_t.patch b/net/atlas-probe/patches/002-Avoid-problems-with-64-bit-time_t.patch deleted file mode 100644 index 9b2e1311..00000000 --- a/net/atlas-probe/patches/002-Avoid-problems-with-64-bit-time_t.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 46da4c4e090e0412cee0777f1e8b219964781da7 Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Fri, 8 Oct 2021 14:39:52 -0300 -Subject: [PATCH] Avoid problems with 64-bit time_t - -The clock_gettime() calls are being handled by calling -syscall(__NR_clock_gettime, ...), which is not portable between systems -using 32-bit and 64-bit time_t. This is being done to avoid having to -link agains librt. - -So, use the standard function, and add a test to see if we can compile -a test without the library, including it otherwise. - -Signed-off-by: Eneas U de Queiroz ---- - Makefile.flags | 6 ++++++ - coreutils/date.c | 6 ++---- - libbb/time.c | 2 +- - 3 files changed, 9 insertions(+), 5 deletions(-) - ---- a/Makefile.flags -+++ b/Makefile.flags -@@ -124,6 +124,12 @@ CFLAGS += --sysroot=$(CONFIG_SYSROOT) - export SYSROOT=$(CONFIG_SYSROOT) - endif - -+# glibc versions before 2.17 need to link with -rt to use clock_gettime -+RT_NEEDED := $(shell echo 'int main(void){struct timespec tp; return clock_gettime(CLOCK_MONOTONIC, &tp);}' >rttest.c; $(CC) $(CFLAGS) -include time.h -o /dev/null rttest.c >/dev/null 2>&1 || echo "y"; rm rttest.c) -+ifeq ($(RT_NEEDED),y) -+LDLIBS += rt -+endif -+ - # Android has no separate crypt library - # gcc-4.2.1 fails if we try to feed C source on stdin: - # echo 'int main(void){return 0;}' | $(CC) $(CFLAGS) -lcrypt -o /dev/null -xc - ---- a/coreutils/date.c -+++ b/coreutils/date.c -@@ -37,7 +37,7 @@ - //config:config FEATURE_DATE_NANO - //config: bool "Support %[num]N nanosecond format specifier" - //config: default n --//config: depends on DATE # syscall(__NR_clock_gettime) -+//config: depends on DATE # clock_gettime() - //config: select PLATFORM_LINUX - //config: help - //config: Support %[num]N format specifier. Adds ~250 bytes of code. -@@ -265,9 +265,7 @@ int date_main(int argc UNUSED_PARAM, cha - #endif - } else { - #if ENABLE_FEATURE_DATE_NANO -- /* libc has incredibly messy way of doing this, -- * typically requiring -lrt. We just skip all this mess */ -- syscall(__NR_clock_gettime, CLOCK_REALTIME, &ts); -+ clock_gettime(CLOCK_REALTIME, &ts); - #else - time(&ts.tv_sec); - #endif ---- a/libbb/time.c -+++ b/libbb/time.c -@@ -243,7 +243,7 @@ char* FAST_FUNC strftime_YYYYMMDDHHMMSS( - * typically requiring -lrt. We just skip all this mess */ - static void get_mono(struct timespec *ts) - { -- if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, ts)) -+ if (clock_gettime(CLOCK_MONOTONIC, ts)) - bb_error_msg_and_die("clock_gettime(MONOTONIC) failed"); - } - unsigned long long FAST_FUNC monotonic_ns(void) diff --git a/net/atlas-probe/patches/003-Fix-SIGSEGV-caused-by-time_t-casted-to-long-on-32bit.patch b/net/atlas-probe/patches/003-Fix-SIGSEGV-caused-by-time_t-casted-to-long-on-32bit.patch deleted file mode 100644 index 5dbc56d1..00000000 --- a/net/atlas-probe/patches/003-Fix-SIGSEGV-caused-by-time_t-casted-to-long-on-32bit.patch +++ /dev/null @@ -1,301 +0,0 @@ -From 899efc5206d5985d0ae65500a1c0542ec2d58e58 Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Mon, 17 Oct 2022 18:44:30 +0200 -Subject: [PATCH 1/4] Fix SIGSEGV caused by time_t casted to long on 32bit - systems - -32bit systems have time_t set to long long int while 64bit system have -time_t set to long int. This is problematic as in the busybox code this -is not handled correctly and we have some casted to long and some not -casted at all. - -Some arch (found this problem on a mt7621) may be restrictive about casting -and crash with segmentation fault if time_t is cast to %ld instead of the -correct %lld. - -This is the cause of https://github.com/RIPE-NCC/ripe-atlas-software-probe/issues/74 - -Use the correct type and cast every time_t to (unsigned long long) so that -eperd and condmv doesn't crash anymore and the measurement works correctly. - -Signed-off-by: Christian Marangi ---- - coreutils/condmv.c | 3 ++- - eperd/condmv.c | 7 ++++--- - eperd/evtdig.c | 12 ++++++------ - eperd/httpget.c | 8 ++++---- - eperd/ntp.c | 4 ++-- - eperd/sslgetcert.c | 8 ++++---- - eperd/traceroute.c | 8 ++++---- - miscutils/perd.c | 4 ++-- - networking/httppost.c | 30 +++++++++++++++--------------- - networking/rptaddrs.c | 2 +- - 10 files changed, 44 insertions(+), 42 deletions(-) - ---- a/coreutils/condmv.c -+++ b/coreutils/condmv.c -@@ -149,7 +149,8 @@ int condmv_main(int argc, char *argv[]) - rebased_from, strerror(errno)); - goto err; - } -- if (fprintf(file, "%s %lu %s\n", opt_add, mytime, from) < 0) -+ if (fprintf(file, "%s %llu %s\n", opt_add, -+ (unsigned long long)mytime, from) < 0) - { - fprintf(stderr, - "condmv: unable to append to '%s': %s\n", ---- a/eperd/condmv.c -+++ b/eperd/condmv.c -@@ -99,8 +99,8 @@ static void condmv_start(void *state) - - len= strlen(condmvstate->to) + 20; - to= malloc(len); -- snprintf(to, len, "%s.%ld", condmvstate->to, -- (long)time(NULL)/condmvstate->interval); -+ snprintf(to, len, "%s.%llu", condmvstate->to, -+ (unsigned long long)time(NULL)/condmvstate->interval); - - crondlog(LVL7 "condmv_start: destination '%s'\n", to); - -@@ -124,7 +124,8 @@ static void condmv_start(void *state) - free(to); - return; - } -- if (fprintf(file, "%s %lu %s\n", condmvstate->atlas, mytime, -+ if (fprintf(file, "%s %llu %s\n", condmvstate->atlas, -+ (unsigned long long)mytime, - condmvstate->from) < 0) - { - crondlog(LVL9 "condmv: unable to append to '%s': %s\n", ---- a/eperd/evtdig.c -+++ b/eperd/evtdig.c -@@ -1009,7 +1009,7 @@ static int mk_dns_buff(struct query_stat - lookup_prepend = xzalloc(DEFAULT_LINE_LENGTH + sizeof(qry->lookupname)); - snprintf(lookup_prepend, (sizeof(qry->lookupname) + - DEFAULT_LINE_LENGTH - 1), -- "%d.%lu.%s", probe_id, qry->xmit_time, -+ "%d.%llu.%s", probe_id, (unsigned long long)qry->xmit_time, - qry->lookupname); - - qnamelen= ChangetoDnsNameFormat(qname, qnamelen, -@@ -3081,7 +3081,7 @@ static void tdig_stats(int unusg_statsed - AS(atlas_get_version_json_str()); - AS(", "); - gettimeofday(&now, NULL); -- JS1(time, %ld, now.tv_sec); -+ JS1(time, %llu, (unsigned long long)now.tv_sec); - JU(sok , base->sentok); - JU(rok , base->recvok); - JU(sent , base->sentbytes); -@@ -3395,7 +3395,7 @@ void printErrorQuick (struct query_state - fprintf(fh, "RESULT { "); - fprintf(fh, "%s,", atlas_get_version_json_str()); - fprintf(fh, "\"id\" : 9202 ,"); -- fprintf(fh, "\"time\" : %ld ,", atlas_time()); -+ fprintf(fh, "\"time\" : %llu ,", (unsigned long long)atlas_time()); - - fprintf(fh, "\"error\" : [{ "); - fprintf(fh, "\"query busy\": \"not starting a new one. previous one is not done yet\"}"); -@@ -3405,7 +3405,7 @@ void printErrorQuick (struct query_state - fprintf(fh, "\"id\" : \"%s\"", qry->str_Atlas); - if (qry->str_bundle) - fprintf(fh, ",\"bundle\" : %s", qry->str_bundle); -- fprintf(fh, ",\"start time\" : %ld", qry->xmit_time); -+ fprintf(fh, ",\"start time\" : %llu", (unsigned long long)qry->xmit_time); - if(qry->retry) { - fprintf(fh, ",\"retry\": %d", qry->retry); - -@@ -3456,7 +3456,7 @@ void printReply(struct query_state *qry, - AS(atlas_get_version_json_str()); - AS(", "); - if (qry->opt_rset){ -- JS1(time, %ld, qry->xmit_time); -+ JS1(time, %llu, (unsigned long long)qry->xmit_time); - JD(lts,lts); - AS("\"resultset\" : [ {"); - } -@@ -3466,7 +3466,7 @@ void printReply(struct query_state *qry, - AS (",{"); - } - -- JS1(time, %ld, qry->xmit_time); -+ JS1(time, %llu, (unsigned long long)qry->xmit_time); - JD(lts,lts); - - if (qry->opt_do_tls && ssl_version != NULL) ---- a/eperd/httpget.c -+++ b/eperd/httpget.c -@@ -853,10 +853,10 @@ static void report(struct hgstate *state - fprintf(fh, DBQ(id) ":" DBQ(%s) ", " - "%s, " - DBQ(lts) ":%d, " -- DBQ(time) ":%ld, ", -+ DBQ(time) ":%llu, ", - state->atlas, atlas_get_version_json_str(), - get_timesync(), -- state->gstart); -+ (unsigned long long)state->gstart); - if (state->bundle) - { - fprintf(fh, DBQ(bundle) ":%s, ", -@@ -876,8 +876,8 @@ static void report(struct hgstate *state - { - if (state->do_combine) - { -- snprintf(line, sizeof(line), DBQ(time) ":%ld, ", -- state->start.tv_sec); -+ snprintf(line, sizeof(line), DBQ(time) ":%llu, ", -+ (unsigned long long)state->start.tv_sec); - } - else - { ---- a/eperd/ntp.c -+++ b/eperd/ntp.c -@@ -366,10 +366,10 @@ static void report(struct ntpstate *stat - fprintf(fh, DBQ(id) ":" DBQ(%s) - ", %s" - ", " DBQ(lts) ":%d" -- ", " DBQ(time) ":%ld, ", -+ ", " DBQ(time) ":%llu, ", - state->atlas, atlas_get_version_json_str(), - get_timesync(), -- state->starttime); -+ (unsigned long long)state->starttime); - if (state->bundle) - fprintf(fh, DBQ(bundle) ":%s, ", state->bundle); - } ---- a/eperd/sslgetcert.c -+++ b/eperd/sslgetcert.c -@@ -1026,9 +1026,9 @@ static void report(struct state *state) - fprintf(fh, DBQ(id) ":" DBQ(%s) ", " - "%s, " - DBQ(lts) ":%d, " -- DBQ(time) ":%ld, ", -+ DBQ(time) ":%llu, ", - state->atlas, atlas_get_version_json_str(), -- get_timesync(), state->gstart); -+ get_timesync(), (unsigned long long)state->gstart); - if (state->bundle) - fprintf(fh, DBQ(bundle) ":%s, ", state->bundle); - } -@@ -1185,8 +1185,8 @@ static FILE *report_head(struct state *s - fprintf(fh, DBQ(bundle) ":%s, ", state->bundle); - } - -- fprintf(fh, "%s" DBQ(time) ":%ld", -- state->atlas ? ", " : "", atlas_time()); -+ fprintf(fh, "%s" DBQ(time) ":%llu", -+ state->atlas ? ", " : "", (unsigned long long)atlas_time()); - fprintf(fh, ", " DBQ(dst_name) ":" DBQ(%s) ", " - DBQ(dst_port) ":" DBQ(%s), - state->hostname, state->portname); ---- a/eperd/traceroute.c -+++ b/eperd/traceroute.c -@@ -362,12 +362,12 @@ static void report(struct trtstate *stat - fprintf(fh, DBQ(id) ":" DBQ(%s) - ", %s" - ", " DBQ(lts) ":%d" -- ", " DBQ(time) ":%ld" -- ", " DBQ(endtime) ":%ld, ", -+ ", " DBQ(time) ":%llu" -+ ", " DBQ(endtime) ":%llu, ", - state->atlas, atlas_get_version_json_str(), - get_timesync(), -- state->starttime, -- (long)atlas_time()); -+ (unsigned long long)state->starttime, -+ (unsigned long long)atlas_time()); - if (state->bundle_id) - fprintf(fh, DBQ(bundle) ":%s, ", state->bundle_id); - } ---- a/miscutils/perd.c -+++ b/miscutils/perd.c -@@ -1197,8 +1197,8 @@ error: - fprintf(fn, "RESULT { "); - if (atlas_id) - fprintf(fn, DBQ(id) ":" DBQ(%s) ", ", atlas_id); -- fprintf(fn, "%s, " DBQ(time) ":%d, ", -- atlas_get_version_json_str(), time(NULL)); -+ fprintf(fn, "%s, " DBQ(time) ":%llu, ", -+ atlas_get_version_json_str(), (unsigned long long)time(NULL)); - if (reason != NULL) - fprintf(fn, DBQ(reason) ":" DBQ(%s) ", ", reason); - fprintf(fn, DBQ(err) ":%d, " DBQ(cmd) ": \"", r); ---- a/networking/httppost.c -+++ b/networking/httppost.c -@@ -492,32 +492,32 @@ int httppost_main(int argc, char *argv[] - if (need_set_time && getenv("HTTPPOST_ALLOW_STIME")) - { - fprintf(stderr, -- "setting time, time difference is %ld\n", -- (long)server_time-now.tv_sec); -+ "setting time, time difference is %llu\n", -+ (unsigned long long)server_time-now.tv_sec); - ts.tv_sec= server_time; - ts.tv_nsec= 0; - clock_settime(CLOCK_REALTIME, &ts); - if (atlas_id) - { - printf( -- "RESULT %s ongoing %ld httppost setting time, local %ld, remote %ld\n", -- atlas_id, (long)time(NULL), -- (long)now.tv_sec, -- (long)server_time); -+ "RESULT %s ongoing %llu httppost setting time, local %llu, remote %llu\n", -+ atlas_id, (unsigned long long)time(NULL), -+ (unsigned long long)now.tv_sec, -+ (unsigned long long)server_time); - } - } - else if (need_set_time) - { - fprintf(stderr, -- "not setting time, time difference is %ld\n", -- (long)server_time-now.tv_sec); -+ "not setting time, time difference is %llu\n", -+ (unsigned long long)server_time-now.tv_sec); - if (atlas_id) - { - printf( -- "RESULT %s ongoing %ld httppost not in sync, local %ld, remote %ld\n", -- atlas_id, (long)time(NULL), -- (long)now.tv_sec, -- (long)server_time); -+ "RESULT %s ongoing %llu httppost not in sync, local %llu, remote %llu\n", -+ atlas_id, (unsigned long long)time(NULL), -+ (unsigned long long)now.tv_sec, -+ (unsigned long long)server_time); - } - } - else if (rtt <= 1) -@@ -528,7 +528,7 @@ int httppost_main(int argc, char *argv[] - fh= fopen(fn_new, "wt"); - if (fh) - { -- fprintf(fh, "%ld\n", (long)now.tv_sec); -+ fprintf(fh, "%llu\n", (unsigned long long)now.tv_sec); - fclose(fh); - rename(fn_new, fn); - } -@@ -537,8 +537,8 @@ int httppost_main(int argc, char *argv[] - } - else if (atlas_id) - { -- printf("RESULT %s ongoing %ld httppost rtt %g ms\n", -- atlas_id, (long)time(NULL), rtt*1000); -+ printf("RESULT %s ongoing %llu httppost rtt %g ms\n", -+ atlas_id, (unsigned long long)time(NULL), rtt*1000); - } - } - ---- a/networking/rptaddrs.c -+++ b/networking/rptaddrs.c -@@ -802,7 +802,7 @@ static int rpt_ipv6(char *cache_name, ch - JS(id, opt_atlas); - } - gettimeofday(&now, NULL); -- JS1(time, %ld, now.tv_sec); -+ JS1(time, %llu, (unsigned long long)now.tv_sec); - - /* Copy all lines */ - while (fgets(buf, sizeof(buf), file) != NULL) diff --git a/net/atlas-probe/patches/005-Mute-some-no-previous-prototype-compilation-warning.patch b/net/atlas-probe/patches/005-Mute-some-no-previous-prototype-compilation-warning.patch deleted file mode 100644 index 3a1d7649..00000000 --- a/net/atlas-probe/patches/005-Mute-some-no-previous-prototype-compilation-warning.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 25f131be221c5b2f8cb4f0c2a32f522415bb3bbf Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Mon, 17 Oct 2022 20:15:30 +0200 -Subject: [PATCH] Mute some no previous prototype compilation warning - -Mute some no previous prototype compilation warning found in -atlas_unsafe, rxtxrpt_main and route_set_flags. - -Signed-off-by: Christian Marangi ---- - include/libbb.h | 2 ++ - libbb/route_set_flags.c | 2 ++ - 2 files changed, 4 insertions(+) - ---- a/include/libbb.h -+++ b/include/libbb.h -@@ -463,6 +463,7 @@ char *is_suffixed_with(const char *strin - #define ATLAS_TIMESYNC_FILE_REL ATLAS_DATA_NEW_REL "/timesync.vol" - #define ATLAS_FUZZING_REL "data" - -+extern int atlas_unsafe(void); - extern char *rebased_validated_filename(const char *path, const char *prefix); - extern char *rebased_validated_dir(const char *path, const char *prefix); - extern int validate_atlas_id(const char *atlas_id); -@@ -484,6 +485,7 @@ extern void read_response(int fd, int ty - extern void read_response_file(FILE *file, int type, size_t *sizep, - void *data); - extern void write_response(FILE *file, int type, size_t size, void *data); -+extern int rxtxrpt_main(int argc, char *argv[]); - - int ndelay_on(int fd) FAST_FUNC; - int ndelay_off(int fd) FAST_FUNC; ---- a/libbb/route_set_flags.c -+++ b/libbb/route_set_flags.c -@@ -1,6 +1,8 @@ - #include - #include - -+#include "libbb.h" -+ - static const - IF_NOT_FEATURE_IPV6(uint16_t) - IF_FEATURE_IPV6(unsigned) diff --git a/net/atlas-probe/patches/006-Cast-sockaddr_in6-to-sockaddr-to-mute-compilation-wa.patch b/net/atlas-probe/patches/006-Cast-sockaddr_in6-to-sockaddr-to-mute-compilation-wa.patch deleted file mode 100644 index 24b164b3..00000000 --- a/net/atlas-probe/patches/006-Cast-sockaddr_in6-to-sockaddr-to-mute-compilation-wa.patch +++ /dev/null @@ -1,137 +0,0 @@ -From dba9e1b7707c9cc9f5804b7a5cbda32a08e9e18f Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Mon, 17 Oct 2022 20:00:24 +0200 -Subject: [PATCH] Cast sockaddr_in6 to sockaddr to mute compilation warning - -Cast sockaddr_in6 to sockaddr to mute compilation warning as -documentation say for getsockname. - -Signed-off-by: Christian Marangi ---- - eperd/evtdig.c | 3 ++- - eperd/httpget.c | 3 ++- - eperd/ntp.c | 4 ++-- - eperd/ping.c | 12 ++++++++---- - eperd/sslgetcert.c | 3 ++- - eperd/traceroute.c | 2 +- - networking/rptra6.c | 2 +- - 7 files changed, 18 insertions(+), 11 deletions(-) - ---- a/eperd/evtdig.c -+++ b/eperd/evtdig.c -@@ -1612,7 +1612,8 @@ static void tcp_connected(struct tu_env - } - else - { -- getsockname(bufferevent_getfd(bev), &qry->loc_sin6, &qry->loc_socklen); -+ getsockname(bufferevent_getfd(bev), -+ (struct sockaddr *)&qry->loc_sin6, &qry->loc_socklen); - if (qry->response_out) - { - write_response(qry->resp_file, RESP_SOCKNAME, ---- a/eperd/httpget.c -+++ b/eperd/httpget.c -@@ -2103,7 +2103,8 @@ static void connected(struct tu_env *env - else - { - getsockname(bufferevent_getfd(bev), -- &state->loc_sin6, &state->loc_socklen); -+ (struct sockaddr *)&state->loc_sin6, -+ &state->loc_socklen); - if (state->response_out) - { - write_response(state->resp_file, RESP_SOCKNAME, ---- a/eperd/ntp.c -+++ b/eperd/ntp.c -@@ -1218,13 +1218,13 @@ static int create_socket(struct ntpstate - - len= sizeof(state->loc_sin6); - read_response(state->socket, RESP_SOCKNAME, -- &len, &state->loc_sin6); -+ &len, (struct sockaddr *)&state->loc_sin6); - state->loc_socklen= len; - } - else - { - if (getsockname(state->socket, -- &state->loc_sin6, -+ (struct sockaddr*)&state->loc_sin6, - &state->loc_socklen) == -1) - { - crondlog(DIE9 "getsockname failed"); ---- a/eperd/ping.c -+++ b/eperd/ping.c -@@ -703,7 +703,8 @@ static void ping_xmit(struct pingstate * - } - else - { -- getsockname(host->socket, &host->loc_sin6, -+ getsockname(host->socket, -+ (struct sockaddr *)&host->loc_sin6, - &host->loc_socklen); - if (host->resp_file_out) - { -@@ -735,7 +736,8 @@ static void ping_xmit(struct pingstate * - host->include_probe_id); - - host->loc_socklen= sizeof(host->loc_sin6); -- getsockname(host->socket, &host->loc_sin6, &host->loc_socklen); -+ getsockname(host->socket, (struct sockaddr *)&host->loc_sin6, -+ &host->loc_socklen); - - if (host->response_in) - { -@@ -1567,7 +1569,8 @@ static void ping_start2(void *state) - } - - if (!pingstate->response_in && -- connect(pingstate->socket, &pingstate->sin6, -+ connect(pingstate->socket, -+ (struct sockaddr *)&pingstate->sin6, - pingstate->socklen) == -1) - { - snprintf(line, sizeof(line), -@@ -1592,7 +1595,8 @@ static void ping_start2(void *state) - } - else - { -- getsockname(pingstate->socket, &pingstate->loc_sin6, -+ getsockname(pingstate->socket, -+ (struct sockaddr *)&pingstate->loc_sin6, - &pingstate->loc_socklen); - if (pingstate->resp_file_out) - { ---- a/eperd/sslgetcert.c -+++ b/eperd/sslgetcert.c -@@ -1801,7 +1801,8 @@ static void connected(struct tu_env *env - else - { - getsockname(bufferevent_getfd(bev), -- &state->loc_sin6, &state->loc_socklen); -+ (struct sockaddr *)&state->loc_sin6, -+ &state->loc_socklen); - if (state->response_out) - { - write_response(state->resp_file, RESP_SOCKNAME, ---- a/eperd/traceroute.c -+++ b/eperd/traceroute.c -@@ -4631,7 +4631,7 @@ static int create_socket(struct trtstate - { - state->loc_socklen= sizeof(state->loc_sin6); - if (!state->response_in && getsockname(state->socket_icmp, -- &state->loc_sin6, -+ (struct sockaddr *)&state->loc_sin6, - &state->loc_socklen) == -1) - { - crondlog(DIE9 "getsockname failed"); ---- a/networking/rptra6.c -+++ b/networking/rptra6.c -@@ -441,7 +441,7 @@ static int send_sol(int sock) - inet_pton(AF_INET6, "FF02::2", &sin6.sin6_addr); - sin6.sin6_family= AF_INET6; - -- sendto(sock, &pkt, sizeof(pkt), 0, &sin6, sizeof(sin6)); -+ sendto(sock, &pkt, sizeof(pkt), 0, (struct sockaddr*)&sin6, sizeof(sin6)); - - alarm(RTR_SOLICITATION_INTERVAL); - diff --git a/net/atlas-probe/patches/007-Cast-size_t-to-long-to-mute-warning-on-32bit-systems.patch b/net/atlas-probe/patches/007-Cast-size_t-to-long-to-mute-warning-on-32bit-systems.patch deleted file mode 100644 index 0e2d3cb7..00000000 --- a/net/atlas-probe/patches/007-Cast-size_t-to-long-to-mute-warning-on-32bit-systems.patch +++ /dev/null @@ -1,83 +0,0 @@ -From d8bd85fba865508c0c6dff57b14c98f3ca70bbfc Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Mon, 17 Oct 2022 19:18:06 +0200 -Subject: [PATCH] Cast size_t to long to mute warning on 32bit systems - -Cast size_t to long to mute warning on 32bit systems. - -Signed-off-by: Christian Marangi ---- - eperd/evtdig.c | 10 +++++----- - eperd/sslgetcert.c | 2 +- - libbb/atlas_bb64.c | 2 +- - 3 files changed, 7 insertions(+), 7 deletions(-) - ---- a/eperd/evtdig.c -+++ b/eperd/evtdig.c -@@ -3792,7 +3792,7 @@ unsigned char* ReadName(unsigned char *b - /* Bad format */ - snprintf((char *)name, sizeof(name), - "format-error at %lu: value 0x%x", -- offset, len); -+ (unsigned long)offset, len); - *count= -1; - free(name); name= NULL; - return name; -@@ -3803,7 +3803,7 @@ unsigned char* ReadName(unsigned char *b - { - snprintf((char *)name, sizeof(name), - "offset-error at %lu: offset %lu", -- offset, noffset); -+ (unsigned long)offset, (unsigned long)noffset); - *count= -1; - free(name); name= NULL; - return name; -@@ -3814,7 +3814,7 @@ unsigned char* ReadName(unsigned char *b - /* Too many */ - snprintf((char *)name, sizeof(name), - "too many redirects at %lu", -- offset); -+ (unsigned long)offset); - *count= -1; - free(name); name= NULL; - return name; -@@ -3836,7 +3836,7 @@ unsigned char* ReadName(unsigned char *b - { - snprintf((char *)name, sizeof(name), - "buf-bounds-error at %lu: len %d", -- offset, len); -+ (unsigned long)offset, len); - *count= -1; - free(name); name= NULL; - return name; -@@ -3846,7 +3846,7 @@ unsigned char* ReadName(unsigned char *b - { - snprintf((char *)name, sizeof(name), - "name-length-error at %lu: len %d", -- offset, p+len+1); -+ (unsigned long)offset, p+len+1); - *count= -1; - free(name); name= NULL; - return name; ---- a/eperd/sslgetcert.c -+++ b/eperd/sslgetcert.c -@@ -182,7 +182,7 @@ static void buf_add(struct buf *buf, con - newbuf= malloc(maxsize); - if (!newbuf) - { -- fprintf(stderr, "unable to allocate %ld bytes\n", maxsize); -+ fprintf(stderr, "unable to allocate %ld bytes\n", (long)maxsize); - exit(1); - } - ---- a/libbb/atlas_bb64.c -+++ b/libbb/atlas_bb64.c -@@ -43,7 +43,7 @@ int buf_add(struct buf *buf, const void - newbuf= malloc(maxsize); - if (!newbuf) - { -- fprintf(stderr, "unable to allocate %ld bytes\n", maxsize); -+ fprintf(stderr, "unable to allocate %ld bytes\n", (long)maxsize); - return (1); - } - diff --git a/net/atlas-probe/patches/010-openssl.patch b/net/atlas-probe/patches/010-openssl.patch new file mode 100644 index 00000000..53965978 --- /dev/null +++ b/net/atlas-probe/patches/010-openssl.patch @@ -0,0 +1,25 @@ +--- a/libevent-2.1.11-stable/test/regress_ssl.c ++++ b/libevent-2.1.11-stable/test/regress_ssl.c +@@ -148,9 +148,9 @@ ssl_getcert(EVP_PKEY *key) + X509_set_issuer_name(x509, name); + X509_NAME_free(name); + +- X509_time_adj(X509_get_notBefore(x509), 0, &now); ++ X509_time_adj(X509_getm_notBefore(x509), 0, &now); + now += 3600; +- X509_time_adj(X509_get_notAfter(x509), 0, &now); ++ X509_time_adj(X509_getm_notAfter(x509), 0, &now); + X509_set_pubkey(x509, key); + tt_assert(0 != X509_sign(x509, key, EVP_sha1())); + +@@ -469,8 +469,8 @@ regress_bufferevent_openssl(void *arg) + type = (enum regress_openssl_type)data->setup_data; + + if (type & REGRESS_OPENSSL_RENEGOTIATE) { +- if (SSLeay() >= 0x10001000 && +- SSLeay() < 0x1000104f) { ++ if (OPENSSL_VERSION_NUMBER >= 0x10001000 && ++ OPENSSL_VERSION_NUMBER < 0x1000104f) { + /* 1.0.1 up to 1.0.1c has a bug where TLS1.1 and 1.2 + * can't renegotiate with themselves. Disable. */ + disable_tls_11_and_12 = 1; From 96aa43878c53bea513d0469fc2989b1f921e48bc Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Sun, 15 Jan 2023 13:18:35 +0100 Subject: [PATCH 032/102] atlas-sw-probe: update to version 5080 Signed-off-by: Josef Schlehofer --- net/atlas-sw-probe/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/atlas-sw-probe/Makefile b/net/atlas-sw-probe/Makefile index 4ea2e3ea..51b0256b 100644 --- a/net/atlas-sw-probe/Makefile +++ b/net/atlas-sw-probe/Makefile @@ -7,15 +7,15 @@ include $(TOPDIR)/rules.mk PKG_NAME:=atlas-sw-probe -PKG_VERSION:=5040 +PKG_VERSION:=5080 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/RIPE-NCC/ripe-atlas-software-probe.git PKG_SOURCE:=ripe-atlas-software-probe-$(PKG_VERSION).tar.gz -PKG_MIRROR_HASH:=fed1d6fa1f513e72d7266098dd74232741e2d70aea583f23e7e85521c971c6fc -PKG_SOURCE_VERSION:=193daa18cc305c0194045e2d24d004b5116f041a +PKG_MIRROR_HASH:=ad8b012803f98abbf1594384c5a4e27de9e9c112d43da272e73dd10591a566e1 +PKG_SOURCE_VERSION:=67b0736887d33d1c42557e7c7694cbd4e5d8e6ee PKG_MAINTAINER:=Jan Pavlinec PKG_LICENSE:=GPL-3.0-or-later From 99059105fc3e07b6c7d7575e964296328f1cf17a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 13 Jan 2023 19:09:00 -0800 Subject: [PATCH 033/102] foolsm: update to 1.0.21 Signed-off-by: Rosen Penev --- net/foolsm/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/foolsm/Makefile b/net/foolsm/Makefile index 5e60cdfd..2d67aa6e 100644 --- a/net/foolsm/Makefile +++ b/net/foolsm/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foolsm -PKG_VERSION:=1.0.13 -PKG_RELEASE:=2 +PKG_VERSION:=1.0.21 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://lsm.foobar.fi/download -PKG_HASH:=4eeda0e666e8ee93aab9b9c6709e9695e042dc391fb0999280874c8a73bce476 +PKG_SOURCE_URL:=https://lsm.foobar.fi/download +PKG_HASH:=527d9c363aa62b9fc511b42c5a06f774a8767c4b5330db4d959c10b46b0dede7 PKG_MAINTAINER:= PKG_LICENSE:=GPL-2.0-only From 62747ed72490dee3ba351448b4e07f75aade69a6 Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Wed, 18 Jan 2023 13:00:54 +0100 Subject: [PATCH 034/102] git: update to 2.34.6 Fixes CVE-2022-23521 Fixes CVE-2022-41903 Fixes CVE-2022-39260 Fixes CVE-2022-39253 Fixes CVE-2022-29187 Signed-off-by: Michal Vasilek --- net/git/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/git/Makefile b/net/git/Makefile index af31d27f..aa800e1f 100644 --- a/net/git/Makefile +++ b/net/git/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=git -PKG_VERSION:=2.34.3 +PKG_VERSION:=2.34.6 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/software/scm/git/ -PKG_HASH:=648e2f753a4360984d437f9038cb4649442fb5be846950bcaaca006b75c78418 +PKG_HASH:=ed2c17ea71cacac9b92835e74edef7b26ed5bc85bb25e954adb0efa12fbfcf69 PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=COPYING From 420b42fab921a0c4a29e0cb7d0671984f3618356 Mon Sep 17 00:00:00 2001 From: Daniel Bermond Date: Wed, 11 Jan 2023 14:30:48 -0300 Subject: [PATCH 035/102] i2pd: update to version 2.45.0 Maintainer : @yangfl (David Yang) Build system : Arch Linux x86_64 Build tested : r7800 OpenWrt git master (r21756, commit 55c32a6ce3) Run tested : r7800 OpenWrt git master (r21756, commit 55c32a6ce3) Signed-off-by: Daniel Bermond --- net/i2pd/Makefile | 6 +++--- net/i2pd/patches/010-config.patch | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/net/i2pd/Makefile b/net/i2pd/Makefile index 5dcf4d3a..146aa669 100644 --- a/net/i2pd/Makefile +++ b/net/i2pd/Makefile @@ -10,13 +10,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=i2pd -PKG_VERSION:=2.43.0 -PKG_RELEASE:=$(AUTORELEASE) +PKG_VERSION:=2.45.0 +PKG_RELEASE:=1 PKG_BUILD_PARALLEL:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/PurpleI2P/i2pd/tar.gz/$(PKG_VERSION)? -PKG_HASH:=db1679653491a411dd16fa329488d840296c8f680e0691f9fe0d0e796e5d7bca +PKG_HASH:=4050c0a38fda06a76defbd2721f468f5b09889ed7b6b5a7e207e4659d300738f PKG_MAINTAINER:=David Yang PKG_LICENSE:=BSD-3-Clause diff --git a/net/i2pd/patches/010-config.patch b/net/i2pd/patches/010-config.patch index f3e52cf6..3b08cc38 100644 --- a/net/i2pd/patches/010-config.patch +++ b/net/i2pd/patches/010-config.patch @@ -29,7 +29,7 @@ ## Write full CLF-formatted date and time to log (default: write only time) # logclftime = true -@@ -115,9 +115,9 @@ published = true +@@ -115,9 +115,9 @@ ssu = false [http] ## Web Console settings ## Uncomment and set to 'false' to disable Web Console @@ -83,11 +83,11 @@ ## Name i2pd appears in UPnP forwardings list (default = I2Pd) # name = I2Pd -@@ -238,7 +238,7 @@ verify = true - +@@ -239,7 +239,7 @@ verify = true [limits] - ## Maximum active transit sessions (default:2500) --# transittunnels = 2500 + ## Maximum active transit sessions (default: 5000) + ## This value is doubled if floodfill mode is enabled! +-# transittunnels = 5000 +transittunnels = 500 ## Limit number of open file descriptors (0 - use system limit) # openfiles = 0 From 3914f223c43f09248c2acfdb29b674d8070d77eb Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Tue, 20 Dec 2022 10:05:04 -0300 Subject: [PATCH 036/102] libreswan: set DNSSEC_ROOTKEY_FILE, LINUX_VARIANT Libreswan will set DEFAULT_DNSSEC_ROOTKEY_FILE from the LINUX_VARIANT variable, which is taken from the ID field in /etc/os-release. This points to the host file, which is wrong. Set both variables when calling make. Signed-off-by: Eneas U de Queiroz --- net/libreswan/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/libreswan/Makefile b/net/libreswan/Makefile index bcc4c0f4..cbbb33ca 100644 --- a/net/libreswan/Makefile +++ b/net/libreswan/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libreswan PKG_VERSION:=4.9 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://download.libreswan.org/ @@ -84,9 +84,11 @@ MAKE_FLAGS+= \ PREFIX="/usr" \ FINALRUNDIR="/var/run/pluto" \ FINALNSSDIR="/etc/ipsec.d" \ + DEFAULT_DNSSEC_ROOTKEY_FILE=/etc/unbound/root.key \ MODPROBEARGS="-q" \ OSDEP=linux \ BUILDENV=linux \ + LINUX_VARIANT="openwrt" \ ARCH="$(LINUX_KARCH)" \ define Build/Prepare From b3f76da0a8d0b213c453fb1eb741278ddfecb1d7 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 13 Jan 2023 18:22:36 -0800 Subject: [PATCH 037/102] netperf: use git tarball netperf.org is gone now. Only github is left. Signed-off-by: Rosen Penev --- net/netperf/Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/net/netperf/Makefile b/net/netperf/Makefile index 9564a4c6..fa889361 100644 --- a/net/netperf/Makefile +++ b/net/netperf/Makefile @@ -9,12 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=netperf PKG_VERSION:=2.7.0 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_LICENSE:=Custom -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=ftp://ftp.netperf.org/netperf/ -PKG_HASH:=842af17655835c8be7203808c3393e6cb327a8067f3ed1f1053eb78b4e40375a +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_URL:=https://github.com/HewlettPackard/netperf +PKG_MIRROR_HASH:=fa46ffc25a00c925167d96e4c57131b5b650ea725b12b69ff6feabec759b271d PKG_CPE_ID:=cpe:/a:netperf:netperf @@ -24,7 +25,7 @@ define Package/netperf SECTION:=net CATEGORY:=Network TITLE:=Network performance measurement tool - URL:=http://www.netperf.org/ + URL:=https://github.com/HewlettPackard/netperf MAINTAINER:=Toke Høiland-Jørgensen endef From f23801a21bdf07d3f1abb0a2bcdb20472e1fb19b Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 14 Jan 2023 13:41:22 -0800 Subject: [PATCH 038/102] rp-pppoe: update to 3.15 Signed-off-by: Rosen Penev --- net/rp-pppoe/Makefile | 6 +++--- net/rp-pppoe/patches/110-Makefile.patch | 2 +- net/rp-pppoe/patches/130-static-lib-fix.patch | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/net/rp-pppoe/Makefile b/net/rp-pppoe/Makefile index c5b6865e..f062765c 100644 --- a/net/rp-pppoe/Makefile +++ b/net/rp-pppoe/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rp-pppoe -PKG_VERSION:=3.14 -PKG_RELEASE:=3 +PKG_VERSION:=3.15 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://dianne.skoll.ca/projects/rp-pppoe/download -PKG_HASH:=7825232f64ab4d618ef074d62d145ae43d6edc91b9a718c6130a4742bac40e2a +PKG_HASH:=b1f318bc7e4e5b0fd8a8e23e8803f5e6e43165245a5a10a7162a92a6cf17829a PKG_MAINTAINER:= PKG_LICENSE:=LGPL-2.0-or-later diff --git a/net/rp-pppoe/patches/110-Makefile.patch b/net/rp-pppoe/patches/110-Makefile.patch index 0d4a341f..013c35b6 100644 --- a/net/rp-pppoe/patches/110-Makefile.patch +++ b/net/rp-pppoe/patches/110-Makefile.patch @@ -1,6 +1,6 @@ --- a/src/Makefile.in +++ b/src/Makefile.in -@@ -72,7 +72,7 @@ pppoe-sniff: pppoe-sniff.o if.o common.o +@@ -73,7 +73,7 @@ pppoe-sniff: pppoe-sniff.o if.o common.o @CC@ -o $@ $^ $(LDFLAGS) pppoe-server: pppoe-server.o if.o debug.o common.o md5.o libevent/libevent.a @PPPOE_SERVER_DEPS@ diff --git a/net/rp-pppoe/patches/130-static-lib-fix.patch b/net/rp-pppoe/patches/130-static-lib-fix.patch index 1221c2b4..d9a63da6 100644 --- a/net/rp-pppoe/patches/130-static-lib-fix.patch +++ b/net/rp-pppoe/patches/130-static-lib-fix.patch @@ -1,6 +1,6 @@ --- a/src/Makefile.in +++ b/src/Makefile.in -@@ -140,7 +140,8 @@ plugin/plugin.o: plugin.c +@@ -141,7 +141,8 @@ plugin/plugin.o: plugin.c @CC@ -DPLUGIN=1 '-DRP_VERSION="$(RP_VERSION)"' $(CFLAGS) -I$(PPPD_INCDIR) -c -o $@ -fPIC $< plugin/libplugin.a: plugin/discovery.o plugin/if.o plugin/common.o plugin/debug.o From 15e0870ea402e005d1fb43d4485be4f245536b50 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 5 Dec 2022 00:51:14 +0000 Subject: [PATCH 039/102] safe-search: fix use with dnsmasq in ujail The safe-search package creates symlinks in a configured additional hosts directory. The link targets are inside another directory which has to be made available to dnsmasq as well. Now that support for adding additional paths to dnsmasq was added by commit openwrt/openwrt@aa12a0fdd1c5a004281633c5b0758da1781bb41c implement adding this path using the existing uci-defaults script. Signed-off-by: Daniel Golle --- net/safe-search/Makefile | 2 +- net/safe-search/files/safe-search.defaults | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/net/safe-search/Makefile b/net/safe-search/Makefile index b8afee5d..1492db09 100644 --- a/net/safe-search/Makefile +++ b/net/safe-search/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=safe-search PKG_VERSION:=2.0.1 -PKG_RELEASE:=$(AUTORELEASE) +PKG_RELEASE:=11 PKG_LICENSE:=MIT PKG_MAINTAINER:=Gregory L. Dietsche diff --git a/net/safe-search/files/safe-search.defaults b/net/safe-search/files/safe-search.defaults index 063e84cc..e7f4d052 100644 --- a/net/safe-search/files/safe-search.defaults +++ b/net/safe-search/files/safe-search.defaults @@ -5,6 +5,8 @@ # uci del_list dhcp.@dnsmasq[0].addnhosts=/etc/safe-search/enabled uci add_list dhcp.@dnsmasq[0].addnhosts=/etc/safe-search/enabled +uci del_list dhcp.@dnsmasq[0].addn_mount=/etc/safe-search/available +uci add_list dhcp.@dnsmasq[0].addn_mount=/etc/safe-search/available uci commit dhcp /usr/sbin/safe-search-maintenance From 75b4644f46f150b4259df2b4a0b2740ab5f4cf5e Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 14 Jan 2023 14:26:04 -0800 Subject: [PATCH 040/102] socat: update to 1.7.4.4 Signed-off-by: Rosen Penev --- net/socat/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/socat/Makefile b/net/socat/Makefile index b9b7ba88..2f3ca78f 100644 --- a/net/socat/Makefile +++ b/net/socat/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=socat -PKG_VERSION:=1.7.4.1 +PKG_VERSION:=1.7.4.4 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://www.dest-unreach.org/socat/download -PKG_HASH:=3faca25614e89123dff5045680549ecef519d02e331aaf3c4f5a8f6837c675e9 +PKG_HASH:=fbd42bd2f0e54a3af6d01bdf15385384ab82dbc0e4f1a5e153b3e0be1b6380ac PKG_MAINTAINER:=Ted Hess PKG_LICENSE:=GPL-2.0-or-later OpenSSL From 09247da8c2c39557fd0245259cc55d17d3e0de76 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 14 Jan 2023 15:05:01 -0800 Subject: [PATCH 041/102] xinetd: fix URL Something went wrong here. Switch to git tarballs. Signed-off-by: Rosen Penev --- net/xinetd/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/xinetd/Makefile b/net/xinetd/Makefile index 1d52a1b5..9ac1f1cd 100644 --- a/net/xinetd/Makefile +++ b/net/xinetd/Makefile @@ -9,11 +9,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xinetd PKG_VERSION:=2.3.15 -PKG_RELEASE:=14 +PKG_RELEASE:=15 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/xinetd-org/xinetd/archive -PKG_HASH:=bf4e060411c75605e4dcbdf2ac57c6bd9e1904470a2f91e01ba31b50a80a5be3 +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=$(PKG_NAME)-2-3-15 +PKG_SOURCE_URL:=https://github.com/xinetd-org/xinetd +PKG_MIRROR_HASH:=ef2258416a278ec7aebaa1e3501c0b59f5ae5e0ea7f1f0220b20143eb208881f PKG_MAINTAINER:=Florian Eckert PKG_LICENSE:=xinetd From 0814072a63481c8b15e2675563962cebeb7cfee9 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 27 Nov 2022 17:13:32 -0800 Subject: [PATCH 042/102] mpd: update to 0.23.11 Signed-off-by: Rosen Penev --- sound/mpd/Makefile | 6 +++--- sound/mpd/patches/010-gcc12.patch | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 sound/mpd/patches/010-gcc12.patch diff --git a/sound/mpd/Makefile b/sound/mpd/Makefile index 3f08da07..b330a8ae 100644 --- a/sound/mpd/Makefile +++ b/sound/mpd/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mpd -PKG_VERSION:=0.23.9 -PKG_RELEASE:=$(AUTORELEASE) +PKG_VERSION:=0.23.11 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://www.musicpd.org/download/mpd/0.23 -PKG_HASH:=2becaba980402e8dc7972ccc3476e493b7ae2eeb720d31fa6712472ed48e9f2d +PKG_HASH:=edb4e7a8f9dff238b5610f9e2461940ea98c727a5462fafb1cdf836304dfdca9 PKG_MAINTAINER:= PKG_LICENSE:=GPL-2.0-or-later diff --git a/sound/mpd/patches/010-gcc12.patch b/sound/mpd/patches/010-gcc12.patch new file mode 100644 index 00000000..a3b83b5d --- /dev/null +++ b/sound/mpd/patches/010-gcc12.patch @@ -0,0 +1,30 @@ +From e4b055eb6d08c5c8f8d85828ce4005d410e462cb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= + +Date: Thu, 1 Dec 2022 08:29:23 +0700 +Subject: [PATCH] v0.23.x: RemoteTagCache: add missing include + +Fix build with Boost 1.81.0. `` was included by one of those boost headers, +however, it's no longer included as of Boost 1.81.0. + +`master` doesn't use `std::array` in this file. + +While we're at it, add all necessary inclusion files. +--- + src/RemoteTagCache.hxx | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/src/RemoteTagCache.hxx ++++ b/src/RemoteTagCache.hxx +@@ -28,7 +28,11 @@ + #include + #include + ++#include ++#include ++#include + #include ++#include + + class RemoteTagCacheHandler; + From c8b25b033b8e99e3fd8967ede62a5a2beeaee2fd Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Mon, 9 Jan 2023 14:39:52 +0100 Subject: [PATCH 043/102] acpica-unix: update to 20221020 The latest upstream version has an incorrect file name (tar_0.gz). Therefore, there is an error when unpacking the acrhive, as this is not recognised correctly. To fix this, PKG_CAT is set. Signed-off-by: Florian Eckert --- utils/acpica-unix/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/acpica-unix/Makefile b/utils/acpica-unix/Makefile index 563f83ee..7548dfee 100644 --- a/utils/acpica-unix/Makefile +++ b/utils/acpica-unix/Makefile @@ -8,12 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=acpica-unix -PKG_VERSION:=20211217 +PKG_VERSION:=20221020 PKG_RELEASE:=$(AUTORELEASE) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://acpica.org/sites/$(patsubst %-unix,%,$(PKG_NAME))/files/$(PKG_SOURCE_URL) -PKG_HASH:=2511f85828820d747fa3e2c3433d3a38c22db3d9c2fd900e1a84eb4173cb5992 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar_0.gz +PKG_CAT:=gzip -dc +PKG_SOURCE_URL:=https://acpica.org/sites/$(patsubst %-unix,%,$(PKG_NAME))/files/ +PKG_HASH:=33a2e394aca0ca57d4018afe3da340dfad5eb45b1b9300e81dd595fda07cf1c5 PKG_MAINTAINER:=Philip Prindeville PKG_LICENSE:=GPL-2.0 From 746a5a1f7c3c7354df5b837f725585490c3d8bd0 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Mon, 9 Jan 2023 14:45:04 +0100 Subject: [PATCH 044/102] acpica-unix: remove autorelease While we're at it, let's also remove the deprecated feature autorelease. Signed-off-by: Florian Eckert --- utils/acpica-unix/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/acpica-unix/Makefile b/utils/acpica-unix/Makefile index 7548dfee..5d508e46 100644 --- a/utils/acpica-unix/Makefile +++ b/utils/acpica-unix/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=acpica-unix PKG_VERSION:=20221020 -PKG_RELEASE:=$(AUTORELEASE) +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar_0.gz PKG_CAT:=gzip -dc From af275ffc3907016714f62a4e2e727cd7408aead1 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Mon, 9 Jan 2023 14:46:21 +0100 Subject: [PATCH 045/102] acpica-unix: backport pending patches to fix gcc12 build issue Due to the compiler change of openwrt, from gcc version 11 to gcc version 12, we have now the following build errors. ../../../source/components/utilities/utdebug.c: In function 'AcpiUtInitStackPtrTrace': ../../../source/components/utilities/utdebug.c:188:31: error: storing the address of local variable 'CurrentSp' in 'AcpiGbl_EntryStackPointer' [-Werror=dangling-pointer=] 188 | AcpiGbl_EntryStackPointer = &CurrentSp; | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ ../../../source/components/utilities/utdebug.c:185:29: note: 'CurrentSp' declared here 185 | ACPI_SIZE CurrentSp; | ^~~~~~~~~ In file included from ../../../source/include/acpi.h:173, from ../../../source/components/utilities/utdebug.c:154: ../../../source/include/acglobal.h:335:41: note: 'AcpiGbl_EntryStackPointer' declared here 335 | ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_EntryStackPointer); | ^~~~~~~~~~~~~~~~~~~~~~~~~ ../../../source/include/acpixf.h:188:17: note: in definition of macro 'ACPI_GLOBAL' 188 | extern type name | ^~~~ cc1: all warnings being treated as errors make[4]: *** [../Makefile.rules:20: obj/utdebug.o] Error 1 This is already issue opend in the the upstream project acpica. https://github.com/acpica/acpica/issues/771 There is already a fix available, but it has not yet been merged. https://github.com/acpica/acpica/pull/776 Signed-off-by: Florian Eckert --- utils/acpica-unix/Makefile | 2 +- ...0001-ACPI_CAST_PTR-cast-through-void.patch | 22 +++++ ...-Use-use-uintptr_t-for-ACPI_UINTPTR_.patch | 37 ++++++++ ...UINT_PTR_T-to-store-stack-boundaries.patch | 85 +++++++++++++++++++ 4 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 utils/acpica-unix/patches/0001-ACPI_CAST_PTR-cast-through-void.patch create mode 100644 utils/acpica-unix/patches/0002-Linux-non-kernel-Use-use-uintptr_t-for-ACPI_UINTPTR_.patch create mode 100644 utils/acpica-unix/patches/0003-debug-use-UINT_PTR_T-to-store-stack-boundaries.patch diff --git a/utils/acpica-unix/Makefile b/utils/acpica-unix/Makefile index 5d508e46..10e5a4c1 100644 --- a/utils/acpica-unix/Makefile +++ b/utils/acpica-unix/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=acpica-unix PKG_VERSION:=20221020 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar_0.gz PKG_CAT:=gzip -dc diff --git a/utils/acpica-unix/patches/0001-ACPI_CAST_PTR-cast-through-void.patch b/utils/acpica-unix/patches/0001-ACPI_CAST_PTR-cast-through-void.patch new file mode 100644 index 00000000..71510df5 --- /dev/null +++ b/utils/acpica-unix/patches/0001-ACPI_CAST_PTR-cast-through-void.patch @@ -0,0 +1,22 @@ +From 0f814783ef9ed3a50e15cab08579218ec45b4640 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= +Date: Sat, 21 May 2022 12:15:16 +0200 +Subject: [PATCH 1/3] ACPI_CAST_PTR: cast through "void *" + +Not all pointer are castable to integers directly and ACPI_UINTPTR_T is +not guaranteed to be "void *". +--- + source/include/actypes.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/source/include/actypes.h ++++ b/source/include/actypes.h +@@ -649,7 +649,7 @@ typedef UINT64 + + /* Pointer manipulation */ + +-#define ACPI_CAST_PTR(t, p) ((t *) (ACPI_UINTPTR_T) (p)) ++#define ACPI_CAST_PTR(t, p) ((t *) (ACPI_UINTPTR_T) (void *) (p)) + #define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (ACPI_UINTPTR_T) (p)) + #define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) + (ACPI_SIZE)(b))) + #define ACPI_SUB_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) - (ACPI_SIZE)(b))) diff --git a/utils/acpica-unix/patches/0002-Linux-non-kernel-Use-use-uintptr_t-for-ACPI_UINTPTR_.patch b/utils/acpica-unix/patches/0002-Linux-non-kernel-Use-use-uintptr_t-for-ACPI_UINTPTR_.patch new file mode 100644 index 00000000..92fb3cdb --- /dev/null +++ b/utils/acpica-unix/patches/0002-Linux-non-kernel-Use-use-uintptr_t-for-ACPI_UINTPTR_.patch @@ -0,0 +1,37 @@ +From 6b7a78c41c04772a30923c8c0ba71770d55ac815 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= +Date: Sat, 21 May 2022 12:17:14 +0200 +Subject: [PATCH 2/3] Linux non-kernel: Use use uintptr_t for ACPI_UINTPTR_T + +--- + source/include/platform/aclinux.h | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/source/include/platform/aclinux.h ++++ b/source/include/platform/aclinux.h +@@ -168,6 +168,8 @@ + #define ACPI_USE_DO_WHILE_0 + #define ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS + ++#define ACPI_UINTPTR_T uintptr_t ++ + + #ifdef __KERNEL__ + +@@ -252,8 +254,6 @@ + #define ACPI_SPINLOCK spinlock_t * + #define ACPI_CPU_FLAGS unsigned long + +-#define ACPI_UINTPTR_T uintptr_t +- + #define ACPI_TO_INTEGER(p) ((uintptr_t)(p)) + #define ACPI_OFFSET(d, f) offsetof(d, f) + +@@ -311,6 +311,7 @@ + + #ifdef ACPI_USE_STANDARD_HEADERS + #include ++#include + #endif + + /* Define/disable kernel-specific declarators */ diff --git a/utils/acpica-unix/patches/0003-debug-use-UINT_PTR_T-to-store-stack-boundaries.patch b/utils/acpica-unix/patches/0003-debug-use-UINT_PTR_T-to-store-stack-boundaries.patch new file mode 100644 index 00000000..b0c1bef6 --- /dev/null +++ b/utils/acpica-unix/patches/0003-debug-use-UINT_PTR_T-to-store-stack-boundaries.patch @@ -0,0 +1,85 @@ +From 2185f7d5d7a5650dbcb6a05e9de41f340cd3b865 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= +Date: Sat, 21 May 2022 12:17:58 +0200 +Subject: [PATCH 3/3] debug: use UINT_PTR_T to store stack boundaries + +GCC12 complains about storing invalid pointers, store them as integers +instead. + +obj/acpiexec ../../../source/components/utilities/utdebug.c +../../../source/components/utilities/utdebug.c: In function 'AcpiUtInitStackPtrTrace': +../../../source/components/utilities/utdebug.c:188:31: error: storing the address of local variable 'CurrentSp' in 'AcpiGbl_EntryStackPointer' [-Werror=dangling-pointer=] + 188 | AcpiGbl_EntryStackPointer = &CurrentSp; + | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ +../../../source/components/utilities/utdebug.c:185:29: note: 'CurrentSp' declared here + 185 | ACPI_SIZE CurrentSp; + | ^~~~~~~~~ + +Fixes #771 +--- + source/components/debugger/dbstats.c | 4 ++-- + source/components/utilities/utdebug.c | 6 +++--- + source/components/utilities/utinit.c | 2 +- + source/include/acglobal.h | 4 ++-- + 4 files changed, 8 insertions(+), 8 deletions(-) + +--- a/source/components/debugger/dbstats.c ++++ b/source/components/debugger/dbstats.c +@@ -647,8 +647,8 @@ AcpiDbDisplayStatistics ( + AcpiGbl_EntryStackPointer, AcpiGbl_LowestStackPointer); + + AcpiOsPrintf ("\nSubsystem Stack Usage:\n\n"); +- AcpiOsPrintf ("Entry Stack Pointer %p\n", AcpiGbl_EntryStackPointer); +- AcpiOsPrintf ("Lowest Stack Pointer %p\n", AcpiGbl_LowestStackPointer); ++ AcpiOsPrintf ("Entry Stack Pointer %p\n", ACPI_TO_POINTER(AcpiGbl_EntryStackPointer)); ++ AcpiOsPrintf ("Lowest Stack Pointer %p\n", ACPI_TO_POINTER(AcpiGbl_LowestStackPointer)); + AcpiOsPrintf ("Stack Use %X (%u)\n", Temp, Temp); + AcpiOsPrintf ("Deepest Procedure Nesting %u\n", AcpiGbl_DeepestNesting); + #endif +--- a/source/components/utilities/utdebug.c ++++ b/source/components/utilities/utdebug.c +@@ -185,7 +185,7 @@ AcpiUtInitStackPtrTrace ( + ACPI_SIZE CurrentSp; + + +- AcpiGbl_EntryStackPointer = &CurrentSp; ++ AcpiGbl_EntryStackPointer = ACPI_TO_INTEGER(&CurrentSp); + } + + +@@ -208,9 +208,9 @@ AcpiUtTrackStackPtr ( + ACPI_SIZE CurrentSp; + + +- if (&CurrentSp < AcpiGbl_LowestStackPointer) ++ if (ACPI_TO_INTEGER(&CurrentSp) < AcpiGbl_LowestStackPointer) + { +- AcpiGbl_LowestStackPointer = &CurrentSp; ++ AcpiGbl_LowestStackPointer = ACPI_TO_INTEGER(&CurrentSp); + } + + if (AcpiGbl_NestingLevel > AcpiGbl_DeepestNesting) +--- a/source/components/utilities/utinit.c ++++ b/source/components/utilities/utinit.c +@@ -359,7 +359,7 @@ AcpiUtInitGlobals ( + #endif + + #ifdef ACPI_DEBUG_OUTPUT +- AcpiGbl_LowestStackPointer = ACPI_CAST_PTR (ACPI_SIZE, ACPI_SIZE_MAX); ++ AcpiGbl_LowestStackPointer = ACPI_SIZE_MAX; + #endif + + #ifdef ACPI_DBG_TRACK_ALLOCATIONS +--- a/source/include/acglobal.h ++++ b/source/include/acglobal.h +@@ -332,8 +332,8 @@ extern const ACPI_PREDEFINED_NAMES + ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeCount); + ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeSize); + ACPI_GLOBAL (UINT32, AcpiGbl_MaxConcurrentNodeCount); +-ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_EntryStackPointer); +-ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_LowestStackPointer); ++ACPI_GLOBAL (ACPI_UINTPTR_T, AcpiGbl_EntryStackPointer); ++ACPI_GLOBAL (ACPI_UINTPTR_T, AcpiGbl_LowestStackPointer); + ACPI_GLOBAL (UINT32, AcpiGbl_DeepestNesting); + ACPI_INIT_GLOBAL (UINT32, AcpiGbl_NestingLevel, 0); + #endif From efc9e5ce1e02495a8337e8802eabe87eeee57132 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 13 Jan 2023 17:28:33 -0800 Subject: [PATCH 046/102] bc: use @DEBIAN Seems Debian no longer offers ftp. Signed-off-by: Rosen Penev --- utils/bc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/bc/Makefile b/utils/bc/Makefile index f02285e8..14f9480e 100644 --- a/utils/bc/Makefile +++ b/utils/bc/Makefile @@ -12,7 +12,7 @@ PKG_VERSION:=1.06.95 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz -PKG_SOURCE_URL:=ftp://ftp.debian.org/debian/pool/main/b/bc +PKG_SOURCE_URL:=@DEBIAN/pool/main/b/bc PKG_HASH:=5e1471869dd27ba4120dd3942d2f4ec6646cf917fb056be9ae0d3a8259668d47 PKG_MAINTAINER:=Bruno Randolf From 73ed23a370e9fac61f4ef408a9ee70b1b07751f6 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 14 Jan 2023 02:35:28 +0000 Subject: [PATCH 047/102] bluez: update to version 5.66 ver 5.66: Fix issue with A2DP and transport connection collisions. Fix issue with allowing application specific error codes. Fix issue with not setting initiator flag correctly. Fix issue with HoG Report MAP size handling. Add initial support for Basic Audio Profile. Add initial support for Volume Control Profile. ver 5.65: Fix issue with A2DP cache invalidation handling. Fix issue with A2DP and not initialized SEP codec. Fix issue with A2DP and multiple SetConfiguration to same SEP Fix issue with AVRCP and not properly initialized volume. Fix issue with SDP records when operating in LE only mode. Fix issue with HoG and not reading report map of instances. Fix issue with GATT server crashing while disconnecting. Fix issue with not removing connected devices. Fix issue with enabling wake support without RPA Resolution. Fix issue with pairing failed due to the error of Already Paired. Add support for CONFIGURATION_DIRECTORY environment variable. Add support for STATE_DIRECTORY environment variable. Add support for "Bonded" property with Device API. Add experimental support for ISO socket. Package btmon in new package 'bluez-utils-btmon' to prevent adding glib2 it now requires as a dependency for all of bluez-utils. Signed-off-by: Daniel Golle --- utils/bluez/Makefile | 22 ++++++++++++---- ...-speed-must-be-reset-after-the-firmw.patch | 4 +-- ...-the-43xx-firmware-into-lib-firmware.patch | 10 +++---- utils/bluez/patches/201-readline.patch | 26 +++++++++---------- ...fresh_adv_manager_for_non-LE_devices.patch | 2 +- .../patches/210-util-define-MAX_INPUT.patch | 12 +++++++++ 6 files changed, 50 insertions(+), 26 deletions(-) create mode 100644 utils/bluez/patches/210-util-define-MAX_INPUT.patch diff --git a/utils/bluez/Makefile b/utils/bluez/Makefile index 588a2f1a..c585593c 100644 --- a/utils/bluez/Makefile +++ b/utils/bluez/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bluez -PKG_VERSION:=5.64 -PKG_RELEASE:=$(AUTORELEASE) +PKG_VERSION:=5.66 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/ -PKG_HASH:=ae437e65b6b3070c198bc5b0109fe9cdeb9eaa387380e2072f9de65fe8a1de34 +PKG_HASH:=39fea64b590c9492984a0c27a89fc203e1cdc74866086efb8f4698677ab2b574 PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=COPYING @@ -47,6 +47,14 @@ $(call Package/bluez/Default) DEPENDS:=+bluez-libs endef +define Package/bluez-utils-btmon +$(call Package/bluez/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE+= utilities + DEPENDS:=+bluez-libs +glib2 +endef + define Package/bluez-utils-extra $(call Package/bluez/Default) SECTION:=utils @@ -111,10 +119,8 @@ endef define Package/bluez-utils/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/bdaddr $(1)/usr/bin/ -# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/bccmd $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/bluemoon $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/btattach $(1)/usr/bin/ - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/btmon $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ciptool $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/hciattach $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/hciconfig $(1)/usr/bin/ @@ -127,6 +133,11 @@ define Package/bluez-utils/install $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rfcomm $(1)/usr/bin/ endef +define Package/bluez-utils-btmon/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/btmon $(1)/usr/bin/ +endef + define Package/bluez-utils-extra/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/btmgmt $(1)/usr/bin/ @@ -153,5 +164,6 @@ endef $(eval $(call BuildPackage,bluez-libs)) $(eval $(call BuildPackage,bluez-utils)) +$(eval $(call BuildPackage,bluez-utils-btmon)) $(eval $(call BuildPackage,bluez-utils-extra)) $(eval $(call BuildPackage,bluez-daemon)) diff --git a/utils/bluez/patches/002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch b/utils/bluez/patches/002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch index 3df63411..a2035304 100644 --- a/utils/bluez/patches/002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch +++ b/utils/bluez/patches/002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch @@ -10,7 +10,7 @@ Subject: [PATCH 2/4] bcm43xx: The UART speed must be reset after the firmware --- a/tools/hciattach_bcm43xx.c +++ b/tools/hciattach_bcm43xx.c -@@ -354,11 +354,8 @@ int bcm43xx_init(int fd, int def_speed, +@@ -350,11 +350,8 @@ int bcm43xx_init(int fd, int def_speed, return -1; if (bcm43xx_locate_patch(FIRMWARE_DIR, chip_name, fw_path)) { @@ -23,7 +23,7 @@ Subject: [PATCH 2/4] bcm43xx: The UART speed must be reset after the firmware if (bcm43xx_load_firmware(fd, fw_path)) return -1; -@@ -368,6 +365,7 @@ int bcm43xx_init(int fd, int def_speed, +@@ -364,6 +361,7 @@ int bcm43xx_init(int fd, int def_speed, return -1; } diff --git a/utils/bluez/patches/004-Move-the-43xx-firmware-into-lib-firmware.patch b/utils/bluez/patches/004-Move-the-43xx-firmware-into-lib-firmware.patch index 670d4304..cce53b32 100644 --- a/utils/bluez/patches/004-Move-the-43xx-firmware-into-lib-firmware.patch +++ b/utils/bluez/patches/004-Move-the-43xx-firmware-into-lib-firmware.patch @@ -7,14 +7,14 @@ Subject: [PATCH 4/4] Move the 43xx firmware into /lib/firmware tools/hciattach_bcm43xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---- a/tools/hciattach_bcm43xx.c -+++ b/tools/hciattach_bcm43xx.c -@@ -31,7 +31,7 @@ - #include "hciattach.h" +--- a/tools/hciattach.h ++++ b/tools/hciattach.h +@@ -41,7 +41,7 @@ + #define HCI_UART_VND_DETECT 5 #ifndef FIRMWARE_DIR -#define FIRMWARE_DIR "/etc/firmware" +#define FIRMWARE_DIR "/lib/firmware/brcm" #endif - #define FW_EXT ".hcd" + int read_hci_event(int fd, unsigned char *buf, int size); diff --git a/utils/bluez/patches/201-readline.patch b/utils/bluez/patches/201-readline.patch index f60001c0..e58b504b 100644 --- a/utils/bluez/patches/201-readline.patch +++ b/utils/bluez/patches/201-readline.patch @@ -1,7 +1,7 @@ --- a/Makefile.in +++ b/Makefile.in -@@ -3479,7 +3479,7 @@ unit_tests = $(am__append_55) unit/test- - @CLIENT_TRUE@ client/admin.c +@@ -3598,7 +3598,7 @@ unit_tests = $(am__append_62) unit/test- + @CLIENT_TRUE@ client/player.h client/player.c @CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \ -@CLIENT_TRUE@ $(GLIB_LIBS) $(DBUS_LIBS) -lreadline @@ -9,16 +9,16 @@ @ZSH_COMPLETIONS_TRUE@zshcompletiondir = $(ZSH_COMPLETIONDIR) @ZSH_COMPLETIONS_TRUE@dist_zshcompletion_DATA = completion/zsh/_bluetoothctl -@@ -3722,7 +3722,7 @@ unit_tests = $(am__append_55) unit/test- +@@ -3877,7 +3877,7 @@ unit_tests = $(am__append_62) unit/test- - @MESH_TRUE@@TOOLS_TRUE@tools_meshctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \ - @MESH_TRUE@@TOOLS_TRUE@ lib/libbluetooth-internal.la \ --@MESH_TRUE@@TOOLS_TRUE@ $(GLIB_LIBS) $(DBUS_LIBS) -ljson-c -lreadline -+@MESH_TRUE@@TOOLS_TRUE@ $(GLIB_LIBS) $(DBUS_LIBS) -ljson-c -lreadline -lncurses + @DEPRECATED_TRUE@@MESH_TRUE@@TOOLS_TRUE@tools_meshctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \ + @DEPRECATED_TRUE@@MESH_TRUE@@TOOLS_TRUE@ lib/libbluetooth-internal.la \ +-@DEPRECATED_TRUE@@MESH_TRUE@@TOOLS_TRUE@ $(GLIB_LIBS) $(DBUS_LIBS) -ljson-c -lreadline ++@DEPRECATED_TRUE@@MESH_TRUE@@TOOLS_TRUE@ $(GLIB_LIBS) $(DBUS_LIBS) -ljson-c -lreadline -lncurses @MESH_TRUE@@TOOLS_TRUE@tools_mesh_cfgclient_SOURCES = tools/mesh-cfgclient.c \ @MESH_TRUE@@TOOLS_TRUE@ tools/mesh/model.h tools/mesh/config-model.h \ -@@ -3736,7 +3736,7 @@ unit_tests = $(am__append_55) unit/test- +@@ -3891,7 +3891,7 @@ unit_tests = $(am__append_62) unit/test- @MESH_TRUE@@TOOLS_TRUE@ mesh/crypto.h mesh/crypto.c @MESH_TRUE@@TOOLS_TRUE@tools_mesh_cfgclient_LDADD = lib/libbluetooth-internal.la src/libshared-ell.la \ @@ -27,7 +27,7 @@ @MESH_TRUE@@TOOLS_TRUE@tools_mesh_cfgtest_SOURCES = tools/mesh-cfgtest.c @MESH_TRUE@@TOOLS_TRUE@tools_mesh_cfgtest_LDADD = lib/libbluetooth-internal.la src/libshared-ell.la \ -@@ -3793,7 +3793,7 @@ unit_tests = $(am__append_55) unit/test- +@@ -3948,7 +3948,7 @@ unit_tests = $(am__append_62) unit/test- @READLINE_TRUE@ tools/obex-client-tool.c @READLINE_TRUE@tools_obex_client_tool_LDADD = lib/libbluetooth-internal.la \ @@ -36,8 +36,8 @@ @READLINE_TRUE@tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \ @READLINE_TRUE@ tools/obex-server-tool.c -@@ -3804,15 +3804,15 @@ unit_tests = $(am__append_55) unit/test- - @READLINE_TRUE@tools_bluetooth_player_SOURCES = tools/bluetooth-player.c +@@ -3959,15 +3959,15 @@ unit_tests = $(am__append_62) unit/test- + @READLINE_TRUE@tools_bluetooth_player_SOURCES = tools/bluetooth-player.c client/player.c @READLINE_TRUE@tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \ @READLINE_TRUE@ src/libshared-glib.la \ -@READLINE_TRUE@ $(GLIB_LIBS) $(DBUS_LIBS) -lreadline @@ -55,7 +55,7 @@ @DEPRECATED_TRUE@@READLINE_TRUE@attrib_gatttool_SOURCES = attrib/gatttool.c attrib/att.c attrib/gatt.c \ @DEPRECATED_TRUE@@READLINE_TRUE@ attrib/gattrib.c btio/btio.c \ -@@ -3821,7 +3821,7 @@ unit_tests = $(am__append_55) unit/test- +@@ -3976,7 +3976,7 @@ unit_tests = $(am__append_62) unit/test- @DEPRECATED_TRUE@@READLINE_TRUE@ client/display.h @DEPRECATED_TRUE@@READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \ @@ -64,7 +64,7 @@ @CUPS_TRUE@cupsdir = $(libdir)/cups/backend @CUPS_TRUE@profiles_cups_bluetooth_SOURCES = profiles/cups/main.c \ -@@ -3841,7 +3841,7 @@ unit_tests = $(am__append_55) unit/test- +@@ -3996,7 +3996,7 @@ unit_tests = $(am__append_62) unit/test- @BTPCLIENT_TRUE@tools_btpclient_DEPENDENCIES = lib/libbluetooth-internal.la $(ell_dependencies) @BTPCLIENT_TRUE@tools_btpclientctl_SOURCES = tools/btpclientctl.c client/display.c @BTPCLIENT_TRUE@tools_btpclientctl_LDADD = src/libshared-mainloop.la src/libshared-glib.la \ diff --git a/utils/bluez/patches/205-refresh_adv_manager_for_non-LE_devices.patch b/utils/bluez/patches/205-refresh_adv_manager_for_non-LE_devices.patch index 3252ecf4..b79667bb 100644 --- a/utils/bluez/patches/205-refresh_adv_manager_for_non-LE_devices.patch +++ b/utils/bluez/patches/205-refresh_adv_manager_for_non-LE_devices.patch @@ -34,7 +34,7 @@ This commit prevents the call to btd_adv_manager_refresh for non-LE devices. --- a/src/adapter.c +++ b/src/adapter.c -@@ -601,7 +601,9 @@ static void settings_changed(struct btd_ +@@ -634,7 +634,9 @@ static void settings_changed(struct btd_ */ if (!adapter->discovery_discoverable) store_adapter_info(adapter); diff --git a/utils/bluez/patches/210-util-define-MAX_INPUT.patch b/utils/bluez/patches/210-util-define-MAX_INPUT.patch new file mode 100644 index 00000000..e2af0bf6 --- /dev/null +++ b/utils/bluez/patches/210-util-define-MAX_INPUT.patch @@ -0,0 +1,12 @@ +--- a/src/shared/util.c ++++ b/src/shared/util.c +@@ -23,6 +23,9 @@ + #include + #include + #include ++#ifndef MAX_INPUT ++#define MAX_INPUT _POSIX_MAX_INPUT ++#endif + + #ifdef HAVE_SYS_RANDOM_H + #include From 55d2bec23a9aa4c610c04611d9a31a08c07a9a42 Mon Sep 17 00:00:00 2001 From: Stefan Hellermann Date: Thu, 5 Jan 2023 15:34:48 +0100 Subject: [PATCH 048/102] dfu-programmer: update to 1.0.0 The project website http://dfu-programmer.github.io seams dead, but there are new releases on github. They just released 1.0.0, update to it. I removed docs, bash-completion and the fedora spec file from configure.ac to fix cross compilation problems. Signed-off-by: Stefan Hellermann --- utils/dfu-programmer/Makefile | 17 ++++++----------- .../patches/000-remove-docs-etc.patch | 9 +++++++++ 2 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 utils/dfu-programmer/patches/000-remove-docs-etc.patch diff --git a/utils/dfu-programmer/Makefile b/utils/dfu-programmer/Makefile index aadd7965..8a7e1a0e 100644 --- a/utils/dfu-programmer/Makefile +++ b/utils/dfu-programmer/Makefile @@ -1,26 +1,21 @@ -# -# Copyright (C) 2015 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - include $(TOPDIR)/rules.mk PKG_NAME:=dfu-programmer -PKG_VERSION:=0.7.2 +PKG_VERSION:=1.0.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=@SF/$(PKG_NAME)/$(PKG_VERSION) -PKG_HASH:=1db4d36b1aedab2adc976e8faa5495df3cf82dc4bf883633dc6ba71f7c4af995 +PKG_SOURCE_URL:=https://github.com/$(PKG_NAME)/$(PKG_NAME)/releases/download/v$(PKG_VERSION)/ +PKG_HASH:=867eaf0a8cd10123715491807ab99cecb54dc6f09dddade4b2a42b0b0ef9e6b0 PKG_MAINTAINER:=Stefan Hellermann PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING +PKG_FIXUP:=autoreconf PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 +MAKE_PATH:=src include $(INCLUDE_DIR)/package.mk @@ -29,7 +24,7 @@ define Package/dfu-programmer CATEGORY:=Utilities SUBMENU:=Microcontroller programming TITLE:=USB programmer for Atmel microcontrollers - URL:=http://dfu-programmer.github.io/ + URL:=https://github.com/dfu-programmer/dfu-programmer DEPENDS:=+libusb-1.0 endef diff --git a/utils/dfu-programmer/patches/000-remove-docs-etc.patch b/utils/dfu-programmer/patches/000-remove-docs-etc.patch new file mode 100644 index 00000000..ad0f3686 --- /dev/null +++ b/utils/dfu-programmer/patches/000-remove-docs-etc.patch @@ -0,0 +1,9 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -28,5 +28,5 @@ AC_FUNC_MEMCMP + # Checks for libusb. + AC_SEARCH_LIBS(libusb_init, usb-1.0,, [AC_MSG_ERROR([libusb 1.0 not found])]) + +-AC_CONFIG_FILES(fedora/dfu-programmer.spec Makefile docs/Makefile src/Makefile) ++AC_CONFIG_FILES(src/Makefile) + AC_OUTPUT From 2a8cb48b531675fa01d01e5c735e4a7a186354a2 Mon Sep 17 00:00:00 2001 From: Thomas Huehn Date: Sat, 8 Oct 2022 15:11:17 +0200 Subject: [PATCH 049/102] cpusage: add new package This PR adds the new package "cpusage" to OpenWrt packages. Cpusage is a small utility that prints cpu usage per second as output. Signed-off-by: Thomas Huehn --- utils/cpusage/Makefile | 39 ++++ utils/cpusage/src/cpusage.c | 343 ++++++++++++++++++++++++++++++++++++ 2 files changed, 382 insertions(+) create mode 100644 utils/cpusage/Makefile create mode 100644 utils/cpusage/src/cpusage.c diff --git a/utils/cpusage/Makefile b/utils/cpusage/Makefile new file mode 100644 index 00000000..f1f63ab3 --- /dev/null +++ b/utils/cpusage/Makefile @@ -0,0 +1,39 @@ +# SPDX-Identifier-License: GPL-2.0-only +# +# Copyright (C) 2005 Fabian Schneider, +# 2010 Florian Sesser, +# 2022 Thomas Hühn + +include $(TOPDIR)/rules.mk + +PKG_NAME:=cpusage +PKG_VERSION:=$(AUTORELEASE) +PKG_MAINTAINER:=Thomas Hühn + +include $(INCLUDE_DIR)/package.mk + +define Package/cpusage + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Outputs CPU usage statistics once per second +endef + +define Package/cpusage/description + CPUsage outputs CPU usage statistics once per second. + Optionally writes CSV output (see '-o' option). + Originally written by Fabian Schneider (TUM, TUB) in 2005. + Timestamp and CSV-compliance by Florian Sesser (TUM), 2010. + Refreshed by Thomas Hühn in 2022. +endef + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) \ + -o $(PKG_BUILD_DIR)/cpusage $(PKG_BUILD_DIR)/cpusage.c +endef + +define Package/cpusage/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/cpusage $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,cpusage)) diff --git a/utils/cpusage/src/cpusage.c b/utils/cpusage/src/cpusage.c new file mode 100644 index 00000000..300fb62e --- /dev/null +++ b/utils/cpusage/src/cpusage.c @@ -0,0 +1,343 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define CPUSTATES 7 +#define IDLEI 3 +/* long names: + * user - nice - system - idle - iowait - irq - soft irq */ +char *cpustatenames[] = {"user", "nice", "system", "idle", + "iowait", "irq", "softirq", NULL}; + +#define LIMIT 95 + +static const char usage[] = + "\n usage: cpusage [ -hos ] [ -a | -l limit | -o ] [ -c CPU ]\n"; + +char *appname; + +static float cpu_perc[CPUSTATES]; +static float cpu_max[CPUSTATES]; +static float cpu_min[CPUSTATES]; + +int cpunum; /* -1 all, 0-n CPU/Core 0-n */ + +int output; + +int breakloop; + +/* returns 1-n yielding the number of CPU's/Cores */ +int getNumCPU() { + char buffer[32768]; + int fd, len, i; + char *test; + + fd = open("/proc/stat", O_RDONLY); + if (fd <= 0) + fprintf(stderr, "%s: cannot open /proc/stat \n", appname); + + len = read(fd, buffer, sizeof(buffer) - 1); + close(fd); + buffer[len] = '\0'; + + i = 0; + + test = strstr(buffer, "cpu"); + if (test != NULL) { + test += sizeof("cpu"); + test = strstr(test, "cpu"); + } + + while (test != NULL) { + test += sizeof("cpu"); + /* fprintf(stderr, "%s: DEBUG: %s\n", appname, test); */ + i++; + test = strstr(test, "cpu"); + } + return i; +} + +void getSysinfo(unsigned long *ptr, size_t size) { + char buffer[4096]; + char match[100]; + char *start; + int fd, len, j; + + for (j = 0; j < size; j++) + ptr[j] = 0; + + fd = open("/proc/stat", O_RDONLY); + if (fd <= 0) + fprintf(stderr, "%s: cannot open /proc/stat\n", appname); + + len = read(fd, buffer, sizeof(buffer) - 1); + close(fd); + buffer[len] = '\0'; + + strcpy(match, "cpu "); + start = buffer; + if (cpunum != -1) { + sprintf(match, "cpu%d ", cpunum); + start = strstr(buffer, match); + } + + strcat(match, "%ld %ld %ld %ld %ld %ld %ld"); + if (sscanf(start, match, &ptr[0], &ptr[1], &ptr[2], &ptr[3], &ptr[4], &ptr[5], + &ptr[6]) != 7) { + fprintf(stderr, "%s: wrong /proc/stat format\n", appname); + } +} + +long perc(int cpustates, long *cp_time, long *cp_old, long *cp_diff) { + + int i = 0; + long total = 0; + + for (i = 0; i < cpustates; i++) { + cp_diff[i] = cp_time[i] - cp_old[i]; + total += cp_diff[i]; + } + + for (i = 0; i < cpustates; i++) { + cpu_perc[i] = ((float)cp_diff[i] * 100.0 / total); + /* new max ? */ + if (cpu_perc[i] > cpu_max[i]) + cpu_max[i] = cpu_perc[i]; + /* new min ? */ + if (cpu_perc[i] < cpu_min[i]) + cpu_min[i] = cpu_perc[i]; + } + + return total; +} + +void print_perc(float *perc, const char *head) { + int i; + time_t Zeitstempel; + struct tm *now; + + /* human readable */ + if ((output == 0) && (head != "")) + printf("%s: ", head); + + /* machine readable */ + if ((output == 1) && (head != "")) + printf("%s;", head); + + /* timestamp */ + time(&Zeitstempel); + now = localtime(&Zeitstempel); + if (output == 0) + printf("timestamp: %04d-%02d-%02d %02d.%02d.%02d, ", now->tm_year + 1900, + now->tm_mon + 1, now->tm_mday, now->tm_hour, now->tm_min, + now->tm_sec); + else + printf("%04d-%02d-%02d;%02d:%02d:%02d;", now->tm_year + 1900, + now->tm_mon + 1, now->tm_mday, now->tm_hour, now->tm_min, + now->tm_sec); + + if (output == 0) + printf("%s: %5.1f%%, ", cpustatenames[0], perc[0]); + else + printf("%.1f", perc[0]); + + /* print out calculated information in percentages */ + for (i = 1; i < CPUSTATES; i++) { + if (output == 0) + printf("%s: %5.1f%%, ", cpustatenames[i], perc[i]); + else + printf(";%.1f", perc[i]); + } + printf("\n"); +} + +/* to catch Strg+C when looping */ +void loop_term_handler(int signum) { breakloop = 1; } + +int main(int argc, char **argv) { + + appname = argv[0]; + + int i, c, limit; + int runonce; /* run just once and exit */ + int avg; /* is avg measurement allready running */ + int avg_run; /* did we allready had an avg measurement */ + static long cp_time1[CPUSTATES]; + static long cp_time2[CPUSTATES]; + static long cp_avg_start[CPUSTATES]; + static long cp_avg_stop[CPUSTATES]; + static long cp_diff[CPUSTATES]; + + struct sigaction sigold, signew; + + long *old = cp_time2; + long *new = cp_time1; + + long total; + limit = LIMIT; + output = 0; /* 0: human readable; 1: machine readable */ + runonce = 0; /* 0: run continuesly; 1: run once */ + + cpunum = -1; /* -1: all CPUs/Cores, 0-n: special CPU/Core */ + + /* reading commandline options */ + while (1) { + c = getopt(argc, argv, "saohl:c:"); + + if (c == -1) { + break; + } + + switch (c) { + /*run once and exit */ + case 's': + runonce = 1; + break; + /* use avg from begin to end -> same as "-l 100" */ + case 'a': + limit = 100; + break; + case 'o': + output = 1; /* machine readable */ + // header for CSV output + printf("date;time;user;nice;system;idle;iowait;irq;softirq\n"); + break; + /* print usage */ + case 'h': + fprintf(stderr, "%s: %s", appname, usage); + exit(0); + break; + /* set limit */ + case 'l': + if (!(sscanf(optarg, "%d", &limit) == 1)) { + fprintf(stderr, "%s: option for -l should be integer (is %s)\n", + appname, optarg); + exit(1); + } + break; + /* select CPU/Core */ + case 'c': + if (!(sscanf(optarg, "%d", &cpunum) == 1)) { + fprintf(stderr, "%s: option for -c should be integer (is %s)\n", + appname, optarg); + exit(1); + } + break; + } + } + + if (cpunum != -1) { + int numcpu = getNumCPU(); + if (cpunum < numcpu) { + printf("-- Selected CPU %d\n", cpunum); + } else { + if (numcpu == 1) { + fprintf(stderr, "%s: CPU %d not available (found %d CPU: [0])\n", + appname, cpunum, numcpu); + } else { + fprintf(stderr, + "%s: CPU %d not available (found %d CPU's: [0]-[%d])\n ", + appname, cpunum, numcpu, numcpu - 1); + } + exit(1); + } + } + + breakloop = 0; + + for (i = 0; i < CPUSTATES; i++) { + cpu_max[i] = 0; + cpu_min[i] = 100; + } + + /* get information */ + getSysinfo((unsigned long *)new, CPUSTATES); + + /* catch Strg+C when capturing to call pcap_breakloop() */ + memset(&signew, 0, sizeof(signew)); + signew.sa_handler = loop_term_handler; + if (sigaction(SIGINT, &signew, &sigold) < 0) { + fprintf(stderr, "Could not set signal handler -> exiting"); + } + + avg = 0; + avg_run = 0; + + if (runonce) { + breakloop = 1; + } + + while (1) { + usleep(1000000); + + if (new == cp_time1) { + new = cp_time2; + old = cp_time1; + } else { + new = cp_time1; + old = cp_time2; + } + + /* get information again */ + getSysinfo((unsigned long *)new, CPUSTATES); + + /* convert cp_time counts to percentages */ + total = perc(CPUSTATES, new, old, cp_diff); + + /* check for avg measurement start */ + if (!avg_run && !avg && (cpu_perc[IDLEI] <= limit)) { + avg = 1; + for (i = 0; i < CPUSTATES; i++) + cp_avg_start[i] = new[i]; + } + + /* check for avg measurement stop */ + if (!avg_run && avg && (cpu_perc[IDLEI] > limit)) { + avg = 0; + for (i = 0; i < CPUSTATES; i++) + cp_avg_stop[i] = new[i]; + avg_run = 1; + } + + print_perc(cpu_perc, ""); + + if (breakloop) { + if (avg) { + avg = 0; + for (i = 0; i < CPUSTATES; i++) + cp_avg_stop[i] = new[i]; + } + break; + } + } + + /* Set default behaviour when loop is done */ + if (sigaction(SIGINT, &sigold, &signew) < 0) { + fprintf(stderr, "%s: Could not restore signal handler -> exiting", appname); + } + + if (!runonce && output == 0) { + // print avg only when not making a one-shot msg and + // when not writing CSV output + printf("---Summary----\n"); + + print_perc(cpu_min, "Min"); + + print_perc(cpu_max, "Max"); + + perc(CPUSTATES, cp_avg_start, cp_avg_stop, cp_diff); + + print_perc(cpu_perc, "Avg"); + } + + return 0; +} From f14be922a0758da27e0b1b5d458914aef3534b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=20=E6=96=87=E9=9B=A8?= Date: Wed, 14 Dec 2022 03:48:25 +0000 Subject: [PATCH 050/102] base16384: add new package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Encode binary files to printable utf16be. See more at https://github.com/fumiama/base16384. Signed-off-by: 源 文雨 --- utils/base16384/Makefile | 61 ++++++++++++++++++++++++++++++++++++++++ utils/base16384/test.sh | 15 ++++++++++ 2 files changed, 76 insertions(+) create mode 100644 utils/base16384/Makefile create mode 100644 utils/base16384/test.sh diff --git a/utils/base16384/Makefile b/utils/base16384/Makefile new file mode 100644 index 00000000..90fe988d --- /dev/null +++ b/utils/base16384/Makefile @@ -0,0 +1,61 @@ +# SPDX-Identifier-License: GPL-3.0-or-later +# +# Copyright (C) 2022 源 文雨 + +include $(TOPDIR)/rules.mk + +PKG_NAME:=base16384 +PKG_VERSION:=2.2.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/fumiama/base16384/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=948da6d9eca3af64123a7df1aa0f71a81e38ab02815ab2218e71a7aface0035e + +PKG_MAINTAINER:=源 文雨 +PKG_LICENSE:=GPL-3.0-or-later +PKG_LICENSE_FILES:=LICENSE + +CMAKE_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/base16384 + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Encode binary files to printable utf16be + URL:=https://github.com/fumiama/base16384 +endef + +define Package/libbase16384 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Base16384 library + URL:=https://github.com/fumiama/base16384 +endef + +define Package/base16384/description + There are 16384 Chinese characters (from \u4E00 to \u8DFF) + as the "alphabet", just like what base64 did. + If length of the data has a remainder after mod 7, + an unicode Chinese character \u3Dxx will be appended to present it + with xx ranging from 01 to 06. +endef + +define Package/libbase16384/description + $(call Package/base16384/description) +endef + +define Package/base16384/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/base16384 $(1)/usr/bin/base16384 +endef + +define Package/libbase16384/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbase16384.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,base16384)) +$(eval $(call BuildPackage,libbase16384)) diff --git a/utils/base16384/test.sh b/utils/base16384/test.sh new file mode 100644 index 00000000..fcc070df --- /dev/null +++ b/utils/base16384/test.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +case "$1" in + "base16384") + i=1 + while [ $i -le 100 ]; do + s="$(head /dev/urandom | head -c $i)" + if [ "$(echo $s)" != "$(echo $s | base16384 -e - - | base16384 -d - -)" ]; then + exit $i + fi + i=$( expr $i + 1 ) + done +esac + +exit 0 From 011557d96a813613a3baa54e4d41c48e24594797 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Wed, 20 Oct 2021 14:27:12 +0200 Subject: [PATCH 051/102] bossa: add bossa Based on the work of Hirokazu MORIKAWA (nxhack): https://github.com/nxhack/openwrt-arduino-packages/tree/master/bossa BOSSA is a flash programming utility for Atmel's SAM family of flash-based ARM microcontrollers. The motivation behind BOSSA is to create a simple, easy-to-use, open source utility to replace Atmel's SAM-BA software. Signed-off-by: Nick Hainke --- utils/bossa/Makefile | 45 +++++++++++++++++++++++++++ utils/bossa/patches/902-musl_fd.patch | 12 +++++++ 2 files changed, 57 insertions(+) create mode 100644 utils/bossa/Makefile create mode 100644 utils/bossa/patches/902-musl_fd.patch diff --git a/utils/bossa/Makefile b/utils/bossa/Makefile new file mode 100644 index 00000000..443664bd --- /dev/null +++ b/utils/bossa/Makefile @@ -0,0 +1,45 @@ +# SPDX-License-Identifier: GPL-2.0-only + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bossa +PKG_VERSION:=1.9.1 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/shumatech/BOSSA/tar.gz/$(PKG_VERSION)? +PKG_HASH:=ca650455dfa36cbd029010167347525bea424717a71a691381c0811591c93e72 +PKG_BUILD_DIR:=$(BUILD_DIR)/BOSSA-$(PKG_VERSION) + +PKG_MAINTAINER:=Nick Hainke +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +include $(INCLUDE_DIR)/package.mk + +define Package/bossa + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libstdcpp + TITLE:=Utility to flash ARM microcontrollers + URL:=http://www.shumatech.com/web/products/bossa +endef + +define Package/bossa/description + BOSSA is a flash programming utility for Atmel's SAM family of flash-based + ARM microcontrollers. The motivation behind BOSSA is to create a simple, + easy-to-use, open source utility to replace Atmel's SAM-BA software. +endef + +define Build/Compile + COMMON_CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \ + COMMON_LDFLAGS="$(TARGET_LINKFLAGS) $(TARGET_LDFLAGS)" \ + $(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(TARGET_CFLAGS)" bin/bossac +endef + +define Package/bossa/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/bossac $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,bossa)) diff --git a/utils/bossa/patches/902-musl_fd.patch b/utils/bossa/patches/902-musl_fd.patch new file mode 100644 index 00000000..7ca1b286 --- /dev/null +++ b/utils/bossa/patches/902-musl_fd.patch @@ -0,0 +1,12 @@ +--- a/src/PosixSerialPort.cpp ++++ b/src/PosixSerialPort.cpp +@@ -39,6 +39,9 @@ + + #include + ++/* __MUSL__ */ ++#include ++ + #ifndef B460800 + #define B460800 460800 + #endif From b59b91cabd604ff64120e4f63d12d3babd1566df Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Mon, 8 Nov 2021 21:47:27 +0100 Subject: [PATCH 052/102] bossa: add patch to fix flash failures on serial bossa only waited 1ms for the serial device instead calling tcdrain(). Without this patch bossa is failing to flash a ATSAM3S4 8/10 times. Patch has been submitted as PR#150 upstream. https://github.com/shumatech/BOSSA/pull/150 Signed-off-by: Alexander Couzens --- ...rt-Call-tcdrain-to-write-serial-data.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 utils/bossa/patches/101-PosixSerialPort-Call-tcdrain-to-write-serial-data.patch diff --git a/utils/bossa/patches/101-PosixSerialPort-Call-tcdrain-to-write-serial-data.patch b/utils/bossa/patches/101-PosixSerialPort-Call-tcdrain-to-write-serial-data.patch new file mode 100644 index 00000000..b285dd0a --- /dev/null +++ b/utils/bossa/patches/101-PosixSerialPort-Call-tcdrain-to-write-serial-data.patch @@ -0,0 +1,24 @@ +From 0fd3078b4863002e5d384d7e453d668841414abe Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 13 Jan 2021 01:34:08 +0100 +Subject: [PATCH] PosixSerialPort: Call tcdrain() to write serial data +GithubPR: 150 + +--- + src/PosixSerialPort.cpp | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +--- a/src/PosixSerialPort.cpp ++++ b/src/PosixSerialPort.cpp +@@ -290,10 +290,7 @@ PosixSerialPort::put(int c) + void + PosixSerialPort::flush() + { +- // There isn't a reliable way to flush on a file descriptor +- // so we just wait it out. One millisecond is the USB poll +- // interval so that should cover it. +- usleep(1000); ++ tcdrain(_devfd); + } + + bool From 99b932194889142dd98e5140631a86fbea8efb97 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Wed, 8 Dec 2021 23:50:50 +0100 Subject: [PATCH 053/102] bossa: fix fpic compilation Fixes: #17287 ("bossa: recompile with -fPIC") Signed-off-by: Nick Hainke --- utils/bossa/Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/utils/bossa/Makefile b/utils/bossa/Makefile index 443664bd..5760fcfa 100644 --- a/utils/bossa/Makefile +++ b/utils/bossa/Makefile @@ -32,9 +32,13 @@ define Package/bossa/description endef define Build/Compile - COMMON_CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \ - COMMON_LDFLAGS="$(TARGET_LINKFLAGS) $(TARGET_LDFLAGS)" \ - $(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(TARGET_CFLAGS)" bin/bossac + $(MAKE) -C $(PKG_BUILD_DIR) bin/bossac \ + CC="$(TARGET_CC_NOCACHE)" \ + CXX="$(TARGET_CXX_NOCACHE)" \ + CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \ + CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" endef define Package/bossa/install From 9364ab2784487c099bc29dffcb6cdc6320bc8661 Mon Sep 17 00:00:00 2001 From: "Sergey V. Lobanov" Date: Sat, 8 Jan 2022 14:46:15 +0300 Subject: [PATCH 054/102] bossa: fix build on macos override OS=Linux Makefile variable to support building on macos Signed-off-by: Sergey V. Lobanov --- utils/bossa/Makefile | 1 + .../bossa/patches/102_allow_override_os.patch | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 utils/bossa/patches/102_allow_override_os.patch diff --git a/utils/bossa/Makefile b/utils/bossa/Makefile index 5760fcfa..8ec04d47 100644 --- a/utils/bossa/Makefile +++ b/utils/bossa/Makefile @@ -33,6 +33,7 @@ endef define Build/Compile $(MAKE) -C $(PKG_BUILD_DIR) bin/bossac \ + OS="Linux" \ CC="$(TARGET_CC_NOCACHE)" \ CXX="$(TARGET_CXX_NOCACHE)" \ CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \ diff --git a/utils/bossa/patches/102_allow_override_os.patch b/utils/bossa/patches/102_allow_override_os.patch new file mode 100644 index 00000000..34202d13 --- /dev/null +++ b/utils/bossa/patches/102_allow_override_os.patch @@ -0,0 +1,18 @@ +commit 7b1ee33f339bd0d69a7295facda7b3d2b4b55d1a +Author: Sergey V. Lobanov +Date: Sat Jan 8 14:22:21 2022 +0300 + + allow override OS to support cross-compile compilation if build OS + host OS are different (e.g. build on MacOS for Linux) + +--- a/Makefile ++++ b/Makefile +@@ -28,7 +28,7 @@ INSTALLDIR=install + # + # Determine OS + # +-OS:=$(shell uname -s | cut -c -7) ++OS?=$(shell uname -s | cut -c -7) + + # + # Windows rules From 02324ce72b1dafdb85680c2c2148c4a1873f75a7 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 18 Jul 2021 17:40:47 +0200 Subject: [PATCH 055/102] clocate: add package clocate is a small utility to determinethe location of a 802.11 capable device by using a remote locator service (Mozilla or Google). Signed-off-by: David Bauer --- utils/clocate/Makefile | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 utils/clocate/Makefile diff --git a/utils/clocate/Makefile b/utils/clocate/Makefile new file mode 100644 index 00000000..424f75e9 --- /dev/null +++ b/utils/clocate/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2021 David Bauer +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=clocate +PKG_SOURCE_DATE:=2021-07-07 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/blocktrron/clocate.git +PKG_SOURCE_VERSION:=ef531687c16bab959f61dff3755148ac9a0c1464 +PKG_MIRROR_HASH:=1fde4052113a52c018476062a5fad656673b89be95a469fed2d35649a7f1bce3 + +PKG_MAINTAINER:=David Bauer +PKG_LICENSE:=GPL-2.0-only + +include $(INCLUDE_DIR)/package.mk + +define Package/clocate + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libcurl +libnl-tiny +libjson-c + TITLE:=Determine device location using neighbouring WiFi networks +endef + +define Package/clocate/description + This program can locate a device by sending the nighbouring WiFI networks + to a geolocation Provider. Currently supported providers are Mozilla and Google. +endef + +define Package/clocate/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/clocate $(1)/sbin/clocate +endef + +MAKE_FLAGS += LIBNL_TINY=1 + +$(eval $(call BuildPackage,clocate)) From 38c3b1db3b7de6d0798b700a8c3e7c74751da507 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 21 Nov 2021 22:19:50 +0100 Subject: [PATCH 056/102] clocate: update to latest HEAD 4a4c0c0 nl80211: fix IE loop d83e572 nl80211: fix potential oob read Signed-off-by: David Bauer --- utils/clocate/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/clocate/Makefile b/utils/clocate/Makefile index 424f75e9..3c955fca 100644 --- a/utils/clocate/Makefile +++ b/utils/clocate/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=clocate -PKG_SOURCE_DATE:=2021-07-07 +PKG_SOURCE_DATE:=2021-11-09 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/blocktrron/clocate.git -PKG_SOURCE_VERSION:=ef531687c16bab959f61dff3755148ac9a0c1464 -PKG_MIRROR_HASH:=1fde4052113a52c018476062a5fad656673b89be95a469fed2d35649a7f1bce3 +PKG_SOURCE_VERSION:=4a4c0c0cb53fc3df2891d649eb457efdee843572 +PKG_MIRROR_HASH:=8eef756ea5e951097eea53feb243a317612f88c2628c9417f4b28a28a3b4686c PKG_MAINTAINER:=David Bauer PKG_LICENSE:=GPL-2.0-only From 5ce14f29036083c71ed9fb49db2f36da2afc20a3 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sun, 30 Oct 2022 00:55:35 +0800 Subject: [PATCH 057/102] dos2unix: add new package dos2unix - text file format converters includes: dos2unix - DOS/Mac to Unix text file format converter (dos2unix/mac2unix) unix2dos - Unix to DOS/Mac text file format converter (unix2dos/unix2mac) Signed-off-by: Tianling Shen --- utils/dos2unix/Makefile | 53 +++++++++++++++++++++++++++++++++++++++++ utils/dos2unix/test.sh | 3 +++ 2 files changed, 56 insertions(+) create mode 100644 utils/dos2unix/Makefile create mode 100644 utils/dos2unix/test.sh diff --git a/utils/dos2unix/Makefile b/utils/dos2unix/Makefile new file mode 100644 index 00000000..2326e0c8 --- /dev/null +++ b/utils/dos2unix/Makefile @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: GPL-3.0-only +# +# Copyright (C) 2022 ImmortalWrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=dos2unix +PKG_VERSION:=7.4.3 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://waterlan.home.xs4all.nl/dos2unix/ \ + @SF/dos2unix +PKG_HASH:=b68db41956daf933828423aa30510e00c12d29ef5916e715e8d4e694fe66ca72 + +PKG_MAINTAINER:=Tianling Shen +PKG_LICENSE:=BSD-2-Clause +PKG_LICENSE_FILES:=COPYING.txt + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +MAKE_FLAGS+= D2U_OS=Linux + +define dos2unix/template + define Package/$(1) + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Text file format converters ($(1)) + URL:=https://waterlan.home.xs4all.nl/dos2unix.html + PROVIDES:=$(2) + endef + + define Package/$(1)/description + Convert text files with DOS or Mac line breaks to Unix line breaks + and vice versa. + + This package contains the $(1). + endef + + define Package/$(1)/install + $$(INSTALL_DIR) $$(1)/usr/bin + $$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/ + $$(LN) $(1) $$(1)/usr/bin/$(2) + endef + + $$(eval $$(call BuildPackage,$(1))) +endef + +$(eval $(call dos2unix/template,dos2unix,mac2unix)) +$(eval $(call dos2unix/template,unix2dos,unix2mac)) diff --git a/utils/dos2unix/test.sh b/utils/dos2unix/test.sh new file mode 100644 index 00000000..233259e7 --- /dev/null +++ b/utils/dos2unix/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +"$1" --version | grep "$2" From 642a598d9c12bf8e71ca74732ea33d2db8b79738 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 18 Dec 2022 15:06:12 +0100 Subject: [PATCH 058/102] dos2unix: Deactivate NLS support By default the dos2unix build uses the msgfmt application which is provided by the host tool gettext in OpenWrt. Instead of adding the dependency to gettext deactivate NLS support. This fixes the following build error: ------------------------------------------- msgfmt -c po/da.po -o po/da.mo make[4]: msgfmt: No such file or directory make[4]: *** [Makefile:472: po/da.mo] Error 127 Signed-off-by: Hauke Mehrtens --- utils/dos2unix/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/dos2unix/Makefile b/utils/dos2unix/Makefile index 2326e0c8..10d6d5f3 100644 --- a/utils/dos2unix/Makefile +++ b/utils/dos2unix/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dos2unix PKG_VERSION:=7.4.3 -PKG_RELEASE:=$(AUTORELEASE) +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://waterlan.home.xs4all.nl/dos2unix/ \ @@ -22,7 +22,7 @@ PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk -MAKE_FLAGS+= D2U_OS=Linux +MAKE_FLAGS+= D2U_OS=Linux ENABLE_NLS= define dos2unix/template define Package/$(1) From d618ffaa468e83566b35a13504a7701bf172a49e Mon Sep 17 00:00:00 2001 From: Oskari Rauta Date: Thu, 12 Jan 2023 10:56:08 +0200 Subject: [PATCH 059/102] efibootmgr: new package Co-authored-by: Tianling Shen Signed-off-by: Oskari Rauta --- utils/efibootmgr/Makefile | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 utils/efibootmgr/Makefile diff --git a/utils/efibootmgr/Makefile b/utils/efibootmgr/Makefile new file mode 100644 index 00000000..fc53f872 --- /dev/null +++ b/utils/efibootmgr/Makefile @@ -0,0 +1,55 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=efibootmgr +PKG_VERSION:=18 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/rhboot/efibootmgr.git +PKG_SOURCE_DATE:=2022-11-12 +PKG_SOURCE_VERSION:=1904f9cd5a48207d49e393ac8de824f54ccfb697 +PKG_MIRROR_HASH:=0355e00bb54d468ecbaa106aa703dd389f2f2f4c7b7afb78a258cec10d75f78d + +PKG_LICENSE:=GPL-2.0-only +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=OSkari Rauta + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/efibootmgr + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Application to modify the EFI Boot Manager + DEPENDS:=@TARGET_x86_64 +efivar +libpopt + URL:=https://github.com/rhboot/efibootmgr +endef + +define Package/efibootmgr/description + This is efibootmgr, a Linux user-space application to modify the + Intel Extensible Firmware Interface (EFI) Boot Manager. + This application can create and destroy boot entries, change + the boot order, change the next running boot option, and more. + + Details on the EFI Boot Manager are available from the + EFI Specification, v1.02 or above, available from: + http://www.uefi.org + + Note: efibootmgr requires either the efivarfs or the legacy + efivars kernel module to be loaded prior to use. +endef + +MAKE_VARS += \ + EFIDIR="/boot/EFI" \ + PCDIR="$(STAGING_DIR)/usr/lib/pkgconfig" \ + EXTRAINCDIR="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/usr/include/efivar" \ + EXTRALIBDIR="-L$(STAGING_DIR)/usr/lib" + +define Package/efibootmgr/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{efibootdump,efibootmgr} $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,efibootmgr)) From d169d6907bb19d3747e7ca895a2586d4ed59e345 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 13 Jan 2023 18:33:57 -0800 Subject: [PATCH 060/102] evtest: update to 1.35 Switch to git tarballs as the old freedesktop cgit doesn't work properly anymore. Signed-off-by: Rosen Penev --- utils/evtest/Makefile | 11 +++--- utils/evtest/patches/010-musl.patch | 19 ---------- ...ld-on-32bit-arches-with-64bit-time_t.patch | 38 ------------------- 3 files changed, 6 insertions(+), 62 deletions(-) delete mode 100644 utils/evtest/patches/010-musl.patch delete mode 100644 utils/evtest/patches/020-Fix-build-on-32bit-arches-with-64bit-time_t.patch diff --git a/utils/evtest/Makefile b/utils/evtest/Makefile index 8f0c51ba..86077b5e 100644 --- a/utils/evtest/Makefile +++ b/utils/evtest/Makefile @@ -8,12 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=evtest -PKG_VERSION:=1.34 -PKG_RELEASE:=3 +PKG_VERSION:=1.35 +PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=https://cgit.freedesktop.org/evtest/snapshot -PKG_HASH:=e49f1f160b30c8f7c2a4caef5ab655f1caf816483d19fdedd6db2d251d7ab80e +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_URL:=https://gitlab.freedesktop.org/libevdev/evtest +PKG_MIRROR_HASH:=0a2599d92a6915ecedf43c341917fb6f332ffd3967352a2458acf5290167813e PKG_MAINTAINER:=Pushpal Sidhu PKG_LICENSE:=GPL-2.0-or-later diff --git a/utils/evtest/patches/010-musl.patch b/utils/evtest/patches/010-musl.patch deleted file mode 100644 index 647c9dc5..00000000 --- a/utils/evtest/patches/010-musl.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 12d5ea5ca2d9a47a1cab06caf2b36967667a3daf Mon Sep 17 00:00:00 2001 -From: Leo -Date: Sun, 24 Nov 2019 20:58:20 +0100 -Subject: [PATCH] Add missing include of limits.h for PATH_MAX - ---- - evtest.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/evtest.c -+++ b/evtest.c -@@ -59,6 +59,7 @@ - #include - #include - #include -+#include /* PATH_MAX */ - - #define BITS_PER_LONG (sizeof(long) * 8) - #define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) diff --git a/utils/evtest/patches/020-Fix-build-on-32bit-arches-with-64bit-time_t.patch b/utils/evtest/patches/020-Fix-build-on-32bit-arches-with-64bit-time_t.patch deleted file mode 100644 index 3fcb2522..00000000 --- a/utils/evtest/patches/020-Fix-build-on-32bit-arches-with-64bit-time_t.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 648f5c1a9e07843e185782d207bc1bcbe6586f6e Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 30 Nov 2019 11:58:58 -0800 -Subject: [PATCH] Fix build on 32bit arches with 64bit time_t - -time element is deprecated on new input_event structure in kernel's -input.h [1] - -[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=152194fe9c3f - -Signed-off-by: Khem Raj ---- - evtest.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - ---- a/evtest.c -+++ b/evtest.c -@@ -61,6 +61,11 @@ - #include - #include /* PATH_MAX */ - -+#ifndef input_event_sec -+#define input_event_sec time.tv_sec -+#define input_event_usec time.tv_usec -+#endif -+ - #define BITS_PER_LONG (sizeof(long) * 8) - #define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) - #define OFF(x) ((x)%BITS_PER_LONG) -@@ -1140,7 +1145,7 @@ static int print_events(int fd) - type = ev[i].type; - code = ev[i].code; - -- printf("Event: time %ld.%06ld, ", ev[i].time.tv_sec, ev[i].time.tv_usec); -+ printf("Event: time %ld.%06ld, ", ev[i].input_event_sec, ev[i].input_event_usec); - - if (type == EV_SYN) { - if (code == SYN_MT_REPORT) From 430cb77d73a08fb7e328c83f8fbf157d6702c33d Mon Sep 17 00:00:00 2001 From: Oskari Rauta Date: Thu, 25 Nov 2021 01:47:23 +0200 Subject: [PATCH 061/102] fatresize: add new package fatresize is a small tool using libparted to resize FAT type partitions. Signed-off-by: Oskari Rauta --- utils/fatresize/Makefile | 41 ++++++++++++++++++++++++++++++++++++++++ utils/fatresize/test.sh | 7 +++++++ 2 files changed, 48 insertions(+) create mode 100644 utils/fatresize/Makefile create mode 100644 utils/fatresize/test.sh diff --git a/utils/fatresize/Makefile b/utils/fatresize/Makefile new file mode 100644 index 00000000..a51f1211 --- /dev/null +++ b/utils/fatresize/Makefile @@ -0,0 +1,41 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=fatresize +PKG_VERSION:=1.1.0 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/ya-mouse/fatresize.git +PKG_SOURCE_DATE:=2021-11-24 +PKG_SOURCE_VERSION:=316981e43b14f42a9aa7b461c97e1f61f6f2390b +PKG_MIRROR_HASH:=5a7eabaf5896a92c72b9bdf1cacc5aa1bd19335d8c617c8c9bd0f02699b91548 + +PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +PKG_MAINTAINER:=Oskari Rauta +PKG_LICENSE:=GPL-3.0-only +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/package.mk + +define Package/fatresize + SECTION:=utils + CATEGORY:=Utilities + TITLE:=fatresize + SUBMENU:=Disc + URL:=https://github.com/ya-mouse/fatresize + DEPENDS:=+libparted +endef + +define Package/fatresize/description + Resize FAT partitions using libparted +endef + +define Package/fatresize/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fatresize $(1)/sbin/ +endef + +$(eval $(call BuildPackage,fatresize)) diff --git a/utils/fatresize/test.sh b/utils/fatresize/test.sh new file mode 100644 index 00000000..1af4643d --- /dev/null +++ b/utils/fatresize/test.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +case "$1" in + "fatresize") + test $(/sbin/fatresize -h | grep '^Please report bugs to mouse@ya.ru' | wc -l) -gt 0 + ;; +esac From 5c4fbfd060fdcdda73907e31334f81253c3d1491 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 14 Jan 2023 20:29:39 -0800 Subject: [PATCH 062/102] flashrom: update to 1.2.1 Signed-off-by: Rosen Penev --- utils/flashrom/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/flashrom/Makefile b/utils/flashrom/Makefile index f3af5d7b..6fee21da 100644 --- a/utils/flashrom/Makefile +++ b/utils/flashrom/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=flashrom -PKG_VERSION:=1.2 -PKG_RELEASE:=2 +PKG_VERSION:=1.2.1 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://download.flashrom.org/releases -PKG_HASH:=e1f8d95881f5a4365dfe58776ce821dfcee0f138f75d0f44f8a3cd032d9ea42b +PKG_HASH:=89a7ff5beb08c89b8795bbd253a51b9453547a864c31793302296b56bbc56d65 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-v$(PKG_VERSION) PKG_MAINTAINER:=Álvaro Fernández Rojas From cd401d2ae1d1c662345999a258f85ccfb1921a00 Mon Sep 17 00:00:00 2001 From: "W. Michael Petullo" Date: Thu, 17 Jun 2021 15:29:21 -0500 Subject: [PATCH 063/102] fuse-overlayfs: add new package This is part of an attempt to get rootless podman to work on OpenWrt. See https://github.com/openwrt/packages/issues/15096. Signed-off-by: W. Michael Petullo --- utils/fuse-overlayfs/Makefile | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 utils/fuse-overlayfs/Makefile diff --git a/utils/fuse-overlayfs/Makefile b/utils/fuse-overlayfs/Makefile new file mode 100644 index 00000000..8cc285f9 --- /dev/null +++ b/utils/fuse-overlayfs/Makefile @@ -0,0 +1,39 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=fuse-overlayfs +PKG_VERSION:=1.5.0 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_MAINTAINER:=W. Michael Petullo + +PKG_LICENSE:=GPL-3.0-or-later +PKG_LICENSE_FILES:=COPYING + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/containers/fuse-overlayfs/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=6c81b65b71067b303aaa9871f512c2cabc23e2b793f19c6c854d01a492b5a923 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/fuse-overlayfs + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libfuse3 + TITLE:=fuse-overlayfs + URL:=https://github.com/containers/fuse-overlayfs +endef + +define Package/fuse-overlayfs/description + FUSE overlay+shiftfs implementation for rootless containers +endef + +define Package/fuse-overlayfs/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fuse-overlayfs $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,fuse-overlayfs)) From febf16463b09da4eedf68725284ddedef94e0c1f Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 24 Oct 2021 11:52:06 -0700 Subject: [PATCH 064/102] fuse-overlayfs: update to 1.7.1 Rearrange Makefile for consistency between packages. Add m4 patch to fix compilation under some systems. Signed-off-by: Rosen Penev --- utils/fuse-overlayfs/Makefile | 13 ++++++------- utils/fuse-overlayfs/patches/010-m4.patch | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 utils/fuse-overlayfs/patches/010-m4.patch diff --git a/utils/fuse-overlayfs/Makefile b/utils/fuse-overlayfs/Makefile index 8cc285f9..6abafc83 100644 --- a/utils/fuse-overlayfs/Makefile +++ b/utils/fuse-overlayfs/Makefile @@ -1,17 +1,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fuse-overlayfs -PKG_VERSION:=1.5.0 +PKG_VERSION:=1.7.1 PKG_RELEASE:=$(AUTORELEASE) -PKG_MAINTAINER:=W. Michael Petullo - -PKG_LICENSE:=GPL-3.0-or-later -PKG_LICENSE_FILES:=COPYING - PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/containers/fuse-overlayfs/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=6c81b65b71067b303aaa9871f512c2cabc23e2b793f19c6c854d01a492b5a923 +PKG_HASH:=fe2c076aed7b8669e7970301a99c0b197759b611035d8199de4c0add7d2fb2b4 + +PKG_MAINTAINER:=W. Michael Petullo +PKG_LICENSE:=GPL-3.0-or-later +PKG_LICENSE_FILES:=COPYING PKG_FIXUP:=autoreconf PKG_INSTALL:=1 diff --git a/utils/fuse-overlayfs/patches/010-m4.patch b/utils/fuse-overlayfs/patches/010-m4.patch new file mode 100644 index 00000000..522d6d70 --- /dev/null +++ b/utils/fuse-overlayfs/patches/010-m4.patch @@ -0,0 +1,22 @@ +--- a/m4/stdint.m4 ++++ b/m4/stdint.m4 +@@ -15,7 +15,7 @@ AC_DEFUN_ONCE([gl_STDINT_H], + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + AC_REQUIRE([gl_LIMITS_H]) +- AC_REQUIRE([gt_TYPE_WINT_T]) ++ AC_REQUIRE([gt_TYPE_WINT_T_FO]) + + dnl Check for long long int and unsigned long long int. + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) +--- a/m4/wint_t.m4 ++++ b/m4/wint_t.m4 +@@ -9,7 +9,7 @@ dnl Test whether has the 'wint + dnl or would, if present, override 'wint_t'. + dnl Prerequisite: AC_PROG_CC + +-AC_DEFUN([gt_TYPE_WINT_T], ++AC_DEFUN([gt_TYPE_WINT_T_FO], + [ + AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t], + [AC_COMPILE_IFELSE( From 2aebb105d4858709423fd440cdba6aabc778021b Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 10 Jun 2021 10:11:25 +0200 Subject: [PATCH 065/102] lcd4linux: Possibility added that the config can also be loaded from /tmp Until now, the configuration must be stored under '/etc/lcd4linux.conf'. So that the configuration can also be changed dynamically, it makes sense to store this under /tmp and load them from this directory. The init script first checks whether there is a configuration under '/etc/lcd4linux.conf' and only then does it try to find it under '/tmp/lcd4linux.conf'. If there is no configuration, an error message is shown. Signed-off-by: Florian Eckert --- utils/lcd4linux/Makefile | 2 +- utils/lcd4linux/files/lcd4linux.init | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/utils/lcd4linux/Makefile b/utils/lcd4linux/Makefile index 20eac074..4f42576d 100644 --- a/utils/lcd4linux/Makefile +++ b/utils/lcd4linux/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lcd4linux -PKG_RELEASE:=7 +PKG_RELEASE:=8 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/feckert/lcd4linux diff --git a/utils/lcd4linux/files/lcd4linux.init b/utils/lcd4linux/files/lcd4linux.init index a5e6a9db..3c743b04 100644 --- a/utils/lcd4linux/files/lcd4linux.init +++ b/utils/lcd4linux/files/lcd4linux.init @@ -5,10 +5,19 @@ START=98 USE_PROCD=1 PROG="/usr/bin/lcd4linux" -CONFIGFILE="/etc/lcd4linux.conf" +STATIC_CONFIG="/etc/lcd4linux.conf" +DYNAMIC_CONFIG="/tmp/lcd4linux.conf" start_service() { - [ -f /etc/lcd4linux.conf ] || return 1 + if [ -f "$DYNAMIC_CONFIG" ]; then + CONFIGFILE="$DYNAMIC_CONFIG" + elif [ -f "$STATIC_CONFIG" ]; then + CONFIGFILE="$STATIC_CONFIG" + else + echo "No config found" + return 1 + fi + procd_open_instance procd_set_param command "$PROG" procd_append_param command -F From b24da9232203442753c12dc9ae12b88252ec2e7b Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 29 Sep 2022 16:19:53 +0200 Subject: [PATCH 066/102] lcd4linux: add debug option Setting the DEBUG variable in the init script to '1' enables the lcd4linux verbose mode, by setting the arg '-vv'. The option also redirects the error and stdout to the syslog. Signed-off-by: Florian Eckert --- utils/lcd4linux/files/lcd4linux.init | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/lcd4linux/files/lcd4linux.init b/utils/lcd4linux/files/lcd4linux.init index 3c743b04..3884b041 100644 --- a/utils/lcd4linux/files/lcd4linux.init +++ b/utils/lcd4linux/files/lcd4linux.init @@ -4,6 +4,7 @@ START=98 USE_PROCD=1 +DEBUG=1 PROG="/usr/bin/lcd4linux" STATIC_CONFIG="/etc/lcd4linux.conf" DYNAMIC_CONFIG="/tmp/lcd4linux.conf" @@ -24,6 +25,11 @@ start_service() { procd_append_param command -q procd_append_param command -o /tmp/lcd4linux.png procd_append_param command -f "$CONFIGFILE" + [ "$DEBUG" = 1 ] && { + procd_append_param command -vv + procd_set_param stdout 1 + procd_set_param stderr 1 + } procd_set_param file "$CONFIGFILE" procd_close_instance } From 17578fe9e2b7f5901e0dfc39af9a80f739824821 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 13 Jan 2023 20:58:47 -0800 Subject: [PATCH 067/102] pcsc-tools: update to 1.6.1 Signed-off-by: Rosen Penev --- utils/pcsc-tools/Makefile | 6 +++--- utils/pcsc-tools/patches/001-disable-atr.patch | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/utils/pcsc-tools/Makefile b/utils/pcsc-tools/Makefile index 76ad6588..92680165 100644 --- a/utils/pcsc-tools/Makefile +++ b/utils/pcsc-tools/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pcsc-tools -PKG_VERSION:=1.5.7 +PKG_VERSION:=1.6.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=http://ludovic.rousseau.free.fr/softwares/pcsc-tools/ -PKG_HASH:=e0ea8f8496d5bcf5316da913869ba95b925d0405c2aaade801c0d6ce7697699d +PKG_SOURCE_URL:=http://ludovic.rousseau.free.fr/softwares/pcsc-tools +PKG_HASH:=86fb756adfd18958d05af61e53c7503d4c46f0700677e6d0688dd4360eb53150 PKG_MAINTAINER:= PKG_LICENSE:=GPL-2.0-or-later diff --git a/utils/pcsc-tools/patches/001-disable-atr.patch b/utils/pcsc-tools/patches/001-disable-atr.patch index fcca4cd1..c5adda10 100644 --- a/utils/pcsc-tools/patches/001-disable-atr.patch +++ b/utils/pcsc-tools/patches/001-disable-atr.patch @@ -3,12 +3,12 @@ as a dependency. --- a/pcsc_scan.c +++ b/pcsc_scan.c -@@ -241,7 +241,7 @@ static void initialize_options(options_t - #ifdef WIN32 +@@ -294,7 +294,7 @@ static void initialize_options(options_t + #if defined(WIN32) || defined(__APPLE__) options->analyse_atr = False; #else - options->analyse_atr = True; + options->analyse_atr = False; #endif options->stress_card = False; - options->print_version = False; + options->maxtime = 0; From 1015c02652b7036241c8e126cfc41b28428feaf5 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 14 Jan 2023 13:21:00 -0800 Subject: [PATCH 068/102] pigz: update to 2.7 Signed-off-by: Rosen Penev --- utils/pigz/Makefile | 6 +++--- utils/pigz/patches/001.patch | 14 +++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/utils/pigz/Makefile b/utils/pigz/Makefile index 7f76a088..f37092a3 100644 --- a/utils/pigz/Makefile +++ b/utils/pigz/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pigz -PKG_VERSION:=2.4 +PKG_VERSION:=2.7 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://zlib.net/pigz/ -PKG_HASH:=a4f816222a7b4269bd232680590b579ccc72591f1bb5adafcd7208ca77e14f73 +PKG_SOURCE_URL:=https://zlib.net/pigz +PKG_HASH:=b4c9e60344a08d5db37ca7ad00a5b2c76ccb9556354b722d56d55ca7e8b1c707 PKG_MAINTAINER:=Ken Wong PKG_LICENSE:=CUSTOM diff --git a/utils/pigz/patches/001.patch b/utils/pigz/patches/001.patch index bdd910c3..28e8eaa4 100644 --- a/utils/pigz/patches/001.patch +++ b/utils/pigz/patches/001.patch @@ -1,14 +1,18 @@ --- a/Makefile +++ b/Makefile -@@ -1,7 +1,7 @@ +@@ -1,11 +1,11 @@ -CC=gcc --CFLAGS=-O3 -Wall -Wextra -Wno-unknown-pragmas +-CFLAGS=-O3 -Wall -Wextra -Wno-unknown-pragmas -Wcast-qual -LDFLAGS= --LIBS=-lm -lpthread -lz +CC?=gcc -+CFLAGS?=-O3 -Wall -Wextra -Wno-unknown-pragmas ++CFLAGS?=-O3 -Wall -Wextra -Wno-unknown-pragmas -Wcast-qual +LDFLAGS?= + # CFLAGS=-O3 -Wall -Wextra -Wno-unknown-pragmas -Wcast-qual -g -fsanitize=thread + # LDFLAGS=-g -fsanitize=thread + # CFLAGS=-O3 -Wall -Wextra -Wno-unknown-pragmas -Wcast-qual -g -fsanitize=address + # LDFLAGS=-g -fsanitize=address +-LIBS=-lm -lpthread -lz +LIBS?=-lm -lpthread -lz ZOPFLI=zopfli/src/zopfli/ - ZOP=deflate.o blocksplitter.o tree.o lz77.o cache.o hash.o util.o squeeze.o katajainen.o + ZOP=deflate.o blocksplitter.o tree.o lz77.o cache.o hash.o util.o squeeze.o katajainen.o symbols.o From 0531874651771e870cfd9a9ccef3d5254b4514c0 Mon Sep 17 00:00:00 2001 From: Nuno Goncalves Date: Tue, 12 Oct 2021 18:30:13 +0200 Subject: [PATCH 069/102] gl-puli-mcu: add GL.iNet GL-XE300 (Puli) power monitoring daemon Signed-off-by: Nuno Goncalves --- utils/gl-puli-mcu/Makefile | 33 +++ .../gl-puli-mcu/files/etc/init.d/gl-puli-mcu | 13 ++ utils/gl-puli-mcu/src/CMakeLists.txt | 7 + utils/gl-puli-mcu/src/gl-puli-mcu.c | 214 ++++++++++++++++++ 4 files changed, 267 insertions(+) create mode 100644 utils/gl-puli-mcu/Makefile create mode 100755 utils/gl-puli-mcu/files/etc/init.d/gl-puli-mcu create mode 100644 utils/gl-puli-mcu/src/CMakeLists.txt create mode 100644 utils/gl-puli-mcu/src/gl-puli-mcu.c diff --git a/utils/gl-puli-mcu/Makefile b/utils/gl-puli-mcu/Makefile new file mode 100644 index 00000000..a0be04b8 --- /dev/null +++ b/utils/gl-puli-mcu/Makefile @@ -0,0 +1,33 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=gl-puli-mcu +PKG_VERSION:=1 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_MAINTAINER:=Nuno Goncalves +PKG_LICENSE:=GPL-3.0-or-later + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/gl-puli-mcu + SECTION:=utils + CATEGORY:=Utilities + TITLE:=GL.iNet GL-XE300 (Puli) power monitoring support + DEPENDS:=+kmod-usb-serial-ch341 +libubus +libubox +endef + +define Package/gl-puli-mcu/description + Interfaces with GL-XE300 (Puli) power monitoring MCU over + a USB to UART adapter present on the device and provides + battery SOC, temperature, charging state and cycle count at + ubus battery/info. +endef + +define Package/gl-puli-mcu/install + $(CP) ./files/* $(1)/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/gl-puli-mcu $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,gl-puli-mcu)) diff --git a/utils/gl-puli-mcu/files/etc/init.d/gl-puli-mcu b/utils/gl-puli-mcu/files/etc/init.d/gl-puli-mcu new file mode 100755 index 00000000..d8252973 --- /dev/null +++ b/utils/gl-puli-mcu/files/etc/init.d/gl-puli-mcu @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common + +START=99 +USE_PROCD=1 + +start_service() { + procd_open_instance + procd_set_param command /usr/sbin/gl-puli-mcu + procd_set_param respawn + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_close_instance +} diff --git a/utils/gl-puli-mcu/src/CMakeLists.txt b/utils/gl-puli-mcu/src/CMakeLists.txt new file mode 100644 index 00000000..de0d2c1a --- /dev/null +++ b/utils/gl-puli-mcu/src/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.12) +PROJECT(gl-puli-mcu C) +ADD_DEFINITIONS(-Os -ggdb -Wall --std=gnu17 -Wmissing-declarations) +SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") +ADD_EXECUTABLE(gl-puli-mcu gl-puli-mcu.c) +TARGET_LINK_LIBRARIES(gl-puli-mcu ubox ubus ${CMAKE_DL_LIBS}) +INSTALL(TARGETS gl-puli-mcu RUNTIME DESTINATION sbin) diff --git a/utils/gl-puli-mcu/src/gl-puli-mcu.c b/utils/gl-puli-mcu/src/gl-puli-mcu.c new file mode 100644 index 00000000..fe55cc42 --- /dev/null +++ b/utils/gl-puli-mcu/src/gl-puli-mcu.c @@ -0,0 +1,214 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * + * Copyright (C) 2014 John Crispin + * Copyright (C) 2021 Nuno Goncalves + */ + +#include +#include + +#include +#include +#include +#include +#include + +static struct ustream_fd stream; +static struct ubus_auto_conn conn; +static struct blob_buf b; + +struct Battery +{ + float temperature; + uint16_t cycles; + uint8_t soc; + bool charging; + bool set; +} battery; + +static bool +process(char *read) +{ + if (read[0] != '{' || + read[1] != 'O' || + read[2] != 'K' || + read[3] != '}' || + read[4] != ',') + return false; + const char *from = read + 5; + char *to; + battery.soc = strtoul(from, &to, 10); + if (from == to) + return false; + from = to + 1; + battery.temperature = strtoul(from, &to, 10) / 10.0f; + if (from == to) + return false; + if (to[0] != ',' || (to[1] != '0' && to[1] != '1') || to[2] != ',') + return false; + battery.charging = to[1] == '1'; + from = to + 3; + battery.cycles = strtoul(from, &to, 10); + if (from == to) + return false; + return true; +} + +static int +consume(struct ustream *s, char **a) +{ + char *eol = strstr(*a, "\n"); + + if (!eol) + return -1; + + *eol++ = '\0'; + + battery.set = process(*a); + if (!battery.set) + ULOG_ERR("failed to parse message from serial: %s", a); + + ustream_consume(s, eol - *a); + *a = eol; + + return 0; +} + +static void +msg_cb(struct ustream *s, int bytes) +{ + int len; + char *a = ustream_get_read_buf(s, &len); + + while (!consume(s, &a)) + ; +} + +static void +notify_cb(struct ustream *s) +{ + if (!s->eof) + return; + + ULOG_ERR("tty error, shutting down\n"); + exit(-1); +} + +static int +serial_open(char *dev) +{ + const int tty = open(dev, O_RDWR | O_NOCTTY | O_NONBLOCK); + if (tty < 0) + { + ULOG_ERR("%s: device open failed: %s\n", dev, strerror(errno)); + return -1; + } + + struct termios config; + tcgetattr(tty, &config); + cfmakeraw(&config); + cfsetispeed(&config, B9600); + cfsetospeed(&config, B9600); + tcsetattr(tty, TCSANOW, &config); + + stream.stream.string_data = true; + stream.stream.notify_read = msg_cb; + stream.stream.notify_state = notify_cb; + + ustream_fd_init(&stream, tty); + + tcflush(tty, TCIFLUSH); + + return 0; +} + +static struct uloop_timeout serial_query_timer; +static void +serial_query_handler(struct uloop_timeout *timeout) +{ + const char cmd[] = "{ \"mcu_status\": \"1\" }\n"; + const unsigned cmd_len = sizeof(cmd) - 1; + ustream_write(&stream.stream, cmd, cmd_len, false); + uloop_timeout_set(&serial_query_timer, 3000); // timeout in 3 sec + uloop_timeout_add(timeout); +} + +static int +battery_info(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + blob_buf_init(&b, 0); + + if (!battery.set) + { + blobmsg_add_u8(&b, "error", 1); + } + else + { + blobmsg_add_u16(&b, "soc", battery.soc); + blobmsg_add_u8(&b, "charging", battery.charging); + blobmsg_add_double(&b, "temperature", battery.temperature); + blobmsg_add_u16(&b, "cycles", battery.cycles); + } + ubus_send_reply(ctx, req, b.head); + + return UBUS_STATUS_OK; +} + +static const struct ubus_method battery_methods[] = { + UBUS_METHOD_NOARG("info", battery_info), +}; + +static struct ubus_object_type battery_object_type = + UBUS_OBJECT_TYPE("battery", battery_methods); + +static struct ubus_object battery_object = { + .name = "battery", + .type = &battery_object_type, + .methods = battery_methods, + .n_methods = ARRAY_SIZE(battery_methods), +}; + +static void +ubus_connect_handler(struct ubus_context *ctx) +{ + int ret; + + ret = ubus_add_object(ctx, &battery_object); + if (ret) + fprintf(stderr, "Failed to add object: %s\n", ubus_strerror(ret)); +} + +int +main(int argc, char **argv) +{ + + uloop_init(); + conn.path = NULL; + conn.cb = ubus_connect_handler; + ubus_auto_connect(&conn); + + if (serial_open("/dev/ttyUSB0") < 0) + return -1; + + serial_query_timer.cb = serial_query_handler; + serial_query_handler(&serial_query_timer); + uloop_run(); + uloop_done(); + + return 0; +} From 6c4793d1ae0f0a9dcf2c909ce1b12b6fd1e02f56 Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Wed, 2 Nov 2022 16:08:08 +0100 Subject: [PATCH 070/102] librespeed-cli: add package Signed-off-by: Michal Vasilek --- utils/librespeed-cli/Makefile | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 utils/librespeed-cli/Makefile diff --git a/utils/librespeed-cli/Makefile b/utils/librespeed-cli/Makefile new file mode 100644 index 00000000..b724b875 --- /dev/null +++ b/utils/librespeed-cli/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2022 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=librespeed-cli +PKG_VERSION:=1.0.10 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/librespeed/speedtest-cli/tar.gz/v${PKG_VERSION}? +PKG_HASH:=904ec84f41714d5a7ab778534d332219cd254fdd0f97cc33ebb3540d31fb802c + +PKG_MAINTAINER:=Michal Vasilek +PKG_LICENSE:=LGPL-3.0-only +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DIR:=$(BUILD_DIR)/speedtest-cli-$(PKG_VERSION) +PKG_BUILD_DEPENDS:=golang/host +PKG_BUILD_PARALLEL:=1 +PKG_USE_MIPS16:=0 + +GO_PKG:=github.com/librespeed/speedtest-cli + +include $(INCLUDE_DIR)/package.mk +include ../../lang/golang/golang-package.mk + +define Package/librespeed-cli + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Command line client for LibreSpeed + URL:=https://github.com/librespeed/speedtest-cli + DEPENDS:=$(GO_ARCH_DEPENDS) +endef + +define Package/librespeed-cli/description + LibreSpeed client for measuring internet speed from command line. +endef + +$(eval $(call GoBinPackage,librespeed-cli)) +$(eval $(call BuildPackage,librespeed-cli)) From bec265434488d586d729f4f2cb90ca4c371fc2ab Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Mon, 21 Nov 2022 13:49:20 +0100 Subject: [PATCH 071/102] librespeed-cli: rename binary to librespeed-cli upstream names the binary librespeed-cli and this avoids a conflict with python3-speedtest-cli Signed-off-by: Michal Vasilek --- utils/librespeed-cli/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/librespeed-cli/Makefile b/utils/librespeed-cli/Makefile index b724b875..a816fdae 100644 --- a/utils/librespeed-cli/Makefile +++ b/utils/librespeed-cli/Makefile @@ -41,5 +41,11 @@ define Package/librespeed-cli/description LibreSpeed client for measuring internet speed from command line. endef +define Package/librespeed-cli/install + $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR)) + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/speedtest-cli $(1)/usr/bin/librespeed-cli +endef + $(eval $(call GoBinPackage,librespeed-cli)) $(eval $(call BuildPackage,librespeed-cli)) From f462e425437527420bb44be22c36ff35b3f19bdb Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Fri, 25 Jun 2021 09:04:23 +0100 Subject: [PATCH 072/102] lolcat: add package A pure C implementation of lolcat, probably the lightest out there. Signed-off-by: Rui Salvaterra --- utils/lolcat/Makefile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 utils/lolcat/Makefile diff --git a/utils/lolcat/Makefile b/utils/lolcat/Makefile new file mode 100644 index 00000000..644bd25f --- /dev/null +++ b/utils/lolcat/Makefile @@ -0,0 +1,29 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=lolcat +PKG_VERSION:=1.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/jaseg/lolcat/tar.gz/refs/tags/v$(PKG_VERSION)? +PKG_HASH:=b6e1a0e24479fbdd4eb907531339e2cafc0c00b78d19caf70e8377b8b7546331 + +PKG_MAINTAINER:=Rui Salvaterra +PKG_LICENSE:=WTFPL +PKG_LICENSE_FILES:=LICENSE + +include $(INCLUDE_DIR)/package.mk + +define Package/lolcat + SECTION:=utils + CATEGORY:=Utilities + TITLE:=A cat variant with rainbow colour output + URL:=https://github.com/jaseg/lolcat +endef + +define Package/lolcat/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lolcat $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,lolcat)) From 6a79da3e60850ea45299f3a727d163ae83ab5f3f Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Mon, 4 Oct 2021 17:32:33 +0200 Subject: [PATCH 073/102] miniflux: new package Signed-off-by: Michal Vasilek --- utils/miniflux/Makefile | 59 ++++++++++++++++++++++++++++++ utils/miniflux/files/miniflux.conf | 20 ++++++++++ utils/miniflux/files/miniflux.init | 44 ++++++++++++++++++++++ utils/miniflux/test.sh | 2 + 4 files changed, 125 insertions(+) create mode 100644 utils/miniflux/Makefile create mode 100644 utils/miniflux/files/miniflux.conf create mode 100644 utils/miniflux/files/miniflux.init create mode 100644 utils/miniflux/test.sh diff --git a/utils/miniflux/Makefile b/utils/miniflux/Makefile new file mode 100644 index 00000000..52837102 --- /dev/null +++ b/utils/miniflux/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=miniflux +PKG_VERSION:=2.0.33 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/miniflux/v2/tar.gz/${PKG_VERSION}? +PKG_HASH:=b61c9ddb62be8f1cc15a70a1c916d55f8ac47299df9c2323552eb275a36d2cc3 + +PKG_MAINTAINER:=Michal Vasilek +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DIR:=$(BUILD_DIR)/v2-$(PKG_VERSION) +PKG_BUILD_DEPENDS:=golang/host +PKG_BUILD_PARALLEL:=1 +PKG_USE_MIPS16:=0 + +GO_PKG:=miniflux.app +GO_PKG_LDFLAGS_X:=miniflux.app/version.Version=$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../../lang/golang/golang-package.mk + +define Package/miniflux + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Feed reader + USERID:=miniflux=1120:miniflux=1120 + URL:=https://miniflux.app + DEPENDS:=$(GO_ARCH_DEPENDS) +pgsql-server +endef + +define Package/miniflux/description + Miniflux is a small and simple feed reader. +endef + +define Package/miniflux/install + $(call GoPackage/Package/Install/Bin,$(1)) + $(INSTALL_DIR) $(1)/etc/config/ + $(INSTALL_CONF) ./files/miniflux.conf $(1)/etc/config/miniflux + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) ./files/miniflux.init $(1)/etc/init.d/miniflux +endef + +define Package/miniflux/conffiles +/etc/config/miniflux +endef + +$(eval $(call GoBinPackage,miniflux)) +$(eval $(call BuildPackage,miniflux)) diff --git a/utils/miniflux/files/miniflux.conf b/utils/miniflux/files/miniflux.conf new file mode 100644 index 00000000..ec448a24 --- /dev/null +++ b/utils/miniflux/files/miniflux.conf @@ -0,0 +1,20 @@ +package miniflux + +config miniflux main + # if set, all other uci settings are ignored + option config_file '' + + option listen_address '127.0.0.1:5433' + + # run migrations on each start, disabling this will make miniflux fail to + # start on the next upgrade until migrations are ran manually + option migrate 1 + +config miniflux database + # if set, all other options in this section will be ignored + option url '' + + option user miniflux + option password '' + option sslmode disable + option dbname miniflux diff --git a/utils/miniflux/files/miniflux.init b/utils/miniflux/files/miniflux.init new file mode 100644 index 00000000..6c718690 --- /dev/null +++ b/utils/miniflux/files/miniflux.init @@ -0,0 +1,44 @@ +#!/bin/sh /etc/rc.common + +# Copyright (C) 2021 CZ.NIC z.s.p.o. (https://www.nic.cz/) + +START=70 + +USE_PROCD=1 +PROG=/usr/bin/miniflux.app + +start_service() { + local config_file + config_load miniflux + + procd_open_instance + procd_set_param command "$PROG" + procd_append_param user miniflux + + config_get config_file main config_file + if [ -n "$config_file" ]; then + procd_append_param command -config-file="$config_file" + else + local listen_address run_migrations database_url + config_get listen_address main listen_address + procd_append_param env LISTEN_ADDR="$listen_address" + config_get run_migrations main run_migrations + [ "$run_migrations" = 1 ] && procd_append_param env RUN_MIGRATIONS=1 + + config_get database_url database url + if [ -z "$database_url" ]; then + local database_user database_password database_dbname database_sslmode + config_get database_user database user + config_get database_password database password + config_get database_dbname database dbname + config_get database_sslmode database sslmode + database_url="user=$database_user password=$database_password dbname=$database_dbname sslmode=$database_sslmode" + fi + procd_append_param env DATABASE_URL="$database_url" + fi + + procd_set_param file "$config_file" + procd_set_param respawn + procd_set_param stderr 1 + procd_close_instance +} diff --git a/utils/miniflux/test.sh b/utils/miniflux/test.sh new file mode 100644 index 00000000..42ff3198 --- /dev/null +++ b/utils/miniflux/test.sh @@ -0,0 +1,2 @@ +#!/bin/sh +miniflux.app -version | grep "$2" From b35cbc44ec37a378d5a19923de905498bd33d456 Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Wed, 12 Jan 2022 12:12:10 +0100 Subject: [PATCH 074/102] miniflux: update to 2.0.34 Signed-off-by: Michal Vasilek --- utils/miniflux/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/miniflux/Makefile b/utils/miniflux/Makefile index 52837102..902177ff 100644 --- a/utils/miniflux/Makefile +++ b/utils/miniflux/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=miniflux -PKG_VERSION:=2.0.33 +PKG_VERSION:=2.0.34 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/miniflux/v2/tar.gz/${PKG_VERSION}? -PKG_HASH:=b61c9ddb62be8f1cc15a70a1c916d55f8ac47299df9c2323552eb275a36d2cc3 +PKG_HASH:=ce065b8afa6d220b80b9c0b9afbfe3c42f08bc77718deaeb05864bd444b4d324 PKG_MAINTAINER:=Michal Vasilek PKG_LICENSE:=Apache-2.0 From a31bf6c9b4424383e5e4b041c48c5a775ec9856e Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Wed, 2 Feb 2022 13:02:46 +0100 Subject: [PATCH 075/102] miniflux: update to 2.0.35 Signed-off-by: Michal Vasilek --- utils/miniflux/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/miniflux/Makefile b/utils/miniflux/Makefile index 902177ff..6cbd024e 100644 --- a/utils/miniflux/Makefile +++ b/utils/miniflux/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=miniflux -PKG_VERSION:=2.0.34 +PKG_VERSION:=2.0.35 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/miniflux/v2/tar.gz/${PKG_VERSION}? -PKG_HASH:=ce065b8afa6d220b80b9c0b9afbfe3c42f08bc77718deaeb05864bd444b4d324 +PKG_HASH:=8f9693380754072d1a74671c6b645abe7ddb0c8d22651ebc867b1af6dfcc4229 PKG_MAINTAINER:=Michal Vasilek PKG_LICENSE:=Apache-2.0 From 08003a06ccdf474fabe310d173e24db75870e9a9 Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Thu, 12 May 2022 18:49:32 +0200 Subject: [PATCH 076/102] miniflux: update to 2.0.36 Signed-off-by: Michal Vasilek --- utils/miniflux/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/miniflux/Makefile b/utils/miniflux/Makefile index 6cbd024e..2b54c08c 100644 --- a/utils/miniflux/Makefile +++ b/utils/miniflux/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=miniflux -PKG_VERSION:=2.0.35 +PKG_VERSION:=2.0.36 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/miniflux/v2/tar.gz/${PKG_VERSION}? -PKG_HASH:=8f9693380754072d1a74671c6b645abe7ddb0c8d22651ebc867b1af6dfcc4229 +PKG_HASH:=15ac4ad4ab6f87de2143a85f52252e80d7c216a69aab334363e1972b81f231fd PKG_MAINTAINER:=Michal Vasilek PKG_LICENSE:=Apache-2.0 From 36cd606f4129ea06cc0ce801e7f8616e6946bbe4 Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Fri, 3 Jun 2022 16:52:51 +0200 Subject: [PATCH 077/102] miniflux: update to 2.0.37 Signed-off-by: Michal Vasilek --- utils/miniflux/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/miniflux/Makefile b/utils/miniflux/Makefile index 2b54c08c..7768bee1 100644 --- a/utils/miniflux/Makefile +++ b/utils/miniflux/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=miniflux -PKG_VERSION:=2.0.36 +PKG_VERSION:=2.0.37 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/miniflux/v2/tar.gz/${PKG_VERSION}? -PKG_HASH:=15ac4ad4ab6f87de2143a85f52252e80d7c216a69aab334363e1972b81f231fd +PKG_HASH:=fa647ea15ade5ec2ed64648a34d6df30553f1358f7365a3f7301ff4fd212b635 PKG_MAINTAINER:=Michal Vasilek PKG_LICENSE:=Apache-2.0 From 3cb427967a1fd842444c0dc55e92ad0da06493f4 Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Wed, 17 Aug 2022 11:25:22 +0200 Subject: [PATCH 078/102] miniflux: update to 2.0.38 Signed-off-by: Michal Vasilek --- utils/miniflux/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/miniflux/Makefile b/utils/miniflux/Makefile index 7768bee1..8b5d47f2 100644 --- a/utils/miniflux/Makefile +++ b/utils/miniflux/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=miniflux -PKG_VERSION:=2.0.37 +PKG_VERSION:=2.0.38 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/miniflux/v2/tar.gz/${PKG_VERSION}? -PKG_HASH:=fa647ea15ade5ec2ed64648a34d6df30553f1358f7365a3f7301ff4fd212b635 +PKG_HASH:=8c2e35a91d9b47a0879bcee4c23f342375293e97cee9639bb44b359b21e14d2a PKG_MAINTAINER:=Michal Vasilek PKG_LICENSE:=Apache-2.0 From cd21d398441c309d3bb4aa715aafc74da58ce639 Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Tue, 13 Dec 2022 10:00:53 +0100 Subject: [PATCH 079/102] miniflux: update to 2.0.41 Signed-off-by: Michal Vasilek --- utils/miniflux/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/miniflux/Makefile b/utils/miniflux/Makefile index 8b5d47f2..10d78a3a 100644 --- a/utils/miniflux/Makefile +++ b/utils/miniflux/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=miniflux -PKG_VERSION:=2.0.38 -PKG_RELEASE:=$(AUTORELEASE) +PKG_VERSION:=2.0.41 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/miniflux/v2/tar.gz/${PKG_VERSION}? -PKG_HASH:=8c2e35a91d9b47a0879bcee4c23f342375293e97cee9639bb44b359b21e14d2a +PKG_HASH:=01e150ebfba12c8b5ca7c1d9d5a5976d018081cafc11228d6f77a48ac3333e1b PKG_MAINTAINER:=Michal Vasilek PKG_LICENSE:=Apache-2.0 From 14d9309a22726c2c90694ab29e4453cc77e97b7b Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Mon, 14 Feb 2022 11:36:12 +0100 Subject: [PATCH 080/102] opendoas: add package Signed-off-by: Michal Vasilek --- utils/opendoas/Makefile | 40 +++++++++++++++++++ .../configure-ignore-invalid-arguments.patch | 11 +++++ .../patches/makefile-remove-chown.patch | 10 +++++ 3 files changed, 61 insertions(+) create mode 100644 utils/opendoas/Makefile create mode 100644 utils/opendoas/patches/configure-ignore-invalid-arguments.patch create mode 100644 utils/opendoas/patches/makefile-remove-chown.patch diff --git a/utils/opendoas/Makefile b/utils/opendoas/Makefile new file mode 100644 index 00000000..0019b564 --- /dev/null +++ b/utils/opendoas/Makefile @@ -0,0 +1,40 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=opendoas +PKG_VERSION:=6.8.2 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://github.com/Duncaen/OpenDoas/releases/download/v$(PKG_VERSION) +PKG_HASH:=4e98828056d6266bd8f2c93e6ecf12a63a71dbfd70a5ea99ccd4ab6d0745adf0 + +PKG_MAINTAINER:=Michal Vasilek +PKG_LICENSE:=ISC, BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/opendoas + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Portable OpenBSD doas to execute commands as another user + URL:=https://github.com/Duncaen/OpenDoas +endef + +define Package/opendoas/description + OpenDoas: a portable version of OpenBSD's doas command + + doas is a minimal replacement for the venerable sudo. It was initially + written by Ted Unangst of the OpenBSD project to provide 95% of the features + of sudo with a fraction of the codebase. +endef + +define Package/opendoas/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/doas $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,opendoas)) diff --git a/utils/opendoas/patches/configure-ignore-invalid-arguments.patch b/utils/opendoas/patches/configure-ignore-invalid-arguments.patch new file mode 100644 index 00000000..3ed43514 --- /dev/null +++ b/utils/opendoas/patches/configure-ignore-invalid-arguments.patch @@ -0,0 +1,11 @@ +--- a/configure ++++ b/configure +@@ -67,7 +67,7 @@ for x; do + --uid-max) UID_MAX=$var ;; + --gid-max) UID_MAX=$var ;; + --help|-h) usage ;; +- *) die "Error: unknown option $opt" ;; ++ *) echo "Error: unknown option $opt" ;; + esac + done + diff --git a/utils/opendoas/patches/makefile-remove-chown.patch b/utils/opendoas/patches/makefile-remove-chown.patch new file mode 100644 index 00000000..05cb5709 --- /dev/null +++ b/utils/opendoas/patches/makefile-remove-chown.patch @@ -0,0 +1,10 @@ +--- a/GNUmakefile ++++ b/GNUmakefile +@@ -21,7 +21,6 @@ install: ${PROG} ${PAM_DOAS} ${MAN} + mkdir -p -m 0755 ${DESTDIR}${MANDIR}/man1 + mkdir -p -m 0755 ${DESTDIR}${MANDIR}/man5 + cp -f ${PROG} ${DESTDIR}${BINDIR} +- chown ${BINOWN}:${BINGRP} ${DESTDIR}${BINDIR}/${PROG} + chmod ${BINMODE} ${DESTDIR}${BINDIR}/${PROG} + [ -n "${PAM_DOAS}" ] && cp ${PAM_DOAS} ${DESTDIR}${PAMDIR}/doas || true + [ -n "${PAM_DOAS}" ] && chmod 0644 ${DESTDIR}${PAMDIR}/doas || true From 76470dd9cdf6269681035c92be6159040b5b3629 Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Tue, 16 Aug 2022 15:02:49 +0200 Subject: [PATCH 081/102] opendoas: fix build with PAM When PAM is available, the build system will detect and use it, but the package dependency was missing. Signed-off-by: Michal Vasilek --- utils/opendoas/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/opendoas/Makefile b/utils/opendoas/Makefile index 0019b564..78f962f3 100644 --- a/utils/opendoas/Makefile +++ b/utils/opendoas/Makefile @@ -22,6 +22,7 @@ define Package/opendoas CATEGORY:=Utilities TITLE:=Portable OpenBSD doas to execute commands as another user URL:=https://github.com/Duncaen/OpenDoas + DEPENDS:=+BUSYBOX_CONFIG_PAM:libpam endef define Package/opendoas/description From 0b294a8647eb319ee2d6bb3dd7475375268a2e82 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Wed, 14 Sep 2022 21:21:50 -0300 Subject: [PATCH 082/102] opendoas: avoid libpam dependency Package is failing to build because it picks up libpam dependency regardless of `BUSYBOX_CONFIG_PAM`. Use configure args --with-pam, --without-pam to assert the option. Signed-off-by: Eneas U de Queiroz --- utils/opendoas/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/opendoas/Makefile b/utils/opendoas/Makefile index 78f962f3..23882d52 100644 --- a/utils/opendoas/Makefile +++ b/utils/opendoas/Makefile @@ -33,6 +33,8 @@ define Package/opendoas/description of sudo with a fraction of the codebase. endef +CONFIGURE_ARGS += $(if $(CONFIG_BUSYBOX_CONFIG_PAM),--with,--without)-pam + define Package/opendoas/install $(INSTALL_DIR) $(1)/usr/bin $(CP) $(PKG_INSTALL_DIR)/usr/bin/doas $(1)/usr/bin/ From f85163c22168db065d99351fb73174e62d4620f0 Mon Sep 17 00:00:00 2001 From: Lucian Cristian Date: Wed, 1 Jun 2022 14:55:00 +0000 Subject: [PATCH 083/102] pciutils: update to 3.8.0 Signed-off-by: Lucian Cristian --- utils/pciutils/Makefile | 13 ++++---- .../patches/100-remove-no-timestamping.patch | 11 ------- utils/pciutils/patches/101-no-strip.patch | 10 +++--- .../pciutils/patches/102-compressed-ids.patch | 31 ------------------- .../patches/103-relative-path-ids.patch | 11 ------- utils/pciutils/patches/104-resolv.patch | 6 ++-- utils/pciutils/patches/105-fix-host.patch | 11 ------- utils/pciutils/patches/106-hwdata.patch | 4 +-- 8 files changed, 17 insertions(+), 80 deletions(-) delete mode 100644 utils/pciutils/patches/100-remove-no-timestamping.patch delete mode 100644 utils/pciutils/patches/102-compressed-ids.patch delete mode 100644 utils/pciutils/patches/103-relative-path-ids.patch delete mode 100644 utils/pciutils/patches/105-fix-host.patch diff --git a/utils/pciutils/Makefile b/utils/pciutils/Makefile index 84b8998f..104abbd2 100644 --- a/utils/pciutils/Makefile +++ b/utils/pciutils/Makefile @@ -8,18 +8,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pciutils -PKG_VERSION:=3.7.0 -PKG_RELEASE:=2 +PKG_VERSION:=3.8.0 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/software/utils/pciutils -PKG_HASH:=9d40b97be8b6a2cdf96aead5a61881d1f7e4e0da9544a9bac4fba1ae9dcd40eb +PKG_HASH:=91edbd0429a84705c9ad156d4ff38ccc724d41ea54c4c5b88e38e996f8a34f05 PKG_MAINTAINER:=Lucian Cristian PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING - -PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk @@ -73,8 +71,9 @@ define Build/InstallDev endef define Package/pciutils/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{lspci,setpci,update-pciids} $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lspci $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/setpci $(1)/usr/sbin/ endef define Package/libpci/install diff --git a/utils/pciutils/patches/100-remove-no-timestamping.patch b/utils/pciutils/patches/100-remove-no-timestamping.patch deleted file mode 100644 index 93bc85fa..00000000 --- a/utils/pciutils/patches/100-remove-no-timestamping.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/update-pciids.sh -+++ b/update-pciids.sh -@@ -33,7 +33,7 @@ if which curl >/dev/null 2>&1 ; then - DL="curl -o $DEST.new $SRC" - ${quiet} && DL="$DL -s -S" - elif which wget >/dev/null 2>&1 ; then -- DL="wget --no-timestamping -O $DEST.new $SRC" -+ DL="wget -O $DEST.new $SRC" - ${quiet} && DL="$DL -q" - elif which lynx >/dev/null 2>&1 ; then - DL="eval lynx -source $SRC >$DEST.new" diff --git a/utils/pciutils/patches/101-no-strip.patch b/utils/pciutils/patches/101-no-strip.patch index 2f1e0228..827a4531 100644 --- a/utils/pciutils/patches/101-no-strip.patch +++ b/utils/pciutils/patches/101-no-strip.patch @@ -1,11 +1,13 @@ --- a/Makefile +++ b/Makefile -@@ -119,7 +119,7 @@ distclean: clean +@@ -131,8 +131,8 @@ distclean: clean install: all # -c is ignored on Linux, but required on FreeBSD - $(DIRINSTALL) -m 755 $(DESTDIR)$(SBINDIR) $(DESTDIR)$(IDSDIR) $(DESTDIR)$(MANDIR)/man8 $(DESTDIR)$(MANDIR)/man7 $(DESTDIR)/$(MANDIR)/man5 -- $(INSTALL) -c -m 755 $(STRIP) lspci setpci $(DESTDIR)$(SBINDIR) -+ $(INSTALL) -c -m 755 lspci setpci $(DESTDIR)$(SBINDIR) + $(DIRINSTALL) -m 755 $(DESTDIR)$(BINDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(IDSDIR) $(DESTDIR)$(MANDIR)/man8 $(DESTDIR)$(MANDIR)/man7 $(DESTDIR)/$(MANDIR)/man5 +- $(INSTALL) -c -m 755 $(STRIP) lspci$(EXEEXT) $(DESTDIR)$(LSPCIDIR) +- $(INSTALL) -c -m 755 $(STRIP) setpci$(EXEEXT) $(DESTDIR)$(SBINDIR) ++ $(INSTALL) -c -m 755 lspci$(EXEEXT) $(DESTDIR)$(LSPCIDIR) ++ $(INSTALL) -c -m 755 setpci$(EXEEXT) $(DESTDIR)$(SBINDIR) $(INSTALL) -c -m 755 update-pciids $(DESTDIR)$(SBINDIR) $(INSTALL) -c -m 644 $(PCI_IDS) $(DESTDIR)$(IDSDIR) $(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(DESTDIR)$(MANDIR)/man8 diff --git a/utils/pciutils/patches/102-compressed-ids.patch b/utils/pciutils/patches/102-compressed-ids.patch deleted file mode 100644 index 2ea8605d..00000000 --- a/utils/pciutils/patches/102-compressed-ids.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/update-pciids.sh -+++ b/update-pciids.sh -@@ -6,9 +6,8 @@ set -e - SRC="https://pci-ids.ucw.cz/v2.2/pci.ids" - DEST=pci.ids - PCI_COMPRESSED_IDS= --GREP=grep - --# if pci.ids is read-only (because the filesystem is read-only), -+# if pci.ids.gz is read-only (because the filesystem is read-only), - # then just skip this whole process. - if ! touch ${DEST} >/dev/null 2>&1 ; then - ${quiet} || echo "${DEST} is read-only, exiting." 1>&2 -@@ -18,7 +17,7 @@ fi - if [ "$PCI_COMPRESSED_IDS" = 1 ] ; then - DECOMP="cat" - SRC="$SRC.gz" -- GREP=zgrep -+ DEST="$DEST.gz" - elif which bzip2 >/dev/null 2>&1 ; then - DECOMP="bzip2 -d" - SRC="$SRC.bz2" -@@ -53,7 +52,7 @@ if ! $DECOMP <$DEST.new >$DEST.neww ; th - exit 1 - fi - --if ! $GREP >/dev/null "^C " $DEST.neww ; then -+if ! zcat $DEST.neww | grep >/dev/null "^C " ; then - echo >&2 "update-pciids: missing class info, probably truncated file" - exit 1 - fi diff --git a/utils/pciutils/patches/103-relative-path-ids.patch b/utils/pciutils/patches/103-relative-path-ids.patch deleted file mode 100644 index c6d69068..00000000 --- a/utils/pciutils/patches/103-relative-path-ids.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -88,7 +88,7 @@ lspci: LDLIBS+=$(LIBKMOD_LIBS) - ls-kernel.o: CFLAGS+=$(LIBKMOD_CFLAGS) - - update-pciids: update-pciids.sh -- sed <$< >$@ "s@^DEST=.*@DEST=$(IDSDIR)/$(PCI_IDS)@;s@^PCI_COMPRESSED_IDS=.*@PCI_COMPRESSED_IDS=$(PCI_COMPRESSED_IDS)@" -+ sed <$< >$@ "s@^PCI_COMPRESSED_IDS=.*@PCI_COMPRESSED_IDS=$(PCI_COMPRESSED_IDS)@" - chmod +x $@ - - # The example of use of libpci diff --git a/utils/pciutils/patches/104-resolv.patch b/utils/pciutils/patches/104-resolv.patch index 0acfb81c..485e1b9f 100644 --- a/utils/pciutils/patches/104-resolv.patch +++ b/utils/pciutils/patches/104-resolv.patch @@ -1,11 +1,11 @@ --- a/lib/configure +++ b/lib/configure -@@ -52,7 +52,7 @@ echo >>$c "#define PCI_OS_`echo $sys | t +@@ -60,7 +60,7 @@ echo >>$c "#define PCI_OS_`echo $sys | t echo >$m 'WITH_LIBS=' echo_n "Looking for access methods..." -LIBRESOLV=-lresolv +LIBRESOLV= LIBEXT=so - - case $sys in + EXEEXT= + SYSINCLUDE=/usr/include diff --git a/utils/pciutils/patches/105-fix-host.patch b/utils/pciutils/patches/105-fix-host.patch deleted file mode 100644 index 14f7ded6..00000000 --- a/utils/pciutils/patches/105-fix-host.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/lib/configure -+++ b/lib/configure -@@ -39,7 +39,7 @@ if [ -z "$HOST" ] ; then - fi - [ -n "$RELEASE" ] && rel="${RELEASE}" - # CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless. --host=`echo $HOST | sed -e 's/^\([^-]*\)-\([^-]*\)-\([^-]*\)-\([^-]*\)$/\1-\3/' -e 's/^\([^-]*\)-\([^-]*\)-\([^-]*\)$/\1-\2/' -e 's/^\([^-]*\)-\([^-]*\)$/\1--\2/' | tr '[A-Z]' '[a-z]'` -+host=`echo $HOST | sed -e 's/^\([^-]*\)-\([^-]*\)-\([^-]*\)-\([^-]*\)$/\1-\3/' -e 's/^\([^-]*\)-\([^-]*\)$/\1--\2/' | tr '[A-Z]' '[a-z]'` - cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` - sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - echo " $host $rel $cpu $sys" diff --git a/utils/pciutils/patches/106-hwdata.patch b/utils/pciutils/patches/106-hwdata.patch index ee63bc5b..e18ef78c 100644 --- a/utils/pciutils/patches/106-hwdata.patch +++ b/utils/pciutils/patches/106-hwdata.patch @@ -1,7 +1,7 @@ --- a/Makefile +++ b/Makefile -@@ -35,7 +35,7 @@ ABI_VERSION=.3 - PREFIX=/usr/local +@@ -36,7 +36,7 @@ PREFIX=/usr/local + BINDIR=$(PREFIX)/bin SBINDIR=$(PREFIX)/sbin SHAREDIR=$(PREFIX)/share -IDSDIR=$(SHAREDIR) From 8bb27f5f97d6069dae99740f4cd4f6b8a144904d Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Sun, 21 Aug 2022 10:44:33 +0200 Subject: [PATCH 084/102] pciutils: backport patch to fix compilation with older binutils While building pciutils 3.8.0 for OpenWrt 21.02 includes target mvebu/cortex-a9, mvebu/cortex-a53 and powerpc/8540, it fails because of this error: -I -c -o filter.o filter.c {standard input}: Assembler messages: {standard input}:6: Error: multiple versions [`pci_filter_init@@LIBPCI_3.8'|`pci_filter_init@LIBPCI_3.3'] for symbol `pci_filter_init_v38' {standard input}:8: Error: multiple versions [`pci_filter_parse_slot@@LIBPCI_3.8'|`pci_filter_parse_slot@LIBPCI_3.3'] for symbol `pci_filter_parse_slot_v38' {standard input}:10: Error: multiple versions [`pci_filter_parse_id@@LIBPCI_3.8'|`pci_filter_parse_id@LIBPCI_3.3'] for symbol `pci_filter_parse_id_v38' {standard input}:12: Error: multiple versions [`pci_filter_match@@LIBPCI_3.8'|`pci_filter_match@LIBPCI_3.3'] for symbol `pci_filter_match_v38' make[4]: *** [: filter.o] Error 1 make[4]: Leaving directory ' make[3]: *** [Makefile:70: lib/libpci.so.3.8.0] Error 2 make[3]: Leaving directory ' make[2]: *** [Makefile:88: Error 2 make[2]: Leaving directory ' Signed-off-by: Josef Schlehofer --- utils/pciutils/Makefile | 2 +- ...07-avoid-addng-multiple-version-tags.patch | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 utils/pciutils/patches/107-avoid-addng-multiple-version-tags.patch diff --git a/utils/pciutils/Makefile b/utils/pciutils/Makefile index 104abbd2..870ffae3 100644 --- a/utils/pciutils/Makefile +++ b/utils/pciutils/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pciutils PKG_VERSION:=3.8.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/software/utils/pciutils diff --git a/utils/pciutils/patches/107-avoid-addng-multiple-version-tags.patch b/utils/pciutils/patches/107-avoid-addng-multiple-version-tags.patch new file mode 100644 index 00000000..74b57828 --- /dev/null +++ b/utils/pciutils/patches/107-avoid-addng-multiple-version-tags.patch @@ -0,0 +1,42 @@ +From 0478e1f3928bfaa34eb910ba2cbaf1dda8f84aab Mon Sep 17 00:00:00 2001 +From: Martin Mares +Date: Wed, 10 Aug 2022 13:34:28 +0700 +Subject: [PATCH] Avoid adding multiple version tags to the same symbol + +This is apparently forbidden in most versions of binutils. +--- + lib/filter.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +--- a/lib/filter.c ++++ b/lib/filter.c +@@ -303,21 +303,25 @@ pci_filter_match_v30(struct pci_filter_v + // (their positions in struct pci_filter were declared as RFU). + + STATIC_ALIAS(void pci_filter_init(struct pci_access *a, struct pci_filter *f), pci_filter_init_v38(a, f)); ++DEFINE_ALIAS(void pci_filter_init_v33(struct pci_access *a, struct pci_filter *f), pci_filter_init_v38); + SYMBOL_VERSION(pci_filter_init_v30, pci_filter_init@LIBPCI_3.0); +-SYMBOL_VERSION(pci_filter_init_v38, pci_filter_init@LIBPCI_3.3); ++SYMBOL_VERSION(pci_filter_init_v33, pci_filter_init@LIBPCI_3.3); + SYMBOL_VERSION(pci_filter_init_v38, pci_filter_init@@LIBPCI_3.8); + + STATIC_ALIAS(char *pci_filter_parse_slot(struct pci_filter *f, char *str), pci_filter_parse_slot_v38(f, str)); ++DEFINE_ALIAS(char *pci_filter_parse_slot_v33(struct pci_filter *f, char *str), pci_filter_parse_slot_v38); + SYMBOL_VERSION(pci_filter_parse_slot_v30, pci_filter_parse_slot@LIBPCI_3.0); +-SYMBOL_VERSION(pci_filter_parse_slot_v38, pci_filter_parse_slot@LIBPCI_3.3); ++SYMBOL_VERSION(pci_filter_parse_slot_v33, pci_filter_parse_slot@LIBPCI_3.3); + SYMBOL_VERSION(pci_filter_parse_slot_v38, pci_filter_parse_slot@@LIBPCI_3.8); + + STATIC_ALIAS(char *pci_filter_parse_id(struct pci_filter *f, char *str), pci_filter_parse_id_v38(f, str)); ++DEFINE_ALIAS(char *pci_filter_parse_id_v33(struct pci_filter *f, char *str), pci_filter_parse_id_v38); + SYMBOL_VERSION(pci_filter_parse_id_v30, pci_filter_parse_id@LIBPCI_3.0); +-SYMBOL_VERSION(pci_filter_parse_id_v38, pci_filter_parse_id@LIBPCI_3.3); ++SYMBOL_VERSION(pci_filter_parse_id_v33, pci_filter_parse_id@LIBPCI_3.3); + SYMBOL_VERSION(pci_filter_parse_id_v38, pci_filter_parse_id@@LIBPCI_3.8); + + STATIC_ALIAS(int pci_filter_match(struct pci_filter *f, struct pci_dev *d), pci_filter_match_v38(f, d)); ++DEFINE_ALIAS(int pci_filter_match_v33(struct pci_filter *f, struct pci_dev *d), pci_filter_match_v38); + SYMBOL_VERSION(pci_filter_match_v30, pci_filter_match@LIBPCI_3.0); +-SYMBOL_VERSION(pci_filter_match_v38, pci_filter_match@LIBPCI_3.3); ++SYMBOL_VERSION(pci_filter_match_v33, pci_filter_match@LIBPCI_3.3); + SYMBOL_VERSION(pci_filter_match_v38, pci_filter_match@@LIBPCI_3.8); From da317aa25d779940db75ddb55b97e3ca1d4b608f Mon Sep 17 00:00:00 2001 From: Oskari Rauta Date: Wed, 4 Jan 2023 13:55:55 +0200 Subject: [PATCH 085/102] qfirehose: new package Signed-off-by: Oskari Rauta --- utils/qfirehose/Makefile | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 utils/qfirehose/Makefile diff --git a/utils/qfirehose/Makefile b/utils/qfirehose/Makefile new file mode 100644 index 00000000..76e99c2e --- /dev/null +++ b/utils/qfirehose/Makefile @@ -0,0 +1,55 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=qfirehose +PKG_VERSION:=1.4.9 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/nippynetworks/qfirehose/tar.gz/$(PKG_VERSION)? +PKG_HASH:=b7c04f9356823c6ee0f4ca152e8fd2015f34b95490cea68461a060993befadef + +PKG_MAINTAINER:=Oskari Rauta +PKG_LICENSE:= +PKG_LICENSE_FILES:=NOTICE + +include $(INCLUDE_DIR)/package.mk + +define Package/qfirehose + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Quectel Firehose Recovery application + URL:=https://github.com/nippynetworks/qfirehose +endef + +define Package/qfirehose/description + Utility that is able to flash firmwares on Quectel's modems. + Usage: qfirehose -f FW_PATH + + Warning. + + - Use of software is completely on your own risk. + Flashing wrong firmware or failed flash can brick your modem permanently. + Avoid flashing, if device works without issues and updated firmware does not contain new necessary changes. + Do not flash, if you are not willing to take this risk or do not know what you are doing. + + - After succesful flashing, you should use terminal to issue factory reset for modem settings with AT&F command. + + - mPCIe users (mostly): If modem has completely disappeared after succesful flashing, reason might be that some firmware updates + set default mode to USB3 which is unsupported by some mPCIe slots, in this case, you should connect it to USB + port using mPCIe -> USB adapter, even most of cheap chinese modules can reveal device. After this you should issue + a command to use USB2, which may vary between models, but on most Quectel modems is: AT+QUSBCFG="SS",0 + Changing value on end of AT command 0 to 1, selects USB3 instead. Refer to documents of your modem. +endef + +define Build/Configure + $(RM) $(PKG_BUILD_DIR)/QFirehose +endef + +MAKE_ARGS += linux + +define Package/qfirehose/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/QFirehose $(1)/usr/bin/qfirehose +endef + +$(eval $(call BuildPackage,qfirehose)) From 3e5cc6ec8119b7cb506a548b1e732003f9f0cc7d Mon Sep 17 00:00:00 2001 From: Alexandru Gagniuc Date: Tue, 14 Jun 2022 22:48:47 -0500 Subject: [PATCH 086/102] realtek-poe: Add package to control PoE for Realtek 838x devices The realtek-poe package is used to configure the Power-over-Ethernet controller found on Realtex 838x based switches. On many such switches, the PoE doesn't work without this package. Signed-off-by: Stijn Segers Signed-off-by: Alexandru Gagniuc --- utils/realtek-poe/Makefile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 utils/realtek-poe/Makefile diff --git a/utils/realtek-poe/Makefile b/utils/realtek-poe/Makefile new file mode 100644 index 00000000..aecbb498 --- /dev/null +++ b/utils/realtek-poe/Makefile @@ -0,0 +1,35 @@ +## SPDX-License-Identifier: GPL-2.0-or-later + +include $(TOPDIR)/rules.mk + +PKG_NAME:=realtek-poe +PKG_RELEASE:=$(AUTORELEASE) +PKG_LICENSE:=GPL-2.0 +PKG_MAINTAINER:=Martin Kennedy + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/Hurricos/realtek-poe.git +PKG_SOURCE_VERSION:=382c60e7549948399b4244f7149cf76eaf5f0a7d +PKG_MIRROR_HASH:=442a01521c9a056e137e010be492ed5be0a39c3b68a2fa0ca0f0dbb765d9c74c +CMAKE_SOURCE_SUBDIR:=src + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/realtek-poe + SECTION:=net + CATEGORY:=Network + TITLE:=Realtek PoE Switch Port daemon + DEPENDS:=@TARGET_realtek +libubox +libubus +libuci +endef + +define Package/realtek-poe/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/realtek-poe $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/init.d/poe $(1)/etc/init.d/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/files/etc/config/poe $(1)/etc/config/ +endef + +$(eval $(call BuildPackage,realtek-poe)) From 2a95f1f8fb510e8fb3d3bea76203fab70cafe4ee Mon Sep 17 00:00:00 2001 From: Alexandru Gagniuc Date: Sun, 18 Sep 2022 10:34:59 -0500 Subject: [PATCH 087/102] realtek-poe: Update package to v1.0 v1.0 fixes a bug with MCU communication, and allows shutting down individual ports over ubus. A summarry of commands can be shown with: ubus -v list poe Signed-off-by: Alexandru Gagniuc --- utils/realtek-poe/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/realtek-poe/Makefile b/utils/realtek-poe/Makefile index aecbb498..fbdab7bd 100644 --- a/utils/realtek-poe/Makefile +++ b/utils/realtek-poe/Makefile @@ -9,8 +9,8 @@ PKG_MAINTAINER:=Martin Kennedy PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/Hurricos/realtek-poe.git -PKG_SOURCE_VERSION:=382c60e7549948399b4244f7149cf76eaf5f0a7d -PKG_MIRROR_HASH:=442a01521c9a056e137e010be492ed5be0a39c3b68a2fa0ca0f0dbb765d9c74c +PKG_SOURCE_VERSION:=39c93d39dd10da77b4fe48bc1d6bdd3c5978f866 +PKG_MIRROR_HASH:=ad9652dda8d77281e4724e0104552e18e521cedd4e24f56b0483cf6c5ee5ff69 CMAKE_SOURCE_SUBDIR:=src include $(INCLUDE_DIR)/package.mk From 2aa2d0ba52d92b7492efb6b1158a5b4f4d00bdf2 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 14 Jan 2023 13:53:30 -0800 Subject: [PATCH 088/102] rtl-sdr: switch to git tarball Upstream switched URLs. Signed-off-by: Rosen Penev --- utils/rtl-sdr/Makefile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/utils/rtl-sdr/Makefile b/utils/rtl-sdr/Makefile index 8237d4a1..fc788fc1 100644 --- a/utils/rtl-sdr/Makefile +++ b/utils/rtl-sdr/Makefile @@ -8,18 +8,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rtl-sdr PKG_VERSION:=0.6.0 -PKG_RELEASE:=2 +PKG_RELEASE:=3 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://git.osmocom.org/rtl-sdr/snapshot -PKG_HASH:=ee10a76fe0c6601102367d4cdf5c26271e9442d0491aa8df27e5a9bf639cff7c - -CMAKE_INSTALL:=1 - -PKG_LICENSE:=GPLv2 -PKG_LICENSE_FILES:=COPYING +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=0.6.0 +PKG_SOURCE_URL:=https://gitea.osmocom.org/sdr/rtl-sdr +PKG_MIRROR_HASH:=c7673b94126a61575823cde088112146be4e4874111ad134e7330371060f746d PKG_MAINTAINER:=Vasilis Tsiligiannis +PKG_LICENSE:=GPL-2.0-or-later +PKG_LICENSE_FILES:=COPYING include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk From 78ff8f873d57efc0a44880b92132778a2d6eb500 Mon Sep 17 00:00:00 2001 From: Oskari Rauta Date: Thu, 25 Nov 2021 05:30:08 +0200 Subject: [PATCH 089/102] slirp4netns: new package Signed-off-by: Oskari Rauta --- utils/slirp4netns/Makefile | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 utils/slirp4netns/Makefile diff --git a/utils/slirp4netns/Makefile b/utils/slirp4netns/Makefile new file mode 100644 index 00000000..d76722e0 --- /dev/null +++ b/utils/slirp4netns/Makefile @@ -0,0 +1,39 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=slirp4netns +PKG_VERSION:=1.1.9 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/rootless-containers/slirp4netns/archive/v$(PKG_VERSION) +PKG_HASH:=5ff0d3e4bf6b11c8a4fcf5bd3219b8d52096e3b8cc73ca760aa554bb1eb08768 + +PKG_MAINTAINER:=Oskari Rauta +PKG_LICENSE:=GPL-2.0-or-later +PKG_LICENSE_FILES:=COPYING + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/slirp4netns + SECTION:=net + CATEGORY:=Network + TITLE:=slirp4netns + DEPENDS:=@!arc +libslirp +libseccomp +glib2 +libcap + URL:=https://github.com/rootless-containers/slirp4netns +endef + +define Package/slirp4netns/description + User-mode networking for unprivileged network namespaces +endef + +define Package/slirp4netns/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/slirp4netns $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,slirp4netns)) From 32cb34b0aede166665a4723c19e085fea94f797e Mon Sep 17 00:00:00 2001 From: Oskari Rauta Date: Sun, 5 Dec 2021 21:49:16 +0200 Subject: [PATCH 090/102] slirp4netns: update to version 1.1.12 Most recent changes: - Explicitly support DHCP - Update parson to v1.1.3 Signed-off-by: Oskari Rauta --- utils/slirp4netns/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/slirp4netns/Makefile b/utils/slirp4netns/Makefile index d76722e0..4283e672 100644 --- a/utils/slirp4netns/Makefile +++ b/utils/slirp4netns/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=slirp4netns -PKG_VERSION:=1.1.9 +PKG_VERSION:=1.1.12 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/rootless-containers/slirp4netns/archive/v$(PKG_VERSION) -PKG_HASH:=5ff0d3e4bf6b11c8a4fcf5bd3219b8d52096e3b8cc73ca760aa554bb1eb08768 +PKG_HASH:=279dfe58a61b9d769f620b6c0552edd93daba75d7761f7c3742ec4d26aaa2962 PKG_MAINTAINER:=Oskari Rauta PKG_LICENSE:=GPL-2.0-or-later From f962aa6f2887caf84c7f367f6810f05a42d3833a Mon Sep 17 00:00:00 2001 From: Oskari Rauta Date: Mon, 9 May 2022 23:22:47 +0300 Subject: [PATCH 091/102] slirp4netns: update to v1.2.0 Changelog: https://github.com/rootless-containers/slirp4netns/releases Signed-off-by: Oskari Rauta --- utils/slirp4netns/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/slirp4netns/Makefile b/utils/slirp4netns/Makefile index 4283e672..044409d0 100644 --- a/utils/slirp4netns/Makefile +++ b/utils/slirp4netns/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=slirp4netns -PKG_VERSION:=1.1.12 +PKG_VERSION:=1.2.0 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/rootless-containers/slirp4netns/archive/v$(PKG_VERSION) -PKG_HASH:=279dfe58a61b9d769f620b6c0552edd93daba75d7761f7c3742ec4d26aaa2962 +PKG_HASH:=b584edde686d3cfbac210cbdb93c4b0ba5d8cc0a6a4d92b9dfc3c5baec99c727 PKG_MAINTAINER:=Oskari Rauta PKG_LICENSE:=GPL-2.0-or-later From 82dd0d82798b3b6e05140711c82727eab44a90f2 Mon Sep 17 00:00:00 2001 From: Andrey Butirsky Date: Fri, 7 Oct 2022 22:10:12 +0300 Subject: [PATCH 092/102] sms-tool: SMS Tool for 3G/4G modem Co-authored-by: Cezary Jackiewicz Co-authored-by: Josef Schlehofer Signed-off-by: Andrey Butirsky --- utils/sms-tool/Makefile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 utils/sms-tool/Makefile diff --git a/utils/sms-tool/Makefile b/utils/sms-tool/Makefile new file mode 100644 index 00000000..1b36529a --- /dev/null +++ b/utils/sms-tool/Makefile @@ -0,0 +1,39 @@ +# 2017 - 2021 Cezary Jackiewicz +# 2014 lovewilliam +# sms tool for various of 3g/4g modem +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=sms-tool +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE_URL:=https://github.com/obsy/sms_tool +PKG_SOURCE_PROTO:=git +PKG_SOURCE_DATE:=2022-03-21 +PKG_SOURCE_VERSION:=f07699ab5189656f595ffa75872c8938bf4b40ac +PKG_MIRROR_HASH:=0d114a97eb7aeadd95b49281d29371ba0570382125c34f3f8668d34fd0290f46 + +PKG_MAINTAINER:=Andrey Butirsky +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE-2.0.txt + +include $(INCLUDE_DIR)/package.mk + +define Package/sms-tool + SECTION:=utils + CATEGORY:=Utilities + TITLE:=SMS tool for 3G/4G modems + URL:=https://github.com/obsy/sms_tool +endef + +define Package/sms-tool/description + SMS Tool for 3G/4G modem +endef + +define Package/sms-tool/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/sms_tool $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,sms-tool)) From 2e16703fc473fd5d306ce7db9ef75abed51c6bd3 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 14 Jan 2023 14:34:54 -0800 Subject: [PATCH 093/102] stress: update to 1.0.5 New upstream. Signed-off-by: Rosen Penev --- utils/stress/Makefile | 22 +++++++++------------- utils/stress/patches/010-usleep.patch | 10 +++++----- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/utils/stress/Makefile b/utils/stress/Makefile index 3a66817d..953b21cd 100644 --- a/utils/stress/Makefile +++ b/utils/stress/Makefile @@ -8,17 +8,20 @@ include $(TOPDIR)/rules.mk PKG_NAME:=stress -PKG_VERSION:=1.0.4 -PKG_RELEASE:=2 +PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://fossies.org/linux/privat -PKG_HASH:=369c997f65e8426ae8b318d4fdc8e6f07a311cfa77cc4b25dace465c582163c0 +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=1.0.5 +PKG_SOURCE_URL:=https://github.com/resurrecting-open-source-projects/stress +PKG_MIRROR_HASH:=711e42ead6fd220a98821aae0cf024930785e439d3d0d50663fed1b2cd021bd1 -PKG_LICENSE:=GPL-2.0 +PKG_MAINTAINER:=Alexandru Ardelean +PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=COPYING +PKG_FIXUP:=autoreconf PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk @@ -27,7 +30,6 @@ define Package/stress CATEGORY:=Utilities TITLE:=stress is a simple stress utility URL:= - MAINTAINER:=Alexandru Ardelean endef define Package/stress/description @@ -35,12 +37,6 @@ stress is a simple tool that imposes certain types of compute \ stress on UNIX-like operating systems. endef -CONFIGURE_ARGS += \ - --prefix="/usr" - -MAKE_FLAGS += \ - CFLAGS="$(TARGET_CFLAGS)" - define Package/stress/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/stress $(1)/usr/bin/ diff --git a/utils/stress/patches/010-usleep.patch b/utils/stress/patches/010-usleep.patch index 69467264..fde51cf8 100644 --- a/utils/stress/patches/010-usleep.patch +++ b/utils/stress/patches/010-usleep.patch @@ -1,6 +1,6 @@ --- a/src/stress.c +++ b/src/stress.c -@@ -262,6 +262,7 @@ main (int argc, char **argv) +@@ -263,6 +263,7 @@ main (int argc, char **argv) /* Calculate the backoff value so we get good fork throughput. */ backoff = do_backoff * forks; @@ -8,7 +8,7 @@ dbg (stdout, "using backoff sleep of %llius\n", backoff); /* If we are supposed to respect a timeout, calculate it. */ -@@ -296,7 +297,7 @@ main (int argc, char **argv) +@@ -297,7 +298,7 @@ main (int argc, char **argv) { case 0: /* child */ alarm (timeout); @@ -17,7 +17,7 @@ if (do_dryrun) exit (0); exit (hogcpu ()); -@@ -317,7 +318,7 @@ main (int argc, char **argv) +@@ -318,7 +319,7 @@ main (int argc, char **argv) { case 0: /* child */ alarm (timeout); @@ -26,7 +26,7 @@ if (do_dryrun) exit (0); exit (hogio ()); -@@ -337,7 +338,7 @@ main (int argc, char **argv) +@@ -338,7 +339,7 @@ main (int argc, char **argv) { case 0: /* child */ alarm (timeout); @@ -35,7 +35,7 @@ if (do_dryrun) exit (0); exit (hogvm -@@ -358,7 +359,7 @@ main (int argc, char **argv) +@@ -359,7 +360,7 @@ main (int argc, char **argv) { case 0: /* child */ alarm (timeout); From fa7192f7a2452bc88d90dfefa04a13a829bf3326 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Thu, 5 Jan 2023 20:49:41 +0200 Subject: [PATCH 094/102] stress-ng: bump to version 0.15.01 Signed-off-by: Alexandru Ardelean --- utils/stress-ng/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/stress-ng/Makefile b/utils/stress-ng/Makefile index 2f116d9f..8792198f 100644 --- a/utils/stress-ng/Makefile +++ b/utils/stress-ng/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=stress-ng -PKG_VERSION:=0.15.00 +PKG_VERSION:=0.15.01 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/ColinIanKing/stress-ng/tar.gz/refs/tags/V$(PKG_VERSION)? -PKG_HASH:=cdb18c7dfcdeb0ff2d716c141341d1b2ca6051e4338cee3a555a65f26958c256 +PKG_HASH:=2168627350d8e3b7f4571732d6117ab054a9851600899c30ad82fd3c9649d644 PKG_MAINTAINER:=Alexandru Ardelean PKG_LICENSE:=GPL-2.0-only From b27e671389555e5242fd22cf1dc01528f6402aad Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sun, 3 Apr 2022 12:03:52 +0200 Subject: [PATCH 095/102] ubnt-manager: add ubnt-manager This app makes it easier to work with AirOS devices. So far, only monitoring is implemented. Signed-off-by: Nick Hainke --- utils/ubnt-manager/Makefile | 40 ++++++++++ utils/ubnt-manager/files/ubnt-manager.config | 9 +++ utils/ubnt-manager/files/ubnt-manager.sh | 79 ++++++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 utils/ubnt-manager/Makefile create mode 100644 utils/ubnt-manager/files/ubnt-manager.config create mode 100755 utils/ubnt-manager/files/ubnt-manager.sh diff --git a/utils/ubnt-manager/Makefile b/utils/ubnt-manager/Makefile new file mode 100644 index 00000000..8416eff1 --- /dev/null +++ b/utils/ubnt-manager/Makefile @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: GPL-2.0-only + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ubnt-manager +PKG_VERSION:=1 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_MAINTAINER:=Nick Hainke +PKG_LICENSE:=GPL-2.0-only + +include $(INCLUDE_DIR)/package.mk + +define Package/ubnt-manager + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Managment app for Ubiquiti devices + PKGARCH:=all + EXTRA_DEPENDS:=dropbear +endef + +define Package/ubnt-manager/description +Managment app for Ubiquiti devices. +endef + +define Package/ubnt-manager/conffiles +/etc/config/ubnt-manager +endef + +define Build/Compile +endef + +define Package/ubnt-manager/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/ubnt-manager.sh $(1)/usr/bin/ubnt-manager + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/ubnt-manager.config $(1)/etc/config/ubnt-manager +endef + +$(eval $(call BuildPackage,ubnt-manager)) diff --git a/utils/ubnt-manager/files/ubnt-manager.config b/utils/ubnt-manager/files/ubnt-manager.config new file mode 100644 index 00000000..bc29cdf0 --- /dev/null +++ b/utils/ubnt-manager/files/ubnt-manager.config @@ -0,0 +1,9 @@ +config device 'sample_ap' # make sure to not use dashes in name + option target '192.168.1.20' + option username 'ubnt' + option password 'ubnt' + +#config device 'sample_ap1' +# option target '10.31.81.21' +# option username 'ubnt' +# option password '...' diff --git a/utils/ubnt-manager/files/ubnt-manager.sh b/utils/ubnt-manager/files/ubnt-manager.sh new file mode 100755 index 00000000..c65eb236 --- /dev/null +++ b/utils/ubnt-manager/files/ubnt-manager.sh @@ -0,0 +1,79 @@ +#!/bin/sh + +. /usr/share/libubox/jshn.sh +. /lib/functions.sh + +log() { + local msg="$1" + logger -t ubnt-manager -s "$msg" +} + +rexec() { + local target="$1" + local username="$2" + local password="$3" + local cmd="$4" + raw=$(DROPBEAR_PASSWORD="$password" ssh -y $username@$target "$cmd" 2>/dev/null) + ssh_result=$? +} + +get_json_dump() { + local cmd="/usr/www/status.cgi" + rexec $* "$cmd" + echo $raw +} + +handle_device() { + local device="${1//-/_}" # replace "-" with "_" + config_load ubnt-manager + config_get target "$device" target + config_get username "$device" username + config_get password "$device" password + ssh_result=0 +} + +add_device_to_list() { + local device="$1" + device_list="$device_list $device" +} + +list_devices() { + device_list="" + config_load ubnt-manager + config_foreach add_device_to_list device device_list + echo $device_list +} + +usage() { + cat < Date: Mon, 25 Apr 2022 19:02:33 -0700 Subject: [PATCH 096/102] ubnt-manager: run through shellcheck Signed-off-by: Rosen Penev --- utils/ubnt-manager/files/ubnt-manager.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/utils/ubnt-manager/files/ubnt-manager.sh b/utils/ubnt-manager/files/ubnt-manager.sh index c65eb236..cc72e1fe 100755 --- a/utils/ubnt-manager/files/ubnt-manager.sh +++ b/utils/ubnt-manager/files/ubnt-manager.sh @@ -13,14 +13,13 @@ rexec() { local username="$2" local password="$3" local cmd="$4" - raw=$(DROPBEAR_PASSWORD="$password" ssh -y $username@$target "$cmd" 2>/dev/null) - ssh_result=$? + raw=$(DROPBEAR_PASSWORD="$password" ssh -y "$username@$target" "$cmd" 2>/dev/null) } get_json_dump() { local cmd="/usr/www/status.cgi" - rexec $* "$cmd" - echo $raw + rexec "$@" "$cmd" + echo "$raw" } handle_device() { @@ -29,7 +28,6 @@ handle_device() { config_get target "$device" target config_get username "$device" username config_get password "$device" password - ssh_result=0 } add_device_to_list() { @@ -41,7 +39,7 @@ list_devices() { device_list="" config_load ubnt-manager config_foreach add_device_to_list device device_list - echo $device_list + echo "$device_list" } usage() { @@ -59,7 +57,7 @@ while [ "$1" != "" ]; do -t | --target) shift target=$1 - handle_device $target + handle_device "$target" ;; -j | --json) json=1 @@ -74,6 +72,6 @@ while [ "$1" != "" ]; do shift done -if [ ! -z $json ]; then - get_json_dump $target $username $password | sed 's/Content-Type:\ application\/json//' +if [ -n "$json" ]; then + get_json_dump "$target" "$username" "$password" | sed 's/Content-Type:\ application\/json//' fi From c0e7e06eca087f149411c1b8674f3a832b2edea9 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Sat, 14 Jan 2023 11:36:18 +0200 Subject: [PATCH 097/102] xz: update to version 5.4.1 Update to 5.4.1 (keep in sync with xz in tools/) Signed-off-by: Hannu Nyman --- utils/xz/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/xz/Makefile b/utils/xz/Makefile index e8d01626..fe989b79 100644 --- a/utils/xz/Makefile +++ b/utils/xz/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xz -PKG_VERSION:=5.2.9 +PKG_VERSION:=5.4.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/lzmautils -PKG_HASH:=b194507fba3a462a753c553149ccdaa168337bcb7deefddd067ba987c83dfce6 +PKG_HASH:=dd172acb53867a68012f94c17389401b2f274a1aa5ae8f84cbfb8b7e383ea8d3 PKG_MAINTAINER:= PKG_LICENSE:=Public-Domain LGPL-2.1-or-later GPL-2.0-or-later GPL-3.0-or-later From 19e7fac08c4f325e9447cb012d6ed40afbe2b0ee Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 14 Jan 2023 20:51:54 +0800 Subject: [PATCH 098/102] yq: Update to 4.30.7 Signed-off-by: Tianling Shen --- utils/yq/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/yq/Makefile b/utils/yq/Makefile index 980f8bb7..33cfb406 100644 --- a/utils/yq/Makefile +++ b/utils/yq/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=yq -PKG_VERSION:=4.30.6 +PKG_VERSION:=4.30.7 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/mikefarah/yq/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=320d0ce36d1dbe703b4cbdb28e9a927c1e87b157e8c05aeb078d6c9c1b0138ea +PKG_HASH:=84dff2f03ae34b84032a36e381440b78684a9eb5cf849789878da78e94fcd679 PKG_MAINTAINER:=Tianling Shen PKG_LICENSE:=MIT From 7ee6452bd258cc8b88a3cafef81480e14127ad23 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 16 Jan 2023 16:26:41 +0800 Subject: [PATCH 099/102] yq: Update to 4.30.8 Signed-off-by: Tianling Shen --- utils/yq/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/yq/Makefile b/utils/yq/Makefile index 33cfb406..b386e94f 100644 --- a/utils/yq/Makefile +++ b/utils/yq/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=yq -PKG_VERSION:=4.30.7 +PKG_VERSION:=4.30.8 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/mikefarah/yq/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=84dff2f03ae34b84032a36e381440b78684a9eb5cf849789878da78e94fcd679 +PKG_HASH:=aaf6c9f37968970413b8a6daf0b313a86efd1b8e3e5959e527b50636508eb776 PKG_MAINTAINER:=Tianling Shen PKG_LICENSE:=MIT From 9300bc22118581c9f4b11ec044d3f3216e8ac075 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 25 Dec 2022 02:15:08 +0100 Subject: [PATCH 100/102] zyxel-reset: add package Add the zyxel-reset package. This package allows to trigger a factory-reset for ZyXEL devices by sending a magic LLDP package while the device-to-reset is booting. This is useful for remote-resetting a ZyXEL device running stock firmware connected to a switch using OpenWrt. It also allows to reset devices which do not have a reset-button such as the NWA55AXE. Signed-off-by: David Bauer --- utils/zyxel-reset/Makefile | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 utils/zyxel-reset/Makefile diff --git a/utils/zyxel-reset/Makefile b/utils/zyxel-reset/Makefile new file mode 100644 index 00000000..3839a710 --- /dev/null +++ b/utils/zyxel-reset/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2022 David Bauer +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=zyxel-reset +PKG_SOURCE_DATE:=2022-12-23 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/blocktrron/zyxel-reset.git +PKG_SOURCE_VERSION:=e1def7b5f117c206afe15aa57ca7433eb972d5d1 +PKG_MIRROR_HASH:=dc02f6afc5d083a7a62ec51b35b352595ef6c99a8192facb1bff7b7f90cec06a + +PKG_MAINTAINER:=David Bauer +PKG_LICENSE:=GPL-2.0-only + +include $(INCLUDE_DIR)/package.mk + +define Package/zyxel-reset + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Trigger factory-reset for ZyXEL APs +endef + +define Package/zyxel-reset/description + This program can trigger a factory-reset on ZyXEL Access Points + running stock-firmware. +endef + +define Package/zyxel-reset/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/zyxel-reset $(1)/usr/bin/zyxel-reset +endef + +$(eval $(call BuildPackage,zyxel-reset)) From 0c0530005cadbffc9833e8755df115b7a2d7476c Mon Sep 17 00:00:00 2001 From: Michal Hrusecky Date: Thu, 28 Oct 2021 14:43:22 +0200 Subject: [PATCH 101/102] afuse: Add new package This commit add new package afuse into packages feed. afuse is an automounting file system implemented in user-space using FUSE. It implements the most basic functionality that can be expected by an automounter; that is it manages a directory of virtual directories. If one of these virtual directories is accessed and is not already automounted, afuse will attempt to mount a filesystem onto that directory. If the mount succeeds the requested access proceeds as normal, otherwise it will fail with an error. Signed-off-by: Michal Hrusecky --- utils/afuse/Makefile | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 utils/afuse/Makefile diff --git a/utils/afuse/Makefile b/utils/afuse/Makefile new file mode 100644 index 00000000..bae53b60 --- /dev/null +++ b/utils/afuse/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2021 Michal Hrusecky +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=afuse +PKG_VERSION:=0.4.1 +PKG_RELEASE:=1 + +PKG_MAINTAINER:=Michal Hrusecky +PKG_LICENSE:=GPL-2.0-or-later +PKG_LICENSE_FILES:=COPYING + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/pcarrier/$(PKG_NAME)/archive/refs/tags/v$(PKG_VERSION).tar.gz? +PKG_HASH:=8c7950cdeb24cdff828cdd3807537ee12cab87b18ecef4496b7bdedb2b8bd0e9 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/afuse + SECTION:=net + CATEGORY:=Utilities + SUBMENU:=Filesystem + TITLE:=Automounting file system implemented in user-space using FUSE + DEPENDS:=+libfuse +fuse-utils + URL:=https://github.com/pcarrier/afuse +endef + +define Package/afuse/description + Automounting file system implemented in user-space using FUSE. It + implements the most basic functionality that can be expected by an + automounter; that is it manages a directory of virtual directories. If + one of these virtual directories is accessed and is not already + automounted, afuse will attempt to mount a filesystem onto that + directory. If the mount succeeds the requested access proceeds as + normal, otherwise it will fail with an error. +endef + +TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/fuse/ + +define Package/afuse/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/afuse $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,afuse)) From c4274f59c90be41663e430ad29e127962adbafb7 Mon Sep 17 00:00:00 2001 From: Simon Polack Date: Tue, 3 Aug 2021 12:59:44 +0200 Subject: [PATCH 102/102] airos-dfs-reset: add airos-dfs-reset Ubiquitis airmax based gear does not fallback to original port after DFS event is over. This tool triggers the fallback automatically by soft-restarting unconditionally, whenever the configured freq differs from the running. Signed-off-by: Simon Polack --- utils/airos-dfs-reset/Makefile | 46 +++++++ utils/airos-dfs-reset/files/airos-dfs-reset | 114 ++++++++++++++++++ .../files/airos-dfs-reset.config | 15 +++ .../files/airos-dfs-reset.init | 18 +++ 4 files changed, 193 insertions(+) create mode 100644 utils/airos-dfs-reset/Makefile create mode 100644 utils/airos-dfs-reset/files/airos-dfs-reset create mode 100644 utils/airos-dfs-reset/files/airos-dfs-reset.config create mode 100644 utils/airos-dfs-reset/files/airos-dfs-reset.init diff --git a/utils/airos-dfs-reset/Makefile b/utils/airos-dfs-reset/Makefile new file mode 100644 index 00000000..353795f8 --- /dev/null +++ b/utils/airos-dfs-reset/Makefile @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2021 Simon Polack +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=airos-dfs-reset +PKG_VERSION:=1 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_MAINTAINER:=Simon Polack +PKG_LICENSE:=GPL-2.0-only + +include $(INCLUDE_DIR)/package.mk + +define Package/airos-dfs-reset + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Companion app for Ubiquity AirOS to help with DFS + PKGARCH:=all + EXTRA_DEPENDS:=dropbear +endef + +define Package/airos-dfs-reset/description +Companion app for Ubiquity AirOS Gear to enforce fallback to original frequency after DFS event is over. +It works by soft-rebooting if running-frequency doesnt match the configured frequency. +endef + +define Package/airos-dfs-reset/conffiles +/etc/config/airos-dfs-reset +endef + +define Build/Compile +endef + +define Package/airos-dfs-reset/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/airos-dfs-reset.init $(1)/etc/init.d/airos-dfs-reset + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/airos-dfs-reset $(1)/usr/bin/airos-dfs-reset + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/airos-dfs-reset.config $(1)/etc/config/airos-dfs-reset +endef + +$(eval $(call BuildPackage,airos-dfs-reset)) diff --git a/utils/airos-dfs-reset/files/airos-dfs-reset b/utils/airos-dfs-reset/files/airos-dfs-reset new file mode 100644 index 00000000..1d15c914 --- /dev/null +++ b/utils/airos-dfs-reset/files/airos-dfs-reset @@ -0,0 +1,114 @@ +#!/bin/sh + +. /lib/functions.sh + +log() { + local msg="$1" + logger -t airos-dfs-reset -s "$msg" +} + +rexec() { + local target="$1" + local username="$2" + local password="$3" + local cmd="$4" + raw=$(DROPBEAR_PASSWORD="$password" ssh -y $username@$target "$cmd") + ssh_result=$? +} + +reset_dfs() { + local cmd="/usr/etc/rc.d/rc.softrestart force" + rexec $* "$cmd" +} + +get_running_freq() { + local cmd="iwconfig ath0 | grep Frequency | awk -F ':' '{print \$3}' | awk '{print \$1}' | sed 's/\.//'" + + rexec $* "$cmd" + + # Append zeroes which are then cut to 4, we have to convert GHz into MHz + raw="$raw"000 + + running_freq=${raw:0:4} +} + +get_target_freq() { + local cmd="grep 'radio.1.freq' /tmp/system.cfg | awk -F '=' '{ print \$2}'" + rexec $* "$cmd" + target_freq="$raw" +} + +check_dfs() { + local target="$1" + local username="$2" + local password="$3" + + get_running_freq $target $username $password + if [ "$ssh_result" != 0 ]; then + return + fi + get_target_freq $target $username $password + if [ "$ssh_result" != 0 ]; then + return + fi + log "Running freq: $running_freq - Target freq: $target_freq" + + [ "$running_freq" == "$target_freq" ] +} + + +reset_allowed() { + local daytime_limit="$1" + local start="$(echo $daytime_limit | awk -F '-' '{print $1'})" + local end="$(echo $daytime_limit | awk -F '-' '{print $2'})" + local cur="$(date +%H)" + [ "$cur" -ge "$start" ] && [ "$cur" -le "$end" ] +} + +handle_device() { + local device="$1" + config_get target "$device" target + config_get username "$device" username + config_get password "$device" password + config_get daytime_limit "$device" daytime_limit "0-23" + + ssh_result=0 + + log "Checking Device $device" + + check_dfs $target $username $password + freqmatch=$? + + if [ "$ssh_result" != 0 ]; then + log "ssh exited non-zero - connect timeout?" + return + elif [ "$freqmatch" == 0 ]; then + log "Frequency is matching. No radar event fired" + else + log "Frequency doesnt match. Looks like DFS activity :(" + if reset_allowed $daytime_limit; then + log "Initiating reset" + reset_dfs $target $username $password + log "Waiting $cfg_reset_sleep seconds after reset" + sleep $cfg_reset_sleep + else + log "Resetting is forbidden at this daytime" + fi + fi +} + +main() { + log "started!" + + config_load airos-dfs-reset + config_get cfg_interval general interval 600 + config_get cfg_reset_sleep general reset_sleep 120 + + while :; + do + config_foreach handle_device device + sleep $cfg_interval + done +} + +main diff --git a/utils/airos-dfs-reset/files/airos-dfs-reset.config b/utils/airos-dfs-reset/files/airos-dfs-reset.config new file mode 100644 index 00000000..c718a525 --- /dev/null +++ b/utils/airos-dfs-reset/files/airos-dfs-reset.config @@ -0,0 +1,15 @@ +config airos-dfs-reset general + option interval '600' # Check every x seconds + option reset_sleep '120' # Sleep after reset to let routing protocols reconverge + +config device 'sample_ap' # make sure to not use dashes in name + option target '192.168.1.20' + option username 'ubnt' + option password 'ubnt' + option daytime_limit '2-7' # .. from 2:xx to 7:xx reset is allowed + +#config device 'sample_ap1' +# option target '10.31.81.21' +# option username 'ubnt' +# option password '...' +# option daytime_limit '0-23' diff --git a/utils/airos-dfs-reset/files/airos-dfs-reset.init b/utils/airos-dfs-reset/files/airos-dfs-reset.init new file mode 100644 index 00000000..d75c5b95 --- /dev/null +++ b/utils/airos-dfs-reset/files/airos-dfs-reset.init @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common + +USE_PROCD=1 +START=95 +STOP=01 + +start_service() { + procd_open_instance + procd_set_param command /usr/bin/airos-dfs-reset + procd_set_param stdout 0 + procd_set_param stderr 0 + procd_set_param user nobody + procd_close_instance +} + +service_stopped() { + echo "airos-dfs-reset stopped!" +}