Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled

This commit is contained in:
domenico
2025-06-24 14:35:53 +02:00
commit c06fb25d1f
9263 changed files with 1750214 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
#
# Copyright (C) 2007-2014 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:=argp-standalone
PKG_VERSION:=1.3
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.lysator.liu.se/~nisse/misc/
PKG_HASH:=dec79694da1319acd2238ce95df57f3680fea2482096e483323fddf3d818d8be
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=LGPL-2.1
PKG_LICENSE:=Makefile.am
PKG_BUILD_FLAGS:=no-lto
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
define Package/argp-standalone
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Hierarchial argument parsing broken out from glibc
URL:=http://www.lysator.liu.se/~nisse/misc/
endef
define Package/argp-standalone/description
GNU libc hierarchial argument parsing library broken out from glibc.
endef
MAKE_FLAGS += \
CFLAGS="$(TARGET_CFLAGS) $(FPIC) -std=gnu89"
HOST_MAKE_FLAGS += \
CFLAGS="$(HOST_CFLAGS) $(FPIC) -std=gnu89"
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_BUILD_DIR)/argp.h \
$(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libargp.a \
$(1)/usr/lib/
endef
define Host/Install
$(INSTALL_DIR) $(1)/include
$(CP) $(HOST_BUILD_DIR)/argp.h \
$(1)/include/
$(INSTALL_DIR) $(1)/lib
$(CP) $(HOST_BUILD_DIR)/libargp.a \
$(1)/lib/
endef
$(eval $(call BuildPackage,argp-standalone))
$(eval $(call HostBuild))

View File

@@ -0,0 +1,79 @@
# --- T2-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# T2 SDE: package/.../rng-tools/throw-in-funcdef.patch.argp-standalone
# Copyright (C) 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or 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.
# --- T2-COPYRIGHT-NOTE-END ---
No __THROW in function implementation.
--jsaw
--- a/argp.h
+++ b/argp.h
@@ -560,17 +560,17 @@ __argp_short_program_name(const struct a
# endif
# ifndef ARGP_EI
-# define ARGP_EI extern __inline__
+# define ARGP_EI extern inline
# endif
ARGP_EI void
-__argp_usage (__const struct argp_state *__state) __THROW
+__argp_usage (__const struct argp_state *__state)
{
__argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
}
ARGP_EI int
-__option_is_short (__const struct argp_option *__opt) __THROW
+__option_is_short (__const struct argp_option *__opt)
{
if (__opt->flags & OPTION_DOC)
return 0;
@@ -582,7 +582,7 @@ __option_is_short (__const struct argp_o
}
ARGP_EI int
-__option_is_end (__const struct argp_option *__opt) __THROW
+__option_is_end (__const struct argp_option *__opt)
{
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
}
--- a/argp-parse.c
+++ b/argp-parse.c
@@ -1277,13 +1277,13 @@ weak_alias (__argp_input, _argp_input)
/* Defined here, in case a user is not inlining the definitions in
* argp.h */
void
-__argp_usage (__const struct argp_state *__state) __THROW
+__argp_usage (__const struct argp_state *__state)
{
__argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
}
int
-__option_is_short (__const struct argp_option *__opt) __THROW
+__option_is_short (__const struct argp_option *__opt)
{
if (__opt->flags & OPTION_DOC)
return 0;
@@ -1297,7 +1297,7 @@ __option_is_short (__const struct argp_o
}
int
-__option_is_end (__const struct argp_option *__opt) __THROW
+__option_is_end (__const struct argp_option *__opt)
{
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
}

View File

@@ -0,0 +1,11 @@
--- a/argp-fmtstream.h
+++ b/argp-fmtstream.h
@@ -192,7 +192,7 @@ extern void __argp_fmtstream_update (arg
extern int _argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
-#ifdef __OPTIMIZE__
+#if 0
/* Inline versions of above routines. */
#if !_LIBC

View File

@@ -0,0 +1,14 @@
--- a/argp-help.c
+++ b/argp-help.c
@@ -777,9 +777,9 @@ hol_entry_cmp (const struct hol_entry *e
const char *long2 = hol_entry_first_long (entry2);
if (doc1)
- doc1 = canon_doc_option (&long1);
+ doc1 = long1 != NULL && canon_doc_option (&long1);
if (doc2)
- doc2 = canon_doc_option (&long2);
+ doc2 = long2 != NULL && canon_doc_option (&long2);
if (doc1 != doc2)
/* `documentation' options always follow normal options (or

View File

@@ -0,0 +1,126 @@
#
# Copyright (C) 2010-2019 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:=elfutils
PKG_VERSION:=0.192
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION) \
https://mirrors.kernel.org/sourceware/$(PKG_NAME)/$(PKG_VERSION)
PKG_HASH:=616099beae24aba11f9b63d86ca6cc8d566d968b802391334c91df54eab416b4
PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=COPYING COPYING-GPLV2 COPYING-LGPLV3
PKG_CPE_ID:=cpe:/a:elfutils_project:elfutils
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/elfutils/Default
SECTION:=libs
CATEGORY:=Libraries
TITLE:=ELF manipulation libraries
URL:=https://fedorahosted.org/elfutils/
ABI_VERSION:=1
endef
define Package/libasm
$(call Package/elfutils/Default)
TITLE+= (libasm)
DEPENDS:=+libelf +libdw
endef
define Package/libdw
$(call Package/elfutils/Default)
DEPENDS:=+libelf +libbz2 +USE_MUSL:musl-fts
TITLE+= (libdw)
endef
define Package/libelf
$(call Package/elfutils/Default)
DEPENDS:=$(INTL_DEPENDS) +zlib
TITLE+= (libelf)
PROVIDES:=libelf1
endef
ifeq ($(CONFIG_BUILD_NLS),y)
TARGET_LDFLAGS += -lintl
else
CONFIGURE_ARGS += --disable-nls
endif
HOST_CONFIGURE_ARGS += \
--disable-shared \
--disable-nls \
--disable-debuginfod \
--disable-libdebuginfod \
--without-bzlib \
--without-lzma \
--without-zstd
CONFIGURE_ARGS += \
--program-prefix=eu- \
--disable-debuginfod \
--disable-libdebuginfod \
--without-bzlib \
--without-lzma \
--without-zstd
HOST_CONFIGURE_VARS += \
ac_cv_search__obstack_free=yes
CONFIGURE_VARS += \
ac_cv_search__obstack_free=yes
TARGET_CFLAGS += \
-D_GNU_SOURCE \
-Wno-unused-result \
-Wno-format-nonliteral
ifneq ($(CONFIG_GCC_USE_VERSION_11),y)
TARGET_CFLAGS += \
-Wno-error=use-after-free
endif
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libasm*.{a,so*} $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libdw*.{a,so*} $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf*.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libelf.pc $(1)/usr/lib/pkgconfig/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libdw.pc $(1)/usr/lib/pkgconfig/
endef
define Package/libasm/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libasm{-*.so,*.so.*} $(1)/usr/lib/
endef
define Package/libdw/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libdw{-*.so,*.so.*} $(1)/usr/lib/
endef
define Package/libelf/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf{-*.so,*.so.*} $(1)/usr/lib/
endef
# these lines need to be ordered by dependency because of ABI versioning
$(eval $(call BuildPackage,libelf))
$(eval $(call BuildPackage,libdw))
$(eval $(call BuildPackage,libasm))

View File

@@ -0,0 +1,23 @@
--- a/config/libelf.pc.in
+++ b/config/libelf.pc.in
@@ -8,7 +8,7 @@ Description: elfutils libelf library to
Version: @VERSION@
URL: http://elfutils.org/
-Libs: -L${libdir} -lelf
+Libs: -L${libdir} -lelf @intl_LDFLAGS@
Cflags: -I${includedir}
Requires.private: zlib @LIBZSTD@
--- a/configure.ac
+++ b/configure.ac
@@ -728,6 +728,9 @@ dnl AM_GNU_GETTEXT_REQUIRE_VERSION suppo
AM_GNU_GETTEXT_VERSION([0.19.6])
AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.6])
+case "$USE_NLS" in yes) intl_LDFLAGS="-lintl" ;; esac
+AC_SUBST([intl_LDFLAGS])
+
dnl Appended to the config.h file.
dnl We hide all kinds of configuration magic in lib/eu-config.h.
AH_BOTTOM([#include <eu-config.h>])

View File

@@ -0,0 +1,11 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,7 +27,7 @@ AM_MAKEFLAGS = --no-print-directory
pkginclude_HEADERS = version.h
SUBDIRS = config lib libelf libcpu backends libebl libdwelf libdwfl libdw \
- libasm debuginfod src po doc tests
+ libasm
EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING SECURITY \
COPYING COPYING-GPLV2 COPYING-LGPLV3 CONDUCT

View File

@@ -0,0 +1,55 @@
From 578f370c7e7a9f056aefa062b34590b0aa13bce5 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Tue, 15 Aug 2017 17:27:30 +0800
Subject: [PATCH] Fix build on aarch64/musl
Errors
invalid operands to binary & (have 'long double' and 'unsigned int')
error: redefinition
of 'struct iovec'
struct iovec { void *iov_base; size_t iov_len; };
^
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Rebase to 0.170
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
backends/aarch64_initreg.c | 4 ++--
backends/arm_initreg.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
--- a/backends/aarch64_initreg.c
+++ b/backends/aarch64_initreg.c
@@ -33,7 +33,7 @@
#include "system.h"
#include <assert.h>
#if defined(__aarch64__) && defined(__linux__)
-# include <linux/uio.h>
+# include <sys/uio.h>
# include <sys/user.h>
# include <sys/ptrace.h>
# include <asm/ptrace.h>
@@ -94,7 +94,7 @@ aarch64_set_initial_registers_tid (pid_t
Dwarf_Word dwarf_fregs[32];
for (int r = 0; r < 32; r++)
- dwarf_fregs[r] = fregs.vregs[r] & 0xFFFFFFFF;
+ dwarf_fregs[r] = (unsigned int)fregs.vregs[r] & 0xFFFFFFFF;
if (! setfunc (64, 32, dwarf_fregs, arg))
return false;
--- a/backends/arm_initreg.c
+++ b/backends/arm_initreg.c
@@ -38,7 +38,7 @@
#endif
#ifdef __aarch64__
-# include <linux/uio.h>
+# include <sys/uio.h>
# include <sys/user.h>
# include <sys/ptrace.h>
/* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */

View File

@@ -0,0 +1,31 @@
From f5d6e088f84dd05278c4698a21cbf1ff4569978d Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Tue, 22 Oct 2024 15:03:42 +0200
Subject: [PATCH] libelf: Add libeu objects to libelf.a static archive
libelf might use some symbols from libeu.a, specifically the eu-search
wrappers. But we don't ship libeu.a separately. So include the libeu
objects in the libelf.a archive to facilitate static linking.
* libelf/Makefile.am (libeu_objects): New variable.
(libelf_a_LIBADD): New, add libeu_objects.
https://sourceware.org/bugzilla/show_bug.cgi?id=32293
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
libelf/Makefile.am | 3 +++
1 file changed, 3 insertions(+)
--- a/libelf/Makefile.am
+++ b/libelf/Makefile.am
@@ -122,6 +122,9 @@ libelf.so: $(srcdir)/libelf.map $(libelf
@$(textrel_check)
$(AM_V_at)ln -fs $@ $@.$(VERSION)
+libeu_objects = $(shell $(AR) t ../lib/libeu.a)
+libelf_a_LIBADD = $(addprefix ../lib/,$(libeu_objects))
+
install: install-am libelf.so
$(mkinstalldirs) $(DESTDIR)$(libdir)
$(INSTALL_PROGRAM) libelf.so $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so

View File

@@ -0,0 +1,24 @@
From f3c664d069d81a4872a1ec8241ee709f37c53e9c Mon Sep 17 00:00:00 2001
From: Aaron Merey <amerey@redhat.com>
Date: Tue, 29 Oct 2024 14:16:57 -0400
Subject: [PATCH] configure.ac: Fix ENABLE_IMA_VERIFICATION conditional
Fix test statement for ENABLE_IMA_VERIFICATION always evalutating to
false due to a missing 'x'.
Signed-off-by: Aaron Merey <amerey@redhat.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/configure.ac
+++ b/configure.ac
@@ -895,7 +895,7 @@ AS_IF([test "x$enable_debuginfod" != "xn
AM_CONDITIONAL([DEBUGINFOD],[test "x$enable_debuginfod" = "xyes"])
AS_IF([test "x$enable_debuginfod_ima_verification" = "xyes"],AC_DEFINE([ENABLE_IMA_VERIFICATION],[1],[Build IMA verification]))
AS_IF([test "x$have_libarchive" = "xyes"],AC_DEFINE([HAVE_LIBARCHIVE],[1],[Define to 1 if libarchive is available]))
-AM_CONDITIONAL([ENABLE_IMA_VERIFICATION],[test "$enable_debuginfod_ima_verification" = "xyes"])
+AM_CONDITIONAL([ENABLE_IMA_VERIFICATION],[test "x$enable_debuginfod_ima_verification" = "xyes"])
AM_CONDITIONAL([OLD_LIBMICROHTTPD],[test "x$old_libmicrohttpd" = "xyes"])
dnl for /etc/profile.d/elfutils.{csh,sh}

View File

@@ -0,0 +1,193 @@
From 8707194a9f2f0b13e53041b03ebfdbdbd2942e43 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Tue, 5 Nov 2024 23:31:14 +0100
Subject: [PATCH 1/1] libelf: Only fetch shdr once in elf_compress[_gnu]
Some compilers assume the second call to elf[32|64]_getshdr can fail
and produce error: potential null pointer dereference. Just store the
result of the first call and reuse (when not NULL).
* libelf/elf_compress.c (elf_compress): Store getshdr result in
a shdr union var.
* libelf/elf_compress_gnu.c (): Likewise
https://sourceware.org/bugzilla/show_bug.cgi?id=32311
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
libelf/elf_compress.c | 55 +++++++++++++++++++++------------------
libelf/elf_compress_gnu.c | 45 ++++++++++++++------------------
2 files changed, 48 insertions(+), 52 deletions(-)
--- a/libelf/elf_compress.c
+++ b/libelf/elf_compress.c
@@ -584,25 +584,30 @@ elf_compress (Elf_Scn *scn, int type, un
Elf64_Xword sh_flags;
Elf64_Word sh_type;
Elf64_Xword sh_addralign;
+ union shdr
+ {
+ Elf32_Shdr *s32;
+ Elf64_Shdr *s64;
+ } shdr;
if (elfclass == ELFCLASS32)
{
- Elf32_Shdr *shdr = elf32_getshdr (scn);
- if (shdr == NULL)
+ shdr.s32 = elf32_getshdr (scn);
+ if (shdr.s32 == NULL)
return -1;
- sh_flags = shdr->sh_flags;
- sh_type = shdr->sh_type;
- sh_addralign = shdr->sh_addralign;
+ sh_flags = shdr.s32->sh_flags;
+ sh_type = shdr.s32->sh_type;
+ sh_addralign = shdr.s32->sh_addralign;
}
else
{
- Elf64_Shdr *shdr = elf64_getshdr (scn);
- if (shdr == NULL)
+ shdr.s64 = elf64_getshdr (scn);
+ if (shdr.s64 == NULL)
return -1;
- sh_flags = shdr->sh_flags;
- sh_type = shdr->sh_type;
- sh_addralign = shdr->sh_addralign;
+ sh_flags = shdr.s64->sh_flags;
+ sh_type = shdr.s64->sh_type;
+ sh_addralign = shdr.s64->sh_addralign;
}
if ((sh_flags & SHF_ALLOC) != 0)
@@ -679,17 +684,17 @@ elf_compress (Elf_Scn *scn, int type, un
correctly and ignored when SHF_COMPRESSED is set. */
if (elfclass == ELFCLASS32)
{
- Elf32_Shdr *shdr = elf32_getshdr (scn);
- shdr->sh_size = new_size;
- shdr->sh_addralign = __libelf_type_align (ELFCLASS32, ELF_T_CHDR);
- shdr->sh_flags |= SHF_COMPRESSED;
+ shdr.s32->sh_size = new_size;
+ shdr.s32->sh_addralign = __libelf_type_align (ELFCLASS32,
+ ELF_T_CHDR);
+ shdr.s32->sh_flags |= SHF_COMPRESSED;
}
else
{
- Elf64_Shdr *shdr = elf64_getshdr (scn);
- shdr->sh_size = new_size;
- shdr->sh_addralign = __libelf_type_align (ELFCLASS64, ELF_T_CHDR);
- shdr->sh_flags |= SHF_COMPRESSED;
+ shdr.s64->sh_size = new_size;
+ shdr.s64->sh_addralign = __libelf_type_align (ELFCLASS64,
+ ELF_T_CHDR);
+ shdr.s64->sh_flags |= SHF_COMPRESSED;
}
__libelf_reset_rawdata (scn, out_buf, new_size, 1, ELF_T_CHDR);
@@ -731,17 +736,15 @@ elf_compress (Elf_Scn *scn, int type, un
correctly and ignored when SHF_COMPRESSED is set. */
if (elfclass == ELFCLASS32)
{
- Elf32_Shdr *shdr = elf32_getshdr (scn);
- shdr->sh_size = scn->zdata_size;
- shdr->sh_addralign = scn->zdata_align;
- shdr->sh_flags &= ~SHF_COMPRESSED;
+ shdr.s32->sh_size = scn->zdata_size;
+ shdr.s32->sh_addralign = scn->zdata_align;
+ shdr.s32->sh_flags &= ~SHF_COMPRESSED;
}
else
{
- Elf64_Shdr *shdr = elf64_getshdr (scn);
- shdr->sh_size = scn->zdata_size;
- shdr->sh_addralign = scn->zdata_align;
- shdr->sh_flags &= ~SHF_COMPRESSED;
+ shdr.s64->sh_size = scn->zdata_size;
+ shdr.s64->sh_addralign = scn->zdata_align;
+ shdr.s64->sh_flags &= ~SHF_COMPRESSED;
}
__libelf_reset_rawdata (scn, scn->zdata_base,
--- a/libelf/elf_compress_gnu.c
+++ b/libelf/elf_compress_gnu.c
@@ -59,25 +59,30 @@ elf_compress_gnu (Elf_Scn *scn, int infl
Elf64_Xword sh_flags;
Elf64_Word sh_type;
Elf64_Xword sh_addralign;
+ union shdr
+ {
+ Elf32_Shdr *s32;
+ Elf64_Shdr *s64;
+ } shdr;
if (elfclass == ELFCLASS32)
{
- Elf32_Shdr *shdr = elf32_getshdr (scn);
- if (shdr == NULL)
+ shdr.s32 = elf32_getshdr (scn);
+ if (shdr.s32 == NULL)
return -1;
- sh_flags = shdr->sh_flags;
- sh_type = shdr->sh_type;
- sh_addralign = shdr->sh_addralign;
+ sh_flags = shdr.s32->sh_flags;
+ sh_type = shdr.s32->sh_type;
+ sh_addralign = shdr.s32->sh_addralign;
}
else
{
- Elf64_Shdr *shdr = elf64_getshdr (scn);
- if (shdr == NULL)
+ shdr.s64 = elf64_getshdr (scn);
+ if (shdr.s64 == NULL)
return -1;
- sh_flags = shdr->sh_flags;
- sh_type = shdr->sh_type;
- sh_addralign = shdr->sh_addralign;
+ sh_flags = shdr.s64->sh_flags;
+ sh_type = shdr.s64->sh_type;
+ sh_addralign = shdr.s64->sh_addralign;
}
/* Allocated sections, or sections that are already are compressed
@@ -122,15 +127,9 @@ elf_compress_gnu (Elf_Scn *scn, int infl
sh_flags won't have a SHF_COMPRESSED hint in the GNU format.
Just adjust the sh_size. */
if (elfclass == ELFCLASS32)
- {
- Elf32_Shdr *shdr = elf32_getshdr (scn);
- shdr->sh_size = new_size;
- }
+ shdr.s32->sh_size = new_size;
else
- {
- Elf64_Shdr *shdr = elf64_getshdr (scn);
- shdr->sh_size = new_size;
- }
+ shdr.s64->sh_size = new_size;
__libelf_reset_rawdata (scn, out_buf, new_size, 1, ELF_T_BYTE);
@@ -187,15 +186,9 @@ elf_compress_gnu (Elf_Scn *scn, int infl
sh_flags won't have a SHF_COMPRESSED hint in the GNU format.
Just adjust the sh_size. */
if (elfclass == ELFCLASS32)
- {
- Elf32_Shdr *shdr = elf32_getshdr (scn);
- shdr->sh_size = size;
- }
+ shdr.s32->sh_size = size;
else
- {
- Elf64_Shdr *shdr = elf64_getshdr (scn);
- shdr->sh_size = size;
- }
+ shdr.s64->sh_size = size;
__libelf_reset_rawdata (scn, buf_out, size, sh_addralign,
__libelf_data_type (&ehdr, sh_type,

View File

@@ -0,0 +1,29 @@
--- a/libdw/libdw_alloc.c
+++ b/libdw/libdw_alloc.c
@@ -152,5 +152,5 @@ __attribute ((noreturn)) attribute_hidde
__libdw_oom (void)
{
while (1)
- error (EXIT_FAILURE, ENOMEM, "libdw");
+ error (EXIT_FAILURE, errno, gettext ("cannot allocate memory"));
}
--- a/libdwfl/dwfl_error.c
+++ b/libdwfl/dwfl_error.c
@@ -139,6 +139,7 @@ __libdwfl_seterrno (Dwfl_Error error)
static const char *
errnomsg(int error)
{
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
/* Won't be changed by strerror_r, but not const so compiler doesn't throw warning */
static char unknown[] = "unknown error";
@@ -149,6 +150,9 @@ errnomsg(int error)
static __thread char msg[128];
return strerror_r (error, msg, sizeof (msg)) ? unknown : msg;
#endif
+#else
+ return strerror (error & 0xffff);
+#endif
}
const char *

View File

@@ -0,0 +1,83 @@
--- a/libdwfl/argp-std.c
+++ b/libdwfl/argp-std.c
@@ -51,9 +51,6 @@ static const struct argp_option options[
{ "linux-process-map", 'M', "FILE", 0,
N_("Find addresses in files mapped as read from FILE"
" in Linux /proc/PID/maps format"), 0 },
- { "kernel", 'k', NULL, 0, N_("Find addresses in the running kernel"), 0 },
- { "offline-kernel", 'K', "RELEASE", OPTION_ARG_OPTIONAL,
- N_("Kernel with all modules"), 0 },
{ "debuginfo-path", OPT_DEBUGINFO, "PATH", 0,
N_("Search path for separate debuginfo files"), 0 },
{ NULL, 0, NULL, 0, NULL, 0 }
@@ -80,15 +77,6 @@ static const Dwfl_Callbacks proc_callbac
.find_elf = INTUSE(dwfl_linux_proc_find_elf),
};
-static const Dwfl_Callbacks kernel_callbacks =
- {
- .find_debuginfo = INTUSE(dwfl_standard_find_debuginfo),
- .debuginfo_path = &debuginfo_path,
-
- .find_elf = INTUSE(dwfl_linux_kernel_find_elf),
- .section_address = INTUSE(dwfl_linux_kernel_module_section_address),
- };
-
/* Structure held at state->HOOK. */
struct parse_opt
{
@@ -221,43 +209,6 @@ parse_opt (int key, char *arg, struct ar
}
break;
- case 'k':
- {
- struct parse_opt *opt = state->hook;
- if (opt->dwfl == NULL)
- {
- Dwfl *dwfl = INTUSE(dwfl_begin) (&kernel_callbacks);
- int result = INTUSE(dwfl_linux_kernel_report_kernel) (dwfl);
- if (result != 0)
- return fail (dwfl, result, _("cannot load kernel symbols"), state);
- result = INTUSE(dwfl_linux_kernel_report_modules) (dwfl);
- if (result != 0)
- /* Non-fatal to have no modules since we do have the kernel. */
- argp_failure (state, 0, result, _("cannot find kernel modules"));
- opt->dwfl = dwfl;
- }
- else
- goto toomany;
- }
- break;
-
- case 'K':
- {
- struct parse_opt *opt = state->hook;
- if (opt->dwfl == NULL)
- {
- Dwfl *dwfl = INTUSE(dwfl_begin) (&offline_callbacks);
- int result = INTUSE(dwfl_linux_kernel_report_offline) (dwfl, arg,
- NULL);
- if (result != 0)
- return fail (dwfl, result, _("cannot find kernel or modules"), state);
- opt->dwfl = dwfl;
- }
- else
- goto toomany;
- }
- break;
-
case ARGP_KEY_SUCCESS:
{
struct parse_opt *opt = state->hook;
--- a/libdwfl/Makefile.am
+++ b/libdwfl/Makefile.am
@@ -50,7 +50,7 @@ libdwfl_a_SOURCES = dwfl_begin.c dwfl_en
argp-std.c find-debuginfo.c \
dwfl_build_id_find_elf.c \
dwfl_build_id_find_debuginfo.c \
- linux-kernel-modules.c linux-proc-maps.c \
+ linux-proc-maps.c \
dwfl_addrmodule.c dwfl_addrdwarf.c \
cu.c dwfl_module_nextcu.c dwfl_nextcu.c dwfl_cumodule.c \
dwfl_module_addrdie.c dwfl_addrdie.c \

View File

@@ -0,0 +1,55 @@
strip.c: Pointer `arhdr` created at strip.c:2741 and then dereferenced without NULL-check.
The same situation for the `arhdr` pointer at the objdump.c:313 and
the `h` pointer at the readelf.c:13545.
Triggers found by static analyzer Svace.
Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
---
src/objdump.c | 5 +++++
src/readelf.c | 5 +++++
src/strip.c | 5 +++++
3 files changed, 15 insertions(+)
--- a/src/objdump.c
+++ b/src/objdump.c
@@ -311,6 +311,11 @@ handle_ar (int fd, Elf *elf, const char
{
/* The the header for this element. */
Elf_Arhdr *arhdr = elf_getarhdr (subelf);
+ if (arhdr == NULL)
+ {
+ printf ("cannot get arhdr: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
/* Skip over the index entries. */
if (strcmp (arhdr->ar_name, "/") != 0
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -13543,6 +13543,11 @@ dump_archive_index (Elf *elf, const char
as_off, fname, elf_errmsg (-1));
const Elf_Arhdr *h = elf_getarhdr (subelf);
+ if (h == NULL)
+ {
+ printf ("cannot get arhdr: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
printf (_("Archive member '%s' contains:\n"), h->ar_name);
--- a/src/strip.c
+++ b/src/strip.c
@@ -2739,6 +2739,11 @@ handle_ar (int fd, Elf *elf, const char
{
/* The the header for this element. */
Elf_Arhdr *arhdr = elf_getarhdr (subelf);
+ if (arhdr == NULL)
+ {
+ printf ("cannot get arhdr: %s\n", elf_errmsg (-1));
+ exit (1);
+ }
if (elf_kind (subelf) == ELF_K_ELF)
result |= handle_elf (fd, subelf, new_prefix, arhdr->ar_name, 0, NULL);

View File

@@ -0,0 +1,187 @@
#
# Copyright (C) 2006-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:=gettext-full
PKG_VERSION:=0.22.5
PKG_RELEASE:=1
PKG_SOURCE:=gettext-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/gettext
PKG_HASH:=fe10c37353213d78a5b83d48af231e005c4da84db5ce88037d88355938259640
PKG_BUILD_DIR:=$(BUILD_DIR)/gettext-$(PKG_VERSION)
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/gettext-$(PKG_VERSION)
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=GPL-3.0-or-later
PKG_CPE_ID:=cpe:/a:gnu:gettext
PKG_INSTALL:=1
PKG_BUILD_DEPENDS:=gettext-full/host libunistring libxml2
PKG_BUILD_PARALLEL:=0
PKG_FIXUP:=autoreconf
HOST_BUILD_DEPENDS:=gperf/host libiconv-full/host libunistring/host libxml2/host
HOST_BUILD_PARALLEL:=0
PKG_SUBDIRS:= \
$$$$(foreach dir, \
intl \
intl-csharp \
intl-java \
its \
gnulib-lib \
gnulib-local \
lib \
$$$$(SUBDIR_libasprintf) \
libgettextpo \
libgrep \
libtextstyle \
m4 \
misc \
po \
projects \
src \
styles \
gettext-runtime \
gettext-tools \
,$$$$(wildcard $$$$(dir)) )
PKG_MAKEFILES_FAKE:= \
gnulib-local/m4/Makefile \
libtextstyle/gnulib-local/Makefile \
libtextstyle/m4/Makefile \
m4/Makefile
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
define Package/libintl-full
SECTION:=libs
CATEGORY:=Libraries
TITLE:=GNU Internationalization library
URL:=http://www.gnu.org/software/gettext/
ABI_VERSION:=8
endef
export GNULIB_SRCDIR:=$(HOST_GNULIB_SRCDIR)
TARGET_CFLAGS += $(FPIC)
ifneq ($(HOST_OS),Linux)
TARGET_CFLAGS += -I$(STAGING_DIR_HOSTPKG)/include
endif
CONFIGURE_ARGS += \
--enable-shared \
--enable-static \
--disable-libasprintf \
--disable-rpath \
--enable-nls \
--disable-java \
--disable-openmp \
--disable-curses \
--with-included-gettext \
--without-libintl-prefix \
--without-libexpat-prefix \
--with-libunistring-prefix=$(STAGING_DIR)/usr \
--with-libxml2-prefix=$(STAGING_DIR) \
--without-emacs
HOST_CONFIGURE_ARGS += \
--disable-shared \
--enable-static \
--disable-libasprintf \
--disable-rpath \
--disable-java \
--disable-openmp \
--without-emacs \
--with-libiconv-prefix=$(STAGING_DIR_HOSTPKG) \
--with-libunistring-prefix=$(STAGING_DIR_HOSTPKG) \
--with-libxml2-prefix=$(STAGING_DIR_HOSTPKG)
HOST_CONFIGURE_VARS += \
EMACS="no" \
HOST_CFLAGS += $(HOST_FPIC)
define Host/Bootstrap
( \
cd $(HOST_BUILD_DIR); \
$(AM_TOOL_PATHS) \
./autogen.sh \
)
endef
define Host/Prepare
$(call Host/Prepare/Default)
$(if $(QUILT),,$(call Host/Bootstrap))
endef
define Host/Configure
$(if $(QUILT),$(call Host/Bootstrap))
$(call Host/Configure/Default)
endef
define Host/Compile
$(foreach makefile,$(PKG_MAKEFILES_FAKE),printf '%s\n%s\n' 'all:' 'install:' > $(HOST_BUILD_DIR)/$(makefile); )
$(call Host/Compile/Default,SUBDIRS='$(PKG_SUBDIRS)')
endef
define Build/Bootstrap
( \
cd $(PKG_BUILD_DIR); \
$(AM_TOOL_PATHS) \
./autogen.sh \
)
endef
define Build/Prepare
$(call Build/Prepare/Default)
$(if $(QUILT),,$(call Build/Bootstrap))
endef
define Build/Configure
$(if $(QUILT),$(call Build/Bootstrap))
$(call Build/Configure/Default)
endef
define Build/Compile
$(foreach makefile,$(PKG_MAKEFILES_FAKE),printf '%s\n%s\n' 'all:' 'install:' > $(PKG_BUILD_DIR)/$(makefile); )
$(call Build/Compile/Default,SUBDIRS='$(PKG_SUBDIRS)')
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib/libintl-full/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/libintl.h $(1)/usr/lib/libintl-full/include/
$(INSTALL_DIR) $(1)/usr/lib/libintl-full/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libintl.{a,so*} $(1)/usr/lib/libintl-full/lib/
$(INSTALL_DIR) $(1)/usr/share/aclocal
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/* $(1)/usr/share/aclocal/
$(SED) '/read dummy/d' $(STAGING_DIR_HOSTPKG)/bin/gettextize
endef
define Host/Install
$(call Host/Compile/Default,install SUBDIRS='$(PKG_SUBDIRS)')
$(LN) msgfmt $(STAGING_DIR_HOSTPKG)/bin/gmsgfmt
endef
define Build/Install
$(call Build/Install/Default,install SUBDIRS='$(PKG_SUBDIRS)')
endef
define Package/libintl-full/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libintl.so.* $(1)/usr/lib/
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,libintl-full))

View File

@@ -0,0 +1,30 @@
--- a/gettext-tools/misc/autopoint.in
+++ b/gettext-tools/misc/autopoint.in
@@ -27,7 +27,11 @@ archive_version=@ARCHIVE_VERSION@
# Set variables
# - gettext_datadir directory where the data files are stored.
-prefix="@prefix@"
+if [ -n "$STAGING_DIR_HOSTPKG" ]; then
+ prefix="$STAGING_DIR_HOSTPKG"
+else
+ prefix="@prefix@"
+fi
datarootdir="@datarootdir@"
: ${gettext_datadir="@datadir@/gettext"}
: ${AUTOM4TE=autom4te}
--- a/gettext-tools/misc/gettextize.in
+++ b/gettext-tools/misc/gettextize.in
@@ -27,7 +27,11 @@ archive_version=@ARCHIVE_VERSION@
# Set variables
# - gettext_datadir directory where the data files are stored.
-prefix="@prefix@"
+if [ -n "$STAGING_DIR_HOSTPKG" ]; then
+ prefix="$STAGING_DIR_HOSTPKG"
+else
+ prefix="@prefix@"
+fi
datarootdir="@datarootdir@"
: ${gettext_datadir="@datadir@/gettext"}
: ${AUTOM4TE=autom4te}

View File

@@ -0,0 +1,24 @@
--- a/gettext-runtime/man/Makefile.am
+++ b/gettext-runtime/man/Makefile.am
@@ -176,8 +176,7 @@ textdomain.3.html: textdomain.3.in
bindtextdomain.3.html: bindtextdomain.3.in
bind_textdomain_codeset.3.html: bind_textdomain_codeset.3.in
-install-html-local:
- $(MKDIR_P) $(DESTDIR)$(htmldir)
+install-html: installdirs-html
for file in $(man_HTML); do \
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
$(INSTALL_DATA) $$dir/$$file $(DESTDIR)$(htmldir)/$$file; \
--- a/gettext-tools/man/Makefile.am
+++ b/gettext-tools/man/Makefile.am
@@ -158,8 +158,7 @@ recode-sr-latin.1.html: recode-sr-latin.
gettextize.1.html: gettextize.1
autopoint.1.html: autopoint.1
-install-html-local:
- $(MKDIR_P) $(DESTDIR)$(htmldir)
+install-html: installdirs-html
for file in $(man_HTML); do \
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
$(INSTALL_DATA) $$dir/$$file $(DESTDIR)$(htmldir)/$$file; \

View File

@@ -0,0 +1,31 @@
--- a/libtextstyle/gnulib-local/modules/libxml.diff
+++ /dev/null
@@ -1,28 +0,0 @@
-*** libxml.orig 2018-10-28 14:37:07.007164889 +0100
---- libxml 2019-02-14 22:19:29.994771110 +0100
-***************
-*** 118,124 ****
- fabs
-
- configure.ac:
-! gl_LIBXML
-
- Makefile.am:
- if INCLUDED_LIBXML
---- 118,133 ----
- fabs
-
- configure.ac:
-! # In libtextstyle, we don't want to use an external libxml, because its
-! # dependencies and their dynamic relocations have an impact on the startup
-! # time of a program that is linked with it. As you can see by using
-! # 'readelf -r ... | wc -l' and 'readelf -d ... | grep NEEDED':
-! # - libxml2.so has more than 3300 relocations and depends on libicuuc.
-! # - libicuuc.so has more than 4900 relocations and depends on libstdc++.
-! # - libstdc++.so has more than 4600 relocations.
-! # These are more than 12800 relocations, to perform at program startup.
-! # So, force the use of the included libxml part.
-! gl_LIBXML([yes])
-
- Makefile.am:
- if INCLUDED_LIBXML

View File

@@ -0,0 +1,21 @@
--- a/autogen.sh
+++ b/autogen.sh
@@ -81,6 +81,7 @@ if ! $skip_gnulib; then
getopt-gnu
gettext-h
havelib
+ libunistring-optional
memmove
noreturn
progname
--- a/gettext-runtime/src/Makefile.am
+++ b/gettext-runtime/src/Makefile.am
@@ -43,7 +43,7 @@ envsubst_SOURCES = envsubst.c
# Link dependencies.
# Need @LTLIBICONV@ because striconv.c uses iconv().
-LDADD = ../gnulib-lib/libgrt.a @LTLIBINTL@ @LTLIBICONV@ $(WOE32_LDADD)
+LDADD = ../gnulib-lib/libgrt.a $(LTLIBUNISTRING) @LTLIBINTL@ @LTLIBICONV@ $(WOE32_LDADD)
# Specify installation directory, for --enable-relocatable.
gettext_CFLAGS = -DINSTALLDIR=\"$(bindir)\"

71
package/libs/gmp/Makefile Normal file
View File

@@ -0,0 +1,71 @@
#
# Copyright (C) 2006-2016 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:=gmp
PKG_VERSION:=6.3.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/gmp/
PKG_HASH:=e56fd59d76810932a0555aa15a14b61c16bed66110d3c75cc2ac49ddaa9ab24c
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
PKG_LICENSE:=GPL-2.0-or-later
PKG_CPE_ID:=cpe:/a:gmplib:gmp
PKG_BUILD_FLAGS:=no-mips16
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
define Package/libgmp
SECTION:=libs
CATEGORY:=Libraries
TITLE:=GNU multiprecision arithmetic library
URL:=http://gmplib.org/
ABI_VERSION:=10
endef
define Package/libgmp/description
GMP is a free library for arbitrary precision arithmetic, operating on
signed integers, rational numbers, and floating point numbers.
endef
TARGET_CFLAGS += $(FPIC)
CONFIGURE_VARS += CC="$(TARGET_CROSS)gcc"
CONFIGURE_ARGS += \
--enable-shared \
--enable-static \
--without-readline \
--disable-fft \
define Build/Compile
$(call Build/Compile/Default, \
DESTDIR="$(PKG_INSTALL_DIR)" \
CC="$(TARGET_CC)" \
all \
)
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/gmp* $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgmp.{a,so*} $(1)/usr/lib/
endef
define Package/libgmp/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgmp.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libgmp))
$(eval $(call HostBuild))

View File

@@ -0,0 +1,51 @@
#
# Copyright (C) 2011-2017 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:=jansson
PKG_VERSION:=2.14
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/akheron/$(PKG_NAME)/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=c739578bf6b764aa0752db9a2fdadcfe921c78f1228c7ec0bb47fa804c55d17b
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:jansson_project:jansson
PKG_BUILD_FLAGS:=lto
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
CMAKE_INSTALL:=1
CMAKE_OPTIONS += \
-DJANSSON_BUILD_DOCS:BOOL=OFF \
-DJANSSON_BUILD_SHARED_LIBS:BOOL=ON \
-DJANSSON_EXAMPLES:BOOL=OFF \
-DJANSSON_WITHOUT_TESTS:BOOL=ON
define Package/jansson
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Jansson library
URL:=http://www.digip.org/jansson/
ABI_VERSION:=4
endef
define Package/jansson/description
Jansson is a C library for encoding, decoding and manipulating JSON data
endef
define Package/jansson/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libjansson*so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,jansson))

View File

@@ -0,0 +1,72 @@
#
# Copyright (C) 2020-2024 Tony Ambardar <itugrok@yahoo.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libbpf
PKG_VERSION:=1.4.6
PKG_RELEASE:=1
PKG_SOURCE_URL:=https://github.com/libbpf/libbpf
PKG_MIRROR_HASH:=0d0d70750c8e45baba19f8cc065771e5d842a90f3ad1637003cae6887dabf11e
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
PKG_ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION)))
PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
PKG_CPE_ID:=cpe:/a:libbpf_project:libbpf
PKG_BUILD_FLAGS:=no-mips16 no-gc-sections no-lto
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/libbpf
SECTION:=libs
CATEGORY:=Libraries
TITLE:=libbpf - eBPF helper library
LICENSE:=LGPL-2.1 OR BSD-2-Clause
ABI_VERSION:=$(PKG_ABI_VERSION)
URL:=http://www.kernel.org
DEPENDS:=+libelf
endef
define Package/libbpf/description
libbpf is a library for loading eBPF programs and reading and manipulating eBPF objects from user-space.
endef
MAKE_FLAGS += \
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
LIBSUBDIR=lib
MAKE_PATH = src
define Build/InstallDev/libbpf
$(INSTALL_DIR) $(1)/usr/include/bpf
$(CP) $(PKG_INSTALL_DIR)/usr/include/bpf/*.h $(1)/usr/include/bpf/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbpf.{a,so*} \
$(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libbpf.pc \
$(1)/usr/lib/pkgconfig/
$(SED) 's,/usr/include,$$$${prefix}/include,g' \
$(1)/usr/lib/pkgconfig/libbpf.pc
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' \
$(1)/usr/lib/pkgconfig/libbpf.pc
endef
Build/InstallDev=$(Build/InstallDev/libbpf)
define Package/libbpf/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbpf.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libbpf))

View File

@@ -0,0 +1,49 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libbsd
PKG_VERSION:=0.11.8
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://libbsd.freedesktop.org/releases
PKG_HASH:=55fdfa2696fb4d55a592fa9ad14a9df897c7b0008ddb3b30c419914841f85f33
PKG_LICENSE:=BSD-4-Clause
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:freedesktop:libbsd
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS := libmd
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/package.mk
define Package/libbsd
SECTION:=libs
CATEGORY:=Libraries
TITLE:=common BSD library
ABI_VERSION:=0
endef
define Package/libbsd/description
This library provides useful functions commonly found on BSD systems, and lacking on others like GNU systems, thus making it easier to port projects with strong BSD origins, without needing to embed the same code over and over again on each project.
endef
TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbsd.{la,so*} $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libbsd*.pc $(1)/usr/lib/pkgconfig/
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
endef
define Package/libbsd/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbsd.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libbsd))

View File

@@ -0,0 +1,13 @@
do not use host path to fix cross compiling
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -230,7 +230,7 @@ if NEED_TRANSPARENT_LIBMD
(echo '/* GNU ld script'; \
echo ' * The MD5 functions are provided by the libmd library. */'; \
cat format.ld; \
- echo "GROUP($(runtimelibdir)/$$soname AS_NEEDED($(MD5_LIBS)))"; \
+ echo "GROUP($$soname AS_NEEDED($(MD5_LIBS)))"; \
)>$(DESTDIR)$(libdir)/libbsd.so
else
if [ "$(libdir)" != "$(runtimelibdir)" ]; then \

View File

@@ -0,0 +1,117 @@
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libcap
PKG_VERSION:=2.69
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/libs/security/linux-privs/libcap2
PKG_HASH:=f311f8f3dad84699d0566d1d6f7ec943a9298b28f714cae3c931dfd57492d7eb
PKG_MAINTAINER:=Paul Wassi <p.wassi@gmx.at>
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=License
PKG_CPE_ID:=cpe:/a:libcap_project:libcap
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk
define Package/libcap/Default
TITLE:=Linux capabilities library
SECTION:=libs
CATEGORY:=Libraries
URL:=https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/
endef
define Package/libcap/description/Default
Linux capabilities
endef
define Package/libcap
$(call Package/libcap/Default)
TITLE += library
endef
define Package/libcap-bin
$(call Package/libcap/Default)
TITLE += binaries
DEPENDS += libcap
endef
define Package/libcap-bin/description
$(call Package/libcap/description/Default)
.
This package contains the libcap utilities.
endef
define Package/libcap-bin/config
if PACKAGE_libcap-bin
config PACKAGE_libcap-bin-capsh-shell
string "capsh shell"
help
Set the capsh shell.
default "/bin/sh"
endif
endef
MAKE_FLAGS += \
BUILD_CC="$(CC)" \
BUILD_CFLAGS="$(FPIC) -I$(PKG_BUILD_DIR)/libcap/include" \
CFLAGS="$(TARGET_CFLAGS)" \
LD="$(TARGET_CC) -Wl,-x -shared" \
LDFLAGS="$(TARGET_LDFLAGS)" \
INDENT="| true" \
GOLANG="no" \
PAM_CAP="no" \
RAISE_SETFCAP="no" \
DYNAMIC="yes" \
lib="lib"
TARGET_CFLAGS += $(FPIC)
ifneq ($(CONFIG_PACKAGE_libcap-bin-capsh-shell),)
TARGET_CFLAGS += -DSHELL='\"$(CONFIG_PACKAGE_libcap-bin-capsh-shell)\"'
endif
TARGET_CFLAGS += $(if $(CONFIG_USE_MUSL),-Dpthread_yield=sched_yield)
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/sys
$(CP) $(PKG_INSTALL_DIR)/usr/include/sys/*.h $(1)/usr/include/sys/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/lib/libcap.{so*,a} $(1)/usr/lib/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/lib/libpsx.a $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/lib/pkgconfig/libcap.pc $(1)/usr/lib/pkgconfig/
$(SED) 's,exec_prefix=,exec_prefix=/usr,g' $(1)/usr/lib/pkgconfig/libcap.pc
$(SED) 's,/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libcap.pc
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libcap.pc
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/lib/pkgconfig/libpsx.pc $(1)/usr/lib/pkgconfig/
$(SED) 's,exec_prefix=,exec_prefix=/usr,g' $(1)/usr/lib/pkgconfig/libpsx.pc
$(SED) 's,/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libpsx.pc
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libpsx.pc
endef
define Package/libcap/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/lib/libcap.so* $(1)/usr/lib/
endef
define Package/libcap-bin/install
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_INSTALL_DIR)/sbin/capsh $(1)/usr/sbin/
$(CP) $(PKG_INSTALL_DIR)/sbin/getcap $(1)/usr/sbin/
$(CP) $(PKG_INSTALL_DIR)/sbin/getpcaps $(1)/usr/sbin/
$(CP) $(PKG_INSTALL_DIR)/sbin/setcap $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,libcap))
$(eval $(call BuildPackage,libcap-bin))

View File

@@ -0,0 +1,10 @@
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,6 @@ ifeq ($(GOLANG),yes)
$(MAKE) -C go $@
rm -f cap/go.sum
endif
- $(MAKE) -C tests $@
$(MAKE) -C progs $@
$(MAKE) -C doc $@

View File

@@ -0,0 +1,8 @@
--- a/progs/mkcapshdoc.sh
+++ b/progs/mkcapshdoc.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This script generates some C code for inclusion in the capsh binary.
# The Makefile generally only generates the .c code and compares it
# with the checked in code in the progs directory.

View File

@@ -0,0 +1,165 @@
#
# Copyright (C) 2011-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:=libevent2
PKG_VERSION:=2.1.12
PKG_RELEASE:=2
PKG_SOURCE:=libevent-$(PKG_VERSION)-stable.tar.gz
PKG_SOURCE_URL:=https://github.com/libevent/libevent/releases/download/release-$(PKG_VERSION)-stable
PKG_HASH:=92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb
PKG_BUILD_DIR:=$(BUILD_DIR)/libevent-$(PKG_VERSION)-stable
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:libevent_project:libevent
PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_libevent2-openssl \
CONFIG_PACKAGE_libevent2-pthreads \
CONFIG_PACKAGE_libevent2-mbedtls
PKG_BUILD_FLAGS:=gc-sections lto
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/libevent2/Default
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Event notification
URL:=http://libevent.org
ABI_VERSION:=7
endef
define Package/libevent2/Default/description
The libevent API provides a mechanism to execute a callback function
when a specific event occurs on a file descriptor or after a timeout
has been reached. Furthermore, libevent also support callbacks due
to signals or regular timeouts.
libevent is meant to replace the event loop found in event driven
network servers. An application just needs to call event_dispatch()
and then add or remove events dynamically without having to change
the event loop.
endef
define Package/libevent2
$(call Package/libevent2/Default)
TITLE+= library (version 2.1)
endef
define Package/libevent2/description
$(call Package/libevent2/Default/description)
This package contains the libevent shared library historically
containing both the core & extra libraries.
endef
define Package/libevent2-core
$(call Package/libevent2/Default)
TITLE+= core library (version 2.1)
endef
define Package/libevent2-core/description
$(call Package/libevent2/Default/description)
This package contains the libevent core shared library for the event,
buffer & utility functions.
endef
define Package/libevent2-extra
$(call Package/libevent2/Default)
TITLE+= extra library (version 2.1)
DEPENDS+=+libevent2-core
endef
define Package/libevent2-extra/description
$(call Package/libevent2/Default/description)
This package contains the libevent extra shared library for specific
protocols including HTTP, DNS & RPC.
endef
define Package/libevent2-openssl
$(call Package/libevent2/Default)
TITLE+= OpenSSL library (version 2.1)
DEPENDS+=+libopenssl +libevent2-core
endef
define Package/libevent2-openssl/description
$(call Package/libevent2/Default/description)
This package contains the libevent OpenSSL shared library for encrypted
bufferevents.
endef
define Package/libevent2-pthreads
$(call Package/libevent2/Default)
TITLE+= Pthreads library (version 2.1)
DEPENDS+=+libpthread +libevent2-core
endef
define Package/libevent2-pthreads/description
$(call Package/libevent2/Default/description)
This package contains the libevent Pthreads shared library for
threading & locking.
endef
TARGET_CFLAGS += $(FPIC)
TARGET_LDFLAGS += -Wl,--as-needed
CMAKE_OPTIONS += \
-DEVENT__DISABLE_BENCHMARK:BOOL=ON \
-DEVENT__DISABLE_DEBUG_MODE:BOOL=ON \
-DEVENT__DISABLE_REGRESS:BOOL=ON \
-DEVENT__DISABLE_SAMPLES:BOOL=ON \
$(if $(CONFIG_PACKAGE_libevent2-openssl),-DEVENT__DISABLE_OPENSSL:BOOL=OFF,-DEVENT__DISABLE_OPENSSL:BOOL=ON) \
$(if $(CONFIG_PACKAGE_libevent2-pthreads),-DEVENT__DISABLE_THREAD_SUPPORT:BOOL=OFF,-DEVENT__DISABLE_THREAD_SUPPORT:BOOL=ON) \
-DEVENT__DISABLE_TESTS:BOOL=ON \
-DBUILD_TESTING:BOOL=OFF
define Build/InstallDev
$(call Build/InstallDev/cmake,$(1))
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libevent*.pc
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libevent*.pc
endef
define Package/libevent2/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent-2.1.so.* $(1)/usr/lib/
endef
define Package/libevent2-core/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_core-2.1.so.* $(1)/usr/lib/
endef
define Package/libevent2-extra/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_extra-2.1.so.* $(1)/usr/lib/
endef
define Package/libevent2-openssl/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_openssl-2.1.so.* $(1)/usr/lib/
endef
define Package/libevent2-pthreads/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_pthreads-2.1.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libevent2))
$(eval $(call BuildPackage,libevent2-core))
$(eval $(call BuildPackage,libevent2-extra))
$(eval $(call BuildPackage,libevent2-openssl))
$(eval $(call BuildPackage,libevent2-pthreads))

View File

@@ -0,0 +1,58 @@
From 81c6b8823c1b58d7837e827bb1098aa5f9e5956b Mon Sep 17 00:00:00 2001
From: "Jeremy W. Murphy" <jeremy.william.murphy@gmail.com>
Date: Tue, 16 May 2023 05:07:36 +1000
Subject: [PATCH] cmake: Only use relative paths for install DESTINATION option
(#1405)
As described in #1404, the explicit use of CMAKE_INSTALL_PREFIX conflicts with using command-line --prefix.
This simply removes all explicit use of CMAKE_INSTALL_PREFIX.
Otherwise this path will be duplicated:
$ cmake -DCMAKE_BUILD_TYPE=debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_INSTALL_PREFIX=inst ..
$ DESTDIR=inst ninja install
...
-- Installing: inst/src/le/libevent/.cmake-debug/inst/include/event2/util.h
-- Installing: inst/src/le/libevent/.cmake-debug/inst/include/event2/ws.h
...
Fixes: #1404
Co-authored-by: Jeremy Murphy <jeremymu@blackmagicdesign.com>
---
CMakeLists.txt | 3 +--
cmake/AddEventLibrary.cmake | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1452,8 +1452,7 @@ endif()
# Installation preparation.
#
-set(EVENT_INSTALL_CMAKE_DIR
- "${CMAKE_INSTALL_PREFIX}/lib/cmake/libevent")
+set(EVENT_INSTALL_CMAKE_DIR "lib/cmake/libevent")
export(PACKAGE libevent)
--- a/cmake/AddEventLibrary.cmake
+++ b/cmake/AddEventLibrary.cmake
@@ -31,7 +31,7 @@ macro(generate_pkgconfig LIB_NAME)
configure_file("lib${LIB_NAME}.pc.in" "lib${LIB_NAME}.pc" @ONLY)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/lib${LIB_NAME}.pc"
- DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig"
+ DESTINATION "lib/pkgconfig"
)
endmacro()
@@ -150,7 +150,7 @@ macro(add_event_library LIB_NAME)
set_target_properties(
"${LIB_NAME}_shared" PROPERTIES
OUTPUT_NAME "${LIB_NAME}-${EVENT_PACKAGE_RELEASE}.${CURRENT_MINUS_AGE}"
- INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
+ INSTALL_NAME_DIR "lib"
LINK_FLAGS "-compatibility_version ${COMPATIBILITY_VERSION} -current_version ${COMPATIBILITY_VERSION}.${EVENT_ABI_LIBVERSION_REVISION}")
else()
math(EXPR CURRENT_MINUS_AGE "${EVENT_ABI_LIBVERSION_CURRENT}-${EVENT_ABI_LIBVERSION_AGE}")

View File

@@ -0,0 +1,97 @@
#
# Copyright (C) 2006-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:=libiconv-full
PKG_VERSION:=1.17
PKG_RELEASE:=1
PKG_SOURCE:=libiconv-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/libiconv
PKG_HASH:=8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313
PKG_BUILD_DIR:=$(BUILD_DIR)/libiconv-$(PKG_VERSION)
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/libiconv-$(PKG_VERSION)
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=LGPL-2.1-or-later
PKG_LICENSE_FILES:=COPYING.LIB
PKG_FIXUP:=patch-libtool
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
define Package/libiconv-full/Default
URL:=https://www.gnu.org/software/libiconv/
TITLE:=Character set conversion
endef
define Package/libiconv-full
$(call Package/libiconv-full/Default)
SECTION:=libs
CATEGORY:=Libraries
TITLE+= library
ABI_VERSION:=2
endef
define Package/libcharset
$(call Package/libiconv-full/Default)
SECTION:=libs
CATEGORY:=Libraries
TITLE+= library
ABI_VERSION:=1
endef
define Package/iconv
$(call Package/libiconv-full/Default)
DEPENDS:=+libiconv-full +libcharset
SECTION:=utils
CATEGORY:=Utilities
TITLE+= utility
endef
CONFIGURE_ARGS += \
--enable-shared \
--enable-static \
--disable-rpath \
--enable-relocatable
HOST_CONFIGURE_ARGS += \
--disable-shared \
--with-pic
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib/libiconv-full/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/iconv.h $(1)/usr/lib/libiconv-full/include/
$(INSTALL_DIR) $(1)/usr/lib/libiconv-full/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcharset.{a,so*} $(1)/usr/lib/libiconv-full/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libiconv.{a,so*} $(1)/usr/lib/libiconv-full/lib/
endef
define Package/libcharset/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcharset.so.* $(1)/usr/lib/
endef
define Package/libiconv-full/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libiconv.so.* $(1)/usr/lib/
endef
define Package/iconv/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/iconv $(1)/usr/bin/
endef
$(eval $(call BuildPackage,libcharset))
$(eval $(call BuildPackage,libiconv-full))
$(eval $(call BuildPackage,iconv))
$(eval $(call HostBuild))

View File

@@ -0,0 +1,60 @@
#
# Copyright (C) 2006-2014 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:=json-c
PKG_VERSION:=0.18
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-nodoc.tar.gz
PKG_SOURCE_URL:=https://s3.amazonaws.com/json-c_releases/releases/
PKG_HASH:=602cdefc1d2aab8318fc0814b7ce7d59e72514d4276ca3eff92f35f86cf1c160
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:json-c:json-c
HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST)
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk
CMAKE_HOST_OPTIONS += \
-DDISABLE_EXTRA_LIBS=TRUE \
-DBUILD_SHARED_LIBS=FALSE
CMAKE_OPTIONS += \
-DDISABLE_EXTRA_LIBS=TRUE
define Package/libjson-c
SECTION:=libs
CATEGORY:=Libraries
TITLE:=javascript object notation
URL:=https://json-c.github.io/json-c/
ABI_VERSION:=5
endef
define Package/libjson-c/description
This package contains a library for javascript object notation backends.
endef
define Build/InstallDev
$(call Build/InstallDev/cmake,$(1))
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/json-c.pc
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/json-c.pc
endef
define Package/libjson-c/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libjson-c.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libjson-c))
$(eval $(call HostBuild))

View File

@@ -0,0 +1,11 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -449,8 +449,6 @@ configure_file(json.h.cmakein ${PROJECT_
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_BINARY_DIR})
-add_subdirectory(doc)
-
# "uninstall" custom target for make generators in unix like operating systems
# and if that target is not present
if (CMAKE_GENERATOR STREQUAL "Unix Makefiles")

View File

@@ -0,0 +1,47 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libmd
PKG_VERSION:=1.1.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://archive.hadrons.org/software/libmd/
PKG_HASH:=1bd6aa42275313af3141c7cf2e5b964e8b1fd488025caf2f971f43b00776b332
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \
--enable-static
define Package/libmd
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Message Digest functions from BSD systems
ABI_VERSION:=0
endef
define Package/libmd/description
This library provides message digest functions found on BSD systems either
on their libc or libmd libraries and lacking on others like GNU systems,
thus making it easier to port projects with strong BSD origins, without
needing to embed the same code over and over again on each project.
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libmd.a $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libmd*.pc $(1)/usr/lib/pkgconfig/
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
endef
$(eval $(call BuildPackage,libmd))

View File

@@ -0,0 +1,79 @@
#
# Copyright (C) 2011-2012 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:=libmnl
PKG_VERSION:=1.0.5
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:= \
http://www.netfilter.org/projects/libmnl/files \
ftp://ftp.netfilter.org/pub/libmnl
PKG_HASH:=274b9b919ef3152bfb3da3a13c950dd60d6e2bcd54230ffeca298d03b40d0525
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_LICENSE:=LGPL-2.1+
PKG_CPE_ID:=cpe:/a:netfilter:libmnl
include $(INCLUDE_DIR)/package.mk
define Package/libmnl
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Minimalistic user-space library for Netlink
URL:=http://www.netfilter.org/projects/libmnl/
ABI_VERSION:=0
endef
define Package/libmnl/description
libmnl is a minimalistic user-space library oriented to Netlink developers.
There are a lot of common tasks in parsing, validating, constructing of
both the Netlink header and TLVs that are repetitive and easy to get wrong.
This library aims to provide simple helpers that allows you to re-use code
and to avoid re-inventing the wheel. The main features of this library are:
.
* Small: the shared library requires around 30KB for an x86-based computer.
.
* Simple: this library avoids complexity and elaborated abstractions that
tend to hide Netlink details.
.
* Easy to use: the library simplifies the work for Netlink-wise developers.
It provides functions to make socket handling, message building, validating,
parsing and sequence tracking, easier.
.
* Easy to re-use: you can use the library to build your own abstraction layer
on top of this library.
.
* Decoupling: the interdependency of the main bricks that compose the library
is reduced, i.e. the library provides many helpers, but the programmer is not
forced to use them.
endef
CONFIGURE_ARGS+= \
--enable-shared \
--enable-static \
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/libmnl $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libmnl.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libmnl.pc $(1)/usr/lib/pkgconfig/
endef
define Package/libmnl/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libmnl.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libmnl))

View File

@@ -0,0 +1,11 @@
--- a/doxygen/Makefile.am
+++ b/doxygen/Makefile.am
@@ -21,7 +21,7 @@ doxyfile.stamp: $(doc_srcs) Makefile.am
# The command has to be a single line so the functions work
# and so `make` gives all lines to `bash -c`
# (hence ";\" at the end of every line but the last).
- /bin/bash -p -c 'declare -A renamed_page;\
+ bash -p -c 'declare -A renamed_page;\
main(){ set -e; cd man/man3; rm -f _*;\
count_real_pages;\
rename_real_pages;\

View File

@@ -0,0 +1,75 @@
#
# Copyright (C) 2009-2013 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:=libnetfilter_conntrack
PKG_VERSION:=1.0.9
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://www.netfilter.org/projects/libnetfilter_conntrack/files
PKG_HASH:=67bd9df49fe34e8b82144f6dfb93b320f384a8ea59727e92ff8d18b5f4b579a8
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:netfilter:libnetfilter_conntrack
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/libnetfilter-conntrack
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=+libnfnetlink +kmod-nf-conntrack-netlink +libmnl
TITLE:=API to the in-kernel connection tracking state table
URL:=http://www.netfilter.org/projects/libnetfilter_conntrack/
ABI_VERSION:=3
endef
define Package/libnetfilter-conntrack/description
libnetfilter_conntrack is a userspace library providing a programming
interface (API) to the in-kernel connection tracking state table. The
library libnetfilter_conntrack has been previously known as
libnfnetlink_conntrack and libctnetlink. This library is currently
used by conntrack-tools among many other applications.
endef
TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \
--enable-static \
--enable-shared \
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/libnetfilter_conntrack
$(CP) \
$(PKG_INSTALL_DIR)/usr/include/libnetfilter_conntrack/*.h \
$(1)/usr/include/libnetfilter_conntrack/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/libnetfilter_conntrack.{so*,a,la} \
$(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnetfilter_conntrack.pc \
$(1)/usr/lib/pkgconfig/
endef
define Package/libnetfilter-conntrack/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/libnetfilter_conntrack.so.* \
$(1)/usr/lib/
endef
$(eval $(call BuildPackage,libnetfilter-conntrack))

View File

@@ -0,0 +1,49 @@
From 21ee35dde73aec5eba35290587d479218c6dd824 Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Thu, 24 Feb 2022 15:01:11 +0100
Subject: conntrack: fix build with kernel 5.15 and musl
Currently, with kernel 5.15 headers and musl building is failing with
redefinition errors due to a conflict between the kernel and musl headers.
Musl is able to suppres the conflicting kernel header definitions if they
are included after the standard libc ones, however since ICMP definitions
were moved into a separate internal header to avoid duplication this has
stopped working and is breaking the builds.
It seems that the issue is that <netinet/in.h> which contains the UAPI
suppression defines is included in the internal.h header and not in the
proto.h which actually includes the kernel ICMP headers and thus UAPI
supression defines are not present.
Solve this by moving the <netinet/in.h> include before the ICMP kernel
includes in the proto.h
Fixes: bc1cb4b11403 ("conntrack: Move icmp request>reply type mapping to common file")
Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
---
include/internal/internal.h | 1 -
include/internal/proto.h | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)
--- a/include/internal/internal.h
+++ b/include/internal/internal.h
@@ -14,7 +14,6 @@
#include <arpa/inet.h>
#include <time.h>
#include <errno.h>
-#include <netinet/in.h>
#include <libnfnetlink/libnfnetlink.h>
#include <libnetfilter_conntrack/libnetfilter_conntrack.h>
--- a/include/internal/proto.h
+++ b/include/internal/proto.h
@@ -2,6 +2,7 @@
#define _NFCT_PROTO_H_
#include <stdint.h>
+#include <netinet/in.h>
#include <linux/icmp.h>
#include <linux/icmpv6.h>

View File

@@ -0,0 +1,73 @@
#
# Copyright (C) 2007-2013 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:=libnfnetlink
PKG_VERSION:=1.0.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:= \
http://www.netfilter.org/projects/libnfnetlink/files/ \
ftp://ftp.netfilter.org/pub/libnfnetlink/
PKG_HASH:=b064c7c3d426efb4786e60a8e6859b82ee2f2c5e49ffeea640cfe4fe33cbc376
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=GPL-2.0+
PKG_CPE_ID:=cpe:/a:netfilter:libnfnetlink
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/libnfnetlink
SECTION:=libs
CATEGORY:=Libraries
TITLE:=A low-level library for netfilter related kernel/userspace communication
URL:=http://netfilter.org/projects/libnfnetlink/
ABI_VERSION:=0
endef
define Package/libnfnetlink/description
libnfnetlink is is the low-level library for netfilter related kernel/userspace communication.
It provides a generic messaging infrastructure for in-kernel netfilter subsystems
(such as nfnetlink_log, nfnetlink_queue, nfnetlink_conntrack) and their respective users
and/or management tools in userspace.
endef
CONFIGURE_ARGS += \
--enable-static \
--enable-shared
CONFIGURE_VARS += \
lt_prog_compiler_pic="$(FPIC)"
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/libnfnetlink
$(CP) \
$(PKG_INSTALL_DIR)/usr/include/libnfnetlink/{libnfnetlink,linux_nfnetlink,linux_nfnetlink_compat}.h \
$(1)/usr/include/libnfnetlink/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/libnfnetlink.{a,so*} \
$(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnfnetlink.pc \
$(1)/usr/lib/pkgconfig/
endef
define Package/libnfnetlink/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/libnfnetlink.so.* \
$(1)/usr/lib/
endef
$(eval $(call BuildPackage,libnfnetlink))

View File

@@ -0,0 +1,75 @@
#
# Copyright (C) 2014 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:=libnftnl
PKG_CPE_ID:=cpe:/a:netfilter:libnftnl
PKG_VERSION:=1.2.8
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files
PKG_HASH:=37fea5d6b5c9b08de7920d298de3cdc942e7ae64b1a3e8b880b2d390ae67ad95
PKG_MAINTAINER:=Steven Barth <steven@midlink.org>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_BUILD_FLAGS:=lto
include $(INCLUDE_DIR)/package.mk
DISABLE_NLS:=
define Package/libnftnl
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=+libmnl
TITLE:=Low-level netlink library for the nf_tables subsystem
URL:=http://www.netfilter.org/projects/libnftnl
ABI_VERSION:=11
endef
define Package/libnftnl/description
libnftnl is a userspace library providing a low-level netlink
programming interface (API) to the in-kernel nf_tables subsystem.
endef
TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \
--enable-static \
--enable-shared
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/libnftnl
$(CP) \
$(PKG_INSTALL_DIR)/usr/include/libnftnl/*.h \
$(1)/usr/include/libnftnl/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/libnftnl.{so*,a,la} \
$(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnftnl.pc \
$(1)/usr/lib/pkgconfig/
endef
define Package/libnftnl/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/libnftnl.so.* \
$(1)/usr/lib/
endef
$(eval $(call BuildPackage,libnftnl))

View File

@@ -0,0 +1,49 @@
#
# Copyright (C) 2006-2012 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:=libnl-tiny
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/libnl-tiny.git
PKG_SOURCE_DATE:=2023-12-05
PKG_SOURCE_VERSION:=965c4bf49658342ced0bd6e7cb069571b4a1ddff
PKG_MIRROR_HASH:=4b56499e71f5f10b123e1c7ee13dbfcd970de560bff8d16ab39dc25c9ff743cb
CMAKE_INSTALL:=1
PKG_LICENSE:=LGPL-2.1
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/libnl-tiny
SECTION:=libs
CATEGORY:=Libraries
TITLE:=netlink socket library
ABI_VERSION:=1
endef
define Package/libnl-tiny/description
This package contains a stripped down version of libnl
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig $(1)/usr/include/libnl-tiny
$(CP) $(PKG_INSTALL_DIR)/usr/include/libnl-tiny/* $(1)/usr/include/libnl-tiny
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-tiny.so* $(1)/usr/lib/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libnl-tiny.pc $(1)/usr/lib/pkgconfig
endef
define Package/libnl-tiny/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-tiny.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libnl-tiny))

148
package/libs/libnl/Makefile Normal file
View File

@@ -0,0 +1,148 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2006-2013 OpenWrt.org
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libnl
PKG_VERSION:=3.10.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl$(subst .,_,$(PKG_VERSION))
PKG_HASH:=49b3e2235fdb58f5910bbb3ed0de8143b71ffc220571540502eb6c2471f204f5
PKG_LICENSE:=LGPL-2.1
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:libnl_project:libnl
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
PKG_BUILD_FLAGS:=gc-sections
include $(INCLUDE_DIR)/package.mk
define Package/libnl/default
SECTION:=libs
CATEGORY:=Libraries
URL:=http://www.infradead.org/~tgr/libnl/
ABI_VERSION:=200
endef
define Package/libnl-core
$(call Package/libnl/default)
TITLE:=Core Netlink Library
DEPENDS:=+libpthread
endef
define Package/libnl-genl
$(call Package/libnl/default)
TITLE:=Generic Netlink Library
DEPENDS:=+libnl-core
endef
define Package/libnl-route
$(call Package/libnl/default)
TITLE:=Routing Netlink Library
DEPENDS:=+libnl-core
endef
define Package/libnl-nf
$(call Package/libnl/default)
TITLE:=Netfilter Netlink Library
DEPENDS:=+libnl-route
endef
define Package/libnl-cli
$(call Package/libnl/default)
TITLE:=CLI Netlink Library
DEPENDS:=+libnl-genl +libnl-nf
endef
define Package/libnl
$(call Package/libnl/default)
TITLE:=Full Netlink Library
DEPENDS:=+libnl-genl +libnl-route +libnl-nf +libnl-cli
endef
define Package/libnl-core/description
Common code for all netlink libraries
endef
define Package/libnl-genl/description
Generic Netlink Library Functions
endef
define Package/libnl-route/description
Routing Netlink Library Functions
endef
define Package/libnl-nf/description
Netfilter Netlink Library Functions
endef
define Package/libnl-cli/description
CLI Netlink Library Functions
endef
define Package/libnl/description
Socket handling, connection management, sending and receiving of data,
message construction and parsing, object caching system, etc.
endef
TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \
--disable-debug
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/libnl3 $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/include/libnl3/* $(1)/usr/include/libnl3/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
# Copy symlinks
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-3.so $(1)/usr/lib/libnl.so
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-genl-3.so $(1)/usr/lib/libnl-genl.so
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-nf-3.so $(1)/usr/lib/libnl-nf.so
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-route-3.so $(1)/usr/lib/libnl-route.so
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-cli-3.so $(1)/usr/lib/libnl-cli.so
endef
define Package/libnl-core/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-3.so.* $(1)/usr/lib/
endef
define Package/libnl-genl/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-genl-3.so.* $(1)/usr/lib/
endef
define Package/libnl-route/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-route-3.so.* $(1)/usr/lib/
endef
define Package/libnl-nf/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-nf-3.so.* $(1)/usr/lib/
endef
define Package/libnl-cli/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-cli-3.so.* $(1)/usr/lib/
endef
define Package/libnl/install
:
endef
$(eval $(call BuildPackage,libnl-core))
$(eval $(call BuildPackage,libnl-genl))
$(eval $(call BuildPackage,libnl-route))
$(eval $(call BuildPackage,libnl-nf))
$(eval $(call BuildPackage,libnl-cli))
$(eval $(call BuildPackage,libnl))

View File

@@ -0,0 +1,17 @@
menu "Configuration"
depends on PACKAGE_libpcap
config PCAP_HAS_USB
bool "Include USB support"
default n
config PCAP_HAS_BT
bool "Include bluetooth support"
depends on BROKEN
default n
config PCAP_HAS_NETFILTER
bool "Include netfilter support"
default n
endmenu

View File

@@ -0,0 +1,105 @@
#
# Copyright (C) 2006-2013 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:=libpcap
PKG_VERSION:=1.10.5
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://www.tcpdump.org/release/
PKG_HASH:=37ced90a19a302a7f32e458224a00c365c117905c2cd35ac544b6880a81488f0
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:tcpdump:libpcap
PKG_ASLR_PIE_REGULAR:=1
PKG_CONFIG_DEPENDS := CONFIG_PACKAGE_rpcapd
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/libpcap
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Low-level packet capture library
URL:=http://www.tcpdump.org/
MENU:=1
ABI_VERSION:=1
endef
define Package/libpcap/description
This package contains a system-independent library for user-level network packet
capture.
endef
define Package/libpcap/config
source "$(SOURCE)/Config.in"
endef
define Package/rpcapd
SECTION:=net
CATEGORY:=Network
TITLE:=Capture daemon to be controlled by a remote libpcap application
URL:=http://www.tcpdump.org/
DEPENDS+= +libpcap
endef
ifdef CONFIG_PACKAGE_rpcapd
CMAKE_OPTIONS += \
-DENABLE_REMOTE=ON
endif
CMAKE_OPTIONS += \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_WITH_LIBNL=OFF \
-DINET6=O$(if $(CONFIG_IPV6),N,FF) \
-DPCAP_SUPPORT_NETFILTER=O$(if $(CONFIG_PCAP_HAS_NETFILTER),N,FF)
# grep 'option(DISABLE_' CMakeLists.txt | cut -f2 -d'(' | cut -f1 -d' ' | sort --unique
CMAKE_OPTIONS += \
-DDISABLE_BLUETOOTH=O$(if $(CONFIG_PCAP_HAS_BT),FF,N) \
-DDISABLE_DAG=ON \
-DDISABLE_DBUS=ON \
-DDISABLE_DPDK=ON \
-DDISABLE_LINUX_USBMON=O$(if $(CONFIG_PCAP_HAS_USB),FF,N) \
-DDISABLE_NETMAP=ON \
-DDISABLE_RDMA=ON \
-DDISABLE_SEPTEL=ON \
-DDISABLE_SNF=ON \
-DDISABLE_TC=ON \
# Debugging options
CMAKE_OPTIONS += \
-DBDEBUG=OFF \
-DYYDEBUG=OFF \
define Build/InstallDev
$(call Build/InstallDev/cmake,$(1))
$(SED) \
's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
$(1)/usr/bin/pcap-config
$(INSTALL_DIR) $(2)/bin
$(LN) ../../usr/bin/pcap-config $(2)/bin/pcap-config
endef
define Package/libpcap/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/
endef
define Package/rpcapd/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rpcapd $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,libpcap))
$(eval $(call BuildPackage,rpcapd))

View File

@@ -0,0 +1,10 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1441,7 +1441,6 @@ if(ENABLE_REMOTE)
#
# OpenSSL/libressl.
#
- find_package(OpenSSL)
if(OPENSSL_FOUND)
#
# We have OpenSSL.

View File

@@ -0,0 +1,69 @@
From f172e36e436d714f4def1439b13efd147a6a8411 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Fri, 18 Oct 2019 12:43:22 +0000
Subject: [PATCH] skip manpages
---
CMakeLists.txt | 55 --------------------------------------------------
1 file changed, 55 deletions(-)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3548,57 +3548,6 @@ if(NOT MSVC)
if(MINGW)
find_program(LINK_EXECUTABLE ln)
endif(MINGW)
- if(UNIX OR (MINGW AND LINK_EXECUTABLE))
- set(MAN1 "")
- foreach(MANPAGE ${MAN1_NOEXPAND})
- set(MAN1 ${MAN1} ${CMAKE_CURRENT_SOURCE_DIR}/${MANPAGE})
- endforeach(MANPAGE)
- install(FILES ${MAN1} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
-
- set(MAN3PCAP "")
- foreach(MANPAGE ${MAN3PCAP_NOEXPAND})
- set(MAN3PCAP ${MAN3PCAP} ${CMAKE_CURRENT_SOURCE_DIR}/${MANPAGE})
- endforeach(MANPAGE)
- foreach(TEMPLATE_MANPAGE ${MAN3PCAP_EXPAND})
- string(REPLACE ".in" "" MANPAGE ${TEMPLATE_MANPAGE})
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY)
- set(MAN3PCAP ${MAN3PCAP} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE})
- endforeach(TEMPLATE_MANPAGE)
- install(FILES ${MAN3PCAP} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
- install_manpage_symlink(pcap_datalink_val_to_name.3pcap pcap_datalink_val_to_description.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
- install_manpage_symlink(pcap_datalink_val_to_name.3pcap pcap_datalink_val_to_description_or_dlt.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
- install_manpage_symlink(pcap_dump_open.3pcap pcap_dump_fopen.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
- install_manpage_symlink(pcap_findalldevs.3pcap pcap_freealldevs.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
- install_manpage_symlink(pcap_geterr.3pcap pcap_perror.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
- install_manpage_symlink(pcap_inject.3pcap pcap_sendpacket.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
- install_manpage_symlink(pcap_list_datalinks.3pcap pcap_free_datalinks.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
- install_manpage_symlink(pcap_list_tstamp_types.3pcap pcap_free_tstamp_types.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
- install_manpage_symlink(pcap_loop.3pcap pcap_dispatch.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
- install_manpage_symlink(pcap_major_version.3pcap pcap_minor_version.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
- install_manpage_symlink(pcap_next_ex.3pcap pcap_next.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
- install_manpage_symlink(pcap_open_dead.3pcap pcap_open_dead_with_tstamp_precision.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
- install_manpage_symlink(pcap_open_offline.3pcap pcap_open_offline_with_tstamp_precision.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
- install_manpage_symlink(pcap_open_offline.3pcap pcap_fopen_offline.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
- install_manpage_symlink(pcap_open_offline.3pcap pcap_fopen_offline_with_tstamp_precision.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
- install_manpage_symlink(pcap_tstamp_type_val_to_name.3pcap pcap_tstamp_type_val_to_description.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
- install_manpage_symlink(pcap_setnonblock.3pcap pcap_getnonblock.3pcap ${CMAKE_INSTALL_MANDIR}/man3)
-
- set(MANFILE "")
- foreach(TEMPLATE_MANPAGE ${MANFILE_EXPAND})
- string(REPLACE ".manfile.in" ".${MAN_FILE_FORMATS}" MANPAGE ${TEMPLATE_MANPAGE})
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY)
- set(MANFILE ${MANFILE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE})
- endforeach(TEMPLATE_MANPAGE)
- install(FILES ${MANFILE} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${MAN_FILE_FORMATS})
-
- set(MANMISC "")
- foreach(TEMPLATE_MANPAGE ${MANMISC_EXPAND})
- string(REPLACE ".manmisc.in" ".${MAN_MISC_INFO}" MANPAGE ${TEMPLATE_MANPAGE})
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY)
- set(MANMISC ${MANMISC} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE})
- endforeach(TEMPLATE_MANPAGE)
- install(FILES ${MANMISC} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${MAN_MISC_INFO})
- endif(UNIX OR (MINGW AND LINK_EXECUTABLE))
endif(NOT MSVC)
# uninstall target

View File

@@ -0,0 +1,642 @@
From 3d8d268320d2381021a409ff8d03533698dd6242 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>
Date: Mon, 23 Nov 2020 00:38:22 +0100
Subject: [PATCH] Add support for B.A.T.M.A.N. Advanced
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This adds support for the layer 2 mesh routing protocol
B.A.T.M.A.N. Advanced. "batadv" can be used to filter on batman-adv
packets. It also allows later filters to look at frames inside the
tunnel when both "version" and "type" are specified.
Documentation for the batman-adv protocol can be found at the following
locations:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/batman-adv.rst
https://www.open-mesh.org/
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
---
Makefile.in | 2 +
batadv_legacy_packet.h | 77 +++++++++++++++++++
batadv_packet.h | 78 ++++++++++++++++++++
ethertype.h | 3 +
gencode.c | 164 +++++++++++++++++++++++++++++++++++++++++
gencode.h | 3 +
grammar.y.in | 32 +++++++-
nametoaddr.c | 59 +++++++++++++++
pcap-filter.manmisc.in | 35 ++++++++-
pcap/namedb.h | 2 +
scanner.l | 1 +
11 files changed, 453 insertions(+), 3 deletions(-)
create mode 100644 batadv_legacy_packet.h
create mode 100644 batadv_packet.h
--- a/Makefile.in
+++ b/Makefile.in
@@ -130,6 +130,8 @@ PUBHDR = \
HDR = $(PUBHDR) \
arcnet.h \
atmuni31.h \
+ batadv_legacy_packet.h \
+ batadv_packet.h \
diag-control.h \
ethertype.h \
extract.h \
--- /dev/null
+++ b/batadv_legacy_packet.h
@@ -0,0 +1,77 @@
+/* SPDX-License-Identifier: BSD-3 */
+/* Copyright (C) 2020 Linus Lüssing */
+
+#ifndef _BATADV_LEGACY_PACKET_H_
+#define _BATADV_LEGACY_PACKET_H_
+
+enum batadv_legacy_packettype {
+ BATADV_LEGACY_IV_OGM = 0x01,
+ BATADV_LEGACY_ICMP = 0x02,
+ BATADV_LEGACY_UNICAST = 0x03,
+ BATADV_LEGACY_BCAST = 0x04,
+ BATADV_LEGACY_VIS = 0x05,
+ BATADV_LEGACY_UNICAST_FRAG = 0x06,
+ BATADV_LEGACY_TT_QUERY = 0x07,
+ BATADV_LEGACY_ROAM_ADV = 0x08,
+ BATADV_LEGACY_UNICAST_4ADDR = 0x09,
+ BATADV_LEGACY_CODED = 0x0a,
+};
+
+#define ETH_ALEN 6
+
+struct batadv_legacy_unicast_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t ttvn;
+ uint8_t dest[ETH_ALEN];
+};
+
+struct batadv_legacy_unicast_4addr_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t src[ETH_ALEN];
+ uint8_t subtype;
+ uint8_t reserved;
+};
+
+struct batadv_legacy_unicast_frag_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t ttvn;
+ uint8_t dest[ETH_ALEN];
+ uint8_t flags;
+ uint8_t align;
+ uint8_t orig[ETH_ALEN];
+ uint8_t seqno[2]; /* 2-byte integral value */
+};
+
+struct batadv_legacy_bcast_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t reserved;
+ uint8_t seqno[4]; /* 4-byte integral value */
+ uint8_t orig[ETH_ALEN];
+};
+
+struct batadv_legacy_coded_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t first_ttvn;
+ uint8_t first_source[ETH_ALEN];
+ uint8_t first_orig_dest[ETH_ALEN];
+ uint8_t first_crc[4]; /* 4-byte integral value */
+ uint8_t second_ttl;
+ uint8_t second_ttvn;
+ uint8_t second_dest[ETH_ALEN];
+ uint8_t second_source[ETH_ALEN];
+ uint8_t second_orig_dest[ETH_ALEN];
+ uint8_t second_crc[4]; /* 4-byte integral value */
+ uint8_t coded_len[2]; /* 2-byte integral value */
+};
+
+#endif /* _BATADV_LEGACY_PACKET_H_ */
--- /dev/null
+++ b/batadv_packet.h
@@ -0,0 +1,78 @@
+/* SPDX-License-Identifier: BSD-3 */
+/* Copyright (C) 2020 Linus Lüssing */
+
+#ifndef _BATADV_PACKET_H_
+#define _BATADV_PACKET_H_
+
+/* For the definitive and most recent packet format definition,
+ * see the batadv_packet.h in the Linux kernel.
+ */
+
+enum batadv_packettype {
+ BATADV_IV_OGM = 0x00,
+ BATADV_BCAST = 0x01,
+ BATADV_CODED = 0x02,
+ BATADV_ELP = 0x03,
+ BATADV_OGM2 = 0x04,
+ BATADV_UNICAST = 0x40,
+ BATADV_UNICAST_FRAG = 0x41,
+ BATADV_UNICAST_4ADDR = 0x42,
+ BATADV_ICMP = 0x43,
+ BATADV_UNICAST_TVLV = 0x44,
+};
+
+#define ETH_ALEN 6
+
+struct batadv_unicast_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t ttvn;
+ uint8_t dest[ETH_ALEN];
+};
+
+struct batadv_unicast_4addr_packet {
+ struct batadv_unicast_packet u;
+ uint8_t src[ETH_ALEN];
+ uint8_t subtype;
+ uint8_t reserved;
+};
+
+struct batadv_frag_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t num_pri; /* number and priority */
+ uint8_t dest[ETH_ALEN];
+ uint8_t orig[ETH_ALEN];
+ uint8_t seqno[2]; /* 2-byte integral value */
+ uint8_t total_size[2]; /* 2-byte integral value */
+};
+
+struct batadv_bcast_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t reserved;
+ uint8_t seqno[4]; /* 4-byte integral value */
+ uint8_t orig[ETH_ALEN];
+};
+
+struct batadv_coded_packet {
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t ttl;
+ uint8_t first_ttvn;
+ uint8_t first_source[ETH_ALEN];
+ uint8_t first_orig_dest[ETH_ALEN];
+ uint8_t first_crc[4]; /* 4-byte integral value */
+ uint8_t second_ttl;
+ uint8_t second_ttvn;
+ uint8_t second_dest[ETH_ALEN];
+ uint8_t second_source[ETH_ALEN];
+ uint8_t second_orig_dest[ETH_ALEN];
+ uint8_t second_crc[4]; /* 4-byte integral value */
+ uint8_t coded_len[2]; /* 2-byte integral value */
+};
+
+#endif /* _BATADV_PACKET_H_ */
--- a/ethertype.h
+++ b/ethertype.h
@@ -49,6 +49,9 @@
#ifndef ETHERTYPE_TRAIL
#define ETHERTYPE_TRAIL 0x1000
#endif
+#ifndef ETHERTYPE_BATMAN
+#define ETHERTYPE_BATMAN 0x4305 /* B.A.T.M.A.N. Advanced */
+#endif
#ifndef ETHERTYPE_MOPDL
#define ETHERTYPE_MOPDL 0x6001
#endif
--- a/gencode.c
+++ b/gencode.c
@@ -58,6 +58,8 @@
#include "sunatmpos.h"
#include "pflog.h"
#include "ppp.h"
+#include "batadv_packet.h"
+#include "batadv_legacy_packet.h"
#include "pcap/sll.h"
#include "pcap/ipnet.h"
#include "arcnet.h"
@@ -9704,6 +9706,168 @@ gen_geneve(compiler_state_t *cstate, bpf
return b1;
}
+static struct block *
+gen_batadv_check_version(compiler_state_t *cstate, struct block *b0, bpf_u_int32 version)
+{
+ struct block *b1;
+
+ if (version > UINT8_MAX)
+ bpf_error(cstate,
+ "batman-adv compatibility version number %u unsupported",
+ version);
+
+ b1 = gen_cmp(cstate, OR_LINKPL, 1, BPF_B, version);
+ gen_and(b0, b1);
+
+ return b1;
+}
+
+static struct block *
+gen_batadv_check_type(compiler_state_t *cstate, struct block *b0,
+ bpf_u_int32 version, bpf_u_int32 type)
+{
+ struct block *b1;
+
+ switch (version) {
+ case 14:
+ case 15:
+ if (type > UINT8_MAX)
+ bpf_error(cstate,
+ "batman-adv packet type %u unsupported for compatibility version %u",
+ type, version);
+
+ b1 = gen_cmp(cstate, OR_LINKPL, 0, BPF_B, type);
+ gen_and(b0, b1);
+ b0 = b1;
+
+ break;
+ default:
+ bpf_error(cstate,
+ "batman-adv compatibility version number %u unsupported",
+ version);
+ }
+
+ return b0;
+}
+
+
+static void gen_batadv_push_offset(compiler_state_t *cstate, u_int offset)
+{
+ PUSH_LINKHDR(cstate, DLT_EN10MB, cstate->off_linkpl.is_variable,
+ cstate->off_linkpl.constant_part + cstate->off_nl + offset,
+ cstate->off_linkpl.reg);
+
+ cstate->off_linktype.constant_part += cstate->off_linkhdr.constant_part;
+ cstate->off_linkpl.constant_part += cstate->off_linkhdr.constant_part;
+
+ cstate->off_nl = 0;
+ cstate->off_nl_nosnap = 0; /* no 802.2 LLC */
+}
+
+static void
+gen_batadv_offsets_v14(compiler_state_t *cstate, bpf_u_int32 type)
+{
+ size_t offset;
+
+ switch (type) {
+ case BATADV_LEGACY_UNICAST: /* 0x03 */
+ offset = sizeof(struct batadv_legacy_unicast_packet);
+ break;
+ case BATADV_LEGACY_BCAST: /* 0x04 */
+ offset = sizeof(struct batadv_legacy_bcast_packet);
+ break;
+ case BATADV_LEGACY_UNICAST_FRAG: /* 0x06 */
+ offset = sizeof(struct batadv_legacy_unicast_frag_packet);
+ break;
+ case BATADV_LEGACY_UNICAST_4ADDR: /* 0x09 */
+ offset = sizeof(struct batadv_legacy_unicast_4addr_packet);
+ break;
+ case BATADV_LEGACY_CODED: /* 0x0a */
+ offset = sizeof(struct batadv_legacy_coded_packet);
+ break;
+ default:
+ offset = 0;
+ }
+
+ if (offset)
+ gen_batadv_push_offset(cstate, (u_int)offset);
+}
+
+static void
+gen_batadv_offsets_v15(compiler_state_t *cstate, bpf_u_int32 type)
+{
+ size_t offset;
+
+ switch (type) {
+ case BATADV_BCAST: /* 0x01 */
+ offset = sizeof(struct batadv_bcast_packet);
+ break;
+ case BATADV_CODED: /* 0x02 */
+ offset = sizeof(struct batadv_coded_packet);
+ break;
+ case BATADV_UNICAST: /* 0x40 */
+ offset = sizeof(struct batadv_unicast_packet);
+ break;
+ case BATADV_UNICAST_FRAG: /* 0x41 */
+ offset = sizeof(struct batadv_frag_packet);
+ break;
+ case BATADV_UNICAST_4ADDR: /* 0x42 */
+ offset = sizeof(struct batadv_unicast_4addr_packet);
+ break;
+ case BATADV_UNICAST_TVLV:
+ /* unsupported for now, needs variable offset to
+ * take tvlv_len into account
+ */
+ /* fall through */
+ default:
+ offset = 0;
+ }
+
+ if (offset)
+ gen_batadv_push_offset(cstate, (u_int)offset);
+}
+
+static void
+gen_batadv_offsets(compiler_state_t *cstate, bpf_u_int32 version, bpf_u_int32 type)
+{
+ switch (version) {
+ case 14:
+ gen_batadv_offsets_v14(cstate, type);
+ break;
+ case 15:
+ gen_batadv_offsets_v15(cstate, type);
+ break;
+ default:
+ break;
+ }
+}
+
+struct block *
+gen_batadv(compiler_state_t *cstate, bpf_u_int32 version, int has_version,
+ bpf_u_int32 type, int has_type)
+{
+ struct block *b0;
+
+ /*
+ * Catch errors reported by us and routines below us, and return NULL
+ * on an error.
+ */
+ if (setjmp(cstate->top_ctx))
+ return (NULL);
+
+ b0 = gen_linktype(cstate, ETHERTYPE_BATMAN);
+
+ if (has_version)
+ b0 = gen_batadv_check_version(cstate, b0, version);
+
+ if (has_type) {
+ b0 = gen_batadv_check_type(cstate, b0, version, type);
+ gen_batadv_offsets(cstate, version, type);
+ }
+
+ return b0;
+}
+
/* Check that the encapsulated frame has a link layer header
* for Ethernet filters. */
static struct block *
--- a/gencode.h
+++ b/gencode.h
@@ -358,6 +358,9 @@ struct block *gen_pppoes(compiler_state_
struct block *gen_geneve(compiler_state_t *, bpf_u_int32, int);
+struct block *gen_batadv(compiler_state_t *, bpf_u_int32, int,
+ bpf_u_int32, int);
+
struct block *gen_atmfield_code(compiler_state_t *, int, bpf_u_int32,
int, int);
struct block *gen_atmtype_abbrev(compiler_state_t *, int);
--- a/grammar.y.in
+++ b/grammar.y.in
@@ -383,6 +383,7 @@ DIAG_OFF_BISON_BYACC
%type <i> mtp2type
%type <blk> mtp3field
%type <blk> mtp3fieldvalue mtp3value mtp3listvalue
+%type <rblk> pbatadv
%token DST SRC HOST GATEWAY
@@ -401,7 +402,7 @@ DIAG_OFF_BISON_BYACC
%token LEN
%token IPV6 ICMPV6 AH ESP
%token VLAN MPLS
-%token PPPOED PPPOES GENEVE
+%token PPPOED PPPOES GENEVE BATADV
%token ISO ESIS CLNP ISIS L1 L2 IIH LSP SNP CSNP PSNP
%token STP
%token IPX
@@ -698,11 +699,40 @@ other: pqual TK_BROADCAST { CHECK_PTR_
| PPPOES { CHECK_PTR_VAL(($$ = gen_pppoes(cstate, 0, 0))); }
| GENEVE pnum { CHECK_PTR_VAL(($$ = gen_geneve(cstate, $2, 1))); }
| GENEVE { CHECK_PTR_VAL(($$ = gen_geneve(cstate, 0, 0))); }
+ | BATADV pbatadv { $$ = $2; }
| pfvar { $$ = $1; }
| pqual p80211 { $$ = $2; }
| pllc { $$ = $1; }
;
+pbatadv: { CHECK_PTR_VAL(($$ = gen_batadv(cstate, 0, 0, 0, 0))); }
+ | pnum { CHECK_PTR_VAL(($$ = gen_batadv(cstate, $1, 1, 0, 0))); }
+ | pnum pnum { CHECK_PTR_VAL(($$ = gen_batadv(cstate, $1, 1, $2, 1))); }
+ | pnum ID
+ {
+ int type;
+
+ switch ($1) {
+ case 14:
+ type = pcap_nametobatadvtype_v14($2);
+ break;
+ case 15:
+ type = pcap_nametobatadvtype_v15($2);
+ break;
+ default:
+ bpf_set_error(cstate, "batman-adv compatibility version number %u unsupported", $1);
+ YYABORT;
+ }
+
+ if (type == PROTO_UNDEF) {
+ bpf_set_error(cstate, "invalid batman-adv packet type value \"%s\"", $2);
+ YYABORT;
+ }
+
+ CHECK_PTR_VAL(($$ = gen_batadv(cstate, $1, 1, type, 1)));
+ }
+ ;
+
pfvar: PF_IFNAME ID { CHECK_PTR_VAL($2); CHECK_PTR_VAL(($$ = gen_pf_ifname(cstate, $2))); }
| PF_RSET ID { CHECK_PTR_VAL($2); CHECK_PTR_VAL(($$ = gen_pf_ruleset(cstate, $2))); }
| PF_RNR NUM { CHECK_PTR_VAL(($$ = gen_pf_rnr(cstate, $2))); }
--- a/nametoaddr.c
+++ b/nametoaddr.c
@@ -134,8 +134,12 @@
#include "diag-control.h"
+#include "batadv_packet.h"
+#include "batadv_legacy_packet.h"
+
#include "gencode.h"
#include <pcap/namedb.h>
+
#include "nametoaddr.h"
#include "thread-local.h"
@@ -597,6 +601,7 @@ PCAP_API_DEF struct eproto eproto_db[] =
{ "moprc", ETHERTYPE_MOPRC },
{ "rarp", ETHERTYPE_REVARP },
{ "sca", ETHERTYPE_SCA },
+ { "batadv", ETHERTYPE_BATMAN },
{ (char *)0, 0 }
};
@@ -631,6 +636,60 @@ pcap_nametollc(const char *s)
while (p->s != 0) {
if (strcmp(p->s, s) == 0)
+ return p->p;
+ p += 1;
+ }
+ return PROTO_UNDEF;
+}
+
+/* Static data base of batman-adv v14 packet type values. */
+static struct eproto batadv_type_db_v14[] = {
+ { "iv_ogm", BATADV_LEGACY_IV_OGM },
+ { "icmp", BATADV_LEGACY_ICMP },
+ { "unicast", BATADV_LEGACY_UNICAST },
+ { "bcast", BATADV_LEGACY_BCAST },
+ { "vis", BATADV_LEGACY_VIS },
+ { "unicast_frag", BATADV_LEGACY_UNICAST_FRAG },
+ { "tt_query", BATADV_LEGACY_TT_QUERY },
+ { "roam_adv", BATADV_LEGACY_ROAM_ADV },
+ { "unicast_4addr", BATADV_LEGACY_UNICAST_4ADDR },
+ { "coded", BATADV_LEGACY_CODED },
+ { (char *)0, 0 }
+};
+
+int pcap_nametobatadvtype_v14(const char *s)
+{
+ struct eproto *p = batadv_type_db_v14;
+
+ while (p->s != 0) {
+ if (strcmp(p->s, s) == 0)
+ return p->p;
+ p += 1;
+ }
+ return PROTO_UNDEF;
+}
+
+/* Static data base of batman-adv v15 packet type values. */
+static struct eproto batadv_type_db_v15[] = {
+ { "iv_ogm", BATADV_IV_OGM },
+ { "bcast", BATADV_BCAST },
+ { "coded", BATADV_CODED },
+ { "elp", BATADV_ELP },
+ { "ogm2", BATADV_OGM2 },
+ { "unicast", BATADV_UNICAST },
+ { "unicast_frag", BATADV_UNICAST_FRAG },
+ { "unicast_4addr", BATADV_UNICAST_4ADDR },
+ { "icmp", BATADV_ICMP },
+ { "unicast_tvlv", BATADV_UNICAST_TVLV },
+ { (char *)0, 0 }
+};
+
+int pcap_nametobatadvtype_v15(const char *s)
+{
+ struct eproto *p = batadv_type_db_v15;
+
+ while (p->s != 0) {
+ if (strcmp(p->s, s) == 0)
return p->p;
p += 1;
}
--- a/pcap-filter.manmisc.in
+++ b/pcap-filter.manmisc.in
@@ -98,6 +98,7 @@ protocols are:
.BR arp ,
.BR rarp ,
.BR decnet ,
+.BR batadv ,
.BR sctp ,
.B tcp
and
@@ -400,7 +401,7 @@ True if the packet is an IPv6 multicast
.IP "\fBether proto \fIprotocol\fR"
True if the packet is of ether type \fIprotocol\fR.
\fIProtocol\fP can be a number or one of the names
-\fBaarp\fP, \fBarp\fP, \fBatalk\fP, \fBdecnet\fP, \fBip\fP, \fBip6\fP,
+\fBaarp\fP, \fBarp\fP, \fBatalk\fP, \fBbatadv\fP, \fBdecnet\fP, \fBip\fP, \fBip6\fP,
\fBipx\fP, \fBiso\fP, \fBlat\fP, \fBloopback\fP, \fBmopdl\fP, \fBmoprc\fP, \fBnetbeui\fP,
\fBrarp\fP, \fBsca\fP or \fBstp\fP.
Note these identifiers (except \fBloopback\fP) are also keywords
@@ -454,7 +455,7 @@ the filter checks for the IPX etype in a
DSAP in the LLC header, the 802.3-with-no-LLC-header encapsulation of
IPX, and the IPX etype in a SNAP frame.
.RE
-.IP "\fBip\fR, \fBip6\fR, \fBarp\fR, \fBrarp\fR, \fBatalk\fR, \fBaarp\fR, \fBdecnet\fR, \fBiso\fR, \fBstp\fR, \fBipx\fR, \fBnetbeui\fP"
+.IP "\fBip\fR, \fBip6\fR, \fBarp\fR, \fBrarp\fR, \fBatalk\fR, \fBaarp\fR, \fBdecnet\fR, \fBiso\fR, \fBstp\fR, \fBipx\fR, \fBnetbeui\fP, \fBbatadv\fP"
Abbreviations for:
.in +.5i
.nf
@@ -795,6 +796,36 @@ For example:
filters IPv4 protocol encapsulated in Geneve with VNI 0xb. This will
match both IPv4 directly encapsulated in Geneve as well as IPv4 contained
inside an Ethernet frame.
+.IP "\fBbatadv \fI[version] \fI[type]\fR"
+True if the packet is a B.A.T.M.A.N. Advanced packet (Ethernet type 0x4305).
+If the optional \fIversion\fR is specified, only true if the packet has the
+specified batman-adv compatibility \fIversion\fR. If the optional \fIversion\fR
+and \fItype\fR are specified, only true if the packet has both the specified
+batman-adv compatibility \fIversion\fR and batman-adv packet \fItype\fR.
+.IP
+\fIversion\fR may be a number from 0 to 255, though only compatibility version
+14 and 15 were actually deployed in the wild. Version 15 is the current version,
+14 is considered deprecated.
+.IP
+\fItype\fR is currently only defined for compatibility \fIversion\fR 14 and 15.
+\fItype\fR may be a number from 0 to 255 for compatibility \fIversion\fR 14 and 15.
+.IP
+The following packet \fItype\fR aliases are available for compat \fIversion\fR 14:
+\fBiv_ogm\fP, \fBicmp\fP, \fBunicast\fP, \fBbcast\fP, \fBvis\fP, \fBunicast-frag\fP,
+\fBtt_query\fP, \fBroam_adv\fP, \fBunicast_4addr\fP, \fPcoded\fP.
+.IP
+The following packet \fItype\fR aliases are available for compat \fIversion\fR 15:
+\fBiv_ogm\fP, \fBbcast\fP, \fBcoded\fP, \fBelp\fP, \fBogm2\fP, \fBunicast\fP,
+\fBunicast_frag\fP, \fBunicast_4addr\fP, \fBicmp\fP, \fPunicast_tvlv\fP.
+.IP
+Note that when the \fBbatadv\fR keyword is encountered in an expression and
+a batman-adv packet \fItype\fR is provided which specifies an encapsulating
+packet type then it changes the decoding offsets for the remainder of the
+expression on the assumption that the packet is a batman-adv packet. For compat
+\fIversion\fR 14 these are packet \fItype\fRs \fBunicast\fP, \fBbcast\fP,
+\fBunicast_frag\fP, \fBunicast_4addr\fP and \fBcoded\fP. For compat \fIversion\fR
+15 these are currently packet \fItype\fRs \fBbcast\fP, \fBcoded\fP, \fBunicast\fP,
+\fBunicast_frag\fP and \fBunicast_4addr\fP.
.IP "\fBiso proto \fIprotocol\fR"
True if the packet is an OSI packet of protocol type \fIprotocol\fP.
\fIProtocol\fP can be a number or one of the names
--- a/pcap/namedb.h
+++ b/pcap/namedb.h
@@ -94,6 +94,8 @@ PCAP_API int pcap_nametoeproto(const cha
PCAP_AVAILABLE_0_9
PCAP_API int pcap_nametollc(const char *);
+PCAP_API int pcap_nametobatadvtype_v14(const char *);
+PCAP_API int pcap_nametobatadvtype_v15(const char *);
/*
* If a protocol is unknown, PROTO_UNDEF is returned.
--- a/scanner.l
+++ b/scanner.l
@@ -365,6 +365,7 @@ mpls return MPLS;
pppoed return PPPOED;
pppoes return PPPOES;
geneve return GENEVE;
+batadv return BATADV;
lane return LANE;
llc return LLC;

View File

@@ -0,0 +1,161 @@
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libselinux
PKG_VERSION:=3.5
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION)
PKG_HASH:=9a3a3705ac13a2ccca2de6d652b6356fead10f36fb33115c185c5ccdf29eec19
PKG_LICENSE:=libselinux-1.0
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
PKG_CPE_ID:=cpe:/a:selinuxproject:libselinux
PKG_BUILD_FLAGS:=no-lto
HOST_BUILD_DEPENDS:=libsepol/host musl-fts/host pcre2/host
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
LIBSELINUX_UTILS := \
avcstat \
compute_av \
compute_create \
compute_member \
compute_relabel \
getconlist \
getdefaultcon \
getenforce \
getfilecon \
getpidcon \
getsebool \
getseuser \
matchpathcon \
policyvers \
sefcontext_compile \
selabel_digest \
selabel_get_digests_all_partial_matches \
selabel_lookup \
selabel_lookup_best_match \
selabel_partial_match \
selinux_check_access \
selinux_check_securetty_context \
selinuxenabled \
selinuxexeccon \
setenforce \
setfilecon \
togglesebool \
validatetrans
LIBSELINUX_ALTS := \
getenforce \
getsebool \
matchpathcon \
selinuxenabled \
setenforce
$(eval $(foreach a,$(LIBSELINUX_ALTS),ALTS_$(a):=300:/usr/sbin/$(a):/usr/sbin/libselinux-$(a)$(newline)))
define Package/libselinux/Default
TITLE:=Runtime SELinux library
URL:=http://selinuxproject.org/page/Main_Page
endef
define Package/libselinux
$(call Package/libselinux/Default)
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=+libsepol +libpcre2 +USE_MUSL:musl-fts
endef
define Package/libselinux/description
libselinux is the runtime SELinux library that provides
interfaces (e.g. library functions for the SELinux kernel
APIs like getcon(), other support functions like
getseuserbyname()) to SELinux-aware applications. libselinux
may use the shared libsepol to manipulate the binary policy
if necessary (e.g. to downgrade the policy format to an
older version supported by the kernel) when loading policy.
endef
define GenUtilPkg
define Package/$(1)
$(call Package/libselinux/Default)
TITLE+= $(2) utility
SECTION:=utils
DEPENDS:=+libselinux
CATEGORY:=Utilities
SUBMENU:=libselinux tools
ALTERNATIVES:=$(ALTS_$(2))
endef
define Package/$(1)/description
libselinux version of the $(2) utility.
endef
endef
$(foreach a,$(LIBSELINUX_UTILS),$(eval $(call GenUtilPkg,libselinux-$(a),$(a))))
# Needed to link libselinux utilities, which link against
# libselinux.so, which indirectly depends on libpcre2.so, installed in
# $(STAGING_DIR_HOSTPKG).
HOST_LDFLAGS += -Wl,-rpath="$(STAGING_DIR_HOSTPKG)/lib"
HOST_MAKE_FLAGS += \
PREFIX=$(STAGING_DIR_HOSTPKG) \
SHLIBDIR=$(STAGING_DIR_HOSTPKG)/lib \
FTS_LDLIBS=-lfts
ifeq ($(CONFIG_USE_MUSL),y)
MAKE_FLAGS += FTS_LDLIBS=-lfts
TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
endif
MAKE_FLAGS += \
SHLIBDIR=/usr/lib \
OS=Linux
define Build/Compile
$(call Build/Compile/Default,all)
endef
define Build/Install
$(call Build/Install/Default,install)
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libselinux.pc $(1)/usr/lib/pkgconfig/
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libselinux.pc
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libselinux.pc
endef
define Package/libselinux/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libselinux.so.* $(1)/usr/lib/
endef
define BuildUtil
define Package/$(1)/install
$(INSTALL_DIR) $$(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/$(2) $$(1)/usr/sbin/$(if $(ALTS_$(2)),libselinux-$(2),$(2))
endef
$$(eval $$(call BuildPackage,$(1)))
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,libselinux))
$(foreach a,$(LIBSELINUX_UTILS),$(eval $(call BuildUtil,libselinux-$(a),$(a))))

View File

@@ -0,0 +1,73 @@
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libsemanage
PKG_VERSION:=3.5
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION)
PKG_HASH:=f53534e50247538280ed0d76c6ce81d8fb3939bd64cadb89da10dba42e40dd9c
PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
PKG_LICENSE:=LGPL-2.1
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:selinuxproject:libsemanage
HOST_BUILD_DEPENDS:=audit/host libselinux/host bzip2/host
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
PKG_INSTALL:=1
define Package/libsemanage
SECTION:=libs
DEPENDS:=+libaudit +libselinux +libbz2
CATEGORY:=Libraries
TITLE:=SELinux policy management library
URL:=http://selinuxproject.org/page/Main_Page
endef
define Package/libsemanage/description
libsemanage is the policy management library. It uses
libsepol for binary policy manipulation and libselinux for
interacting with the SELinux system. It also exec's helper
programs for loading policy and for checking whether the
file_contexts configuration is valid (load_policy and
setfiles from policycoreutils) presently, although this may
change at least for the bootstrapping case (for rpm).
endef #'
HOST_MAKE_FLAGS += \
DESTDIR=$(STAGING_DIR_HOSTPKG) \
PREFIX=""
define Build/Configure
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsemanage.pc $(1)/usr/lib/pkgconfig/
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libsemanage.pc
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libsemanage.pc
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
endef
define Package/libsemanage/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsemanage.so.* $(1)/usr/lib/
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,libsemanage))

View File

@@ -0,0 +1,87 @@
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libsepol
PKG_VERSION:=3.5
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION)
PKG_HASH:=78fdaf69924db780bac78546e43d9c44074bad798c2c415d0b9bb96d065ee8a2
PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
PKG_CPE_ID:=cpe:/a:selinuxproject:libsepol
PKG_BUILD_FLAGS:=no-lto
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
define Package/libsepol
SECTION:=libs
CATEGORY:=Libraries
TITLE:=SELinux binary policy manipulation library
URL:=http://selinuxproject.org/page/Main_Page
endef
define Package/libsepol/description
Libsepol is the binary policy manipulation library. It doesn't
depend upon or use any of the other SELinux components.
endef
define Package/chkcon
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=+libsepol
TITLE:=libsepol chkcon security context validation tool
URL:=http://selinuxproject.org/page/Main_Page
endef
define Package/chkcon/description
chkcon - determine if a security context is valid for a given binary policy
endef
HOST_MAKE_FLAGS += \
PREFIX=$(STAGING_DIR_HOSTPKG) \
SHLIBDIR=$(STAGING_DIR_HOSTPKG)/lib
MAKE_FLAGS += \
SHLIBDIR=/usr/lib \
OS=Linux
define Build/Compile
$(call Build/Compile/Default,all)
endef
define Build/Install
$(call Build/Install/Default,install)
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsepol.pc $(1)/usr/lib/pkgconfig/
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libsepol.pc
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libsepol.pc
endef
define Package/libsepol/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsepol.so.* $(1)/usr/lib/
endef
define Package/chkcon/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/chkcon $(1)/usr/bin/
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,libsepol))
$(eval $(call BuildPackage,chkcon))

View File

@@ -0,0 +1,54 @@
#
# Copyright (C) 2006 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:=libtool
PKG_VERSION:=2.4.7
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/libtool
PKG_HASH:=4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:gnu:libtool
PKG_BUILD_PARALLEL:=0
include $(INCLUDE_DIR)/package.mk
CONFIGURE_PREFIX=$(STAGING_DIR_HOSTPKG)
export GLOBAL_LIBDIR=$(STAGING_DIR)/usr/lib
define Package/libltdl
SECTION:=libs
CATEGORY:=Libraries
TITLE:=A generic dynamic object loading library
URL:=http://www.gnu.org/software/libtool/
ABI_VERSION:=7
endef
define Build/InstallDev
$(MAKE) -C $(PKG_BUILD_DIR) \
bindir="$(2)/libltdl/bin" \
datadir="$(2)/libltdl/share" \
prefix="$(2)/libltdl" \
exec_prefix="$(2)/libltdl" \
install
$(INSTALL_DIR) $(1)/usr/lib $(1)/usr/include
mv $(2)/libltdl/lib/* $(1)/usr/lib/
mv $(2)/libltdl/include/* $(1)/usr/include/
endef
define Package/libltdl/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libltdl/.libs/libltdl.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libltdl))

View File

@@ -0,0 +1,74 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libtraceevent
PKG_VERSION:=1.8.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/snapshot/
PKG_HASH:=919f0c024c7b5059eace52d854d4df00ae7e361a4033e1b4d6fe01d97064a1b9
PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org>
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/libtraceevent
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Linux kernel trace event library
URL:=https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git
ABI_VERSION:=0
endef
define Package/libtraceevent/description
The libtraceevent library provides APIs to access kernel tracepoint events, located in
the tracefs file system under the events directory.
endef
define Package/libtraceevent-extra
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Extra plugins for libtraceevent
DEPENDS:=
endef
CONFIGURE_ARGS+= \
--enable-shared \
--enable-static
PLUGINS_DIR := $(PKG_BUILD_DIR)/plugins
PLUGINS_MAIN := function hrtimer mac80211 sched_switch
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_BUILD_DIR)/include/traceevent $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/lib/libtraceevent.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_BUILD_DIR)/libtraceevent.pc $(1)/usr/lib/pkgconfig/
endef
define Package/libtraceevent/install
$(INSTALL_DIR) $(1)/usr/lib/traceevent/plugins
$(CP) $(PKG_BUILD_DIR)/lib/libtraceevent.so.* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) \
$(patsubst %,$(PLUGINS_DIR)/plugin_%.so,$(PLUGINS_MAIN)) \
$(1)/usr/lib/traceevent/plugins
endef
define Package/libtraceevent-extra/install
$(INSTALL_DIR) $(1)/usr/lib/traceevent/plugins
$(CP) \
$$(patsubst %,$(PLUGINS_DIR)/plugin_%.so, \
$$(filter-out $(PLUGINS_MAIN), \
$$(patsubst $(PLUGINS_DIR)/plugin_%.so,%, \
$$(wildcard $(PLUGINS_DIR)/plugin_*.so)))) \
$(1)/usr/lib/traceevent/plugins
endef
$(eval $(call BuildPackage,libtraceevent))
$(eval $(call BuildPackage,libtraceevent-extra))

View File

@@ -0,0 +1,49 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libtracefs
PKG_VERSION:=1.8.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/snapshot/
PKG_HASH:=f92475d5c4cb509983697fb359ee615bef4f08ed8bdc9c690f6118ba68886de0
PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org>
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/libtracefs
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Linux kernel trace file system library
URL:=https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git
DEPENDS+=+libpthread +libtraceevent
ABI_VERSION:=0
endef
define Package/libtracefs/description
The libtracefs library provides APIs to access kernel trace file system.
endef
CONFIGURE_ARGS+= \
--enable-shared \
--enable-static \
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_BUILD_DIR)/include/* $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/lib/libtracefs.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_BUILD_DIR)/libtracefs.pc $(1)/usr/lib/pkgconfig/
endef
define Package/libtracefs/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/lib/libtracefs.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libtracefs))

View File

@@ -0,0 +1,121 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libubox
PKG_RELEASE=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git
PKG_MIRROR_HASH:=a4f671d10840fd8487394335636051a6df5edf6d8854af4fcb834a590efb240a
PKG_SOURCE_DATE:=2024-03-29
PKG_SOURCE_VERSION:=eb9bcb64185ac155c02cc1a604692c4b00368324
PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
CMAKE_INSTALL:=1
PKG_LICENSE:=ISC
PKG_LICENSE_FILES:=
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_BUILD_DEPENDS:=lua
HOST_BUILD_DEPENDS:=libjson-c/host
HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST)
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/libubox
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Basic utility library
ABI_VERSION:=$(PKG_ABI_VERSION)
DEPENDS:=
endef
define Package/libblobmsg-json
SECTION:=libs
CATEGORY:=Libraries
TITLE:=blobmsg <-> json conversion library
ABI_VERSION:=$(PKG_ABI_VERSION)
DEPENDS:=+libjson-c +libubox
endef
define Package/jshn
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=+libjson-c +libubox +libblobmsg-json
TITLE:=JSON SHell Notation
endef
define Package/jshn/description
Library for parsing and generating JSON from shell scripts
endef
define Package/libjson-script
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=+libubox
ABI_VERSION:=$(PKG_ABI_VERSION)
TITLE:=Minimalistic JSON based scripting engine
endef
define Package/libubox-lua
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=+libubox +liblua
TITLE:=Lua binding for the OpenWrt Basic utility library
endef
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
CMAKE_OPTIONS += \
-DLUAPATH=/usr/lib/lua \
-DABIVERSION="$(PKG_ABI_VERSION)"
define Package/libubox/install
$(INSTALL_DIR) $(1)/lib/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libubox.so.* $(1)/lib/
endef
define Package/libblobmsg-json/install
$(INSTALL_DIR) $(1)/lib/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblobmsg_json.so.* $(1)/lib/
endef
define Package/jshn/install
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/share/libubox
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/jshn $(1)/usr/bin
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libubox/jshn.sh $(1)/usr/share/libubox
endef
define Package/libjson-script/install
$(INSTALL_DIR) $(1)/lib/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libjson_script.so.* $(1)/lib/
endef
define Package/libubox-lua/install
$(INSTALL_DIR) $(1)/usr/lib/lua
$(CP) $(PKG_BUILD_DIR)/lua/uloop.so $(1)/usr/lib/lua/
endef
CMAKE_HOST_OPTIONS += \
-DBUILD_LUA=OFF \
-DBUILD_EXAMPLES=OFF \
-DCMAKE_SKIP_RPATH=FALSE \
-DCMAKE_MACOSX_RPATH=1 \
-DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOST}/lib" \
ifeq ($(HOST_OS),Darwin)
define Host/Install
$(Host/Install/Default)
$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/lib
cd "$(STAGING_DIR_HOSTPKG)/lib" && ln -sf ../../host/lib/libubox.* .
endef
endif
$(eval $(call BuildPackage,libubox))
$(eval $(call BuildPackage,libblobmsg-json))
$(eval $(call BuildPackage,jshn))
$(eval $(call BuildPackage,libjson-script))
$(eval $(call BuildPackage,libubox-lua))
$(eval $(call HostBuild))

View File

@@ -0,0 +1,64 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libunistring
PKG_VERSION:=1.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
PKG_HASH:=632bd65ed74a881ca8a0309a1001c428bd1cbd5cd7ddbf8cedcd2e65f4dcdc44
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:gnu:$(PKG_NAME)
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
define Package/libunistring
SECTION:=libs
CATEGORY:=Libraries
TITLE:=libunistring
URL:=https://www.gnu.org/software/libunistring
endef
define Package/libunistring/description
This library provides functions for manipulating Unicode strings
and for manipulating C strings according to the Unicode standard.
endef
HOST_CFLAGS += $(HOST_FPIC)
TARGET_CFLAGS += $(FPIC)
HOST_CONFIGURE_ARGS += \
--enable-static \
--disable-shared \
--without-libiconv-prefix \
--with-pic
CONFIGURE_ARGS += \
--enable-static \
--enable-shared \
--without-libiconv-prefix \
--with-pic
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/include/unistring
$(CP) $(PKG_INSTALL_DIR)/usr/include/unistring/*.h $(1)/usr/include/unistring/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libunistring.{a,so*} $(1)/usr/lib/
endef
define Package/libunistring/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libunistring.so.* $(1)/usr/lib/
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,libunistring))

View File

@@ -0,0 +1,62 @@
#
# Copyright (C) 2008-2013 OpenWrt.org
# Copyright (C) 2017-2019 Yousong Zhou <yszhou4tech@gmail.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libunwind
PKG_VERSION:=1.8.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/$(PKG_NAME)/$(PKG_NAME)/releases/download/v$(PKG_VERSION)/
PKG_HASH:=ddf0e32dd5fafe5283198d37e4bf9decf7ba1770b6e7e006c33e6df79e6a6157
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
PKG_LICENSE:=X11
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:libunwind_project:libunwind
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/libunwind
SECTION:=libs
CATEGORY:=Libraries
TITLE:=The libunwind project
URL:=http://www.nongnu.org/libunwind/
DEPENDS:=@((mips||mipsel||mips64||powerpc64||x86_64||arm||aarch64||loongarch64)||(USE_GLIBC&&(powerpc||i386))) +zlib
ABI_VERSION:=8
endef
define Package/libunwind/description
Libunwind defines a portable and efficient C programming interface (API) to determine the call-chain of a program.
endef
CONFIGURE_ARGS += \
--disable-documentation \
--disable-tests \
--disable-minidebuginfo
TARGET_LDFLAGS += $(if $(CONFIG_USE_MUSL),-lssp_nonshared)
define Package/libunwind/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libunwin*.so.* $(1)/usr/lib/
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libunwin*.so* $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
endef
$(eval $(call BuildPackage,libunwind))

View File

@@ -0,0 +1,17 @@
--- a/src/mips/getcontext.S
+++ b/src/mips/getcontext.S
@@ -24,12 +24,12 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include "offsets.h"
-#include <endian.h>
.text
+ .set nomips16
#if _MIPS_SIM == _ABIO32
-# if __BYTE_ORDER == __BIG_ENDIAN
+# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
# define OFFSET 4
# else
# define OFFSET 0

View File

@@ -0,0 +1,45 @@
--- a/include/libunwind-mips.h
+++ b/include/libunwind-mips.h
@@ -121,6 +121,42 @@ typedef enum
}
mips_regnum_t;
+#ifndef __GLIBC__
+#include <sys/reg.h>
+
+/* musl as of 1.1.14 does not export these */
+#define EF_REG0 6
+#define EF_REG1 7
+#define EF_REG2 8
+#define EF_REG3 9
+#define EF_REG4 10
+#define EF_REG5 11
+#define EF_REG6 12
+#define EF_REG7 13
+#define EF_REG8 14
+#define EF_REG9 15
+#define EF_REG10 16
+#define EF_REG11 17
+#define EF_REG12 18
+#define EF_REG13 19
+#define EF_REG14 20
+#define EF_REG15 21
+#define EF_REG16 22
+#define EF_REG17 23
+#define EF_REG18 24
+#define EF_REG19 25
+#define EF_REG20 26
+#define EF_REG21 27
+#define EF_REG22 28
+#define EF_REG23 29
+#define EF_REG24 30
+#define EF_REG25 31
+#define EF_REG28 34
+#define EF_REG29 35
+#define EF_REG30 36
+#define EF_REG31 37
+#endif
+
typedef enum
{
UNW_MIPS_ABI_O32,

View File

@@ -0,0 +1,235 @@
--- a/include/libunwind-ppc32.h
+++ b/include/libunwind-ppc32.h
@@ -81,6 +81,88 @@ typedef int64_t unw_sword_t;
typedef long double unw_tdep_fpreg_t;
+#ifndef __GLIBC__
+
+/* We can't include asm/ptrace.h here, as it conflicts with musl's definitions */
+
+#define PT_R0 0
+#define PT_R1 1
+#define PT_R2 2
+#define PT_R3 3
+#define PT_R4 4
+#define PT_R5 5
+#define PT_R6 6
+#define PT_R7 7
+#define PT_R8 8
+#define PT_R9 9
+#define PT_R10 10
+#define PT_R11 11
+#define PT_R12 12
+#define PT_R13 13
+#define PT_R14 14
+#define PT_R15 15
+#define PT_R16 16
+#define PT_R17 17
+#define PT_R18 18
+#define PT_R19 19
+#define PT_R20 20
+#define PT_R21 21
+#define PT_R22 22
+#define PT_R23 23
+#define PT_R24 24
+#define PT_R25 25
+#define PT_R26 26
+#define PT_R27 27
+#define PT_R28 28
+#define PT_R29 29
+#define PT_R30 30
+#define PT_R31 31
+
+#define PT_NIP 32
+#define PT_MSR 33
+#define PT_ORIG_R3 34
+#define PT_CTR 35
+#define PT_LNK 36
+#define PT_XER 37
+#define PT_CCR 38
+#ifndef __powerpc64__
+#define PT_MQ 39
+#else
+#define PT_SOFTE 39
+#endif
+#define PT_TRAP 40
+#define PT_DAR 41
+#define PT_DSISR 42
+#define PT_RESULT 43
+#define PT_DSCR 44
+#define PT_REGS_COUNT 44
+
+#define PT_FPR0 48 /* each FP reg occupies 2 slots in this space */
+
+#ifndef __powerpc64__
+
+#define PT_FPR31 (PT_FPR0 + 2*31)
+#define PT_FPSCR (PT_FPR0 + 2*32 + 1)
+
+#else /* __powerpc64__ */
+
+#define PT_FPSCR (PT_FPR0 + 32) /* each FP reg occupies 1 slot in 64-bit space */
+
+
+#define PT_VR0 82 /* each Vector reg occupies 2 slots in 64-bit */
+#define PT_VSCR (PT_VR0 + 32*2 + 1)
+#define PT_VRSAVE (PT_VR0 + 33*2)
+
+
+/*
+ * Only store first 32 VSRs here. The second 32 VSRs in VR0-31
+ */
+#define PT_VSR0 150 /* each VSR reg occupies 2 slots in 64-bit */
+#define PT_VSR31 (PT_VSR0 + 2*31)
+#endif /* __powerpc64__ */
+
+#endif /* !__GLIBC__ */
+
typedef enum
{
UNW_PPC32_R0,
--- a/include/libunwind-ppc64.h
+++ b/include/libunwind-ppc64.h
@@ -88,6 +88,88 @@ typedef struct {
uint64_t halves[2];
} unw_tdep_vreg_t;
+#ifndef __GLIBC__
+
+/* We can't include asm/ptrace.h here, as it conflicts with musl's definitions */
+
+#define PT_R0 0
+#define PT_R1 1
+#define PT_R2 2
+#define PT_R3 3
+#define PT_R4 4
+#define PT_R5 5
+#define PT_R6 6
+#define PT_R7 7
+#define PT_R8 8
+#define PT_R9 9
+#define PT_R10 10
+#define PT_R11 11
+#define PT_R12 12
+#define PT_R13 13
+#define PT_R14 14
+#define PT_R15 15
+#define PT_R16 16
+#define PT_R17 17
+#define PT_R18 18
+#define PT_R19 19
+#define PT_R20 20
+#define PT_R21 21
+#define PT_R22 22
+#define PT_R23 23
+#define PT_R24 24
+#define PT_R25 25
+#define PT_R26 26
+#define PT_R27 27
+#define PT_R28 28
+#define PT_R29 29
+#define PT_R30 30
+#define PT_R31 31
+
+#define PT_NIP 32
+#define PT_MSR 33
+#define PT_ORIG_R3 34
+#define PT_CTR 35
+#define PT_LNK 36
+#define PT_XER 37
+#define PT_CCR 38
+#ifndef __powerpc64__
+#define PT_MQ 39
+#else
+#define PT_SOFTE 39
+#endif
+#define PT_TRAP 40
+#define PT_DAR 41
+#define PT_DSISR 42
+#define PT_RESULT 43
+#define PT_DSCR 44
+#define PT_REGS_COUNT 44
+
+#define PT_FPR0 48 /* each FP reg occupies 2 slots in this space */
+
+#ifndef __powerpc64__
+
+#define PT_FPR31 (PT_FPR0 + 2*31)
+#define PT_FPSCR (PT_FPR0 + 2*32 + 1)
+
+#else /* __powerpc64__ */
+
+#define PT_FPSCR (PT_FPR0 + 32) /* each FP reg occupies 1 slot in 64-bit space */
+
+
+#define PT_VR0 82 /* each Vector reg occupies 2 slots in 64-bit */
+#define PT_VSCR (PT_VR0 + 32*2 + 1)
+#define PT_VRSAVE (PT_VR0 + 33*2)
+
+
+/*
+ * Only store first 32 VSRs here. The second 32 VSRs in VR0-31
+ */
+#define PT_VSR0 150 /* each VSR reg occupies 2 slots in 64-bit */
+#define PT_VSR31 (PT_VSR0 + 2*31)
+#endif /* __powerpc64__ */
+
+#endif /* !__GLIBC__ */
+
typedef enum
{
UNW_PPC64_R0,
--- a/src/ppc32/Ginit.c
+++ b/src/ppc32/Ginit.c
@@ -46,10 +46,15 @@ static void *
uc_addr (ucontext_t *uc, int reg)
{
void *addr;
+#ifdef __GLIBC__
+ mcontext_t *mc = uc->uc_mcontext.uc_regs;
+#else
+ mcontext_t *mc = &uc->uc_mcontext;
+#endif
if ((unsigned) (reg - UNW_PPC32_R0) < 32)
#if defined(__linux__)
- addr = &uc->uc_mcontext.uc_regs->gregs[reg - UNW_PPC32_R0];
+ addr = &mc->gregs[reg - UNW_PPC32_R0];
#elif defined(__FreeBSD__)
addr = &uc->uc_mcontext.mc_gpr[reg - UNW_PPC32_R0];
#endif
@@ -58,7 +63,7 @@ uc_addr (ucontext_t *uc, int reg)
if ( ((unsigned) (reg - UNW_PPC32_F0) < 32) &&
((unsigned) (reg - UNW_PPC32_F0) >= 0) )
#if defined(__linux__)
- addr = &uc->uc_mcontext.uc_regs->fpregs.fpregs[reg - UNW_PPC32_F0];
+ addr = &mc->fpregs.fpregs[reg - UNW_PPC32_F0];
#elif defined(__FreeBSD__)
addr = &uc->uc_mcontext.mc_fpreg[reg - UNW_PPC32_F0];
#endif
@@ -85,7 +90,7 @@ uc_addr (ucontext_t *uc, int reg)
return NULL;
}
#if defined(__linux__)
- addr = &uc->uc_mcontext.uc_regs->gregs[gregs_idx];
+ addr = &mc->gregs[gregs_idx];
#elif defined(__FreeBSD__)
addr = &uc->uc_mcontext.mc_gpr[gregs_idx];
#endif
--- a/src/ppc32/ucontext_i.h
+++ b/src/ppc32/ucontext_i.h
@@ -44,8 +44,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DE
//#define MQ_IDX 36
#define LINK_IDX 36
+#ifdef __GLIBC__
#define _UC_MCONTEXT_GPR(x) ( ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[x] - (void *)&dmy_ctxt) )
#define _UC_MCONTEXT_FPR(x) ( ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[x] - (void *)&dmy_ctxt) )
+#else
+#define _UC_MCONTEXT_GPR(x) ( ((void *)&dmy_ctxt.uc_mcontext.gregs[x] - (void *)&dmy_ctxt) )
+#define _UC_MCONTEXT_FPR(x) ( ((void *)&dmy_ctxt.uc_mcontext.fpregs.fpregs[x] - (void *)&dmy_ctxt) )
+#endif
/* These are dummy structures used only for obtaining the offsets of the
various structure members. */

View File

@@ -0,0 +1,12 @@
--- a/src/loongarch64/getcontext.S
+++ b/src/loongarch64/getcontext.S
@@ -25,7 +25,9 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include "offsets.h"
+#ifdef __GLIBC__
#include <endian.h>
+#endif
.text
#define SREG(X) st.d $r##X, $r4, (LINUX_UC_MCONTEXT_GREGS + 8 * X)

View File

@@ -0,0 +1,83 @@
#
# Copyright (C) 2010-2016 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:=libusb
PKG_VERSION:=1.0.27
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/libusb/libusb/releases/download/v$(PKG_VERSION)
PKG_HASH:=ffaa41d741a8a3bee244ac8e54a72ea05bf2879663c098c82fc5757853441575
PKG_MAINTAINER:= Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=LGPL-2.1-or-later
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:libusb:libusb
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/libusb-1.0
SECTION:=libs
CATEGORY:=Libraries
TITLE:=A library for accessing Linux USB devices
DEPENDS:=+libpthread +librt +libatomic
URL:=https://libusb.info/
ABI_VERSION:=0
endef
define Package/libusb-1.0/description
libusb is a C library that gives applications easy access to USB devices on
many different operating systems.
endef
define Package/fxload
SECTION:=utils
CATEGORY:=Utilities
TITLE:=fxload firmware loader
URL:=https://linux-hotplug.sourceforge.net
DEPENDS:=+libusb-1.0
endef
define Package/fxload/description
This program is conveniently able to download firmware into FX, FX2,
and FX2LP EZ-USB devices, as well as the original AnchorChips EZ-USB.
It is intended to be invoked by hotplug scripts when the unprogrammed
device appears on the bus.
endef
TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \
--enable-examples-build \
--disable-log \
--disable-udev
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/libusb-1.0
$(CP) $(PKG_INSTALL_DIR)/usr/include/libusb-1.0/libusb.h $(1)/usr/include/libusb-1.0/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb-1.0.* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libusb-1.0.pc $(1)/usr/lib/pkgconfig/
endef
define Package/libusb-1.0/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb-1.0.so* $(1)/usr/lib/
endef
define Package/fxload/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/examples/.libs/fxload $(1)/usr/sbin
endef
$(eval $(call BuildPackage,libusb-1.0))
$(eval $(call BuildPackage,fxload))

View File

@@ -0,0 +1,207 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libxml2
PKG_VERSION:=2.13.4
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNOME/libxml2/$(basename $(PKG_VERSION))
PKG_HASH:=65d042e1c8010243e617efb02afda20b85c2160acdbfbcb5b26b80cec6515650
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:xmlsoft:libxml2
HOST_BUILD_DEPENDS := libiconv-full/host
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
include $(INCLUDE_DIR)/nls.mk
define Package/libxml2
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Gnome XML library
URL:=http://xmlsoft.org/
DEPENDS:=+libpthread +zlib $(ICONV_DEPENDS)
endef
define Package/libxml2/description
A library for manipulating XML and HTML resources.
endef
define Package/libxml2-dev
SECTION:=devel
CATEGORY:=Development
SUBMENU:=Libraries
TITLE:=Development files for libxml2
URL:=http://xmlsoft.org/
DEPENDS:=+libxml2
endef
define Package/libxml2-dev/description
A library for manipulating XML and HTML resources.
This package contains the headers and xml2-config binary.
endef
define Package/libxml2-utils
SECTION:=utils
CATEGORY:=Utilities
TITLE:=XML command line utilities (xmllint...)
URL:=http://xmlsoft.org/
DEPENDS:=+libxml2
endef
define Package/libxml2-utils/description
This package contains the binaries xmllint and xmlcatalog
from libxml2, a library for manipulating XML and HTML resources.
endef
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
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
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/xml2-config \
$(2)/bin/$(GNU_TARGET_NAME)-xml2-config
$(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
$(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.so* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/cmake/libxml2
$(CP) $(PKG_INSTALL_DIR)/usr/lib/cmake/libxml2-$(PKG_VERSION)/*.cmake \
$(1)/usr/lib/cmake/libxml2
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libxml-2.0.pc $(1)/usr/lib/pkgconfig/
$(INSTALL_DIR) $(2)/share/aclocal/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/* $(2)/share/aclocal
endef
define Host/Install
$(call Host/Install/Default)
mv $(1)/bin/xml2-config $(1)/bin/$(GNU_HOST_NAME)-xml2-config
$(LN) $(GNU_HOST_NAME)-xml2-config $(1)/bin/xml2-config
endef
define Package/libxml2/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.so.* $(1)/usr/lib/
endef
define Package/libxml2-dev/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/xml2-config $(1)/usr/bin/
$(SED) "s,$(STAGING_DIR),,g" $(1)/usr/bin/xml2-config
$(INSTALL_DIR) $(1)/usr/include/
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.so $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/{cmake,pkgconfig}
$(CP) $(PKG_INSTALL_DIR)/usr/lib/{cmake,pkgconfig} $(1)/usr/lib/
$(SED) "s,$(STAGING_DIR),,g" $(1)/usr/lib/pkgconfig/*.pc
$(INSTALL_DIR) $(1)/usr/share/aclocal
$(CP) $(PKG_INSTALL_DIR)/usr/share/aclocal/* $(1)/usr/share/aclocal
endef
define Package/libxml2-utils/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/xmllint $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/xmlcatalog $(1)/usr/bin/
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,libxml2))
$(eval $(call BuildPackage,libxml2-dev))
$(eval $(call BuildPackage,libxml2-utils))

View File

@@ -0,0 +1,226 @@
if PACKAGE_libmbedtls
comment "Option details in source code: include/mbedtls/mbedtls_config.h"
comment "Ciphers - unselect old or less-used ciphers to reduce binary size"
config MBEDTLS_AES_C
bool "MBEDTLS_AES_C"
default y
config MBEDTLS_CAMELLIA_C
bool "MBEDTLS_CAMELLIA_C"
default n
config MBEDTLS_CCM_C
bool "MBEDTLS_CCM_C"
default n
config MBEDTLS_CMAC_C
bool "MBEDTLS_CMAC_C (old but used by hostapd)"
default y
config MBEDTLS_DES_C
bool "MBEDTLS_DES_C (old but used by hostapd)"
default y
config MBEDTLS_GCM_C
bool "MBEDTLS_GCM_C"
default y
config MBEDTLS_NIST_KW_C
bool "MBEDTLS_NIST_KW_C (old but used by hostapd)"
default y
config MBEDTLS_RIPEMD160_C
bool "MBEDTLS_RIPEMD160_C"
default n
config MBEDTLS_RSA_NO_CRT
bool "MBEDTLS_RSA_NO_CRT"
default y
config MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
bool "MBEDTLS_KEY_EXCHANGE_PSK_ENABLED"
default y
config MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
bool "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED"
default n
config MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
bool "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED"
default y
config MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
bool "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED"
default n
config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
bool "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED"
default n
config MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
bool "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED"
default n
config MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
bool "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED"
default y
config MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
bool "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED"
default y
config MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
bool "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED"
default n
config MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
bool "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED"
default n
comment "Curves - unselect old or less-used curves to reduce binary size"
config MBEDTLS_ECP_DP_SECP192R1_ENABLED
bool "MBEDTLS_ECP_DP_SECP192R1_ENABLED"
default n
config MBEDTLS_ECP_DP_SECP224R1_ENABLED
bool "MBEDTLS_ECP_DP_SECP224R1_ENABLED"
default n
config MBEDTLS_ECP_DP_SECP256R1_ENABLED
bool "MBEDTLS_ECP_DP_SECP256R1_ENABLED"
default y
config MBEDTLS_ECP_DP_SECP384R1_ENABLED
bool "MBEDTLS_ECP_DP_SECP384R1_ENABLED"
default y
config MBEDTLS_ECP_DP_SECP521R1_ENABLED
bool "MBEDTLS_ECP_DP_SECP521R1_ENABLED"
default y
config MBEDTLS_ECP_DP_SECP192K1_ENABLED
bool "MBEDTLS_ECP_DP_SECP192K1_ENABLED"
default n
config MBEDTLS_ECP_DP_SECP224K1_ENABLED
bool "MBEDTLS_ECP_DP_SECP224K1_ENABLED"
default n
config MBEDTLS_ECP_DP_SECP256K1_ENABLED
bool "MBEDTLS_ECP_DP_SECP256K1_ENABLED"
default y
config MBEDTLS_ECP_DP_BP256R1_ENABLED
bool "MBEDTLS_ECP_DP_BP256R1_ENABLED"
default n
config MBEDTLS_ECP_DP_BP384R1_ENABLED
bool "MBEDTLS_ECP_DP_BP384R1_ENABLED"
default n
config MBEDTLS_ECP_DP_BP512R1_ENABLED
bool "MBEDTLS_ECP_DP_BP512R1_ENABLED"
default n
config MBEDTLS_ECP_DP_CURVE25519_ENABLED
bool "MBEDTLS_ECP_DP_CURVE25519_ENABLED"
default y
config MBEDTLS_ECP_DP_CURVE448_ENABLED
bool "MBEDTLS_ECP_DP_CURVE448_ENABLED"
default n
comment "Build Options - unselect features to reduce binary size"
config MBEDTLS_CIPHER_MODE_OFB
bool "MBEDTLS_CIPHER_MODE_OFB"
default n
config MBEDTLS_CIPHER_MODE_XTS
bool "MBEDTLS_CIPHER_MODE_XTS"
default n
config MBEDTLS_DEBUG_C
bool "MBEDTLS_DEBUG_C"
default n
config MBEDTLS_HKDF_C
bool "MBEDTLS_HKDF_C"
default n
config MBEDTLS_PLATFORM_C
bool "MBEDTLS_PLATFORM_C"
default n
config MBEDTLS_SELF_TEST
bool "MBEDTLS_SELF_TEST"
default n
config MBEDTLS_THREADING_C
bool "MBEDTLS_THREADING_C"
default y
config MBEDTLS_THREADING_PTHREAD
def_bool MBEDTLS_THREADING_C
config MBEDTLS_VERSION_C
bool "MBEDTLS_VERSION_C"
default n
config MBEDTLS_VERSION_FEATURES
bool "MBEDTLS_VERSION_FEATURES"
default n
config MBEDTLS_PSA_CRYPTO_CLIENT
bool "MBEDTLS_PSA_CRYPTO_CLIENT"
config MBEDTLS_DEPRECATED_WARNING
bool "MBEDTLS_DEPRECATED_WARNING"
default n
config MBEDTLS_SSL_PROTO_TLS1_2
bool "MBEDTLS_SSL_PROTO_TLS1_2"
default y
config MBEDTLS_SSL_PROTO_TLS1_3
bool "MBEDTLS_SSL_PROTO_TLS1_3"
select MBEDTLS_PSA_CRYPTO_CLIENT
select MBEDTLS_HKDF_C
default y
config MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
bool "MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE"
depends on MBEDTLS_SSL_PROTO_TLS1_3
default y
config MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED
bool "MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED"
depends on MBEDTLS_SSL_PROTO_TLS1_3
default y
config MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED
bool "MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED"
depends on MBEDTLS_SSL_PROTO_TLS1_3
default y
config MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
bool "MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED"
depends on MBEDTLS_SSL_PROTO_TLS1_3
default y
comment "Build Options"
config MBEDTLS_ENTROPY_FORCE_SHA256
bool "MBEDTLS_ENTROPY_FORCE_SHA256"
default y
config MBEDTLS_SSL_RENEGOTIATION
bool "MBEDTLS_SSL_RENEGOTIATION"
depends on MBEDTLS_SSL_PROTO_TLS1_2
default n
endif

View File

@@ -0,0 +1,179 @@
#
# Copyright (C) 2011-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:=mbedtls
PKG_VERSION:=3.6.2
PKG_RELEASE:=1
PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL=https://github.com/Mbed-TLS/$(PKG_NAME)/releases/download/$(PKG_NAME)-$(PKG_VERSION)
PKG_HASH:=8b54fb9bcf4d5a7078028e0520acddefb7900b3e66fec7f7175bb5b7d85ccdca
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:arm:mbed_tls
MBEDTLS_BUILD_OPTS_CURVES= \
CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED \
CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED \
CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED \
CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED \
CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED \
CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED \
CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED \
CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED \
CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED \
CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED \
CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED \
CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED \
CONFIG_MBEDTLS_ECP_DP_CURVE448_ENABLED
MBEDTLS_BUILD_OPTS_CIPHERS= \
CONFIG_MBEDTLS_AES_C \
CONFIG_MBEDTLS_CAMELLIA_C \
CONFIG_MBEDTLS_CCM_C \
CONFIG_MBEDTLS_CMAC_C \
CONFIG_MBEDTLS_DES_C \
CONFIG_MBEDTLS_GCM_C \
CONFIG_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED \
CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED \
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED \
CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED \
CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \
CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED \
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \
CONFIG_MBEDTLS_NIST_KW_C \
CONFIG_MBEDTLS_RIPEMD160_C \
CONFIG_MBEDTLS_RSA_NO_CRT \
CONFIG_MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \
CONFIG_MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \
CONFIG_MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
MBEDTLS_BUILD_OPTS= \
$(MBEDTLS_BUILD_OPTS_CURVES) \
$(MBEDTLS_BUILD_OPTS_CIPHERS) \
CONFIG_MBEDTLS_CIPHER_MODE_OFB \
CONFIG_MBEDTLS_CIPHER_MODE_XTS \
CONFIG_MBEDTLS_DEBUG_C \
CONFIG_MBEDTLS_ENTROPY_FORCE_SHA256 \
CONFIG_MBEDTLS_HKDF_C \
CONFIG_MBEDTLS_PLATFORM_C \
CONFIG_MBEDTLS_SELF_TEST \
CONFIG_MBEDTLS_SSL_RENEGOTIATION \
CONFIG_MBEDTLS_THREADING_C \
CONFIG_MBEDTLS_THREADING_PTHREAD \
CONFIG_MBEDTLS_VERSION_C \
CONFIG_MBEDTLS_VERSION_FEATURES \
CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT \
CONFIG_MBEDTLS_DEPRECATED_WARNING \
CONFIG_MBEDTLS_SSL_PROTO_TLS1_2 \
CONFIG_MBEDTLS_SSL_PROTO_TLS1_3 \
CONFIG_MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
PKG_CONFIG_DEPENDS := $(MBEDTLS_BUILD_OPTS)
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/mbedtls/Default
TITLE:=Embedded SSL
URL:=https://www.trustedfirmware.org/projects/mbed-tls/
endef
define Package/mbedtls/Default/description
The aim of the mbedtls project is to provide a quality, open-source
cryptographic library written in C and targeted at embedded systems.
endef
define Package/libmbedtls
$(call Package/mbedtls/Default)
SECTION:=libs
CATEGORY:=Libraries
SUBMENU:=SSL
TITLE+= (library)
ABI_VERSION:=21
MENU:=1
endef
define Package/libmbedtls/config
source "$(SOURCE)/Config.in"
endef
define Package/mbedtls-util
$(call Package/mbedtls/Default)
SECTION:=utils
CATEGORY:=Utilities
TITLE+= (utilities)
DEPENDS:=+libmbedtls
endef
define Package/libmbedtls/description
$(call Package/mbedtls/Default/description)
This package contains the mbedtls library.
endef
define Package/mbedtls-util/description
$(call Package/mbedtls/Default/description)
This package contains mbedtls helper programs for private key and
CSR generation (gen_key, cert_req)
endef
TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS))
CMAKE_OPTIONS += \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DUSE_SHARED_MBEDTLS_LIBRARY:Bool=ON \
-DENABLE_TESTING:Bool=OFF \
-DENABLE_PROGRAMS:Bool=ON
define Build/Prepare
$(call Build/Prepare/Default)
$(if $(strip $(foreach opt,$(MBEDTLS_BUILD_OPTS),$($(opt)))),
$(foreach opt,$(MBEDTLS_BUILD_OPTS),
$(PKG_BUILD_DIR)/scripts/config.py \
-f $(PKG_BUILD_DIR)/include/mbedtls/mbedtls_config.h \
$(if $($(opt)),set,unset) $(patsubst CONFIG_%,%,$(opt))),)
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) \
$(PKG_INSTALL_DIR)/usr/include/mbedtls \
$(PKG_INSTALL_DIR)/usr/include/psa \
$(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.a $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/cmake $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/mbedcrypto.pc \
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/mbedtls.pc \
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/mbedx509.pc \
$(1)/usr/lib/pkgconfig/
endef
define Package/libmbedtls/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/
endef
define Package/mbedtls-util/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gen_key $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cert_req $(1)/usr/bin/
endef
$(eval $(call BuildPackage,libmbedtls))
$(eval $(call BuildPackage,mbedtls-util))

View File

@@ -0,0 +1,11 @@
--- a/library/common.h
+++ b/library/common.h
@@ -199,7 +199,7 @@ static inline void mbedtls_xor(unsigned
uint8x16_t x = veorq_u8(v1, v2);
vst1q_u8(r + i, x);
}
-#if defined(__IAR_SYSTEMS_ICC__)
+#if defined(__IAR_SYSTEMS_ICC__) || (defined(MBEDTLS_COMPILER_IS_GCC) && MBEDTLS_GCC_VERSION >= 140100)
/* This if statement helps some compilers (e.g., IAR) optimise out the byte-by-byte tail case
* where n is a constant multiple of 16.
* For other compilers (e.g. recent gcc and clang) it makes no difference if n is a compile-time

View File

@@ -0,0 +1,16 @@
--- a/programs/CMakeLists.txt
+++ b/programs/CMakeLists.txt
@@ -1,13 +1,9 @@
add_subdirectory(aes)
add_subdirectory(cipher)
-if (NOT WIN32)
- add_subdirectory(fuzz)
-endif()
add_subdirectory(hash)
add_subdirectory(pkey)
add_subdirectory(psa)
add_subdirectory(random)
add_subdirectory(ssl)
-add_subdirectory(test)
add_subdirectory(util)
add_subdirectory(x509)

View File

@@ -0,0 +1,64 @@
#
# Copyright (C) 2023 Jeffery To
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=mpfr
PKG_VERSION:=4.2.1
PKG_RELEASE:=1
PKG_SOURCE_URL:=@GNU/mpfr http://www.mpfr.org/mpfr-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=277807353a6726978996945af13e52829e3abd7a9a5b7fb2793894e18f1fcbb2
PKG_LICENSE:=LGPL-3.0-or-later
PKG_LICENSE_FILES:=COPYING.LESSER
PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
PKG_CPE_ID:=cpe:/a:mpfr:gnu_mpfr
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/libmpfr
SECTION:=libs
CATEGORY:=Libraries
TITLE:=GNU MPFR library
URL:=https://www.mpfr.org/
DEPENDS:=+libgmp
ABI_VERSION:=6
endef
define Package/libmpfr/description
MPFR is a portable library written in C for arbitrary precision
arithmetic on floating-point numbers. It is based on the GNU MP library.
It aims to provide a class of floating-point numbers with precise
semantics.
endef
CONFIGURE_ARGS += \
--enable-thread-safe
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/mpf* $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libmpfr.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/mpfr.pc $(1)/usr/lib/pkgconfig/
endef
define Package/libmpfr/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libmpfr.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libmpfr))

View File

@@ -0,0 +1,22 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -38,7 +38,7 @@ AUTOMAKE_OPTIONS = gnu
# old Automake version.
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = doc src tests tune tools/bench
+SUBDIRS = src
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = mpfr.pc
--- a/Makefile.in
+++ b/Makefile.in
@@ -401,7 +401,7 @@ AUTOMAKE_OPTIONS = gnu
# libtoolize and in case some developer needs to switch back to an
# old Automake version.
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = doc src tests tune tools/bench
+SUBDIRS = src
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = mpfr.pc
nobase_dist_doc_DATA = AUTHORS BUGS COPYING COPYING.LESSER NEWS TODO \

View File

@@ -0,0 +1,63 @@
#
# Copyright (C) 2017 Lucian Cristian <lucian.cristian@gmail.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
# updated to work with latest source from abrasive
#
include $(TOPDIR)/rules.mk
PKG_NAME:=musl-fts
PKG_VERSION:=1.2.7
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/pullmoll/musl-fts.git
PKG_SOURCE_VERSION:=0bde52df588e8969879a2cae51c3a4774ec62472
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_MIRROR_HASH:=29c62a600128e9189b1b2e1aea568546178eedf739527f657873b3b773072ecb
PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
PKG_LICENSE:=LGPL-2.1
PKG_LICENSE_FILES:=COPYING AUTHORS
PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=autogen.sh
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
define Package/musl-fts
SECTION:=libs
CATEGORY:=Libraries
TITLE:=fts implementation for musl libc
URL:=https://github.com/pullmoll/musl-fts
DEPENDS:= +libpthread
endef
define Package/musl-fts/description
The musl-fts package implements the fts(3) functions fts_open, fts_read, fts_children, fts_set and fts_close, which are missing in musl libc.
endef
HOST_CONFIGURE_ARGS += --disable-shared --with-pic
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/fts.h $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libfts.so* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/musl-fts.pc $(1)/usr/lib/pkgconfig/
endef
define Package/musl-fts/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libfts.so* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,musl-fts))
$(eval $(call HostBuild))

View File

@@ -0,0 +1,196 @@
#
# Copyright (C) 2006-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:=ncurses
PKG_CPE_ID:=cpe:/a:gnu:ncurses
PKG_VERSION:=6.4
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
PKG_HASH:=6931283d9ac87c5073f30b6290c4c75f21632bb4fc3603ac8100812bed248159
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=README
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=ncurses/host
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
define Package/terminfo
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Terminal Info Database (ncurses)
URL:=http://www.gnu.org/software/ncurses/
endef
define Package/libncurses
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Terminal handling library (Unicode)
URL:=http://www.gnu.org/software/ncurses/
PROVIDES:=libncursesw
DEPENDS:= +terminfo
ABI_VERSION:=6
endef
define Package/libncurses-dev
SECTION:=devel
CATEGORY:=Development
SUBMENU:=Libraries
DEPENDS:=zlib
TITLE:=Development files for the ncurses library
endef
TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \
--enable-echo \
--enable-const \
--enable-overwrite \
--enable-pc-files \
--disable-rpath \
--without-ada \
--without-debug \
--without-manpages \
--without-profile \
--without-progs \
--without-tests \
--disable-big-core \
--disable-home-terminfo \
--with-normal \
--with-shared \
--with-terminfo-dirs=/usr/share/terminfo \
--with-default-terminfo-dir=/usr/share/terminfo \
--with-pkg-config-libdir=/usr/lib/pkgconfig \
--enable-widec \
--with-build-cppflags=-D_GNU_SOURCE
CONFIGURE_VARS += \
cf_try_fPIC=no
HOST_CFLAGS += $(HOST_FPIC)
HOST_CONFIGURE_ARGS += \
--enable-pc-files \
--without-cxx \
--without-cxx-binding \
--without-ada \
--without-debug \
--without-manpages \
--without-profile \
--without-tests \
--without-curses-h
ifeq ($(HOST_OS),FreeBSD)
CONFIGURE_ARGS +=
--with-terminfo=/usr/share/terminfo.db
endif
MAKE_FLAGS += \
BUILD_CC="$(HOSTCC)" \
HOSTCC="$(HOSTCC)" \
HOSTCCFLAGS="" \
PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig \
libs
define Build/Install/Default
$(MAKE_VARS) \
$(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
$(MAKE_INSTALL_FLAGS) \
$(1) install.libs install.data;
endef
define Package/terminfo/install
echo ""
ifneq ($(HOST_OS),FreeBSD)
$(INSTALL_DIR) $(1)/usr/share/terminfo
(cd $(PKG_INSTALL_DIR)/usr/share/terminfo; \
for dir in ??; do \
[ -d "$$$$dir" ] || continue; \
mv $$$$dir $$$$(echo -ne "\x$$$$dir"); \
done \
)
for file in \
a/ansi \
a/alacritty \
d/dumb \
f/foot \
l/linux \
r/rxvt \
r/rxvt-unicode \
s/screen \
s/screen-256color \
t/tmux \
t/tmux-256color \
v/vt100 \
v/vt102 \
x/xterm \
x/xterm-color \
x/xterm-256color; do \
$(INSTALL_DIR) $(1)/usr/share/terminfo/`dirname $$$$file`; \
$(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
$(1)/usr/share/terminfo/$$$$file; \
done
endif
endef
define Package/libncurses/install
$(INSTALL_DIR) $(1)/usr/lib
for lib in ncurses panel menu form; do \
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$$$${lib}w.so.* $(1)/usr/lib/; \
for so in $(1)/usr/lib/lib$$$${lib}w.so.*; do \
ln -s $$$${so##*/} $$$${so%w.so*}.so$$$${so##*w.so}; \
done; \
done
endef
define Package/libncurses-dev/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.a $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
endef
define Build/InstallDev
$(CP) $(PKG_INSTALL_DIR)/* $(1)
for lib in ncurses panel menu form; do \
for so in $(1)/usr/lib/lib$$$${lib}w.so*; do \
ln -s $$$${so##*/} $$$${so%w.so*}.so$$$${so##*w.so}; \
done; \
done
ln -s . $(1)/usr/include/ncursesw
$(TARGET_CROSS)ar rc $(1)/usr/lib/libtinfo.a
$(INSTALL_DIR) $(2)/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/ncursesw6-config $(2)/bin/
$(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' -e 's/$$$$INCS //g' \
$(2)/bin/ncursesw6-config
ln -sf $(STAGING_DIR)/host/bin/ncursesw6-config $(1)/usr/bin/ncursesw6-config
$(SED) 's,$(TOOLCHAIN_DIR),$(STAGING_DIR),g' \
$(1)/usr/lib/pkgconfig/ncursesw.pc
endef
define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR) libs
$(MAKE) -C $(HOST_BUILD_DIR)/progs tic
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,terminfo))
$(eval $(call BuildPackage,libncurses))
$(eval $(call BuildPackage,libncurses-dev))

View File

@@ -0,0 +1,175 @@
--- a/misc/terminfo.src
+++ b/misc/terminfo.src
@@ -6886,6 +6886,172 @@ rxvt-cygwin-native|rxvt terminal emulato
rxvt-16color|rxvt with 16 colors like aixterm,
ncv#32, use=ibm+16color, use=rxvt,
+# rxvt-unicode
+# http://cvs.schmorp.de/rxvt-unicode/doc/etc/rxvt-unicode.terminfo?revision=1.20
+# From: Thomas Dickey <dickey@clark.net> 04 Oct 1997
+# Updated: Özgür Kesim <kesim@math.fu-berlin.de> 02 Nov 1997
+# Updated: Marc Lehmann <pcg@goof.com>, 17 Feb 2005
+rxvt-unicode|rxvt-unicode terminal (X Window System),
+ am,
+ bce,
+ eo,
+ km,
+ msgr,
+ xenl,
+ hs,
+ cols#80,
+ it#8,
+ lines#24,
+ acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~-A.B+C\,D0EhFiG,
+ bel=^G,
+ blink=\E[5m,
+ bold=\E[1m,
+ civis=\E[?25l,
+ clear=\E[H\E[2J,
+ cnorm=\E[?25h,
+ cr=^M,
+ csr=\E[%i%p1%d;%p2%dr,
+ cub=\E[%p1%dD,
+ cub1=^H,
+ cud=\E[%p1%dB,
+ cud1=^J,
+ cuf=\E[%p1%dC,
+ cuf1=\E[C,
+ cup=\E[%i%p1%d;%p2%dH,
+ cuu=\E[%p1%dA,
+ cuu1=\E[A,
+ cvvis=\E[?25h,
+ dch=\E[%p1%dP,
+ dch1=\E[P,
+ dl=\E[%p1%dM,
+ dl1=\E[M,
+ ed=\E[J,
+ el=\E[K,
+ el1=\E[1K,
+ flash=\E[?5h$<20/>\E[?5l,
+ home=\E[H,
+ hpa=\E[%i%p1%dG,
+ ht=^I,
+ hts=\EH,
+ ich=\E[%p1%d@,
+ ich1=\E[@,
+ il=\E[%p1%dL,
+ il1=\E[L,
+ ind=^J,
+ is1=\E[?47l\E=\E[?1l,
+ is2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l,
+ kDC=\E[3$,
+ kIC=\E2$,
+ kEND=\E[8$,
+ kHOM=\E[7$,
+ kLFT=\E[d,
+ kNXT=\E[6$,
+ kPRV=\E[5$,
+ kRIT=\E[c,
+ kbs=\177,
+ ka1=\EOw,
+ ka3=\EOy,
+ kb2=\EOu,
+ kc1=\EOq,
+ kc3=\EOs,
+ kcbt=\E[Z,
+ kcub1=\E[D,
+ kcud1=\E[B,
+ kcuf1=\E[C,
+ kcuu1=\E[A,
+ kdch1=\E[3~,
+ kel=\E[8\^,
+ kend=\E[8~,
+ kent=\EOM,
+ kf1=\E[11~,
+ kf10=\E[21~,
+ kf11=\E[23~,
+ kf12=\E[24~,
+ kf13=\E[25~,
+ kf14=\E[26~,
+ kf15=\E[28~,
+ kf16=\E[29~,
+ kf17=\E[31~,
+ kf18=\E[32~,
+ kf19=\E[33~,
+ kf2=\E[12~,
+ kf20=\E[34~,
+ kf3=\E[13~,
+ kf4=\E[14~,
+ kf5=\E[15~,
+ kf6=\E[17~,
+ kf7=\E[18~,
+ kf8=\E[19~,
+ kf9=\E[20~,
+ kfnd=\E[1~,
+ khome=\E[7~,
+ kich1=\E[2~,
+ kmous=\E[M,
+ knp=\E[6~,
+ kpp=\E[5~,
+ kslt=\E[4~,
+ rc=\E8,
+ rev=\E[7m,
+ ri=\EM,
+ rmso=\E[27m,
+ rmul=\E[24m,
+ rs1=\Ec,
+ rs2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E>,
+ sgr0=\E[m\017,
+ enacs=,
+ smacs=\E(0,
+ rmacs=\E(B,
+ smso=\E[7m,
+ smul=\E[4m,
+ tbc=\E[3g,
+ vpa=\E[%i%p1%dd,
+ colors#88,
+ pairs#256,
+ btns#5,
+ lm#0,
+ ccc,
+ npc,
+ mc5i,
+ ncv#0,
+ mir,
+ xon,
+ bw,
+ ech=\E[%p1%dX,
+ mc0=\E[i,
+ mc4=\E[4i,
+ mc5=\E[5i,
+ sitm=\E[3m,
+ ritm=\E[23m,
+ smam=\E[?7h,
+ rmam=\E[?7l,
+ smir=\E[4h,
+ rmir=\E[4l,
+ smcup=\E[?1049h,
+ rmcup=\E[r\E[?1049l,
+ smkx=\E=,
+ rmkx=\E>,
+ indn=\E[%p1%dS,
+ rin=\E[%p1%dT,
+ sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\E(0%e\E(B%;,
+ op=\E[39;49m,
+ setaf=\E[38;5;%p1%dm,
+ setab=\E[48;5;%p1%dm,
+ setf=%?%p1%{7}%>%t\E[38;5;%p1%dm%e\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m%;,
+ setb=%?%p1%{7}%>%t\E[48;5;%p1%dm%e\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m%;,
+ initc=\E]4;%p1%d;rgb\:%p2%{65535}%*%{1000}%/%4.4X/%p3%{65535}%*%{1000}%/%4.4X/%p4%{65535}%*%{1000}%/%4.4X\E\\,
+ sc=\E7,
+ s0ds=\E(B,
+ s1ds=\E(0,
+ s2ds=\E*B,
+ s3ds=\E+B,
+ u6=\E[%i%d;%dR,
+ u7=\E[6n,
+ u8=\E[?1;2c,
+ u9=\E[c,
+ tsl=\E]2;,
+ fsl=\007,
+ dsl=\E]2;\007,
+
#### MRXVT
# mrxvt 0.5.4
#

View File

@@ -0,0 +1,52 @@
--- a/misc/terminfo.src
+++ b/misc/terminfo.src
@@ -4984,6 +4984,7 @@ xterm-xfree86|xterm terminal emulator (X
xterm+nofkeys|building block for xterm fkey-variants,
npc,
+ kbs=\177,
kcbt=\E[Z, kent=\EOM, nel=\EE, use=ecma+index,
use=ansi+rep, use=ecma+strikeout, use=vt420+lrmm,
use=xterm+sm+1006, use=xterm+tmux, use=ecma+italics,
@@ -6689,6 +6690,7 @@ mlterm-256color|mlterm 3.0 with xterm 25
rxvt-basic|rxvt terminal base (X Window System),
OTbs, am, bce, eo, mir, msgr, xenl, xon, XT,
cols#80, it#8, lines#24,
+ kbs=\177,
acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[2J, cr=\r,
csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
@@ -6698,7 +6700,7 @@ rxvt-basic|rxvt terminal base (X Window
enacs=\E(B\E)0, flash=\E[?5h$<100/>\E[?5l, home=\E[H,
ht=^I, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L,
ind=\n, is1=\E[?47l\E=\E[?1l,
- is2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l, kbs=^H,
+ is2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l,
kcbt=\E[Z, kmous=\E[M, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O,
rmir=\E[4l, rmkx=\E>, rmso=\E[27m, rmul=\E[24m,
rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H,
@@ -8347,6 +8349,7 @@ dumb-emacs-ansi|Emacs dumb terminal with
screen-base|VT 100/ANSI X3.64 virtual terminal (base),
OTbs, OTpt, am, km, mir, msgr, xenl, G0,
colors#8, cols#80, it#8, lines#24, ncv@, pairs#64, U8#1,
+ kbs=\177,
acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxy
yzz{{||}}~~,
bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
@@ -8358,7 +8361,7 @@ screen-base|VT 100/ANSI X3.64 virtual te
dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K,
enacs=\E(B\E)0, flash=\Eg, home=\E[H, hpa=\E[%i%p1%dG,
ht=^I, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L,
- ind=\n, indn=\E[%p1%dS, is2=\E)0, kbs=^H, kcbt=\E[Z,
+ ind=\n, indn=\E[%p1%dS, is2=\E)0, kcbt=\E[Z,
kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kf1=\EOP,
kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf2=\EOQ, kf3=\EOR,
kf4=\EOS, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~,
@@ -8500,6 +8503,7 @@ screen.xterm-r6|screen customized for X1
# on Solaris because Sun's curses implementation gets confused.
screen.teraterm|disable ncv in teraterm,
ncv#127,
+ kbs=^H,
acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i
\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u
\264v\301w\302x\263y\363z\362{\343|\330}\234~\376,

View File

@@ -0,0 +1,44 @@
https://bugs.gentoo.org/545114
extracted from the upstream change (which had many unrelated commits in one)
From 97bb4678dc03e753290b39bbff30ba2825df9517 Mon Sep 17 00:00:00 2001
From: "Thomas E. Dickey" <dickey@invisible-island.net>
Date: Sun, 7 Dec 2014 03:10:09 +0000
Subject: [PATCH] ncurses 5.9 - patch 20141206
+ modify MKlib_gen.sh to work around change in development version of
gcc introduced here:
https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00236.html
(reports by Marcus Shawcroft, Maohui Lei).
--- a/ncurses/base/MKlib_gen.sh
+++ b/ncurses/base/MKlib_gen.sh
@@ -512,11 +512,22 @@ sed -n -f $ED1 \
-e 's/gen_$//' \
-e 's/ / /g' >>$TMP
+cat >$ED1 <<EOF
+s/ / /g
+s/^ //
+s/ $//
+s/P_NCURSES_BOOL/NCURSES_BOOL/g
+EOF
+
+# A patch discussed here:
+# https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
+# introduces spurious #line markers. Work around that by ignoring the system's
+# attempt to define "bool" and using our own symbol here.
+sed -e 's/bool/P_NCURSES_BOOL/g' $TMP > $ED2
+cat $ED2 >$TMP
+
$preprocessor $TMP 2>/dev/null \
-| sed \
- -e 's/ / /g' \
- -e 's/^ //' \
- -e 's/_Bool/NCURSES_BOOL/g' \
+| sed -f $ED1 \
| "$AWK" -f $AW2 \
| sed -f $ED3 \
| sed \

View File

@@ -0,0 +1,22 @@
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -523,7 +523,7 @@ AC_CACHE_CHECK(for options to update arc
;;
(*)
cf_cv_ar_flags=unknown
- for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
+ for cf_ar_flags in -curvD -curv curv -crv crv -cqv cqv -rv rv
do
# check if $ARFLAGS already contains this choice
--- a/configure
+++ b/configure
@@ -5110,7 +5110,7 @@ else
;;
(*)
cf_cv_ar_flags=unknown
- for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
+ for cf_ar_flags in -curvD -curv curv -crv crv -cqv cqv -rv rv
do
# check if $ARFLAGS already contains this choice

View File

@@ -0,0 +1,14 @@
--- a/ncurses/curses.priv.h
+++ b/ncurses/curses.priv.h
@@ -56,6 +56,11 @@ extern "C" {
#include <ncurses_cfg.h>
+#if NEED_WCHAR_H
+#include <stdarg.h>
+#include <wchar.h>
+#endif
+
#if USE_RCS_IDS
#define MODULE_ID(id) static const char Ident[] = id;
#else

View File

@@ -0,0 +1,20 @@
--- a/misc/terminfo.src
+++ b/misc/terminfo.src
@@ -6514,12 +6514,11 @@ konsole-xf3x|KDE console window with key
# The value for kbs (see konsole-vt100) reflects local customization rather
# than the settings used for XFree86 xterm.
konsole-xf4x|KDE console window with keyboard for XFree86 4.x xterm,
- kend=\EOF, khome=\EOH, use=konsole+pcfkeys,
- use=konsole-vt100,
-
-konsole+pcfkeys|konsole subset of xterm+pcfkeys,
- kcbt=\E[Z, use=xterm+pcc2, use=xterm+pcf0,
- use=xterm+pce2,
+ kend=\EOF, kf1=\EOP, kf13=\EO2P, kf14=\EO2Q, kf15=\EO2R,
+ kf16=\EO2S, kf17=\E[15;2~, kf18=\E[17;2~, kf19=\E[18;2~,
+ kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~, kf22=\E[21;2~,
+ kf23=\E[23;2~, kf24=\E[24;2~, kf3=\EOR, kf4=\EOS,
+ khome=\EOH, use=konsole-vt100,
# Obsolete: vt100.keymap
# KDE's "vt100" keyboard has no relationship to any terminal that DEC made, but

View File

@@ -0,0 +1,9 @@
# nettle avanced configuration
menu "Configuration"
depends on PACKAGE_libnettle
config LIBNETTLE_MINI
bool "use mini-gmp instead of gmp; the library will be much smaller at a 10x performance penalty. Note that this option may have side effects to programs that link to both nettle and gmp."
endmenu

View File

@@ -0,0 +1,94 @@
#
# Copyright (C) 2014 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:=nettle
PKG_VERSION:=3.9.1
PKG_RELEASE:=1
PKG_BUILD_FLAGS:=no-mips16
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/nettle
PKG_HASH:=ccfeff981b0ca71bbd6fbcb054f407c60ffb644389a5be80d6716d5b550c6ce3
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:nettle_project:nettle
PKG_BUILD_PARALLEL:=1
PKG_CONFIG_DEPENDS := CONFIG_LIBNETTLE_MINI
include $(INCLUDE_DIR)/package.mk
define Package/libnettle
SECTION:=libs
CATEGORY:=Libraries
TITLE:=GNU crypto library
URL:=http://www.lysator.liu.se/~nisse/nettle/
DEPENDS+= +!LIBNETTLE_MINI:libgmp
ABI_VERSION:=8
endef
define Package/libnettle/config
source "$(SOURCE)/Config.in"
endef
TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \
--enable-shared \
--enable-fat \
--disable-openssl \
--disable-documentation \
--enable-static \
$(if $(CONFIG_powerpc64), $(if $(CONFIG_USE_MUSL),--disable-assembler))
ifeq ($(CONFIG_LIBNETTLE_MINI),y)
CONFIGURE_ARGS += --enable-mini-gmp
endif
ifeq ($(CONFIG_CPU_SUBTYPE),neon)
CONFIGURE_ARGS += \
--enable-arm-neon
endif
ifeq ($(ARCH),armeb)
CONFIGURE_ARGS += \
--disable-assembler
endif
define Build/Compile
$(call Build/Compile/Default, \
DESTDIR="$(PKG_INSTALL_DIR)" \
CC="$(TARGET_CC)" \
libnettle.so libhogweed.so
+$(MAKE) -i $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
DESTDIR="$(PKG_INSTALL_DIR)" \
install)
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/nettle
$(CP) $(PKG_INSTALL_DIR)/usr/include/nettle/*.h $(1)/usr/include/nettle/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnettle.{a,so*} $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libhogweed.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/nettle.pc \
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/hogweed.pc \
$(1)/usr/lib/pkgconfig/
endef
define Package/libnettle/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnettle.so.* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libhogweed.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libnettle))

View File

@@ -0,0 +1,34 @@
--- a/configure
+++ b/configure
@@ -4719,6 +4719,7 @@ $as_echo_n "checking build system compil
# remove anything that might look like compiler output to our "||" expression
rm -f conftest* a.out b.out a.exe a_out.exe
cat >conftest.c <<EOF
+#include <stdlib.h>
int
main ()
{
@@ -4751,6 +4752,7 @@ $as_echo_n "checking build system compil
# remove anything that might look like compiler output to our "||" expression
rm -f conftest* a.out b.out a.exe a_out.exe
cat >conftest.c <<EOF
+#include <stdlib.h>
int
main ()
{
@@ -4787,6 +4789,7 @@ $as_echo_n "checking build system compil
# remove anything that might look like compiler output to our "||" expression
rm -f conftest* a.out b.out a.exe a_out.exe
cat >conftest.c <<EOF
+#include <stdlib.h>
int
main ()
{
@@ -4837,6 +4840,7 @@ else
gmp_cv_prog_exeext_for_build="$EXEEXT"
else
cat >conftest.c <<EOF
+#include <stdlib.h>
int
main ()
{

View File

@@ -0,0 +1,310 @@
if PACKAGE_libopenssl
comment "Build Options"
config OPENSSL_OPTIMIZE_SPEED
bool
default y if x86_64 || i386
prompt "Enable optimization for speed instead of size"
select OPENSSL_WITH_ASM
help
Enabling this option increases code size and performance.
The increase in performance and size depends on the
target CPU. EC and AES seem to benefit the most.
config OPENSSL_SMALL_FOOTPRINT
bool
depends on !OPENSSL_OPTIMIZE_SPEED
default y if SMALL_FLASH || LOW_MEMORY_FOOTPRINT
prompt "Build with OPENSSL_SMALL_FOOTPRINT (read help)"
help
This turns on -DOPENSSL_SMALL_FOOTPRINT. This will save only
1-3% of of the ipk size. The performance drop depends on
architecture and algorithm. MIPS drops 13% of performance for
a 3% decrease in ipk size. On Aarch64, for a 1% reduction in
size, ghash and GCM performance decreases 90%, while
Chacha20-Poly1305 is 15% slower. X86_64 drops 1% of its size
for 3% of performance. Other arches have not been tested.
config OPENSSL_WITH_ASM
bool
default y
prompt "Compile with optimized assembly code"
depends on !arc
help
Disabling this option will reduce code size and performance.
The increase in performance and size depends on the target
CPU and on the algorithms being optimized.
config OPENSSL_WITH_SSE2
bool
default y if !TARGET_x86_legacy && !TARGET_x86_geode
prompt "Enable use of x86 SSE2 instructions"
depends on OPENSSL_WITH_ASM && i386
help
Use of SSE2 instructions greatly increase performance with a
minimum increase in package size, but it will bring no benefit
if your hardware does not support them, such as Geode GX and LX.
AMD Geode NX, and Intel Pentium 4 and above support SSE2.
config OPENSSL_WITH_DEPRECATED
bool
default y
prompt "Include deprecated APIs"
help
This drops all deprecated API, including engine support.
config OPENSSL_NO_DEPRECATED
bool
default !OPENSSL_WITH_DEPRECATED
config OPENSSL_WITH_ERROR_MESSAGES
bool
default y if !OPENSSL_SMALL_FOOTPRINT || (!SMALL_FLASH && !LOW_MEMORY_FOOTPRINT)
prompt "Include error messages"
help
This option aids debugging, but increases package size and
memory usage.
comment "Protocol Support"
config OPENSSL_WITH_TLS13
bool
default y
prompt "Enable support for TLS 1.3"
help
TLS 1.3 is the newest version of the TLS specification.
It aims:
* to increase the overall security of the protocol,
removing outdated algorithms, and encrypting more of the
protocol;
* to increase performance by reducing the number of round-trips
when performing a full handshake.
config OPENSSL_WITH_DTLS
bool
prompt "Enable DTLS support"
help
Datagram Transport Layer Security (DTLS) provides TLS-like security
for datagram-based (UDP, DCCP, CAPWAP, SCTP & SRTP) applications.
config OPENSSL_WITH_NPN
bool
prompt "Enable NPN support"
help
NPN is a TLS extension, obsoleted and replaced with ALPN,
used to negotiate SPDY, and HTTP/2.
config OPENSSL_WITH_SRP
bool
default y
prompt "Enable SRP support"
help
The Secure Remote Password protocol (SRP) is an augmented
password-authenticated key agreement (PAKE) protocol, specifically
designed to work around existing patents.
config OPENSSL_WITH_CMS
bool
default y
prompt "Enable CMS (RFC 5652) support"
help
Cryptographic Message Syntax (CMS) is used to digitally sign,
digest, authenticate, or encrypt arbitrary message content.
comment "Algorithm Selection"
config OPENSSL_WITH_EC2M
bool
prompt "Enable ec2m support"
help
This option enables the more efficient, yet less common, binary
field elliptic curves.
config OPENSSL_WITH_CHACHA_POLY1305
bool
default y
prompt "Enable ChaCha20-Poly1305 ciphersuite support"
help
ChaCha20-Poly1305 is an AEAD ciphersuite with 256-bit keys,
combining ChaCha stream cipher with Poly1305 MAC.
It is 3x faster than AES, when not using a CPU with AES-specific
instructions, as is the case of most embedded devices.
config OPENSSL_PREFER_CHACHA_OVER_GCM
bool
default y if !x86_64 && !aarch64
prompt "Prefer ChaCha20-Poly1305 over AES-GCM by default"
depends on OPENSSL_WITH_CHACHA_POLY1305
help
The default openssl preference is for AES-GCM before ChaCha, but
that takes into account AES-NI capable chips. It is not the
case with most embedded chips, so it may be better to invert
that preference. This is just for the default case. The
application can always override this.
config OPENSSL_WITH_PSK
bool
default y
prompt "Enable PSK support"
help
Build support for Pre-Shared Key based cipher suites.
comment "Less commonly used build options"
config OPENSSL_WITH_ARIA
bool
prompt "Enable ARIA support"
help
ARIA is a block cipher developed in South Korea, based on AES.
config OPENSSL_WITH_CAMELLIA
bool
prompt "Enable Camellia cipher support"
help
Camellia is a bock cipher with security levels and processing
abilities comparable to AES.
config OPENSSL_WITH_IDEA
bool
default y if !SMALL_FLASH
prompt "Enable IDEA cipher support (needs legacy provider)"
help
IDEA is a block cipher with 128-bit keys.
To use the cipher, one must install the libopenssl-legacy
package, using a main libopenssl package compiled with this
option enabled as well.
config OPENSSL_WITH_SEED
bool
default y if !SMALL_FLASH
prompt "Enable SEED cipher support (needs legacy provider)"
help
SEED is a block cipher with 128-bit keys broadly used in
South Korea, but seldom found elsewhere.
To use the cipher, one must install the libopenssl-legacy
package, using a main libopenssl package compiled with this
option enabled as well.
config OPENSSL_WITH_SM234
bool
prompt "Enable SM2/3/4 algorithms support"
help
These algorithms are a set of "Commercial Cryptography"
algorithms approved for use in China.
* SM2 is an EC algorithm equivalent to ECDSA P-256
* SM3 is a hash function equivalent to SHA-256
* SM4 is a 128-block cipher equivalent to AES-128
config OPENSSL_WITH_BLAKE2
bool
prompt "Enable BLAKE2 digest support"
help
BLAKE2 is a cryptographic hash function based on the ChaCha
stream cipher.
config OPENSSL_WITH_MDC2
bool
default y if !SMALL_FLASH
prompt "Enable MDC2 digest support (needs legacy provider)"
help
To use the digest, one must install the libopenssl-legacy
package, using a main libopenssl package compiled with this
option enabled as well.
config OPENSSL_WITH_WHIRLPOOL
bool
default y if !SMALL_FLASH
prompt "Enable Whirlpool digest support (needs legacy provider)"
help
To use the digest, one must install the libopenssl-legacy
package, using a main libopenssl package compiled with this
option enabled as well.
config OPENSSL_WITH_COMPRESSION
bool
prompt "Enable compression support"
help
TLS compression is not recommended, as it is deemed insecure.
The CRIME attack exploits this weakness.
Even with this option turned on, it is disabled by default, and the
application must explicitly turn it on.
config OPENSSL_WITH_RFC3779
bool
prompt "Enable RFC3779 support (BGP)"
help
RFC 3779 defines two X.509 v3 certificate extensions. The first
binds a list of IP address blocks, or prefixes, to the subject of a
certificate. The second binds a list of autonomous system
identifiers to the subject of a certificate. These extensions may be
used to convey the authorization of the subject to use the IP
addresses and autonomous system identifiers contained in the
extensions.
comment "Engine/Hardware Support"
config OPENSSL_ENGINE
bool "Enable engine support"
select OPENSSL_WITH_DEPRECATED
default y
help
This enables alternative cryptography implementations,
most commonly for interfacing with external crypto devices,
or supporting new/alternative ciphers and digests.
If you compile the library with this option disabled, packages built
using an engine-enabled library (i.e. from the official repo) may
fail to run. Compile and install the packages with engine support
disabled, and you should be fine.
Note that you need to enable KERNEL_AIO to be able to build the
afalg engine package.
config OPENSSL_ENGINE_BUILTIN
bool "Build chosen engines into libcrypto"
depends on OPENSSL_ENGINE
help
This builds all chosen engines into libcrypto.so, instead of building
them as dynamic engines in separate packages.
The benefit of building the engines into libcrypto is that they won't
require any configuration to be used by default.
config OPENSSL_ENGINE_BUILTIN_AFALG
bool
prompt "Acceleration support through AF_ALG sockets engine"
depends on OPENSSL_ENGINE_BUILTIN && KERNEL_AIO
select PACKAGE_libopenssl-conf
help
This enables use of hardware acceleration through the
AF_ALG kernel interface.
config OPENSSL_ENGINE_BUILTIN_DEVCRYPTO
bool
prompt "Acceleration support through /dev/crypto"
depends on OPENSSL_ENGINE_BUILTIN
select PACKAGE_libopenssl-conf
help
This enables use of hardware acceleration through OpenBSD
Cryptodev API (/dev/crypto) interface.
Even though configuration is not strictly needed, it is worth seeing
https://openwrt.org/docs/techref/hardware/cryptographic.hardware.accelerators
for information on how to configure the engine.
config OPENSSL_ENGINE_BUILTIN_PADLOCK
bool
prompt "VIA Padlock Acceleration support engine"
depends on OPENSSL_ENGINE_BUILTIN && TARGET_x86
select PACKAGE_libopenssl-conf
help
This enables use of hardware acceleration through the
VIA Padlock module.
config OPENSSL_WITH_ASYNC
bool
prompt "Enable asynchronous jobs support"
depends on OPENSSL_ENGINE && USE_GLIBC
help
Enables async-aware applications to be able to use OpenSSL to
initiate crypto operations asynchronously. In order to work
this will require the presence of an async capable engine.
endif

View File

@@ -0,0 +1,437 @@
#
# Copyright (C) 2006-2016 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:=openssl
PKG_VERSION:=3.0.15
PKG_RELEASE:=1
PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto
PKG_BUILD_PARALLEL:=1
PKG_BASE:=$(subst $(space),.,$(wordlist 1,2,$(subst .,$(space),$(PKG_VERSION))))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:= \
https://www.openssl.org/source/ \
https://www.openssl.org/source/old/$(PKG_BASE)/ \
https://github.com/openssl/openssl/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
PKG_HASH:=23c666d0edf20f14249b3d8f0368acaee9ab585b09e1de82107c66e1f3ec9533
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Eneas U de Queiroz <cotequeiroz@gmail.com>
PKG_CPE_ID:=cpe:/a:openssl:openssl
PKG_CONFIG_DEPENDS:= \
CONFIG_OPENSSL_ENGINE \
CONFIG_OPENSSL_ENGINE_BUILTIN \
CONFIG_OPENSSL_ENGINE_BUILTIN_AFALG \
CONFIG_OPENSSL_ENGINE_BUILTIN_DEVCRYPTO \
CONFIG_OPENSSL_ENGINE_BUILTIN_PADLOCK \
CONFIG_OPENSSL_NO_DEPRECATED \
CONFIG_OPENSSL_OPTIMIZE_SPEED \
CONFIG_OPENSSL_PREFER_CHACHA_OVER_GCM \
CONFIG_OPENSSL_SMALL_FOOTPRINT \
CONFIG_OPENSSL_WITH_ARIA \
CONFIG_OPENSSL_WITH_ASM \
CONFIG_OPENSSL_WITH_ASYNC \
CONFIG_OPENSSL_WITH_BLAKE2 \
CONFIG_OPENSSL_WITH_CAMELLIA \
CONFIG_OPENSSL_WITH_CHACHA_POLY1305 \
CONFIG_OPENSSL_WITH_CMS \
CONFIG_OPENSSL_WITH_COMPRESSION \
CONFIG_OPENSSL_WITH_DTLS \
CONFIG_OPENSSL_WITH_EC2M \
CONFIG_OPENSSL_WITH_ERROR_MESSAGES \
CONFIG_OPENSSL_WITH_IDEA \
CONFIG_OPENSSL_WITH_MDC2 \
CONFIG_OPENSSL_WITH_NPN \
CONFIG_OPENSSL_WITH_PSK \
CONFIG_OPENSSL_WITH_RFC3779 \
CONFIG_OPENSSL_WITH_SEED \
CONFIG_OPENSSL_WITH_SM234 \
CONFIG_OPENSSL_WITH_SRP \
CONFIG_OPENSSL_WITH_SSE2 \
CONFIG_OPENSSL_WITH_TLS13 \
CONFIG_OPENSSL_WITH_WHIRLPOOL
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/openssl-module.mk
ifneq ($(CONFIG_CCACHE),)
HOSTCC=$(HOSTCC_NOCACHE)
HOSTCXX=$(HOSTCXX_NOCACHE)
endif
define Package/openssl/Default
TITLE:=Open source SSL toolkit
URL:=https://www.openssl.org/
SECTION:=libs
CATEGORY:=Libraries
endef
define Package/libopenssl/config
source "$(SOURCE)/Config.in"
endef
define Package/openssl/Default/description
The OpenSSL Project is a collaborative effort to develop a robust,
commercial-grade, full-featured, and Open Source toolkit implementing the
Transport Layer Security (TLS) protocol as well as a full-strength
general-purpose cryptography library.
endef
define Package/libopenssl
$(call Package/openssl/Default)
SUBMENU:=SSL
DEPENDS:=+OPENSSL_WITH_COMPRESSION:zlib \
+OPENSSL_ENGINE_BUILTIN_AFALG:kmod-crypto-user \
+OPENSSL_ENGINE_BUILTIN_DEVCRYPTO:kmod-cryptodev \
+OPENSSL_ENGINE_BUILTIN_PADLOCK:kmod-crypto-hw-padlock \
+(arm||armeb||mips||mipsel||powerpc||arc):libatomic
TITLE+= (libraries)
ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION)))
MENU:=1
endef
define Package/libopenssl/description
$(call Package/openssl/Default/description)
This package contains the OpenSSL shared libraries, needed by other programs.
endef
define Package/openssl-util
$(call Package/openssl/Default)
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=+libopenssl +libopenssl-conf
TITLE+= (utility)
endef
define Package/openssl-util/description
$(call Package/openssl/Default/description)
This package contains the OpenSSL command-line utility.
endef
define Package/libopenssl-conf
$(call Package/openssl/Default)
SUBMENU:=SSL
TITLE:=/etc/ssl/openssl.cnf config file
DEPENDS:=libopenssl
endef
define Package/libopenssl-conf/conffiles
/etc/ssl/openssl.cnf
$(if $(CONFIG_OPENSSL_ENGINE_BUILTIN_DEVCRYPTO),/etc/ssl/modules.cnf.d/devcrypto.cnf)
$(if $(CONFIG_OPENSSL_ENGINE_BUILTIN_PADLOCK),/etc/ssl/modules.cnf.d/padlock.cnf)
endef
define Package/libopenssl-conf/description
$(call Package/openssl/Default/description)
This package installs the OpenSSL configuration file /etc/ssl/openssl.cnf.
endef
ifneq ($(CONFIG_OPENSSL_ENGINE_BUILTIN_PADLOCK)$(CONFIG_OPENSSL_ENGINE_BUILTIN_DEVCRYPTO),)
define Package/libopenssl-conf/postinst
#!/bin/sh
add_engine_config() {
if [ -z "$${IPKG_INSTROOT}" ] && uci -q get "openssl.$$1" >/dev/null; then
[ "$$(uci -q get "openssl.$$1.builtin")" = 1 ] && return
uci set "openssl.$$1.builtin=1" && uci commit openssl
return
fi
}
$(if $(CONFIG_OPENSSL_ENGINE_BUILTIN_DEVCRYPTO),add_engine_config devcrypto)
$(if $(CONFIG_OPENSSL_ENGINE_BUILTIN_PADLOCK),add_engine_config padlock)
endef
endif
$(eval $(call Package/openssl/add-provider,legacy))
define Package/libopenssl-legacy
$(call Package/openssl/Default)
$(call Package/openssl/module/Default)
TITLE:=OpenSSL legacy provider
endef
define Package/libopenssl-legacy/description
The OpenSSL legacy provider supplies OpenSSL implementations of algorithms that
have been deemed legacy. Such algorithms have commonly fallen out of use, have
been deemed insecure by the cryptography community, or something similar. See
https://www.openssl.org/docs/man3.0/man7/OSSL_PROVIDER-legacy.html
endef
$(eval $(call Package/openssl/add-engine,afalg))
define Package/libopenssl-afalg
$(call Package/openssl/Default)
$(call Package/openssl/engine/Default)
TITLE:=AFALG hardware acceleration engine
DEPENDS += @KERNEL_AIO +PACKAGE_libopenssl-afalg:kmod-crypto-user \
@!OPENSSL_ENGINE_BUILTIN
endef
define Package/libopenssl-afalg/description
This package adds an engine that enables hardware acceleration
through the AF_ALG kernel interface.
See https://www.openssl.org/docs/man3.0/man5/config.html#Engine-Configuration
and https://openwrt.org/docs/techref/hardware/cryptographic.hardware.accelerators
The engine_id is "afalg"
endef
$(eval $(call Package/openssl/add-engine,devcrypto))
define Package/libopenssl-devcrypto
$(call Package/openssl/Default)
$(call Package/openssl/engine/Default)
TITLE:=/dev/crypto hardware acceleration engine
DEPENDS += +PACKAGE_libopenssl-devcrypto:kmod-cryptodev @!OPENSSL_ENGINE_BUILTIN
endef
define Package/libopenssl-devcrypto/description
This package adds an engine that enables hardware acceleration
through the /dev/crypto kernel interface.
See https://www.openssl.org/docs/man3.0/man5/config.html#Engine-Configuration
and https://openwrt.org/docs/techref/hardware/cryptographic.hardware.accelerators
The engine_id is "devcrypto"
endef
$(eval $(call Package/openssl/add-engine,padlock))
define Package/libopenssl-padlock
$(call Package/openssl/Default)
$(call Package/openssl/engine/Default)
TITLE:=VIA Padlock hardware acceleration engine
DEPENDS += @TARGET_x86 +PACKAGE_libopenssl-padlock:kmod-crypto-hw-padlock \
@!OPENSSL_ENGINE_BUILTIN
endef
define Package/libopenssl-padlock/description
This package adds an engine that enables VIA Padlock hardware acceleration.
See https://www.openssl.org/docs/man3.0/man5/config.html#Engine-Configuration
and https://openwrt.org/docs/techref/hardware/cryptographic.hardware.accelerators
The engine_id is "padlock"
endef
OPENSSL_OPTIONS:= shared no-tests
ifndef CONFIG_OPENSSL_WITH_BLAKE2
OPENSSL_OPTIONS += no-blake2
endif
ifndef CONFIG_OPENSSL_WITH_CHACHA_POLY1305
OPENSSL_OPTIONS += no-chacha no-poly1305
else
ifdef CONFIG_OPENSSL_PREFER_CHACHA_OVER_GCM
OPENSSL_OPTIONS += -DOPENSSL_PREFER_CHACHA_OVER_GCM
endif
endif
ifndef CONFIG_OPENSSL_WITH_ASYNC
OPENSSL_OPTIONS += no-async
endif
ifndef CONFIG_OPENSSL_WITH_EC2M
OPENSSL_OPTIONS += no-ec2m
endif
ifndef CONFIG_OPENSSL_WITH_ERROR_MESSAGES
OPENSSL_OPTIONS += no-err
endif
ifndef CONFIG_OPENSSL_WITH_TLS13
OPENSSL_OPTIONS += no-tls1_3
endif
ifndef CONFIG_OPENSSL_WITH_ARIA
OPENSSL_OPTIONS += no-aria
endif
ifndef CONFIG_OPENSSL_WITH_SM234
OPENSSL_OPTIONS += no-sm2 no-sm3 no-sm4
endif
ifndef CONFIG_OPENSSL_WITH_CAMELLIA
OPENSSL_OPTIONS += no-camellia
endif
ifndef CONFIG_OPENSSL_WITH_IDEA
OPENSSL_OPTIONS += no-idea
endif
ifndef CONFIG_OPENSSL_WITH_SEED
OPENSSL_OPTIONS += no-seed
endif
ifndef CONFIG_OPENSSL_WITH_MDC2
OPENSSL_OPTIONS += no-mdc2
endif
ifndef CONFIG_OPENSSL_WITH_WHIRLPOOL
OPENSSL_OPTIONS += no-whirlpool
endif
ifndef CONFIG_OPENSSL_WITH_CMS
OPENSSL_OPTIONS += no-cms
endif
ifndef CONFIG_OPENSSL_WITH_RFC3779
OPENSSL_OPTIONS += no-rfc3779
endif
ifdef CONFIG_OPENSSL_NO_DEPRECATED
OPENSSL_OPTIONS += no-deprecated
endif
ifeq ($(CONFIG_OPENSSL_OPTIMIZE_SPEED),y)
TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS)) -O3
endif
ifeq ($(CONFIG_OPENSSL_SMALL_FOOTPRINT),y)
OPENSSL_OPTIONS += -DOPENSSL_SMALL_FOOTPRINT
endif
ifdef CONFIG_OPENSSL_ENGINE
ifdef CONFIG_OPENSSL_ENGINE_BUILTIN
OPENSSL_OPTIONS += disable-dynamic-engine
ifndef CONFIG_OPENSSL_ENGINE_BUILTIN_AFALG
OPENSSL_OPTIONS += no-afalgeng
endif
ifdef CONFIG_OPENSSL_ENGINE_BUILTIN_DEVCRYPTO
OPENSSL_OPTIONS += enable-devcryptoeng
endif
ifndef CONFIG_OPENSSL_ENGINE_BUILTIN_PADLOCK
OPENSSL_OPTIONS += no-padlockeng
endif
else
ifdef CONFIG_PACKAGE_libopenssl-devcrypto
OPENSSL_OPTIONS += enable-devcryptoeng
endif
ifndef CONFIG_PACKAGE_libopenssl-afalg
OPENSSL_OPTIONS += no-afalgeng
endif
ifndef CONFIG_PACKAGE_libopenssl-padlock
OPENSSL_OPTIONS += no-padlockeng
endif
endif
else
OPENSSL_OPTIONS += no-engine
endif
ifndef CONFIG_OPENSSL_WITH_DTLS
OPENSSL_OPTIONS += no-dtls
endif
ifdef CONFIG_OPENSSL_WITH_COMPRESSION
OPENSSL_OPTIONS += zlib-dynamic
else
OPENSSL_OPTIONS += no-comp
endif
ifndef CONFIG_OPENSSL_WITH_NPN
OPENSSL_OPTIONS += no-nextprotoneg
endif
ifndef CONFIG_OPENSSL_WITH_PSK
OPENSSL_OPTIONS += no-psk
endif
ifndef CONFIG_OPENSSL_WITH_SRP
OPENSSL_OPTIONS += no-srp
endif
ifndef CONFIG_OPENSSL_WITH_ASM
OPENSSL_OPTIONS += no-asm
endif
ifdef CONFIG_i386
ifndef CONFIG_OPENSSL_WITH_SSE2
OPENSSL_OPTIONS += no-sse2
endif
endif
OPENSSL_TARGET:=linux-$(call qstrip,$(CONFIG_ARCH))-openwrt
STAMP_CONFIGURED := $(STAMP_CONFIGURED)_$(shell echo $(OPENSSL_OPTIONS) | $(MKHASH) md5)
define Build/Configure
(cd $(PKG_BUILD_DIR); \
./Configure $(OPENSSL_TARGET) \
--prefix=/usr \
--libdir=lib \
--openssldir=/etc/ssl \
--cross-compile-prefix="$(TARGET_CROSS)" \
$(TARGET_CFLAGS) \
$(TARGET_CPPFLAGS) \
$(TARGET_LDFLAGS) \
$(OPENSSL_OPTIONS) && \
{ [ -f $(STAMP_CONFIGURED) ] || make clean; } \
)
endef
TARGET_CFLAGS += $(FPIC)
define Build/Compile
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
CC="$(TARGET_CC)" \
SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \
OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \
$(OPENSSL_MAKEFLAGS) \
all
$(MAKE) -C $(PKG_BUILD_DIR) \
CC="$(TARGET_CC)" \
DESTDIR="$(PKG_INSTALL_DIR)" \
$(OPENSSL_MAKEFLAGS) \
install_sw install_ssldirs
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/openssl $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{crypto,ssl}.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/{openssl,libcrypto,libssl}.pc $(1)/usr/lib/pkgconfig/
[ -n "$(TARGET_LDFLAGS)" ] && $(SED) 's#$(TARGET_LDFLAGS)##g' $(1)/usr/lib/pkgconfig/{openssl,libcrypto,libssl}.pc || true
endef
define Package/libopenssl/install
$(INSTALL_DIR) $(1)/etc/ssl/certs
$(INSTALL_DIR) $(1)/etc/ssl/private
chmod 0700 $(1)/etc/ssl/private
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libcrypto.so.* $(1)/usr/lib/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libssl.so.* $(1)/usr/lib/
$(if $(CONFIG_OPENSSL_ENGINE),$(INSTALL_DIR) $(1)/usr/lib/$(ENGINES_DIR))
endef
define Package/libopenssl-conf/install
$(INSTALL_DIR) $(1)/etc/ssl/modules.cnf.d $(1)/etc/config $(1)/etc/init.d
$(CP) $(PKG_INSTALL_DIR)/etc/ssl/openssl.cnf $(1)/etc/ssl/
$(INSTALL_BIN) ./files/openssl.init $(1)/etc/init.d/openssl
$(SED) 's!%ENGINES_DIR%!/usr/lib/$(ENGINES_DIR)!' $(1)/etc/init.d/openssl
touch $(1)/etc/config/openssl
$(if $(CONFIG_OPENSSL_ENGINE),,
$(SED) 's!engines = engines_sect!#&!' $(1)/etc/ssl/openssl.cnf)
$(if $(CONFIG_OPENSSL_ENGINE_BUILTIN_DEVCRYPTO),
$(CP) ./files/devcrypto.cnf $(1)/etc/ssl/modules.cnf.d/
echo -e "config engine 'devcrypto'\n\toption enabled '1'\n\toption builtin '1'" >> $(1)/etc/config/openssl)
$(if $(CONFIG_OPENSSL_ENGINE_BUILTIN_PADLOCK),
$(CP) ./files/padlock.cnf $(1)/etc/ssl/modules.cnf.d/
echo -e "\nconfig engine 'padlock'\n\toption enabled '1'\n\toption builtin '1'" >> $(1)/etc/config/openssl)
endef
define Package/openssl-util/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/openssl $(1)/usr/bin/
endef
$(eval $(call BuildPackage,libopenssl))
$(eval $(call BuildPackage,libopenssl-conf))
$(eval $(call BuildPackage,libopenssl-afalg))
$(eval $(call BuildPackage,libopenssl-devcrypto))
$(eval $(call BuildPackage,libopenssl-legacy))
$(eval $(call BuildPackage,libopenssl-padlock))
$(eval $(call BuildPackage,openssl-util))

View File

@@ -0,0 +1,3 @@
[afalg_sect]
default_algorithms = ALL

View File

@@ -0,0 +1,34 @@
[devcrypto_sect]
# Leave this alone and configure algorithms with CIPERS/DIGESTS below
default_algorithms = ALL
# Configuration commands:
# Run 'openssl engine -t -c -vv -pre DUMP_INFO devcrypto' to see a
# list of supported algorithms, along with their driver, whether they
# are hw accelerated or not, and the engine's configuration commands.
# USE_SOFTDRIVERS: specifies whether to use software (not accelerated)
# drivers (0=use only accelerated drivers, 1=allow all drivers, 2=use
# if acceleration can't be determined) [default=2]
#USE_SOFTDRIVERS = 2
# CIPHERS: either ALL, NONE, or a comma-separated list of ciphers to
# enable [default=ALL]
# It is recommended to disable the ECB ciphers; in most cases, it will
# only be used for PRNG, in small blocks, where performance is poor,
# and there may be problems with apps forking with open crypto
# contexts, leading to failures. The CBC ciphers work well.
CIPHERS=DES-CBC, DES-EDE3-CBC, AES-128-CBC, AES-192-CBC, AES-256-CBC, \
AES-128-CTR, AES-192-CTR, AES-256-CTR
# DIGESTS: either ALL, NONE, or a comma-separated list of digests to
# enable [default=NONE]
# It is strongly recommended not to enable digests; their performance
# is poor, and there are many cases in which they will not work,
# especially when calling fork with open crypto contexts. Openssh,
# for example, does this, and you may not be able to login.
# Sysupgrade will fail as well. If you're adventurous enough to change
# this, you should change it back to NONE, and reboot before running
# sysupgrade!
DIGESTS = NONE

View File

@@ -0,0 +1,3 @@
[legacy_sect]
activate = 1

View File

@@ -0,0 +1,72 @@
#!/bin/sh /etc/rc.common
START=13
ENGINES_CNF=/var/etc/ssl/engines.cnf
ENGINES_DIR=%ENGINES_DIR%
MODULES_DIR=/usr/lib/ossl-modules
PROVIDERS_CNF=/var/etc/ssl/providers.cnf
#1: cnf file
write_cnf_header() {
mkdir -p "$(dirname "$1")" && \
echo "# This file is automatically generated from /etc/config/openssl." >"$1" || {
echo "Error writing to $1."
return 1
}
}
#1: module name
#2: output cnf file
#3: module.so
enable_module() {
local builtin enabled force
config_get_bool builtin "$1" builtin 0
config_get_bool enabled "$1" enabled 1
config_get_bool force "$1" force 0
if [ "$enabled" = 0 ]; then
[ "$builtin" = 0 ] && return 1
echo "Engine $1 is built into the libcrypto library and can't be disabled through UCI."
echo "If the engine was not built-in, remove 'config builtin' from /etc/config/openssl."
elif [ "$force" = 1 ]; then
printf "[Forced] "
elif ! grep -q "\\[ *$1_sect *]" /etc/ssl/modules.cnf.d/*; then
echo "$1: Could not find section [$1] in config files."
return 1
elif [ "$builtin" = 1 ]; then
printf "[Builtin] "
elif [ ! -f "$3" ];then
echo "Skipping $1: $3 not found."
return 1
fi
echo "Enabling $1"
echo "$1=$1_sect" >>"$2"
}
config_engine() {
enable_module "$1" "$ENGINES_CNF" \
"${ENGINES_DIR}/${1}.so"
}
config_provider() {
enable_module "$1" "$PROVIDERS_CNF" \
"${MODULES_DIR}/${1}.so"
}
start() {
local ret=0
config_load openssl
echo Generating engines.cnf
write_cnf_header "${ENGINES_CNF}" && \
config_foreach config_engine engine || ret=$?
echo Generating providers.cnf
write_cnf_header "${PROVIDERS_CNF}" && \
config_foreach config_provider provider || ret=$?
return $ret
}

View File

@@ -0,0 +1,3 @@
[padlock_sect]
default_algorithms = ALL

View File

@@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
Date: Thu, 27 Sep 2018 08:29:21 -0300
Subject: Do not use host kernel version to disable AFALG
This patch prevents the Configure script from using the host kernel
version to disable building the AFALG engine on openwrt targets.
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
--- a/Configure
+++ b/Configure
@@ -1677,7 +1677,9 @@ $config{CFLAGS} = [ map { $_ eq '--ossl-
unless ($disabled{afalgeng}) {
$config{afalgeng}="";
- if (grep { $_ eq 'afalgeng' } @{$target{enable}}) {
+ if ($target =~ m/openwrt$/) {
+ push @{$config{engdirs}}, "afalg";
+ } elsif (grep { $_ eq 'afalgeng' } @{$target{enable}}) {
my $minver = 4*10000 + 1*100 + 0;
if ($config{CROSS_COMPILE} eq "") {
my $verstr = `uname -r`;

View File

@@ -0,0 +1,71 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
Date: Thu, 27 Sep 2018 08:30:24 -0300
Subject: Add openwrt targets
Targets are named: linux-$(CONFIG_ARCH)-openwrt
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
--- /dev/null
+++ b/Configurations/25-openwrt.conf
@@ -0,0 +1,59 @@
+## Openwrt "CONFIG_ARCH" matching targets.
+
+# The targets need to end in '-openwrt' for the AFALG patch to work
+
+my %targets = (
+ "openwrt" => {
+ template => 1,
+ CFLAGS => add("\$(OPENWRT_OPTIMIZATION_FLAGS)"),
+ },
+ "linux-aarch64-openwrt" => {
+ inherit_from => [ "linux-aarch64", "openwrt" ],
+ },
+ "linux-arc-openwrt" => {
+ inherit_from => [ "linux-latomic", "openwrt" ],
+ },
+ "linux-arm-openwrt" => {
+ inherit_from => [ "linux-armv4", "openwrt" ],
+ },
+ "linux-armeb-openwrt" => {
+ inherit_from => [ "linux-armv4", "openwrt" ],
+ },
+ "linux-i386-openwrt" => {
+ inherit_from => [ "linux-x86", "openwrt" ],
+ },
+ "linux-loongarch64-openwrt" => {
+ inherit_from => [ "linux64-loongarch64", "openwrt" ],
+ },
+ "linux-mips-openwrt" => {
+ inherit_from => [ "linux-mips32", "openwrt" ],
+ },
+ "linux-mips64-openwrt" => {
+ inherit_from => [ "linux64-mips64", "openwrt" ],
+ },
+ "linux-mips64el-openwrt" => {
+ inherit_from => [ "linux64-mips64", "openwrt" ],
+ },
+ "linux-mipsel-openwrt" => {
+ inherit_from => [ "linux-mips32", "openwrt" ],
+ },
+ "linux-powerpc-openwrt" => {
+ inherit_from => [ "linux-ppc", "openwrt" ],
+ },
+ "linux-powerpc64-openwrt" => {
+ inherit_from => [ "linux-ppc64", "openwrt" ],
+ perlasm_scheme => "linux64v2",
+ },
+ "linux-riscv64-openwrt" => {
+ inherit_from => [ "linux-generic64", "openwrt" ],
+ perlasm_scheme => "linux64",
+ },
+ "linux-x86_64-openwrt" => {
+ inherit_from => [ "linux-x86_64", "openwrt" ],
+ },
+
+### Basic default option
+ "linux-generic32-openwrt" => {
+ inherit_from => [ "linux-generic32", "openwrt" ],
+ },
+);

View File

@@ -0,0 +1,21 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
Date: Thu, 27 Sep 2018 08:31:38 -0300
Subject: Avoid exposing build directories
The CFLAGS contain the build directories, and are shown by calling
OpenSSL_version(OPENSSL_CFLAGS), or running openssl version -a
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
--- a/crypto/build.info
+++ b/crypto/build.info
@@ -109,7 +109,7 @@ DEFINE[../libcrypto]=$UPLINKDEF
DEPEND[info.o]=buildinf.h
DEPEND[cversion.o]=buildinf.h
-GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q)" "$(PLATFORM)"
+GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(filter-out -I% -iremap% -fmacro-prefix-map% -ffile-prefix-map%,$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q))" "$(PLATFORM)"
GENERATE[uplink-x86.S]=../ms/uplink-x86.pl
GENERATE[uplink-x86_64.s]=../ms/uplink-x86_64.pl

View File

@@ -0,0 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
Date: Thu, 27 Sep 2018 08:34:38 -0300
Subject: Do not build tests and fuzz directories
This shortens build time.
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
--- a/build.info
+++ b/build.info
@@ -1,7 +1,7 @@
# Note that some of these directories are filtered in Configure. Look for
# %skipdir there for further explanations.
-SUBDIRS=crypto ssl apps util tools fuzz providers doc
+SUBDIRS=crypto ssl apps util tools providers
IF[{- !$disabled{tests} -}]
SUBDIRS=test
ENDIF

View File

@@ -0,0 +1,92 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
Date: Thu, 27 Sep 2018 08:44:39 -0300
Subject: Add OPENSSL_PREFER_CHACHA_OVER_GCM option
This enables a compile-time option to prefer ChaCha20-Poly1305 over
AES-GCM in the openssl default ciphersuite, which is useful in systems
without AES specific CPU instructions.
OPENSSL_PREFER_CHACHA_OVER_GCM must be defined to enable it.
Note that this does not have the same effect as the
SL_OP_PRIORITIZE_CHACHA option, which prioritizes ChaCha20-Poly1305 only
when the client has it on top of its ciphersuite preference.
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
--- a/ssl/ssl_ciph.c
+++ b/ssl/ssl_ciph.c
@@ -1506,11 +1506,29 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head,
&tail);
+ /*
+ * If OPENSSL_PREFER_CHACHA_OVER_GCM is defined, ChaCha20_Poly1305
+ * will be placed before AES-256. Otherwise, the default behavior of
+ * preferring GCM over CHACHA is used.
+ * This is useful for systems that do not have AES-specific CPU
+ * instructions, where ChaCha20-Poly1305 is 3 times faster than AES.
+ * Note that this does not have the same effect as the SSL_OP_PRIORITIZE_CHACHA
+ * option, which prioritizes ChaCha20-Poly1305 only when the client has it on top
+ * of its ciphersuite preference.
+ */
+
+#ifdef OPENSSL_PREFER_CHACHA_OVER_GCM
+ ssl_cipher_apply_rule(0, 0, 0, SSL_CHACHA20, 0, 0, 0, CIPHER_ADD, -1,
+ &head, &tail);
+ ssl_cipher_apply_rule(0, 0, 0, SSL_AESGCM, 0, 0, 0, CIPHER_ADD, -1,
+ &head, &tail);
+#else
/* Within each strength group, we prefer GCM over CHACHA... */
ssl_cipher_apply_rule(0, 0, 0, SSL_AESGCM, 0, 0, 0, CIPHER_ADD, -1,
&head, &tail);
ssl_cipher_apply_rule(0, 0, 0, SSL_CHACHA20, 0, 0, 0, CIPHER_ADD, -1,
&head, &tail);
+#endif
/*
* ...and generally, our preferred cipher is AES.
@@ -1565,7 +1583,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
* Within each group, ciphers remain sorted by strength and previous
* preference, i.e.,
* 1) ECDHE > DHE
- * 2) GCM > CHACHA
+ * 2) GCM > CHACHA, reversed if OPENSSL_PREFER_CHACHA_OVER_GCM is defined
* 3) AES > rest
* 4) TLS 1.2 > legacy
*
@@ -2236,7 +2254,13 @@ const char *OSSL_default_cipher_list(voi
*/
const char *OSSL_default_ciphersuites(void)
{
+#ifdef OPENSSL_PREFER_CHACHA_OVER_GCM
+ return "TLS_CHACHA20_POLY1305_SHA256:"
+ "TLS_AES_256_GCM_SHA384:"
+ "TLS_AES_128_GCM_SHA256";
+#else
return "TLS_AES_256_GCM_SHA384:"
"TLS_CHACHA20_POLY1305_SHA256:"
"TLS_AES_128_GCM_SHA256";
+#endif
}
--- a/include/openssl/ssl.h.in
+++ b/include/openssl/ssl.h.in
@@ -195,9 +195,15 @@ extern "C" {
* DEPRECATED IN 3.0.0, in favor of OSSL_default_ciphersuites()
* Update both macro and function simultaneously
*/
-# define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
- "TLS_CHACHA20_POLY1305_SHA256:" \
- "TLS_AES_128_GCM_SHA256"
+# ifdef OPENSSL_PREFER_CHACHA_OVER_GCM
+# define TLS_DEFAULT_CIPHERSUITES "TLS_CHACHA20_POLY1305_SHA256:" \
+ "TLS_AES_256_GCM_SHA384:" \
+ "TLS_AES_128_GCM_SHA256"
+# else
+# define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
+ "TLS_CHACHA20_POLY1305_SHA256:" \
+ "TLS_AES_128_GCM_SHA256"
+# endif
# endif
/*
* As of OpenSSL 1.0.0, ssl_create_cipher_list() in ssl/ssl_ciph.c always

View File

@@ -0,0 +1,41 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cotequeiroz@gmail.com>
Date: Sat, 27 Mar 2021 17:43:25 -0300
Subject: openssl.cnf: add engine configuration
This adds configuration options for engines, loading all cnf files under
/etc/ssl/engines.cnf.d/.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
--- a/apps/openssl.cnf
+++ b/apps/openssl.cnf
@@ -52,10 +52,13 @@ tsa_policy3 = 1.2.3.4.5.7
[openssl_init]
providers = provider_sect
+engines = engines_sect
# List of providers to load
[provider_sect]
default = default_sect
+.include /var/etc/ssl/providers.cnf
+
# The fips section name should match the section name inside the
# included fipsmodule.cnf.
# fips = fips_sect
@@ -69,7 +72,13 @@ default = default_sect
# OpenSSL may not work correctly which could lead to significant system
# problems including inability to remotely access the system.
[default_sect]
-# activate = 1
+activate = 1
+
+[engines_sect]
+.include /var/etc/ssl/engines.cnf
+
+.include /etc/ssl/modules.cnf.d
+
####################################################################

View File

@@ -0,0 +1,41 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
Date: Mon, 11 Mar 2019 09:29:13 -0300
Subject: e_devcrypto: default to not use digests in engine
Digests are almost always slower when using /dev/crypto because of the
cost of the context switches. Only for large blocks it is worth it.
Also, when forking, the open context structures are duplicated, but the
internal kernel sessions are still shared between forks, which means an
update/close operation in one fork affects all processes using that
session.
This affects digests, especially for HMAC, where the session with the
key hash is used as a source for subsequent operations. At least one
popular application does this across a fork. Disabling digests by
default will mitigate the problem, while still allowing the user to
turn them on if it is safe and fast enough.
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
--- a/engines/e_devcrypto.c
+++ b/engines/e_devcrypto.c
@@ -905,7 +905,7 @@ static void prepare_digest_methods(void)
for (i = 0, known_digest_nids_amount = 0; i < OSSL_NELEM(digest_data);
i++) {
- selected_digests[i] = 1;
+ selected_digests[i] = 0;
/*
* Check that the digest is usable
@@ -1119,7 +1119,7 @@ static const ENGINE_CMD_DEFN devcrypto_c
#ifdef IMPLEMENT_DIGEST
{DEVCRYPTO_CMD_DIGESTS,
"DIGESTS",
- "either ALL, NONE, or a comma-separated list of digests to enable [default=ALL]",
+ "either ALL, NONE, or a comma-separated list of digests to enable [default=NONE]",
ENGINE_CMD_FLAG_STRING},
#endif

View File

@@ -0,0 +1,24 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
Date: Mon, 11 Mar 2019 10:15:14 -0300
Subject: e_devcrypto: ignore error when closing session
In cipher_init, ignore an eventual error when closing the previous
session. It may have been closed by another process after a fork.
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
--- a/engines/e_devcrypto.c
+++ b/engines/e_devcrypto.c
@@ -211,9 +211,8 @@ static int cipher_init(EVP_CIPHER_CTX *c
int ret;
/* cleanup a previous session */
- if (cipher_ctx->sess.ses != 0 &&
- clean_devcrypto_session(&cipher_ctx->sess) == 0)
- return 0;
+ if (cipher_ctx->sess.ses != 0)
+ clean_devcrypto_session(&cipher_ctx->sess);
cipher_ctx->sess.cipher = cipher_d->devcryptoid;
cipher_ctx->sess.keylen = cipher_d->keylen;

View File

@@ -0,0 +1,30 @@
config PCRE2_JIT_ENABLED
bool
depends on PACKAGE_libpcre2 && (aarch64 || aarch64_be || arm || i386 || i686 || x86_64 || mips || mipsel || mips64 || mips64el || powerpc || powerpc64 || powerpcle || sparc)
default y if (arm || i686 || x86_64)
prompt "Enable JIT compiler support"
help
Enable JIT (Just-In-Time) compiler support.
Just-in-time compiling is a heavyweight optimization that can greatly
speed up pattern matching. However, it comes at the cost of extra
processing before the match is performed, so it is of most benefit when
the same pattern is going to be matched many times. This does not
necessarily mean many calls of a matching function; if the pattern is
not anchored, matching attempts may take place many times at various
positions in the subject, even for a single call. Therefore, if the
subject string is very long, it may still pay to use JIT even for
one-off matches. JIT support is available for all of the 8-bit, 16-bit
and 32-bit PCRE2 libraries and adds about 100KB to the resulting
libpcre2.so. JIT support applies only to the traditional Perl-compatible
matching function. It does not apply when the DFA matching function is
being used.
Enabling this option can give an about 10x performance increase on JIT
operations. It can be desireable for e.g. high performance Apache
mod_rewrite or HA-Proxy reqrep operations.
However, JIT should _only_ be enabled on architectures that are supported.
Enabling JIT on unsupported platforms will result in a compilation
failure. A list of supported architectures can be found here:
https://pcre.org/current/doc/html/pcre2jit.html#SEC2

109
package/libs/pcre2/Makefile Normal file
View File

@@ -0,0 +1,109 @@
#
# Copyright (C) 2017 Shane Peelar
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=pcre2
PKG_VERSION:=10.42
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/PCRE2Project/pcre2/releases/download/$(PKG_NAME)-$(PKG_VERSION)
PKG_HASH:=8d36cd8cb6ea2a4c2bb358ff6411b0c788633a2a45dabbf1aeb4b701d1b5e840
PKG_MAINTAINER:=Shane Peelar <lookatyouhacker@gmail.com>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENCE
PKG_CPE_ID:=cpe:/a:pcre:pcre2
PKG_CONFIG_DEPENDS:=\
CONFIG_PACKAGE_libpcre2-16 \
CONFIG_PACKAGE_libpcre2-32 \
CONFIG_PCRE2_JIT_ENABLED
PKG_BUILD_DEPENDS:=zlib
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/libpcre2/default
SECTION:=libs
CATEGORY:=Libraries
URL:=https://www.pcre.org/
endef
define Package/libpcre2/config
source "$(SOURCE)/Config.in"
endef
define Package/libpcre2
$(call Package/libpcre2/default)
TITLE:=A Perl Compatible Regular Expression library
endef
define Package/libpcre2-16
$(call Package/libpcre2/default)
TITLE:=A Perl Compatible Regular Expression library (16bit support)
endef
define Package/libpcre2-32
$(call Package/libpcre2/default)
TITLE:=A Perl Compatible Regular Expression library (32bit support)
endef
CMAKE_HOST_OPTIONS += \
-DBUILD_SHARED_LIBS=OFF \
-DPCRE2_BUILD_PCRE2_8=ON \
-DPCRE2_BUILD_PCRE2_16=ON \
-DPCRE2_BUILD_PCRE2_32=ON \
-DPCRE2_DEBUG=OFF \
-DPCRE2_DISABLE_PERCENT_ZT=ON \
-DPCRE2_SUPPORT_JIT=OFF \
-DPCRE2_SHOW_REPORT=OFF \
-DPCRE2_BUILD_PCRE2GREP=OFF \
-DPCRE2_BUILD_TESTS=OFF \
-DPCRE2_STATIC_PIC=ON
CMAKE_OPTIONS += \
-DBUILD_SHARED_LIBS=ON \
-DPCRE2_BUILD_PCRE2_8=ON \
-DPCRE2_BUILD_PCRE2_16=O$(if $(CONFIG_PACKAGE_libpcre2-16),N,FF) \
-DPCRE2_BUILD_PCRE2_32=O$(if $(CONFIG_PACKAGE_libpcre2-32),N,FF) \
-DPCRE2_DEBUG=OFF \
-DPCRE2_DISABLE_PERCENT_ZT=ON \
-DPCRE2_SUPPORT_JIT=O$(if $(CONFIG_PCRE2_JIT_ENABLED),N,FF) \
-DPCRE2_SHOW_REPORT=OFF \
-DPCRE2_BUILD_PCRE2GREP=OFF \
-DPCRE2_BUILD_TESTS=OFF
define Build/InstallDev
$(call Build/InstallDev/cmake,$(1))
$(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' $(1)/usr/bin/pcre2-config
$(INSTALL_DIR) $(2)/bin
$(LN) ../../usr/bin/pcre2-config $(2)/bin/pcre2-config
endef
define Package/libpcre2/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre2-{8,posix}.so* $(1)/usr/lib/
endef
define Package/libpcre2-16/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre2-16.so* $(1)/usr/lib/
endef
define Package/libpcre2-32/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre2-32.so* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libpcre2))
$(eval $(call BuildPackage,libpcre2-16))
$(eval $(call BuildPackage,libpcre2-32))
$(eval $(call HostBuild))

View File

@@ -0,0 +1,55 @@
#
# Copyright (C) 2006-2010 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:=popt
PKG_VERSION:=1.19
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://ftp.rpm.org/popt/releases/popt-1.x/
PKG_HASH:=c25a4838fc8e4c1c8aacb8bd620edb3084a3d63bf8987fdad3ca2758c63240f9
PKG_LICENSE:=MIT
PKG_CPE_ID:=cpe:/a:popt_project:popt
PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=autogen.sh aclocal.m4
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
TARGET_CFLAGS += $(FPIC)
define Package/libpopt
SECTION:=libs
CATEGORY:=Libraries
TITLE:=A command line option parsing library
URL:=https://github.com/rpm-software-management/popt
ABI_VERSION:=0
endef
CONFIGURE_ARGS += --enable-shared --enable-static
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/popt.h $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpopt.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/popt.pc $(1)/usr/lib/pkgconfig/
endef
define Package/libpopt/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpopt.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libpopt))

View File

@@ -0,0 +1,26 @@
From 19d21b2d9e5aea5f73b1709b3c7803f920471146 Mon Sep 17 00:00:00 2001
From: Nick Hainke <vincent@systemli.org>
Date: Sun, 25 Sep 2022 11:52:29 +0200
Subject: [PATCH] configure.ac: remove require gettext version
This breaks compilation with OpenWrt:
./configure: line 13059: syntax error near unexpected token `0.19.8'
./configure: line 13059: `AM_GNU_GETTEXT_REQUIRE_VERSION(0.19.8)'
Fixes: bf8dd64e8aa0 ("Update gettext autoconf usage")
Signed-off-by: Nick Hainke <vincent@systemli.org>
---
configure.ac | 1 -
1 file changed, 1 deletion(-)
--- a/configure.ac
+++ b/configure.ac
@@ -53,7 +53,6 @@ AC_SEARCH_LIBS([setreuid], [ucb])
AC_CHECK_FUNCS([getuid geteuid iconv mtrace secure_getenv __secure_getenv setreuid setuid stpcpy strerror vasprintf srandom glob_pattern_p mbsrtowcs])
AM_GNU_GETTEXT_VERSION([0.19.8])
-AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.8])
AM_GNU_GETTEXT([external])
AM_ICONV_LINK

View File

@@ -0,0 +1,76 @@
#
# Copyright (C) 2006-2014 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:=readline
PKG_VERSION:=8.2
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/readline
PKG_HASH:=3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:gnu:readline
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
HOST_BUILD_DEPENDS:=ncurses/host
define Package/libreadline
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Command lines edition library
DEPENDS:=+libncursesw
URL:=http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
ABI_VERSION:=8
endef
define Package/libreadline/description
The Readline library provides a set of functions for use by applications
that allow users to edit command lines as they are typed in. Both Emacs
and vi editing modes are available. The Readline library includes
additional functions to maintain a list of previously-entered command
lines, to recall and perhaps reedit those lines, and perform csh-like
history expansion on previous commands.
endef
HOST_CONFIGURE_ARGS += --disable-shared --with-pic
CONFIGURE_ARGS += --with-curses --disable-install-examples
HOST_CONFIGURE_VARS += \
bash_cv_termcap_lib=libncurses
CONFIGURE_VARS += \
bash_cv_wcwidth_broken=no \
bash_cv_func_sigsetjmp=yes \
bash_cv_termcap_lib=libncursesw
TARGET_CFLAGS += $(FPIC)
HOST_CFLAGS += $(FPIC)
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/readline $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{history,readline}.{a,so*} $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/readline.pc $(1)/usr/lib/pkgconfig/
endef
define Package/libreadline/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{history,readline}.so* $(1)/usr/lib/
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,libreadline))

View File

@@ -0,0 +1,16 @@
link readline directly to ncurses since it needs symbols from it
upstream readline does this on purpose (no direct linking), but
it doesn't make much sense in a Linux world
--- a/support/shobj-conf
+++ b/support/shobj-conf
@@ -42,7 +42,7 @@ SHOBJ_XLDFLAGS=
SHOBJ_LIBS=
SHLIB_XLDFLAGS=
-SHLIB_LIBS=
+SHLIB_LIBS=-lncurses
SHLIB_DOT='.'
SHLIB_LIBPREF='lib'

View File

@@ -0,0 +1,20 @@
--- a/configure
+++ b/configure
@@ -7305,6 +7305,9 @@ TERMCAP_DEP=
elif test $bash_cv_termcap_lib = libncurses; then
TERMCAP_LIB=-lncurses
TERMCAP_DEP=
+elif test $bash_cv_termcap_lib = libncursesw; then
+TERMCAP_LIB=-lncursesw
+TERMCAP_DEP=
elif test $bash_cv_termcap_lib = libc; then
TERMCAP_LIB=
TERMCAP_DEP=
@@ -7340,6 +7343,7 @@ case "$TERMCAP_LIB" in
-ltinfo) TERMCAP_PKG_CONFIG_LIB=tinfo ;;
-lcurses) TERMCAP_PKG_CONFIG_LIB=ncurses ;;
-lncurses) TERMCAP_PKG_CONFIG_LIB=ncurses ;;
+-lncursesw) TERMCAP_PKG_CONFIG_LIB=ncursesw ;;
-ltermcap) TERMCAP_PKG_CONFIG_LIB=termcap ;;
*) TERMCAP_PKG_CONFIG_LIB=termcap ;;
esac

Some files were not shown because too many files have changed in this diff Show More