treewide: sync with upstream (#10750)

* build: fix incomplete initramfs compression options

Requires: tools/lz4, tools/lzop

complete the wiring so that these options work:
* `CONFIG_KERNEL_INITRAMFS_COMPRESSION_LZO`
* `CONFIG_KERNEL_INITRAMFS_COMPRESSION_LZ4`

Signed-off-by: Tony Butler <spudz76@gmail.com>
[remove blocking dependencies for separate ramdisk, fix lzop options]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>

* include: sync with upstream

* toolchain/binutils: add support for version 2.40

Release notes:
    https://sourceware.org/pipermail/binutils/2023-January/125671.html

Signed-off-by: Linhui Liu <liulinhui36@gmail.com>

* toolchain/gcc: switch to version 12 by default

Also fix build error with gcc 12.

* toolchain/nasm: update to 2.16.01

ChangeLog:

 Version 2.16.01

       _This is a documentation update release only._

       (*) Fix the creation of the table of contents in the HTML version of
           the documentation.

 Version 2.16

       (*) Support for the `rdf' format has been discontinued and all the
           RDOFF utilities has been removed.

       (*) The `--reproducible' option now leaves the filename field in the
           COFF object format blank. This was always rather useless since
           it is only 18 characters long; as such debug formats have to
           carry their own filename information anyway.

       (*) Fix handling of MASM-syntax reserved memory (e.g. `dw ?') when
           used in structure definitions.

       (*) The preprocessor now supports functions, which can be less
           verbose and more convenient than the equivalent code implemented
           using directives. See section 4.4.

       (*) Fix the handling of `%00' in the preprocessor.

       (*) Fix incorrect handling of path names affecting error messages,
           dependency generation, and debug format output.

       (*) Support for the RDOFF output format and the RDOFF tools have
           been removed. The RDOFF tools had already been broken since at
           least NASM 2.14. For flat code the ELF output format
           recommended; for segmented code the `obj' (OMF) output format.

       (*) New facility: preprocessor functions. Preprocessor functions,
           which are expanded similarly to single-line macros, can greatly
           simplify code that in the past would have required a lengthy
           list of directives and intermediate macros. See section 4.4.

       (*) Single-line macros can now declare parameters (using a `&&'
           prefix) that creates a quoted string, but does _not_ requote an
           already quoted string. See section 4.2.1.

       (*) Instruction table updated per public information available as of
           November 2022.

       (*) All warnings in the preprocessor have now been assigned warning
           classes. See appendix A.

       (*) Fix the invalid use of `RELA'-type relocations instead of `REL'-
           type relocations when generating DWARF debug information for the
           `elf32' output format.

       (*) Fix the handling `at' in `istruc' when the structure contains
           local labels. See section 5.9.2.

       (*) When assembling with `--reproducible', don't encode the filename
           in the COFF header for the `coff', `win32' or `win64' output
           formats. The COFF header only has space for an 18-character
           filename, which makes this field rather useless in the first
           place. Debug output data, if enabled, is not affected.

       (*) Fix incorrect size calculation when using MASM syntax for non-
           byte reservations (e.g. `dw ?'.)

       (*) Allow forcing an instruction in 64-bit mode to have a (possibly
           redundant) REX prefix, using the syntax `{rex}' as a prefix.

       (*) Add a `{vex}' prefix to enforce VEX (AVX) encoding of an
           instruction, either using the 2- or 3-byte VEX prefixes.

       (*) The `CPU' directive has been augmented to allow control of
           generation of VEX (AVX) versus EVEX (AVX-512) instruction
           formats, see section 7.11.

       (*) Some recent instructions that previously have been only
           available using EVEX encodings are now also encodable using VEX
           (AVX) encodings. For backwards compatibility these encodings are
           not enabled by default, but can be generated either via an
           explicit `{vex}' prefix or by specifying either `CPU LATEVEX' or
           `CPU NOEVEX'; see section 7.11.

       (*) Document the already existing `%unimacro' directive. See section
           4.5.12.

       (*) Fix a code range generation bug in the DWARF debug format
           (incorrect information in the `DW_AT_high_pc' field) for the ELF
           output formats. This bug happened to cancel out with a bug in
           older versions of the GNU binutils linker, but breaks with other
           linkers and updated or other linkers that expect the spec to be
           followed.

       (*) Fix segment symbols with addends, e.g. `jmp _TEXT+10h:0' in
           output formats that support segment relocations, e.g. the `obj'
           format.

       (*) Fix various crashes and hangs on invalid input.

Signed-off-by: Linhui Liu <liulinhui36@gmail.com>

* toolchain: musl: Fix symbol loading in gdb

Fix DT_DEBUG handling on MIPS in musl libc.
With this change gdb will load the symbol files for shared libraries on MIPS too.

This patch was taken from this thread: https://www.openwall.com/lists/musl/2022/01/09/4

Signed-off-by: Hauke Mehrtens <hmehrtens@maxlinear.com>

* tools: sync with upstream

* build: fix issues with targets installed via feeds

- fix including modules.mk when a target is being replaced
- fix calling make targets from target/linux

Signed-off-by: Felix Fietkau <nbd@nbd.name>

* package: sync with upstream

Signed-off-by: Tony Butler <spudz76@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Linhui Liu <liulinhui36@gmail.com>
Signed-off-by: Hauke Mehrtens <hmehrtens@maxlinear.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Co-authored-by: Tony Butler <spudz76@gmail.com>
Co-authored-by: Hauke Mehrtens <hmehrtens@maxlinear.com>
Co-authored-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
lovehackintosh 2023-01-25 15:30:35 +08:00 committed by GitHub
parent 44f20dfe69
commit 51ec2f45a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
126 changed files with 3842 additions and 1034 deletions

View File

@ -15,7 +15,7 @@ $(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt dir
world:
DISTRO_PKG_CONFIG:=$(shell $(TOPDIR)/scripts/command_all.sh pkg-config | grep '/usr' -m 1)
export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
export PATH:=$(if $(STAGING_DIR),$(abspath $(STAGING_DIR)/../host/bin),$(TOPDIR)/staging_dir/host/bin):$(PATH)
ifneq ($(OPENWRT_BUILD),1)
_SINGLE=export MAKEFLAGS=$(space);

View File

@ -37,11 +37,9 @@ menu "Target Images"
bool "lzma"
config TARGET_INITRAMFS_COMPRESSION_LZO
depends on !TARGET_ROOTFS_INITRAMFS_SEPARATE
bool "lzo"
config TARGET_INITRAMFS_COMPRESSION_LZ4
depends on !TARGET_ROOTFS_INITRAMFS_SEPARATE
bool "lz4"
config TARGET_INITRAMFS_COMPRESSION_XZ

View File

@ -64,7 +64,7 @@ BPF_CFLAGS := \
-O2 -emit-llvm -Xclang -disable-llvm-passes
ifneq ($(CONFIG_HAS_BPF_TOOLCHAIN),)
ifeq ($(DUMP),)
ifeq ($(DUMP)$(filter download refresh,$(MAKECMDGOALS)),)
CLANG_VER:=$(shell $(CLANG) -dM -E - < /dev/null | grep __clang_major__ | cut -d' ' -f3)
CLANG_VER_VALID:=$(shell [ "$(CLANG_VER)" -ge "$(CLANG_MIN_VER)" ] && echo 1 )
ifeq ($(CLANG_VER_VALID),)

View File

@ -206,5 +206,9 @@ endif
define HostBuild
$(HostBuild/Core)
$(if $(if $(PKG_HOST_ONLY),,$(if $(and $(filter host-%,$(MAKECMDGOALS)),$(PKG_SKIP_DOWNLOAD)),,$(STAMP_PREPARED))),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
$(if $(if $(PKG_HOST_ONLY),,$(if $(and $(filter host-%,$(MAKECMDGOALS)),$(PKG_SKIP_DOWNLOAD)),,$(STAMP_PREPARED))),,
$(if $(and $(CONFIG_AUTOREMOVE), $(wildcard $(HOST_STAMP_INSTALLED), $(wildcard $(HOST_STAMP_BUILT)))),,
$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default))
)
)
endef

View File

@ -277,7 +277,9 @@ endef
define Build/initrd_compression
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),.bzip2) \
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),.gzip) \
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),.lz4) \
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),.lzma) \
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),.lzo) \
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),.xz) \
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),.zstd)
endef
@ -316,6 +318,15 @@ define Build/gzip
@mv $@.new $@
endef
define Build/gzip-filename
@mkdir -p $@.tmp
@cp $@ $@.tmp/$(word 1,$(1))
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $@.tmp/$(word 1,$(1)) $(word 2,$(1)))
$(STAGING_DIR_HOST)/bin/gzip -f -9 -N -c $@.tmp/$(word 1,$(1)) $(word 2,$(1)) > $@.new
@mv $@.new $@
@rm -rf $@.tmp
endef
define Build/install-dtb
$(call locked, \
$(foreach dts,$(DEVICE_DTS), \

View File

@ -333,6 +333,8 @@ define Device/InitProfile
DEVICE_ALT0_TITLE = $$(DEVICE_ALT0_VENDOR) $$(DEVICE_ALT0_MODEL)$$(if $$(DEVICE_ALT0_VARIANT), $$(DEVICE_ALT0_VARIANT))
DEVICE_ALT1_TITLE = $$(DEVICE_ALT1_VENDOR) $$(DEVICE_ALT1_MODEL)$$(if $$(DEVICE_ALT1_VARIANT), $$(DEVICE_ALT1_VARIANT))
DEVICE_ALT2_TITLE = $$(DEVICE_ALT2_VENDOR) $$(DEVICE_ALT2_MODEL)$$(if $$(DEVICE_ALT2_VARIANT), $$(DEVICE_ALT2_VARIANT))
DEVICE_ALT3_TITLE = $$(DEVICE_ALT3_VENDOR) $$(DEVICE_ALT3_MODEL)$$(if $$(DEVICE_ALT3_VARIANT), $$(DEVICE_ALT3_VARIANT))
DEVICE_ALT4_TITLE = $$(DEVICE_ALT4_VENDOR) $$(DEVICE_ALT4_MODEL)$$(if $$(DEVICE_ALT4_VARIANT), $$(DEVICE_ALT4_VARIANT))
DEVICE_VENDOR :=
DEVICE_MODEL :=
DEVICE_VARIANT :=
@ -345,6 +347,12 @@ define Device/InitProfile
DEVICE_ALT2_VENDOR :=
DEVICE_ALT2_MODEL :=
DEVICE_ALT2_VARIANT :=
DEVICE_ALT3_VENDOR :=
DEVICE_ALT3_MODEL :=
DEVICE_ALT3_VARIANT :=
DEVICE_ALT4_VENDOR :=
DEVICE_ALT4_MODEL :=
DEVICE_ALT4_VARIANT :=
DEVICE_PACKAGES :=
DEVICE_DESCRIPTION = Build firmware images for $$(DEVICE_TITLE)
endef
@ -359,6 +367,7 @@ define Device/Init
ARTIFACTS :=
DEVICE_IMG_PREFIX := $(IMG_PREFIX)-$(1)
DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1)-$$(2)
FACTORY_IMG_NAME :=
IMAGE_SIZE :=
KERNEL_PREFIX = $$(DEVICE_IMG_PREFIX)
KERNEL_SUFFIX := -kernel.bin
@ -418,11 +427,14 @@ DEFAULT_DEVICE_VARS := \
DEVICE_FDT_NUM DEVICE_IMG_PREFIX SOC BOARD_NAME UIMAGE_MAGIC UIMAGE_NAME \
SUPPORTED_DEVICES IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR \
UBOOT_PATH IMAGE_SIZE \
FACTORY_IMG_NAME FACTORY_SIZE \
DEVICE_PACKAGES DEVICE_COMPAT_VERSION DEVICE_COMPAT_MESSAGE \
DEVICE_VENDOR DEVICE_MODEL DEVICE_VARIANT \
DEVICE_ALT0_VENDOR DEVICE_ALT0_MODEL DEVICE_ALT0_VARIANT \
DEVICE_ALT1_VENDOR DEVICE_ALT1_MODEL DEVICE_ALT1_VARIANT \
DEVICE_ALT2_VENDOR DEVICE_ALT2_MODEL DEVICE_ALT2_VARIANT
DEVICE_ALT2_VENDOR DEVICE_ALT2_MODEL DEVICE_ALT2_VARIANT \
DEVICE_ALT3_VENDOR DEVICE_ALT3_MODEL DEVICE_ALT3_VARIANT \
DEVICE_ALT4_VENDOR DEVICE_ALT4_MODEL DEVICE_ALT4_VARIANT
define Device/ExportVar
$(1) : $(2):=$$($(2))
@ -505,6 +517,12 @@ define Device/Build/initramfs
DEVICE_ALT2_VENDOR="$$(DEVICE_ALT2_VENDOR)" \
DEVICE_ALT2_MODEL="$$(DEVICE_ALT2_MODEL)" \
DEVICE_ALT2_VARIANT="$$(DEVICE_ALT2_VARIANT)" \
DEVICE_ALT3_VENDOR="$$(DEVICE_ALT3_VENDOR)" \
DEVICE_ALT3_MODEL="$$(DEVICE_ALT3_MODEL)" \
DEVICE_ALT3_VARIANT="$$(DEVICE_ALT3_VARIANT)" \
DEVICE_ALT4_VENDOR="$$(DEVICE_ALT4_VENDOR)" \
DEVICE_ALT4_MODEL="$$(DEVICE_ALT4_MODEL)" \
DEVICE_ALT4_VARIANT="$$(DEVICE_ALT4_VARIANT)" \
DEVICE_TITLE="$$(DEVICE_TITLE)" \
DEVICE_PACKAGES="$$(DEVICE_PACKAGES)" \
TARGET="$(BOARD)" \
@ -613,6 +631,12 @@ define Device/Build/image
DEVICE_ALT2_VENDOR="$(DEVICE_ALT2_VENDOR)" \
DEVICE_ALT2_MODEL="$(DEVICE_ALT2_MODEL)" \
DEVICE_ALT2_VARIANT="$(DEVICE_ALT2_VARIANT)" \
DEVICE_ALT3_VENDOR="$(DEVICE_ALT3_VENDOR)" \
DEVICE_ALT3_MODEL="$(DEVICE_ALT3_MODEL)" \
DEVICE_ALT3_VARIANT="$(DEVICE_ALT3_VARIANT)" \
DEVICE_ALT4_VENDOR="$(DEVICE_ALT4_VENDOR)" \
DEVICE_ALT4_MODEL="$(DEVICE_ALT4_MODEL)" \
DEVICE_ALT4_VARIANT="$(DEVICE_ALT4_VARIANT)" \
DEVICE_TITLE="$(DEVICE_TITLE)" \
DEVICE_PACKAGES="$(DEVICE_PACKAGES)" \
TARGET="$(BOARD)" \
@ -658,6 +682,12 @@ define Device/Build/artifact
DEVICE_ALT2_VENDOR="$(DEVICE_ALT2_VENDOR)" \
DEVICE_ALT2_MODEL="$(DEVICE_ALT2_MODEL)" \
DEVICE_ALT2_VARIANT="$(DEVICE_ALT2_VARIANT)" \
DEVICE_ALT3_VENDOR="$(DEVICE_ALT3_VENDOR)" \
DEVICE_ALT3_MODEL="$(DEVICE_ALT3_MODEL)" \
DEVICE_ALT3_VARIANT="$(DEVICE_ALT3_VARIANT)" \
DEVICE_ALT4_VENDOR="$(DEVICE_ALT4_VENDOR)" \
DEVICE_ALT4_MODEL="$(DEVICE_ALT4_MODEL)" \
DEVICE_ALT4_VARIANT="$(DEVICE_ALT4_VARIANT)" \
DEVICE_TITLE="$(DEVICE_TITLE)" \
DEVICE_PACKAGES="$(DEVICE_PACKAGES)" \
TARGET="$(BOARD)" \
@ -699,6 +729,8 @@ $(if $(strip $(DEVICE_ALT0_TITLE)),Alternative device titles:
- $(DEVICE_ALT0_TITLE))
$(if $(strip $(DEVICE_ALT1_TITLE)),- $(DEVICE_ALT1_TITLE))
$(if $(strip $(DEVICE_ALT2_TITLE)),- $(DEVICE_ALT2_TITLE))
$(if $(strip $(DEVICE_ALT3_TITLE)),- $(DEVICE_ALT3_TITLE))
$(if $(strip $(DEVICE_ALT4_TITLE)),- $(DEVICE_ALT4_TITLE))
@@
endef
@ -716,6 +748,14 @@ ifneq ($$(strip $$(DEVICE_ALT2_TITLE)),)
DEVICE_DISPLAY = $$(DEVICE_ALT2_TITLE) ($$(DEVICE_TITLE))
$$(info $$(call Device/DumpInfo,$(1)))
endif
ifneq ($$(strip $$(DEVICE_ALT3_TITLE)),)
DEVICE_DISPLAY = $$(DEVICE_ALT3_TITLE) ($$(DEVICE_TITLE))
$$(info $$(call Device/DumpInfo,$(1)))
endif
ifneq ($$(strip $$(DEVICE_ALT4_TITLE)),)
DEVICE_DISPLAY = $$(DEVICE_ALT4_TITLE) ($$(DEVICE_TITLE))
$$(info $$(call Device/DumpInfo,$(1)))
endif
DEVICE_DISPLAY = $$(DEVICE_TITLE)
$$(eval $$(if $$(DEVICE_TITLE),$$(info $$(call Device/DumpInfo,$(1)))))
endef

View File

@ -21,7 +21,7 @@ Kernel/Patch:=$(Kernel/Patch/Default)
ifneq (,$(findstring .xz,$(LINUX_SOURCE)))
LINUX_CAT:=xzcat
else
LINUX_CAT:=gzip -dc
LINUX_CAT:=$(STAGING_DIR_HOST)/bin/libdeflate-gzip -dc
endif
ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
@ -180,10 +180,10 @@ endif
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(KERNEL_BUILD_DIR)/initrd.cpio)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),bzip2 -9 -c < $(KERNEL_BUILD_DIR)/initrd.cpio > $(KERNEL_BUILD_DIR)/initrd.cpio.bzip2)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),gzip -n -f -S .gzip -9n $(KERNEL_BUILD_DIR)/initrd.cpio)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),$(STAGING_DIR_HOST)/bin/lz4c -l -c1 -fz --favor-decSpeed $(KERNEL_BUILD_DIR)/initrd.cpio)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),$(STAGING_DIR_HOST)/bin/lzma e -lc1 -lp2 -pb2 $(KERNEL_BUILD_DIR)/initrd.cpio $(KERNEL_BUILD_DIR)/initrd.cpio.lzma)
# ? $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),$(STAGING_DIR_HOST)/bin/lzop -9 -f $(KERNEL_BUILD_DIR)/initrd.cpio)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),$(STAGING_DIR_HOST)/bin/xz -T$(if $(filter 1,$(NPROC)),2,0) -9 -fz --check=crc32 $(KERNEL_BUILD_DIR)/initrd.cpio)
# ? $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),$(STAGING_DIR_HOST)/bin/zstd -T0 -f -o $(KERNEL_BUILD_DIR)/initrd.cpio.zstd $(KERNEL_BUILD_DIR)/initrd.cpio)
endif
+$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all) modules

View File

@ -49,10 +49,9 @@ $(eval $(call TestHostCommand,working-g++, \
g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
$(TMP_DIR)/a.out))
$(eval $(call TestHostCommand,ncurses, \
$(eval $(call RequireCHeader,ncurses.h, \
Please install ncurses. (Missing libncurses.so or ncurses.h), \
echo 'int main(int argc, char **argv) { initscr(); return 0; }' | \
gcc -include ncurses.h -x c -o $(TMP_DIR)/a.out - -lncurses))
initscr(), -lncurses))
$(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \
git --exec-path | xargs -I % -- grep -q -- --recursive %/git-submodule, \
@ -205,6 +204,20 @@ $(eval $(call SetupHostCommand,which,Please install 'which', \
/bin/which which, \
which which))
ifeq ($(HOST_OS),Linux)
$(eval $(call RequireCHeader,argp.h, \
Missing argp.h Please install the argp-standalone package if musl libc))
$(eval $(call RequireCHeader,fts.h, \
Missing fts.h Please install the musl-fts-dev package if musl libc))
$(eval $(call RequireCHeader,obstack.h, \
Missing obstack.h Please install the musl-obstack-dev package if musl libc))
$(eval $(call RequireCHeader,libintl.h, \
Missing libintl.h Please install the musl-libintl package if musl libc))
endif
$(STAGING_DIR_HOST)/bin/mkhash: $(SCRIPT_DIR)/mkhash.c
mkdir -p $(dir $@)
$(CC) -O2 -I$(TOPDIR)/tools/include -o $@ $<

View File

@ -63,6 +63,18 @@ define RequireHeader
$$(eval $$(call Require,$(1),$(2)))
endef
# 1: header to test
# 2: failure message
# 3: optional compile time test
# 4: optional link library test (example -lncurses)
define RequireCHeader
define Require/$(1)
echo 'int main(int argc, char **argv) { $(3); return 0; }' | gcc -include $(1) -x c -o $(TMP_DIR)/a.out - $(4)
endef
$$(eval $$(call Require,$(1),$(2)))
endef
define CleanupPython2
define Require/python2-cleanup
if [ -f "$(STAGING_DIR_HOST)/bin/python" ] && \

View File

@ -11,7 +11,7 @@ TARGET_STAMP:=$(TMP_DIR)/info/.files-$(SCAN_TARGET).stamp
FILELIST:=$(TMP_DIR)/info/.files-$(SCAN_TARGET)-$(SCAN_COOKIE)
OVERRIDELIST:=$(TMP_DIR)/info/.overrides-$(SCAN_TARGET)-$(SCAN_COOKIE)
export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
export PATH:=$(STAGING_DIR_HOST)/bin:$(PATH)
define feedname
$(if $(patsubst feeds/%,,$(1)),,$(word 2,$(subst /, ,$(1))))

View File

@ -51,22 +51,22 @@ path:=$(subst :,$(space),$(PATH))
path:=$(filter-out .%,$(path))
path:=$(subst $(space),:,$(path))
export PATH:=$(path)
export STAGING_DIR_HOST:=$(if $(STAGING_DIR),$(abspath $(STAGING_DIR)/../host),$(TOPDIR)/staging_dir/host)
unexport TAR_OPTIONS
ifeq ($(FORCE),)
.config scripts/config/conf scripts/config/mconf: staging_dir/host/.prereq-build
.config scripts/config/conf scripts/config/mconf: $(STAGING_DIR_HOST)/.prereq-build
endif
SCAN_COOKIE?=$(shell echo $$$$)
export SCAN_COOKIE
export STAGING_DIR_HOST=$(TOPDIR)/staging_dir/host
SUBMAKE:=umask 022; $(SUBMAKE)
ULIMIT_FIX=_limit=`ulimit -n`; [ "$$_limit" = "unlimited" -o "$$_limit" -ge 1024 ] || ulimit -n 1024;
prepare-mk: staging_dir/host/.prereq-build FORCE ;
prepare-mk: $(STAGING_DIR_HOST)/.prereq-build FORCE ;
ifdef SDK
IGNORE_PACKAGES = linux
@ -75,7 +75,7 @@ endif
_ignore = $(foreach p,$(IGNORE_PACKAGES),--ignore $(p))
prepare-tmpinfo: FORCE
@+$(MAKE) -r -s staging_dir/host/.prereq-build $(PREP_MK)
@+$(MAKE) -r -s $(STAGING_DIR_HOST)/.prereq-build $(PREP_MK)
mkdir -p tmp/info
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPTH=5 SCAN_EXTRA=""
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPTH=3 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
@ -152,7 +152,7 @@ xconfig: scripts/config/qconf prepare-tmpinfo FORCE
prepare_kernel_conf: .config toolchain/install FORCE
ifeq ($(wildcard staging_dir/host/bin/quilt),)
ifeq ($(wildcard $(STAGING_DIR_HOST)/bin/quilt),)
prepare_kernel_conf:
@+$(SUBMAKE) -r tools/quilt/compile
else
@ -176,7 +176,7 @@ kernel_nconfig: prepare_kernel_conf
kernel_xconfig: prepare_kernel_conf
$(_SINGLE)$(NO_TRACE_MAKE) -C target/linux xconfig
staging_dir/host/.prereq-build: include/prereq-build.mk
$(STAGING_DIR_HOST)/.prereq-build: include/prereq-build.mk
mkdir -p tmp
@$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \
echo "Prerequisite check failed. Use FORCE=1 to override."; \
@ -199,7 +199,7 @@ else
DOWNLOAD_DIRS = package/download
endif
download: .config FORCE $(if $(wildcard $(TOPDIR)/staging_dir/host/bin/flock),,tools/flock/compile)
download: .config FORCE $(if $(wildcard $(STAGING_DIR_HOST)/bin/flock),,tools/flock/compile)
@+$(foreach dir,$(DOWNLOAD_DIRS),$(SUBMAKE) $(dir);)
clean dirclean: .config
@ -263,7 +263,7 @@ distclean:
@$(_SINGLE)$(SUBMAKE) -C scripts/config clean
ifeq ($(findstring v,$(DEBUG)),)
.SILENT: symlinkclean clean dirclean distclean config-clean download help tmpinfo-clean .config scripts/config/mconf scripts/config/conf menuconfig staging_dir/host/.prereq-build tmp/.prereq-package prepare-tmpinfo
.SILENT: symlinkclean clean dirclean distclean config-clean download help tmpinfo-clean .config scripts/config/mconf scripts/config/conf menuconfig $(STAGING_DIR_HOST)/.prereq-build tmp/.prereq-package prepare-tmpinfo
endif
.PHONY: help FORCE
.NOTPARALLEL:

View File

@ -81,7 +81,7 @@ define Build/Compile/Trusted-Firmware-A
$(if $(DTC),DTC="$(DTC)") \
PLAT=$(PLAT) \
BUILD_STRING="OpenWrt v$(PKG_VERSION)-$(PKG_RELEASE) ($(VARIANT))" \
$(if $(CONFIG_BINUTILS_VERSION_2_39),LDFLAGS="-no-warn-rwx-segments") \
$(if $(CONFIG_BINUTILS_VERSION_2_37)$(CONFIG_BINUTILS_VERSION_2_38),,LDFLAGS="-no-warn-rwx-segments") \
$(TFA_MAKE_FLAGS)
endef

View File

@ -18,7 +18,7 @@ ifeq ($(strip $(UNPACK_CMD)),)
ifeq ($(filter gz tgz,$(EXT)),$(EXT))
EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=))
DECOMPRESS_CMD:=gzip -dc $(DL_DIR)/$(PKG_SOURCE) |
DECOMPRESS_CMD:=$(STAGING_DIR_HOST)/bin/libdeflate-gzip -dc $(DL_DIR)/$(PKG_SOURCE) |
endif
ifeq ($(filter bzip2 bz2 bz tbz2 tbz,$(EXT)),$(EXT))
EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=))
@ -56,7 +56,7 @@ ifeq ($(strip $(UNPACK_CMD)),)
endif
# replace zcat with $(ZCAT), because some system don't support it properly
ifeq ($(PKG_CAT),zcat)
UNPACK_CMD=gzip -dc $(DL_DIR)/$(PKG_SOURCE) | $(TAR_CMD)
UNPACK_CMD=$(STAGING_DIR_HOST)/bin/libdeflate-gzip -dc $(DL_DIR)/$(PKG_SOURCE) | $(TAR_CMD)
endif
endif
endif

View File

@ -9,15 +9,15 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=uboot-envtools
PKG_DISTNAME:=u-boot
PKG_VERSION:=2021.01
PKG_RELEASE:=$(AUTORELEASE)
PKG_VERSION:=2023.01
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:= \
https://ftp.denx.de/pub/u-boot \
https://mirror.cyberbits.eu/u-boot \
ftp://ftp.denx.de/pub/u-boot
PKG_HASH:=b407e1510a74e863b8b5cb42a24625344f0e0c2fc7582d8c866bd899367d0454
PKG_HASH:=69423bad380f89a0916636e89e6dcbd2e4512d584308d922d1039d1e4331950f
PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_DISTNAME)-$(PKG_VERSION)

View File

@ -19,6 +19,10 @@ netgear,wndap620|\
netgear,wndap660)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000" "4"
;;
wd,mybooklive)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000" "1"
ubootenv_add_uci_config "/dev/mtd1" "0x1000" "0x1000" "0x1000" "1"
;;
esac
config_load ubootenv

View File

@ -18,10 +18,16 @@ alfa-network,n2q|\
alfa-network,n5q|\
alfa-network,pi-wifi4|\
alfa-network,r36a|\
alfa-network,tube-2hq|\
allnet,all-wap02860ac|\
araknis,an-300-ap-i-n|\
araknis,an-500-ap-i-ac|\
araknis,an-700-ap-i-ac|\
arduino,yun|\
buffalo,bhr-4grv2|\
devolo,magic-2-wifi|\
engenius,eap1200h|\
engenius,eap1750h|\
engenius,eap300-v2|\
engenius,eap350-v1|\
engenius,eap600|\
@ -38,6 +44,7 @@ glinet,gl-ar750s-nor-nand|\
librerouter,librerouter-v1|\
netgear,ex6400|\
netgear,ex7300|\
netgear,ex7300-v2|\
netgear,wndr4300-v2|\
netgear,wndr4500-v3|\
netgear,wnr1000-v2|\
@ -49,11 +56,33 @@ ocedo,koala|\
ocedo,raccoon|\
openmesh,a40|\
openmesh,a60|\
openmesh,mr600-v1|\
openmesh,mr600-v2|\
openmesh,mr900-v1|\
openmesh,mr900-v2|\
openmesh,mr1750-v1|\
openmesh,mr1750-v2|\
openmesh,om5p|\
openmesh,om5p-an|\
openmesh,om5p-ac-v1|\
openmesh,om5p-ac-v2|\
samsung,wam250|\
ubnt,airrouter|\
ubnt,bullet-m-ar7240|\
ubnt,bullet-m-ar7241|\
ubnt,nanobridge-m|\
ubnt,nanostation-loco-m|\
ubnt,nanostation-m|\
ubnt,picostation-m|\
ubnt,powerbridge-m|\
ubnt,rocket-m|\
watchguard,ap100|\
watchguard,ap200|\
watchguard,ap300|\
yuncore,a770|\
yuncore,a782|\
yuncore,a930|\
yuncore,xd3200|\
yuncore,xd4200|\
ziking,cpe46b|\
zyxel,nbg6616)
@ -63,15 +92,15 @@ buffalo,wzr-hp-ag300h)
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000"
;;
buffalo,wzr-hp-g300nh-rb|\
buffalo,wzr-hp-g300nh-s)
buffalo,wzr-hp-g300nh-s|\
linksys,ea4500-v3)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
;;
domywifi,dw33d)
ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x10000" "0x10000"
;;
glinet,gl-ar150)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000"
;;
dongwon,dw02-412h-64m|\
dongwon,dw02-412h-128m|\
glinet,gl-ar300m-lite|\
glinet,gl-ar300m-nand|\
glinet,gl-ar300m-nor|\
@ -80,17 +109,22 @@ glinet,gl-ar300m16)
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
;;
glinet,gl-ar150)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000"
;;
netgear,wndr3700|\
netgear,wndr3700-v2|\
netgear,wndrmac-v1)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x10000"
;;
netgear,pgzng1|\
netgear,wndr3700-v4|\
netgear,wndr4300|\
netgear,wndr4300tn|\
netgear,wndr4300sw)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
;;
openmesh,om2p-v1|\
openmesh,om2p-v2|\
openmesh,om2p-v4|\
openmesh,om2p-hs-v1|\
@ -105,9 +139,28 @@ plasmacloud,pa300e)
qihoo,c301)
ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000"
;;
ruckus,zf7025)
ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x40000" "0x40000"
;;
ruckus,zf7321|\
ruckus,zf7372)
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x40000" "0x10000"
;;
sophos,ap15|\
sophos,ap55|\
sophos,ap55c|\
sophos,ap100|\
sophos,ap100c)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
;;
wallys,dr531)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000"
;;
zte,mf286|\
zte,mf286a|\
zte,mf286r)
ubootenv_add_uci_config "/dev/mtd7" "0x0" "0x20000" "0x10000"
;;
esac
config_load ubootenv

View File

@ -0,0 +1,19 @@
[ -e /etc/config/ubootenv ] && exit 0
touch /etc/config/ubootenv
. /lib/uboot-envtools.sh
. /lib/functions.sh
board=$(board_name)
case "$board" in
technexion,imx7d-pico-pi)
ubootenv_add_uci_config "/dev/mmcblk2" "0xc0000" "0x2000" "0x2000"
;;
esac
config_load ubootenv
config_foreach ubootenv_add_app_config ubootenv
exit 0

View File

@ -26,26 +26,49 @@ ubootenv_mtdinfo () {
fi
sectors=$(( $ubootenv_size / $mtd_erase ))
sectors=$(printf "0x%x" $sectors )
echo /dev/$mtd_dev 0x0 $ubootenv_size $mtd_erase $sectors
}
case "$board" in
alfa-network,ap120c-ac|\
devolo,magic-2-wifi-next|\
edgecore,ecw5211|\
glinet,gl-a1300 |\
glinet,gl-ap1300|\
glinet,gl-b1300|\
glinet,gl-b2200|\
luma,wrtq-329acn|\
netgear,wac510|\
openmesh,a42|\
openmesh,a62)
openmesh,a62|\
pakedge,wr-1|\
plasmacloud,pa1200|\
plasmacloud,pa2200)
ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x10000" "0x10000"
;;
aruba,ap-303)
ubootenv_add_uci_config "/dev/mtd13" "0x0" "0x10000" "0x10000"
;;
aruba,ap-365)
ubootenv_add_uci_config "/dev/mtd8" "0x0" "0x10000" "0x10000"
;;
buffalo,wtr-m2133hp)
ubootenv_add_uci_config "/dev/mtd8" "0x0" "0x40000" "0x20000"
;;
linksys,ea6350v3)
ubootenv_add_uci_config "/dev/mtd7" "0x0" "0x20000" "0x20000"
;;
linksys,ea8300)
linksys,ea8300|\
linksys,mr8300)
ubootenv_add_uci_config "/dev/mtd7" "0x0" "0x40000" "0x20000"
;;
linksys,whw01)
ubootenv_add_uci_config "/dev/mtd6" "0x0" "0x40000" "0x10000"
;;
linksys,whw03v2)
ubootenv_add_uci_config "/dev/mtd6" "0x0" "0x80000" "0x20000"
;;
zyxel,nbg6617)
ubootenv_add_uci_config "/dev/mtd6" "0x0" "0x10000" "0x10000"
;;

View File

@ -26,6 +26,7 @@ ubootenv_mtdinfo () {
fi
sectors=$(( $ubootenv_size / $mtd_erase ))
sectors=$(printf "0x%x" $sectors )
echo /dev/$mtd_dev 0x0 $ubootenv_size $mtd_erase $sectors
}

View File

@ -8,12 +8,31 @@ touch /etc/config/ubootenv
board=$(board_name)
case "$board" in
dynalink,dl-wrx36)
idx="$(find_mtd_index 0:appsblenv)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" "2"
;;
edgecore,eap102|\
zyxel,nbg7815)
idx="$(find_mtd_index 0:appsblenv)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" "1"
;;
edimax,cax1800)
idx="$(find_mtd_index 0:appsblenv)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x20000"
;;
redmi,ax6|\
xiaomi,ax3600|\
xiaomi,ax9000)
idx="$(find_mtd_index 0:appsblenv)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x20000"
idx2="$(find_mtd_index bdata)"
[ -n "$idx2" ] && \
ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x10000" "0x20000"
;;
qnap,301w)
idx="$(find_mtd_index 0:appsblenv)"
@ -23,6 +42,6 @@ qnap,301w)
esac
config_load ubootenv
config_foreach ubootenv_add_app_config ubootenv
config_foreach ubootenv_add_app_config
exit 0

View File

@ -19,6 +19,7 @@ globalscale,sheevaplug|\
iom,ix2-200|\
linksys,e4200-v2|\
linksys,ea4500|\
netgear,readynas-duo-v2|\
raidsonic,ib-nas62x0|\
seagate,dockstar|\
zyxel,nsa310b|\

View File

@ -32,8 +32,11 @@ bananapi,bpi-r64)
buffalo,wsr-2533dhp2)
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1000" "0x20000"
;;
ruijie,rg-ew3200gx-pro)
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x20000" "0x20000"
;;
ubnt,unifi-6-lr-ubootmod)
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x1000"
;;
xiaomi,redmi-router-ax6s)
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x40000"

View File

@ -17,6 +17,10 @@ bananapi,bpi-r2)
export_bootdevice
export_partdevice ubootpart 1
ubootenv_add_uci_config "/dev/$ubootpart" "0xb0000" "0x10000" "0x10000" "1"
;;
unielec,u7623-02)
ubootenv_add_uci_config "/dev/mmcblk0p1" "0xc0000" "0x10000" "0x10000" "1"
;;
esac
config_load ubootenv

View File

@ -8,10 +8,17 @@ touch /etc/config/ubootenv
board=$(board_name)
case "$board" in
extreme-networks,ws-ap3825i)
ubootenv_add_uci_config "$(find_mtd_part 'cfg1')" "0x0" "0x10000" "0x20000"
ubootenv_add_uci_config "$(find_mtd_part 'cfg2')" "0x0" "0x10000" "0x20000"
;;
ocedo,panda)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x20000" "0x20000"
;;
aerohive,hiveap-330)
ubootenv_add_uci_config "$(find_mtd_part 'u-boot-env')" "0x0" "0x20000" "0x10000"
;;
esac
config_load ubootenv

View File

@ -17,7 +17,10 @@ buffalo,ls421de)
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000"
;;
cznic,turris-omnia)
if grep -q 'U-Boot 2015.10-rc2' /dev/mtd0; then
idx="$(find_mtd_index u-boot-env)"
if [ -n "$idx" ]; then
ubootenv_add_uci_config "/dev/mtd${idx}" "0x0" "0x10000" "0x10000"
elif grep -q 'U-Boot 2015.10-rc2' /dev/mtd0; then
ubootenv_add_uci_config "/dev/mtd0" "0xc0000" "0x10000" "0x40000"
else
ubootenv_add_uci_config "/dev/mtd0" "0xf0000" "0x10000" "0x10000"
@ -30,7 +33,8 @@ globalscale,espressobin|\
globalscale,espressobin-emmc|\
globalscale,espressobin-ultra|\
globalscale,espressobin-v7|\
globalscale,espressobin-v7-emmc)
globalscale,espressobin-v7-emmc|\
globalscale,mochabin)
idx="$(find_mtd_index u-boot-env)"
if [ -n "$idx" ]; then
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" "1"
@ -54,8 +58,14 @@ linksys,wrt3200acm|\
linksys,wrt32x)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
;;
methode,udpu)
methode,udpu|\
methode,edpu)
idx="$(find_mtd_index u-boot-env)"
if [ -n "$idx" ]; then
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" "1"
else
ubootenv_add_uci_config "/dev/mtd0" "0x180000" "0x10000" "0x10000"
fi
;;
esac

View File

@ -14,7 +14,7 @@ board=$(board_name)
case "$board" in
"cloudengines,pogoplug"*|\
"shuttle,kd20")
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x2000" "0x2000" "1"
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x2000" "0x20000" "1"
;;
"mitrastar,stg-212")
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x20000" "0x20000" "1"

View File

@ -8,13 +8,20 @@ touch /etc/config/ubootenv
board=$(board_name)
case "$board" in
d-link,dgs-1210-16|\
d-link,dgs-1210-28|\
d-link,dgs-1210-10mp|\
d-link,dgs-1210-10p|\
d-link,dgs-1210-16|\
d-link,dgs-1210-20|\
d-link,dgs-1210-28|\
zyxel,gs1900-8|\
zyxel,gs1900-8hp-v1|\
zyxel,gs1900-8hp-v2|\
zyxel,gs1900-10hp)
zyxel,gs1900-10hp|\
zyxel,gs1900-16|\
zyxel,gs1900-24-v1|\
zyxel,gs1900-24e|\
zyxel,gs1900-24hp-v1|\
zyxel,gs1900-24hp-v2)
idx="$(find_mtd_index u-boot-env)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x400" "0x10000"
@ -22,6 +29,21 @@ zyxel,gs1900-10hp)
[ -n "$idx2" ] && \
ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x1000" "0x10000"
;;
tplink,sg2008p-v1|\
tplink,sg2210p-v3|\
tplink,sg2452p-v4)
idx="$(find_mtd_index u-boot-env)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x20000" "0x10000"
;;
iodata,bsh-g24mb)
idx="$(find_mtd_index u-boot-env)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
idx2="$(find_mtd_index u-boot-env2)"
[ -n "$idx2" ] && \
ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x3800" "0x10000"
;;
*)
idx="$(find_mtd_index u-boot-env)"
[ -n "$idx" ] && \

View File

@ -3,7 +3,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_VERSION:=2023.01
PKG_HASH:=69423bad380f89a0916636e89e6dcbd2e4512d584308d922d1039d1e4331950f
PKG_BUILD_DEPENDS:=!TARGET_mediatek_mt7623:arm-trusted-firmware-tools/host
PKG_BUILD_DEPENDS:=!(TARGET_ramips||TARGET_mediatek_mt7623):arm-trusted-firmware-tools/host
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
@ -236,6 +236,18 @@ define U-Boot/mt7986_bananapi_bpi-r3-nor
FIP_COMPRESS:=1
endef
define U-Boot/mt7986_xiaomi_redmi-router-ax6000
NAME:=Xiaomi Redmi AX6000
BUILD_SUBTARGET:=filogic
BUILD_DEVICES:=xiaomi_redmi-router-ax6000-ubootmod
UBOOT_CONFIG:=mt7986_xiaomi_redmi-ax6000
UBOOT_IMAGE:=u-boot.fip
BL2_BOOTDEV:=spim-nand
BL2_SOC:=mt7986
BL2_DDRTYPE:=ddr4
DEPENDS:=+trusted-firmware-a-mt7986-spim-nand-ddr4
endef
UBOOT_TARGETS := \
mt7620_mt7530_rfb \
mt7620_rfb \
@ -256,6 +268,7 @@ UBOOT_TARGETS := \
mt7986_bananapi_bpi-r3-sdmmc \
mt7986_bananapi_bpi-r3-snand \
mt7986_bananapi_bpi-r3-nor \
mt7986_xiaomi_redmi-router-ax6000 \
mt7986_rfb
ifdef CONFIG_TARGET_mediatek
@ -291,7 +304,7 @@ endef
define Build/Compile
$(call Build/Compile/U-Boot)
ifeq ($(UBOOT_IMAGE),u-boot.fip))
ifeq ($(UBOOT_IMAGE),u-boot.fip)
$(call Build/fip-image)
endif
endef

View File

@ -125,7 +125,7 @@ Subject: [PATCH] add support for RAVPower RP-WD009
+}
--- /dev/null
+++ b/configs/ravpower-rp-wd009-ram_defconfig
@@ -0,0 +1,61 @@
@@ -0,0 +1,64 @@
+CONFIG_MIPS=y
+CONFIG_SYS_LOAD_ADDR=0x80010000
+CONFIG_NR_DRAM_BANKS=1
@ -140,6 +140,7 @@ Subject: [PATCH] add support for RAVPower RP-WD009
+CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_VERSION_VARIABLE=y
+CONFIG_BOARD_RAVPOWER_RP_WD009=y
+CONFIG_SYS_MIPS_TIMER_FREQ=290000000
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_LICENSE=y
+# CONFIG_CMD_ELF is not set
@ -187,9 +188,11 @@ Subject: [PATCH] add support for RAVPower RP-WD009
+CONFIG_WDT_MT7621=y
+CONFIG_LZMA=y
+CONFIG_BAUDRATE=57600
+CONFIG_SYS_MAXARGS=64
+CONFIG_SYS_CBSIZE=512
--- /dev/null
+++ b/include/configs/ravpower-rp-wd009.h
@@ -0,0 +1,42 @@
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2018 Stefan Roese <sr@denx.de>
@ -219,9 +222,7 @@ Subject: [PATCH] add support for RAVPower RP-WD009
+#define CONFIG_SYS_MEMTEST_END 0x80400000
+
+/* Memory usage */
+#define CONFIG_SYS_MAXARGS 64
+#define CONFIG_SYS_BOOTPARAMS_LEN (128 * 1024)
+#define CONFIG_SYS_CBSIZE 512
+
+/* Environment settings */
+

View File

@ -0,0 +1,392 @@
--- /dev/null
+++ b/configs/mt7986_xiaomi_redmi-ax6000_defconfig
@@ -0,0 +1,176 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_TARGET_MT7986=y
+CONFIG_SYS_TEXT_BASE=0x41e00000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_DEFAULT_DEVICE_TREE="mt7986a-xiaomi_redmi-ax6000"
+CONFIG_DEFAULT_ENV_FILE="xiaomi_redmi-ax6000_env"
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7986a-xiaomi_redmi-ax6000.dtb"
+CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_DEBUG_UART_BASE=0x11002000
+CONFIG_DEBUG_UART_CLOCK=40000000
+CONFIG_DEBUG_UART=y
+CONFIG_SYS_LOAD_ADDR=0x46000000
+CONFIG_SMBIOS_PRODUCT_NAME=""
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_BOOTDELAY=30
+CONFIG_AUTOBOOT_MENU_SHOW=y
+CONFIG_CFB_CONSOLE_ANSI=y
+CONFIG_BOARD_LATE_INIT=y
+CONFIG_BUTTON=y
+CONFIG_BUTTON_GPIO=y
+CONFIG_GPIO_HOG=y
+CONFIG_CMD_ENV_FLAGS=y
+CONFIG_FIT=y
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
+# CONFIG_LED is not set
+# CONFIG_LED_BLINK is not set
+# CONFIG_LED_GPIO is not set
+CONFIG_LOGLEVEL=7
+CONFIG_LOG=y
+CONFIG_SYS_PROMPT="MT7986> "
+CONFIG_CMD_BOOTMENU=y
+CONFIG_CMD_BOOTP=y
+CONFIG_CMD_BUTTON=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_CDP=y
+CONFIG_CMD_CPU=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_DM=y
+CONFIG_CMD_DNS=y
+CONFIG_CMD_ECHO=y
+CONFIG_CMD_ENV_READMEM=y
+CONFIG_CMD_ERASEENV=y
+# CONFIG_CMD_EXT4 is not set
+# CONFIG_CMD_FAT is not set
+CONFIG_CMD_FDT=y
+# CONFIG_CMD_FS_GENERIC is not set
+# CONFIG_CMD_FS_UUID is not set
+CONFIG_CMD_GPIO=y
+# CONFIG_CMD_GPT is not set
+CONFIG_CMD_HASH=y
+CONFIG_CMD_ITEST=y
+# CONFIG_CMD_LED is not set
+CONFIG_CMD_LICENSE=y
+CONFIG_CMD_LINK_LOCAL=y
+# CONFIG_CMD_MBR is not set
+CONFIG_CMD_MTD=y
+# CONFIG_CMD_PCI is not set
+CONFIG_CMD_PSTORE=y
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
+CONFIG_CMD_SF_TEST=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_PXE=y
+# CONFIG_CMD_PWM is not set
+CONFIG_CMD_SMC=y
+CONFIG_CMD_TFTPBOOT=y
+CONFIG_CMD_TFTPSRV=y
+CONFIG_CMD_UBI=y
+CONFIG_CMD_UBI_RENAME=y
+CONFIG_CMD_UBIFS=y
+CONFIG_CMD_ASKENV=y
+CONFIG_CMD_PART=y
+CONFIG_CMD_RARP=y
+CONFIG_CMD_SETEXPR=y
+CONFIG_CMD_SLEEP=y
+CONFIG_CMD_SNTP=y
+CONFIG_CMD_SOURCE=y
+CONFIG_CMD_STRINGS=y
+# CONFIG_CMD_USB is not set
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_UUID=y
+CONFIG_DISPLAY_CPUINFO=y
+CONFIG_DM_MTD=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
+# CONFIG_DM_USB is not set
+# CONFIG_DM_PWM is not set
+# CONFIG_PWM_MTK is not set
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_VERSION_VARIABLE=y
+CONFIG_PARTITION_UUIDS=y
+CONFIG_NETCONSOLE=y
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_CLK=y
+CONFIG_DM_GPIO=y
+# CONFIG_DM_SCSI is not set
+# CONFIG_AHCI is not set
+CONFIG_PHY=y
+# CONFIG_PHY_MTK_TPHY is not set
+CONFIG_PHY_FIXED=y
+CONFIG_DM_ETH=y
+CONFIG_MEDIATEK_ETH=y
+# CONFIG_PCI is not set
+# CONFIG_MMC is not set
+# CONFIG_DM_MMC is not set
+CONFIG_MTD=y
+CONFIG_MTD_UBI_FASTMAP=y
+# CONFIG_DM_PCI is not set
+# CONFIG_PCIE_MEDIATEK is not set
+CONFIG_PINCTRL=y
+CONFIG_PINCONF=y
+# CONFIG_PINCTRL_MT7622 is not set
+CONFIG_POWER_DOMAIN=y
+CONFIG_PRE_CONSOLE_BUFFER=y
+CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
+CONFIG_MTK_POWER_DOMAIN=y
+CONFIG_RAM=y
+CONFIG_DM_SERIAL=y
+CONFIG_MTK_SERIAL=y
+CONFIG_SPI=y
+# CONFIG_I2C is not set
+CONFIG_DM_SPI=y
+CONFIG_MTK_SPI_NAND=y
+CONFIG_MTK_SPI_NAND_MTD=y
+CONFIG_SYSRESET_WATCHDOG=y
+CONFIG_WDT_MTK=y
+CONFIG_LZO=y
+CONFIG_ZSTD=y
+CONFIG_HEXDUMP=y
+CONFIG_RANDOM_UUID=y
+CONFIG_REGEX=y
+# CONFIG_USB is not set
+# CONFIG_USB_HOST is not set
+# CONFIG_USB_XHCI_HCD is not set
+# CONFIG_USB_XHCI_MTK is not set
+# CONFIG_USB_STORAGE is not set
+CONFIG_OF_EMBED=y
+CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_IS_IN_UBI=y
+CONFIG_ENV_UBI_PART="ubi"
+CONFIG_ENV_SIZE=0x1f000
+CONFIG_ENV_SIZE_REDUND=0x1f000
+CONFIG_ENV_UBI_VOLUME="ubootenv"
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_CLK=y
+CONFIG_PHY_FIXED=y
+CONFIG_DM_ETH=y
+CONFIG_MEDIATEK_ETH=y
+CONFIG_PINCTRL=y
+CONFIG_PINCONF=y
+CONFIG_PINCTRL_MT7986=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_MTK_POWER_DOMAIN=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_SERIAL=y
+CONFIG_MTK_SERIAL=y
+CONFIG_HEXDUMP=y
+CONFIG_USE_DEFAULT_ENV_FILE=y
+CONFIG_MTD_SPI_NAND=y
+CONFIG_MTK_SPIM=y
+CONFIG_CMD_MTD=y
+CONFIG_CMD_NAND=y
+CONFIG_CMD_NAND_TRIMFFS=y
+CONFIG_LMB_MAX_REGIONS=64
--- /dev/null
+++ b/arch/arm/dts/mt7986a-xiaomi_redmi-ax6000.dts
@@ -0,0 +1,152 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021 MediaTek Inc.
+ * Author: Sam Shih <sam.shih@mediatek.com>
+ */
+
+/dts-v1/;
+#include "mt7986.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ model = "Xiaomi Redmi AX6000";
+ compatible = "mediatek,mt7986", "mediatek,mt7986-sd-rfb";
+
+ chosen {
+ stdout-path = &uart0;
+ tick-timer = &timer0;
+ };
+
+ keys {
+ compatible = "gpio-keys";
+ factory {
+ label = "reset";
+ gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
+ };
+ mesh {
+ label = "mesh";
+ gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
+ };
+ };
+};
+
+&uart0 {
+ status = "okay";
+};
+
+&uart1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins>;
+ status = "disabled";
+};
+
+&eth {
+ status = "okay";
+ mediatek,gmac-id = <0>;
+ phy-mode = "sgmii";
+ mediatek,switch = "mt7531";
+ reset-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+};
+
+&pinctrl {
+ spic_pins: spi1-pins-func-1 {
+ mux {
+ function = "spi";
+ groups = "spi1_2";
+ };
+ };
+
+ uart1_pins: spi1-pins-func-3 {
+ mux {
+ function = "uart";
+ groups = "uart1_2";
+ };
+ };
+
+ spi_flash_pins: spi0-pins-func-1 {
+ mux {
+ function = "flash";
+ groups = "spi0", "spi0_wp_hold";
+ };
+
+ conf-pu {
+ pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
+ drive-strength = <MTK_DRIVE_8mA>;
+ bias-pull-up = <MTK_PUPD_SET_R1R0_00>;
+ };
+
+ conf-pd {
+ pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
+ drive-strength = <MTK_DRIVE_8mA>;
+ bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
+ };
+ };
+};
+
+&spi0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi_flash_pins>;
+ status = "okay";
+ must_tx;
+ enhance_timing;
+ dma_ext;
+ ipm_design;
+ support_quad;
+ tick_dly = <1>;
+ sample_sel = <0>;
+
+ spi_nand@0 {
+ compatible = "spi-nand";
+ reg = <0>;
+ spi-max-frequency = <52000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "bl2";
+ reg = <0x0 0x80000>;
+ };
+
+ partition@100000 {
+ label = "nvram";
+ reg = <0x100000 0x40000>;
+ };
+
+ partition@140000 {
+ label = "bdata";
+ reg = <0x140000 0x40000>;
+ };
+
+ partition@180000 {
+ label = "factory";
+ reg = <0x180000 0x200000>;
+ };
+
+ partition@380000 {
+ label = "fip";
+ reg = <0x380000 0x200000>;
+ };
+
+ partition@600000 {
+ label = "ubi";
+ reg = <0x580000 0x7a80000>;
+ };
+ };
+ };
+};
+
+&watchdog {
+ status = "disabled";
+};
--- /dev/null
+++ b/xiaomi_redmi-ax6000_env
@@ -0,0 +1,55 @@
+ethaddr_factory=mtd read factory 0x40080000 0x0 0x20000 && env readmem -b ethaddr 0x40080004 0x6 ; setenv ethaddr_factory
+ipaddr=192.168.1.1
+serverip=192.168.1.254
+loadaddr=0x46000000
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
+bootargs=console=ttyS0,115200n8 console_msg_format=syslog
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
+bootconf=config-1
+bootdelay=0
+bootfile=openwrt-mediatek-filogic-xiaomi_redmi-router-ax6000-ubootmod-initramfs-recovery.itb
+bootfile_bl2=openwrt-mediatek-filogic-xiaomi_redmi-router-ax6000-ubootmod-preloader.bin
+bootfile_fip=openwrt-mediatek-filogic-xiaomi_redmi-router-ax6000-ubootmod-bl31-uboot.fip
+bootfile_upg=openwrt-mediatek-filogic-xiaomi_redmi-router-ax6000-ubootmod-squashfs-sysupgrade.itb
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
+bootmenu_default=0
+bootmenu_delay=0
+bootmenu_title= ( ( ( OpenWrt ) ) )
+bootmenu_0=Initialize environment.=run _firstboot
+bootmenu_0d=Run default boot command.=run boot_default
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
+bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return
+bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
+bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
+bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
+bootmenu_6=Load BL31+U-Boot FIP via TFTP then write to NAND.=run boot_tftp_write_fip ; run bootmenu_confirm_return
+bootmenu_7=Load BL2 preloader via TFTP then write to NAND.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
+bootmenu_8=Reboot.=reset
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
+boot_first=if button reset ; then run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
+boot_production=run ubi_read_production && bootm $loadaddr#$bootconf
+boot_recovery=run ubi_read_recovery && bootm $loadaddr#$bootconf
+boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever
+boot_tftp_forever=while true ; do run boot_tftp_recovery ; sleep 1 ; done
+boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
+boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
+boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory
+boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2
+part_fit=fit
+reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800
+mtd_write_fip=mtd erase fip && mtd write fip $loadaddr
+mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr
+ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic 0 ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic 1
+ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset
+ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi
+ubi_read_production=ubi read $loadaddr $part_fit && iminfo $loadaddr && run ubi_prepare_rootfs
+ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery
+ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data
+ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize
+ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize
+_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
+_firstboot=setenv _firstboot ; run ethaddr_factory ; run _switch_to_menu ; run _init_env ; run boot_first
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver"

View File

@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=trace-cmd
PKG_VERSION:=v3.1.5
PKG_VERSION:=v3.1.6
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/snapshot/
PKG_HASH:=9af1ea00e312d03639470e126fa9c786789f03c16df93a57c0bc90eeffbc7d50
PKG_HASH:=f9198ea306deee9cda3b262342b03b6029e82c1b9c671ba521739a9703e115b9
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=COPYING

View File

@ -12,7 +12,9 @@ PKG_NAME:=kernel
PKG_FLAGS:=hold
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/packages
SCAN_DEPS=modules/*.mk $(TOPDIR)/target/linux/*/modules.mk $(TOPDIR)/include/netfilter.mk
SUBTARGETS = $(sort $(filter-out feeds,$(notdir $(wildcard $(TOPDIR)/target/linux/* $(TOPDIR)/target/linux/feeds/*))))
SUBTARGET_MODULES = $(foreach t,$(SUBTARGETS),$(firstword $(wildcard $(TOPDIR)/target/linux/feeds/$(t)/modules.mk $(TOPDIR)/target/linux/$(t)/modules.mk)))
SCAN_DEPS=modules/*.mk $(SUBTARGET_MODULES) $(TOPDIR)/include/netfilter.mk
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=
@ -63,4 +65,4 @@ endef
$(eval $(if $(DUMP),,$(call BuildPackage,kernel)))
include $(sort $(wildcard ./modules/*.mk))
-include $(TOPDIR)/target/linux/*/modules.mk
-include $(SUBTARGET_MODULES)

View File

@ -24,7 +24,7 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/rtl8812au-ct
SUBMENU:=Wireless Drivers
TITLE:=Driver for Realtek 8812 AU devices comfast 912-ac, etc
DEPENDS:=+kmod-cfg80211 +kmod-usb-core +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT
DEPENDS:=+kmod-cfg80211 +kmod-usb-core +@DRIVER_11AC_SUPPORT
FILES:=\
$(PKG_BUILD_DIR)/rtl8812au.ko
AUTOLOAD:=$(call AutoProbe,rtl8812au)
@ -39,7 +39,9 @@ NOSTDINC_FLAGS := \
-I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
-I$(STAGING_DIR)/usr/include/mac80211 \
-I$(STAGING_DIR)/usr/include/mac80211/uapi \
-include backport/backport.h
-include backport/backport.h \
-Wno-error=address \
-Wno-error=stringop-overread
NOSTDINC_FLAGS+=-DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DBUILD_OPENWRT

View File

@ -0,0 +1,56 @@
--- a/os_dep/linux/ioctl_cfg80211.c
+++ b/os_dep/linux/ioctl_cfg80211.c
@@ -798,8 +798,8 @@ check_bss:
DBG_871X(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter));
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
- roam_info.channel = notify_channel;
- roam_info.bssid = cur_network->network.MacAddress;
+ roam_info.links[0].channel = notify_channel;
+ roam_info.links[0].bssid = cur_network->network.MacAddress;
roam_info.req_ie = pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2;
roam_info.req_ie_len = pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2;
roam_info.resp_ie = pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6;
@@ -1389,6 +1389,7 @@ exit:
static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
+ int link_id,
u8 key_index, bool pairwise, const u8 *mac_addr,
#else // (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
u8 key_index, const u8 *mac_addr,
@@ -1529,6 +1530,7 @@ addkey_end:
static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
+ int link_id,
u8 key_index, bool pairwise, const u8 *mac_addr,
#else // (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
u8 key_index, const u8 *mac_addr,
@@ -1562,6 +1564,7 @@ static int cfg80211_rtw_get_key(struct w
static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
+ int link_id,
u8 key_index, bool pairwise, const u8 *mac_addr)
#else // (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
u8 key_index, const u8 *mac_addr)
@@ -1581,7 +1584,7 @@ static int cfg80211_rtw_del_key(struct w
}
static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
- struct net_device *ndev, u8 key_index
+ struct net_device *ndev, int link_id, u8 key_index
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE)
, bool unicast, bool multicast
#endif
@@ -4019,7 +4022,8 @@ static int cfg80211_rtw_change_beacon(st
return ret;
}
-static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
+static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev,
+ unsigned int link_id)
{
DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
return 0;

View File

@ -81,7 +81,7 @@ HOST_CONFIGURE_VARS += \
CONFIGURE_VARS += \
ac_cv_search__obstack_free=yes
TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result -Wno-format-nonliteral
TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result -Wno-format-nonliteral -Wno-error=use-after-free
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2006-2022 OpenWrt.org
# Copyright (C) 2006-2013 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libpcap
PKG_VERSION:=1.10.1
PKG_RELEASE:=$(AUTORELEASE)
PKG_VERSION:=1.10.3
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://www.tcpdump.org/release/
PKG_HASH:=ed285f4accaf05344f90975757b3dbfe772ba41d1c401c2648b7fa45b711bdd4
PKG_HASH:=2a8885c403516cf7b0933ed4b14d6caa30e02052489ebd414dc75ac52e7559e6
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=BSD-3-Clause

View File

@ -1,6 +1,6 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1042,7 +1042,6 @@ endif()
@@ -1325,7 +1325,6 @@ endif()
#
# OpenSSL/libressl.
#

View File

@ -9,7 +9,7 @@ Subject: [PATCH] skip manpages
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2732,57 +2732,6 @@ if(NOT MSVC)
@@ -3325,57 +3325,6 @@ if(NOT MSVC)
if(MINGW)
find_program(LINK_EXECUTABLE ln)
endif(MINGW)

View File

@ -1,26 +0,0 @@
--- a/pcap-common.c
+++ b/pcap-common.c
@@ -1662,14 +1662,23 @@ swap_pseudo_headers(int linktype, struct
break;
case DLT_USB_LINUX:
+#ifndef PCAP_SUPPORT_USB
+ return;
+#endif
swap_linux_usb_header(hdr, data, 0);
break;
case DLT_USB_LINUX_MMAPPED:
+#ifndef PCAP_SUPPORT_USB
+ return;
+#endif
swap_linux_usb_header(hdr, data, 1);
break;
case DLT_NFLOG:
+#ifndef PCAP_SUPPORT_NETFILTER
+ return;
+#endif
swap_nflog_header(hdr, data);
break;
}

View File

@ -1,6 +1,6 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -200,15 +200,7 @@ option(NO_PROTOCHAIN "Disable protochain
@@ -477,15 +477,7 @@ option(NO_PROTOCHAIN "Disable protochain
#
set(PCAP_TYPE "" CACHE STRING "Packet capture type")

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
@@ -133,6 +133,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
@@ -60,6 +60,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"
@@ -9436,6 +9438,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
@@ -375,6 +375,7 @@ DIAG_OFF_BISON_BYACC
%type <i> mtp2type
%type <blk> mtp3field
%type <blk> mtp3fieldvalue mtp3value mtp3listvalue
+%type <rblk> pbatadv
%token DST SRC HOST GATEWAY
@@ -393,7 +394,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
@@ -620,11 +621,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
@@ -136,8 +136,12 @@
#include "diag-control.h"
+#include "batadv_packet.h"
+#include "batadv_legacy_packet.h"
+
#include "gencode.h"
#include <pcap/namedb.h>
+
#include "nametoaddr.h"
#ifdef HAVE_OS_PROTO_H
@@ -604,6 +608,7 @@ PCAP_API_DEF struct eproto eproto_db[] =
{ "moprc", ETHERTYPE_MOPRC },
{ "rarp", ETHERTYPE_REVARP },
{ "sca", ETHERTYPE_SCA },
+ { "batadv", ETHERTYPE_BATMAN },
{ (char *)0, 0 }
};
@@ -638,6 +643,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
@@ -792,6 +793,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
@@ -70,6 +70,8 @@ PCAP_API int pcap_nametoportrange(const
PCAP_API int pcap_nametoproto(const char *);
PCAP_API int pcap_nametoeproto(const char *);
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.
* Also, pcap_nametoport() returns the protocol along with the port number.
--- a/scanner.l
+++ b/scanner.l
@@ -347,6 +347,7 @@ mpls return MPLS;
pppoed return PPPOED;
pppoes return PPPOES;
geneve return GENEVE;
+batadv return BATADV;
lane return LANE;
llc return LLC;

View File

@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libtraceevent
PKG_VERSION:=1.7.0
PKG_VERSION:=1.7.1
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:=3e902184f743c955b183b45f25ea163a3d41c9f287fdcfc95cd9cca748c563c8
PKG_HASH:=17b7131c106793c3b45477445bd32d295170c4245ed8348e03c17296e53009e1
PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org>

View File

@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libtracefs
PKG_VERSION:=1.6.3
PKG_VERSION:=1.6.4
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:=de307faaa54ac52cf0ce3ff19b32b51af24897e3440e643068ac82d31e197e92
PKG_HASH:=52ce793dbb35a3e59bddce31de09a5d92cedd4d0702e64d0916f1ccdb00526c9
PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org>

View File

@ -130,13 +130,6 @@ CMAKE_OPTIONS += \
-DENABLE_TESTING:Bool=OFF \
-DENABLE_PROGRAMS:Bool=ON
define Build/Configure
$(call Build/Configure/Default)
sed -i '/fuzz/d' $(PKG_BUILD_DIR)/programs/CMakeLists.txt
sed -i '/test/d' $(PKG_BUILD_DIR)/programs/CMakeLists.txt
endef
define Build/Prepare
$(call Build/Prepare/Default)

View File

@ -0,0 +1,15 @@
--- a/programs/CMakeLists.txt
+++ b/programs/CMakeLists.txt
@@ -1,12 +1,8 @@
add_subdirectory(aes)
-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

@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ncurses
PKG_CPE_ID:=cpe:/a:gnu:ncurses
PKG_VERSION:=6.3
PKG_RELEASE:=$(AUTORELEASE)
PKG_VERSION:=6.4
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
PKG_HASH:=97fc51ac2b085d4cde31ef4d2c3122c21abc217e9090a43a30fc5ec21684e059
PKG_HASH:=6931283d9ac87c5073f30b6290c4c75f21632bb4fc3603ac8100812bed248159
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=README

View File

@ -1,6 +1,6 @@
--- a/misc/terminfo.src
+++ b/misc/terminfo.src
@@ -6616,6 +6616,172 @@ rxvt-cygwin-native|rxvt terminal emulato
@@ -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,

View File

@ -1,14 +1,14 @@
--- a/misc/terminfo.src
+++ b/misc/terminfo.src
@@ -4815,6 +4815,7 @@ xterm+nofkeys|building block for xterm f
# This version reflects the current xterm features.
xterm-new|modern xterm terminal emulator,
@@ -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=xterm+pcfkeys,
use=xterm+nofkeys,
@@ -6416,6 +6417,7 @@ mlterm-256color|mlterm 3.0 with xterm 25
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,
@ -16,24 +16,24 @@
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,
@@ -6425,7 +6427,7 @@ rxvt-basic|rxvt terminal base (X Window
@@ -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,
rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E>, rmso=\E[27m,
rmul=\E[24m,
@@ -8060,6 +8062,7 @@ dumb-emacs-ansi|Emacs dumb terminal with
screen|VT 100/ANSI X3.64 virtual terminal,
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,
@@ -8071,7 +8074,7 @@ screen|VT 100/ANSI X3.64 virtual termina
@@ -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,
@ -42,7 +42,7 @@
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~,
@@ -8199,6 +8202,7 @@ screen.xterm-r6|screen customized for X1
@@ -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,

View File

@ -15,7 +15,7 @@ Subject: [PATCH] ncurses 5.9 - patch 20141206
--- a/ncurses/base/MKlib_gen.sh
+++ b/ncurses/base/MKlib_gen.sh
@@ -511,11 +511,22 @@ sed -n -f $ED1 \
@@ -512,11 +512,22 @@ sed -n -f $ED1 \
-e 's/gen_$//' \
-e 's/ / /g' >>$TMP

View File

@ -1,6 +1,6 @@
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -505,7 +505,7 @@ AC_CACHE_CHECK(for options to update arc
@@ -523,7 +523,7 @@ AC_CACHE_CHECK(for options to update arc
;;
(*)
cf_cv_ar_flags=unknown
@ -11,7 +11,7 @@
# check if $ARFLAGS already contains this choice
--- a/configure
+++ b/configure
@@ -5072,7 +5072,7 @@ else
@@ -5110,7 +5110,7 @@ else
;;
(*)
cf_cv_ar_flags=unknown

View File

@ -1,6 +1,6 @@
--- a/misc/terminfo.src
+++ b/misc/terminfo.src
@@ -6240,12 +6240,11 @@ konsole-xf3x|KDE console window with key
@@ -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,

View File

@ -0,0 +1,52 @@
From 2bcf8e69bd92e33d84c48e7d108d3d46b22f8a6d Mon Sep 17 00:00:00 2001
From: ValdikSS <iam@valdikss.org.ru>
Date: Wed, 18 Jan 2023 20:14:48 +0300
Subject: [PATCH] Padlock: fix byte swapping assembly for AES-192 and 256
Byte swapping code incorrectly uses the number of AES rounds to swap expanded
AES key, while swapping only a single dword in a loop, resulting in swapped
key and partially swapped expanded keys, breaking AES encryption and
decryption on VIA Padlock hardware.
This commit correctly sets the number of swapping loops to be done.
Fixes #20073
CLA: trivial
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20077)
(cherry picked from commit 7331e7ef79fe4499d81cc92249e9c97e9ff9291a)
---
engines/asm/e_padlock-x86.pl | 2 ++
engines/asm/e_padlock-x86_64.pl | 2 ++
2 files changed, 4 insertions(+)
diff --git a/engines/asm/e_padlock-x86.pl b/engines/asm/e_padlock-x86.pl
index 5b097ce3ef9b..07f7000fd38a 100644
--- a/engines/asm/e_padlock-x86.pl
+++ b/engines/asm/e_padlock-x86.pl
@@ -116,6 +116,8 @@
&function_begin_B("padlock_key_bswap");
&mov ("edx",&wparam(0));
&mov ("ecx",&DWP(240,"edx"));
+ &inc ("ecx");
+ &shl ("ecx",2);
&set_label("bswap_loop");
&mov ("eax",&DWP(0,"edx"));
&bswap ("eax");
diff --git a/engines/asm/e_padlock-x86_64.pl b/engines/asm/e_padlock-x86_64.pl
index 09b0aaa48dfe..dfd2ae656375 100644
--- a/engines/asm/e_padlock-x86_64.pl
+++ b/engines/asm/e_padlock-x86_64.pl
@@ -92,6 +92,8 @@
.align 16
padlock_key_bswap:
mov 240($arg1),%edx
+ inc %edx
+ shl \$2,%edx
.Lbswap_loop:
mov ($arg1),%eax
bswap %eax

View File

@ -8,15 +8,16 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=lldpd
PKG_VERSION:=1.0.9
PKG_RELEASE:=3
PKG_VERSION:=1.0.16
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://media.luffy.cx/files/lldpd
PKG_HASH:=6b64eb3125952b1e33472198b054e8aa0dee45f45d3d4be22789090a474949f5
PKG_SOURCE_URL:=https://github.com/lldpd/lldpd/releases/download/$(PKG_VERSION)/
PKG_HASH:=7753c6e31e938923185f4e10c4ab328929729e22ee4a9687d08881fb82c092ee
PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
PKG_LICENSE:=ISC
PKG_CPE_ID:=cpe:/a:lldpd_project:lldpd
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1

View File

@ -56,6 +56,10 @@ write_lldpd_conf()
[ -e $LLDPD_CONFS_DIR ] || ln -s /etc/lldpd.d $LLDPD_CONFS_DIR
}
service_triggers() {
procd_add_reload_trigger "lldpd"
}
start_service() {
local enable_cdp
@ -84,8 +88,7 @@ start_service() {
write_lldpd_conf
procd_open_instance
procd_set_param command /usr/sbin/lldpd
procd_append_param command -d # don't daemonize, procd will handle that for us
procd_set_param command /usr/sbin/lldpd -d
[ $enable_cdp -gt 0 ] && procd_append_param command '-c'
[ $enable_fdp -gt 0 ] && procd_append_param command '-f'

View File

@ -0,0 +1,43 @@
From 3a3a2f6be704c970938eb8dac4eb0118f1c2fb06 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Wed, 21 Dec 2022 23:26:28 +0100
Subject: [PATCH iproute2 v2] configure: Remove include <sys/stat.h>
The check_name_to_handle_at() function in the configure script is
including sys/stat.h. This include fails with glibc 2.36 like this:
````
In file included from /linux-5.15.84/include/uapi/linux/stat.h:5,
from /toolchain-x86_64_gcc-12.2.0_glibc/include/bits/statx.h:31,
from /toolchain-x86_64_gcc-12.2.0_glibc/include/sys/stat.h:465,
from config.YExfMc/name_to_handle_at_test.c:3:
/linux-5.15.84/include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel headers from user space, see https://kernelnewbies.org/KernelHeaders" [-Wcpp]
10 | #warning "Attempt to use kernel headers from user space, see https://kernelnewbies.org/KernelHeaders"
| ^~~~~~~
In file included from /linux-5.15.84/include/uapi/linux/posix_types.h:5,
from /linux-5.15.84/include/uapi/linux/types.h:14:
/linux-5.15.84/include/uapi/linux/stddef.h:5:10: fatal error: linux/compiler_types.h: No such file or directory
5 | #include <linux/compiler_types.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
````
Just removing the include works, the manpage of name_to_handle_at() says
only fcntl.h is needed.
Fixes: c5b72cc56bf8 ("lib/fs: fix issue when {name,open}_to_handle_at() is not implemented")
Tested-by: Heiko Thiery <heiko.thiery@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
configure | 1 -
1 file changed, 1 deletion(-)
--- a/configure
+++ b/configure
@@ -215,7 +215,6 @@ check_name_to_handle_at()
cat >$TMPDIR/name_to_handle_at_test.c <<EOF
#define _GNU_SOURCE
#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
int main(int argc, char **argv)
{

View File

@ -6,12 +6,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=nftables
PKG_VERSION:=1.0.5
PKG_RELEASE:=2
PKG_VERSION:=1.0.6
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files
PKG_HASH:=8d1b4b18393af43698d10baa25d2b9b6397969beecac7816c35dd0714e4de50a
PKG_HASH:=2407430ddd82987670e48dc2fda9e280baa8307abec04ab18d609df3db005e4c
PKG_MAINTAINER:=
PKG_LICENSE:=GPL-2.0

View File

@ -1,23 +0,0 @@
'rule inet dscpclassify dscp_match meta l4proto { udp } th dport { 3478 } th sport { 3478-3497, 16384-16387 } goto ct_set_ef'
works with 'nft add', but not 'nft insert', the latter yields: "BUG: unhandled op 4".
Fixes: 81e36530fcac ("src: replace interval segment tree overlap and automerge")
Signed-off-by: Florian Westphal <fw@strlen.de>
---
src/evaluate.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/evaluate.c b/src/evaluate.c
index d9c9ca28a53a..edebd7bcd8ab 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -1520,6 +1520,7 @@ static int interval_set_eval(struct eval_ctx *ctx, struct set *set,
switch (ctx->cmd->op) {
case CMD_CREATE:
case CMD_ADD:
+ case CMD_INSERT:
if (set->automerge) {
ret = set_automerge(ctx->msgs, ctx->cmd, set, init,
ctx->nft->debug_mask);
--
2.35.1

View File

@ -32,7 +32,11 @@ define Package/uqmi/description
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include -ffunction-sections -fdata-sections
-I$(STAGING_DIR)/usr/include \
-ffunction-sections \
-fdata-sections \
-Wno-error=dangling-pointer \
-Wno-error=maybe-uninitialized
TARGET_LDFLAGS += -Wl,--gc-sections

View File

@ -29,7 +29,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
ifeq ($(KVER), 3.4.0)
OS_VER=3_4
endif
@@ -123,7 +127,7 @@ endif
@@ -123,7 +131,7 @@ endif
endif
ifeq ($(ARCH), arm64)

View File

@ -1,6 +1,6 @@
--- a/app/nathelper/linux/lib/nat_helper_dt.c
+++ b/app/nathelper/linux/lib/nat_helper_dt.c
@@ -721,7 +721,7 @@ napt_ct_counter_sync(a_uint32_t hw_index)
@@ -721,7 +721,7 @@ napt_ct_counter_sync(a_uint32_t hw_index
}
if (!test_bit(IPS_FIXED_TIMEOUT_BIT, &ct->status)) {
@ -9,7 +9,7 @@
}
if((cct != NULL) && (napt_hw_get_by_index(&napt, hw_index) == 0))
@@ -770,7 +770,7 @@ napt_ct_timer_update(a_uint32_t hw_index)
@@ -770,7 +770,7 @@ napt_ct_timer_update(a_uint32_t hw_index
}
if (!test_bit(IPS_FIXED_TIMEOUT_BIT, &ct->status)) {
@ -32,7 +32,7 @@
}
int
@@ -85,7 +80,7 @@ napt_ct_aging_is_enable(uint32_t ct_addr)
@@ -85,7 +80,7 @@ napt_ct_aging_is_enable(uint32_t ct_addr
ct = (struct nf_conn *)ct_addr;
@ -70,7 +70,7 @@
struct nf_conntrack_tuple_hash *h = NULL;
struct nf_conn *ct = NULL;
struct hlist_nulls_node *pos = (struct hlist_nulls_node *) (*iterate);
@@ -349,7 +342,7 @@ napt_ct_list_iterate(uint32_t *hash, uint32_t *iterate)
@@ -349,7 +342,7 @@ napt_ct_list_iterate(uint32_t *hash, uin
if(pos == 0)
{
/*get head for list*/

View File

@ -0,0 +1,30 @@
From ecd1e0c57fdf7f8916fa20f085e08bb4b6ba0396 Mon Sep 17 00:00:00 2001
From: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Date: Fri, 23 Sep 2022 08:21:13 -0500
Subject: [PATCH 10/11] QSDK: config: Avoid -Werror heroics
Trying to compile the QSDK with warnings as errors is a very brave
endeavor. It's also stupid as it doesn't work on ipq60xx:
isisc_acl_prv.h:99: error: "FIELD_GET" redefined [-Werror]
99 | #define FIELD_GET(reg, field, val) \
|
Instead of dealing with the braindead code, just disable Werror.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
---
config | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/config
+++ b/config
@@ -132,7 +132,7 @@ endif
ifeq ($(ARCH), arm64)
ifeq ($(KVER),$(filter 4.1% 4.4% 4.9% 5.4% 5.10% 5.15%,$(KVER)))
- CPU_CFLAG= -DMODULE -Os -pipe -march=armv8-a -mcpu=cortex-a53+crypto -fno-caller-saves -fno-strict-aliasing -Werror -fno-common -Wno-format-security -Wno-pointer-sign -Wno-unused-but-set-variable -Wno-error=unused-result -mcmodel=large
+ CPU_CFLAG= -DMODULE -Os -pipe -march=armv8-a -mcpu=cortex-a53+crypto -fno-caller-saves -fno-strict-aliasing -fno-common -Wno-format-security -Wno-pointer-sign -Wno-unused-but-set-variable -Wno-error=unused-result -Wno-error=maybe-uninitialized -Wno-error=array-bounds -mcmodel=large
endif
endif

View File

@ -10,8 +10,6 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
include/ref/ref_uci.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/ref/ref_uci.h b/include/ref/ref_uci.h
index a42ea153..0906c5ba 100755
--- a/include/ref/ref_uci.h
+++ b/include/ref/ref_uci.h
@@ -19,6 +19,7 @@
@ -22,6 +20,3 @@ index a42ea153..0906c5ba 100755
#if defined(IN_SWCONFIG)
int
--
2.34.1

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2014-2022 OpenWrt.org
# Copyright (C) 2014-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fstools
PKG_RELEASE:=$(AUTORELEASE)
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git
PKG_MIRROR_HASH:=28be14a1e28fc62e80681e1b5e7f2435692ee326b66afcc1f3d158764df686d5
PKG_SOURCE_DATE:=2022-11-10
PKG_SOURCE_VERSION:=3affe9ea5098c8bb90111ce97d50ad976ef0c034
PKG_MIRROR_HASH:=edda9151c73c1adfe369f5e315347344727a540ad57d3e2b41b9f57f9d4313fe
PKG_SOURCE_DATE:=2023-01-22
PKG_SOURCE_VERSION:=1ea5855e980cd88766dd9f615e78e7dd6edfbb74
CMAKE_INSTALL:=1
PKG_LICENSE:=GPL-2.0

View File

@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=procd
PKG_RELEASE:=$(AUTORELEASE)
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git
PKG_MIRROR_HASH:=d60b4aa9d47d75e906dfd812528a1bc28e91f5af72a9d9275056b71b19d99f04
PKG_SOURCE_DATE:=2022-11-10
PKG_SOURCE_VERSION:=039b88f75367203e540009cc97603b1bce3fafa6
PKG_MIRROR_HASH:=75a92c01ef85f41dc7e0b77ac35f464fbe45942af02ca6847516c4ebf574c4a4
PKG_SOURCE_DATE:=2023-01-16
PKG_SOURCE_VERSION:=190f13a75e67e0bdb662188da79b8be31e0aae01
CMAKE_INSTALL:=1
PKG_LICENSE:=GPL-2.0

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=urngd
PKG_RELEASE:=2
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/urngd.git

View File

@ -208,6 +208,15 @@ config BUSYBOX_DEFAULT_PASSWORD_MINLEN
config BUSYBOX_DEFAULT_MD5_SMALL
int
default 1
config BUSYBOX_DEFAULT_SHA1_SMALL
int
default 3
config BUSYBOX_DEFAULT_SHA1_HWACCEL
bool
default y
config BUSYBOX_DEFAULT_SHA256_HWACCEL
bool
default y
config BUSYBOX_DEFAULT_SHA3_SMALL
int
default 1
@ -298,6 +307,15 @@ config BUSYBOX_DEFAULT_UNICODE_NEUTRAL_TABLE
config BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN
bool
default n
config BUSYBOX_DEFAULT_LOOP_CONFIGURE
bool
default n
config BUSYBOX_DEFAULT_NO_LOOP_CONFIGURE
bool
default n
config BUSYBOX_DEFAULT_TRY_LOOP_CONFIGURE
bool
default y
config BUSYBOX_DEFAULT_FEATURE_SEAMLESS_XZ
bool
default n
@ -860,6 +878,9 @@ config BUSYBOX_DEFAULT_TRUNCATE
bool
default y if TARGET_bcm53xx
default n
config BUSYBOX_DEFAULT_TSORT
bool
default n
config BUSYBOX_DEFAULT_TTY
bool
default n
@ -2162,6 +2183,9 @@ config BUSYBOX_DEFAULT_RUNLEVEL
config BUSYBOX_DEFAULT_RX
bool
default n
config BUSYBOX_DEFAULT_SEEDRNG
bool
default n
config BUSYBOX_DEFAULT_SETFATTR
bool
default n
@ -2174,6 +2198,9 @@ config BUSYBOX_DEFAULT_STRINGS
config BUSYBOX_DEFAULT_TIME
bool
default y
config BUSYBOX_DEFAULT_TREE
bool
default n
config BUSYBOX_DEFAULT_TS
bool
default n
@ -2682,6 +2709,9 @@ config BUSYBOX_DEFAULT_FEATURE_UDHCPC_SANITIZEOPT
config BUSYBOX_DEFAULT_UDHCPC_DEFAULT_SCRIPT
string
default "/usr/share/udhcpc/default.script"
config BUSYBOX_DEFAULT_UDHCPC6_DEFAULT_SCRIPT
string
default ""
config BUSYBOX_DEFAULT_UDHCPC6
bool
default n
@ -3012,6 +3042,9 @@ config BUSYBOX_DEFAULT_ASH_PRINTF
config BUSYBOX_DEFAULT_ASH_TEST
bool
default y
config BUSYBOX_DEFAULT_ASH_SLEEP
bool
default n
config BUSYBOX_DEFAULT_ASH_HELP
bool
default n

View File

@ -5,14 +5,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=busybox
PKG_VERSION:=1.35.0
PKG_RELEASE:=$(AUTORELEASE)
PKG_VERSION:=1.36.0
PKG_RELEASE:=1
PKG_FLAGS:=essential
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://www.busybox.net/downloads \
http://sources.buildroot.net
PKG_HASH:=faeeb244c35a348a334f4a59e44626ee870fb07b6884d68c10ae8bc19f83a694
PKG_HASH:=542750c8af7cb2630e201780b4f99f3dcceeb06f505b479ec68241c1e6af61a5
PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_PAM:libpam
PKG_BUILD_PARALLEL:=1

View File

@ -653,7 +653,7 @@ config BUSYBOX_CONFIG_SORT
sort is used to sort lines of text in specified files.
config BUSYBOX_CONFIG_FEATURE_SORT_BIG
bool "Full SuSv3 compliant sort (support -ktcbdfiogM)"
bool "Full SuSv3 compliant sort (support -ktcbdfioghM)"
default BUSYBOX_DEFAULT_FEATURE_SORT_BIG
depends on BUSYBOX_CONFIG_SORT
help
@ -851,6 +851,11 @@ config BUSYBOX_CONFIG_TRUNCATE
help
truncate truncates files to a given size. If a file does
not exist, it is created unless told otherwise.
config BUSYBOX_CONFIG_TSORT
bool "tsort (0.7 kb)"
default BUSYBOX_DEFAULT_TSORT
help
tsort performs a topological sort.
config BUSYBOX_CONFIG_TTY
bool "tty (3.6 kb)"
default BUSYBOX_DEFAULT_TTY

View File

@ -98,21 +98,47 @@ config BUSYBOX_CONFIG_MD5_SMALL
default BUSYBOX_DEFAULT_MD5_SMALL # all "fast or small" options default to small
range 0 3
help
Trade binary size versus speed for the md5sum algorithm.
Trade binary size versus speed for the md5 algorithm.
Approximate values running uClibc and hashing
linux-2.4.4.tar.bz2 were:
value user times (sec) text size (386)
0 (fastest) 1.1 6144
1 1.4 5392
2 3.0 5088
3 (smallest) 5.1 4912
value user times (sec) text size (386)
0 (fastest) 1.1 6144
1 1.4 5392
2 3.0 5088
3 (smallest) 5.1 4912
config BUSYBOX_CONFIG_SHA1_SMALL
int "SHA1: Trade bytes for speed (0:fast, 3:slow)"
default BUSYBOX_DEFAULT_SHA1_SMALL # all "fast or small" options default to small
range 0 3
help
Trade binary size versus speed for the sha1 algorithm.
With FEATURE_COPYBUF_KB=64:
throughput MB/s size of sha1_process_block64
value 486 x86-64 486 x86-64
0 440 485 3481 3502
1 265 265 641 696
2,3 220 210 342 364
config BUSYBOX_CONFIG_SHA1_HWACCEL
bool "SHA1: Use hardware accelerated instructions if possible"
default BUSYBOX_DEFAULT_SHA1_HWACCEL
help
On x86, this adds ~590 bytes of code. Throughput
is about twice as fast as fully-unrolled generic code.
config BUSYBOX_CONFIG_SHA256_HWACCEL
bool "SHA256: Use hardware accelerated instructions if possible"
default BUSYBOX_DEFAULT_SHA256_HWACCEL
help
On x86, this adds ~1k bytes of code.
config BUSYBOX_CONFIG_SHA3_SMALL
int "SHA3: Trade bytes for speed (0:fast, 1:slow)"
default BUSYBOX_DEFAULT_SHA3_SMALL # all "fast or small" options default to small
range 0 1
help
Trade binary size versus speed for the sha3sum algorithm.
Trade binary size versus speed for the sha3 algorithm.
SHA3_SMALL=0 compared to SHA3_SMALL=1 (approximate):
64-bit x86: +270 bytes of code, 45% faster
32-bit x86: +450 bytes of code, 75% faster
@ -399,3 +425,25 @@ config BUSYBOX_CONFIG_UNICODE_PRESERVE_BROKEN
For example, this means that entering 'l', 's', ' ', 0xff, [Enter]
at shell prompt will list file named 0xff (single char name
with char value 255), not file named '?'.
choice
prompt "Use LOOP_CONFIGURE for losetup and loop mounts"
default BUSYBOX_CONFIG_TRY_LOOP_CONFIGURE
help
LOOP_CONFIGURE is added to Linux 5.8
https://lwn.net/Articles/820408/
This allows userspace to completely setup a loop device with a single
ioctl, removing the in-between state where the device can be partially
configured - eg the loop device has a backing file associated with it,
but is reading from the wrong offset.
config BUSYBOX_CONFIG_LOOP_CONFIGURE
bool "use LOOP_CONFIGURE, needs kernel >= 5.8"
config BUSYBOX_CONFIG_NO_LOOP_CONFIGURE
bool "use LOOP_SET_FD + LOOP_SET_STATUS"
config BUSYBOX_CONFIG_TRY_LOOP_CONFIGURE
bool "try LOOP_CONFIGURE, fall back to LOOP_SET_FD + LOOP_SET_STATUS"
endchoice

View File

@ -704,6 +704,13 @@ config BUSYBOX_CONFIG_RX
default BUSYBOX_DEFAULT_RX
help
Receive files using the Xmodem protocol.
config BUSYBOX_CONFIG_SEEDRNG
bool "seedrng (1.3 kb)"
default BUSYBOX_DEFAULT_SEEDRNG
help
Seed the kernel RNG from seed files, meant to be called
once during startup, once during shutdown, and optionally
at some periodic interval in between.
config BUSYBOX_CONFIG_SETFATTR
bool "setfattr (3.7 kb)"
default BUSYBOX_DEFAULT_SETFATTR
@ -727,6 +734,11 @@ config BUSYBOX_CONFIG_TIME
The time command runs the specified program with the given arguments.
When the command finishes, time writes a message to standard output
giving timing statistics about this program run.
config BUSYBOX_CONFIG_TREE
bool "tree (0.6 kb)"
default BUSYBOX_DEFAULT_TREE
help
List files and directories in a tree structure.
config BUSYBOX_CONFIG_TS
bool "ts (450 bytes)"
default BUSYBOX_DEFAULT_TS

View File

@ -93,12 +93,17 @@ config BUSYBOX_CONFIG_FEATURE_UDHCPC_SANITIZEOPT
config BUSYBOX_CONFIG_UDHCPC_DEFAULT_SCRIPT
string "Absolute path to config script"
default BUSYBOX_DEFAULT_UDHCPC_DEFAULT_SCRIPT
depends on BUSYBOX_CONFIG_UDHCPC || BUSYBOX_CONFIG_UDHCPC6
depends on BUSYBOX_CONFIG_UDHCPC
help
This script is called after udhcpc receives an answer. See
examples/udhcp for a working example. Normally it is safe
to leave this untouched.
config BUSYBOX_CONFIG_UDHCPC6_DEFAULT_SCRIPT
string "Absolute path to config script for IPv6"
default BUSYBOX_DEFAULT_UDHCPC6_DEFAULT_SCRIPT
depends on BUSYBOX_CONFIG_UDHCPC6
# udhcpc6 config is inserted here:
config BUSYBOX_CONFIG_UDHCPC6
bool "udhcpc6 (21 kb)"

View File

@ -201,6 +201,11 @@ config BUSYBOX_CONFIG_ASH_TEST
default BUSYBOX_DEFAULT_ASH_TEST
depends on BUSYBOX_CONFIG_SHELL_ASH
config BUSYBOX_CONFIG_ASH_SLEEP
bool "sleep builtin"
default BUSYBOX_DEFAULT_ASH_SLEEP
depends on BUSYBOX_CONFIG_SHELL_ASH
config BUSYBOX_CONFIG_ASH_HELP
bool "help builtin"
default BUSYBOX_DEFAULT_ASH_HELP

View File

@ -1,42 +0,0 @@
From e63d7cdfdac78c6fd27e9e63150335767592b85e Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Fri, 17 Jun 2022 17:45:34 +0200
Subject: awk: fix use after free (CVE-2022-30065)
fixes https://bugs.busybox.net/show_bug.cgi?id=14781
function old new delta
evaluate 3343 3357 +14
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---
editors/awk.c | 3 +++
testsuite/awk.tests | 6 ++++++
2 files changed, 9 insertions(+)
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -3114,6 +3114,9 @@ static var *evaluate(node *op, var *res)
case XC( OC_MOVE ):
debug_printf_eval("MOVE\n");
+ /* make sure that we never return a temp var */
+ if (L.v == TMPVAR0)
+ L.v = res;
/* if source is a temporary string, jusk relink it to dest */
if (R.v == TMPVAR1
&& !(R.v->type & VF_NUMBER)
--- a/testsuite/awk.tests
+++ b/testsuite/awk.tests
@@ -469,4 +469,10 @@ testing 'awk printf %% prints one %' \
"%\n" \
'' ''
+testing 'awk assign while test' \
+ "awk '\$1==\$1=\"foo\" {print \$1}'" \
+ "foo\n" \
+ "" \
+ "foo"
+
exit $FAILCOUNT

View File

@ -0,0 +1,40 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ucode-mod-bpf
PKG_RELEASE:=1
PKG_LICENSE:=ISC
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/ucode-mod-bpf
SECTION:=utils
CATEGORY:=Utilities
TITLE:=ucode eBPF module
DEPENDS:=+libucode +libbpf
endef
define Package/ucode-mod-bpf/description
The bpf plugin provides functionality for loading and interacting with
eBPF modules.
It allows loading full modules and pinned maps/programs and supports
interacting with maps and attaching programs as tc classifiers.
endef
define Package/ucode-mod-bpf/install
$(INSTALL_DIR) $(1)/usr/lib/ucode
$(CP) $(PKG_BUILD_DIR)/bpf.so $(1)/usr/lib/ucode/
endef
define Build/Configure
endef
define Build/Compile
$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) $(FPIC) \
-Wall -ffunction-sections -Wl,--gc-sections -shared -Wl,--no-as-needed -lbpf \
-o $(PKG_BUILD_DIR)/bpf.so $(PKG_BUILD_DIR)/bpf.c
endef
$(eval $(call BuildPackage,ucode-mod-bpf))

View File

@ -0,0 +1,814 @@
#include <sys/resource.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <stdint.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <bpf/bpf.h>
#include <bpf/libbpf.h>
#include "ucode/module.h"
#define err_return_int(err, ...) do { set_error(err, __VA_ARGS__); return -1; } while(0)
#define err_return(err, ...) do { set_error(err, __VA_ARGS__); return NULL; } while(0)
#define TRUE ucv_boolean_new(true)
static uc_resource_type_t *module_type, *map_type, *map_iter_type, *program_type;
static uc_value_t *registry;
static uc_vm_t *debug_vm;
static struct {
int code;
char *msg;
} last_error;
struct uc_bpf_fd {
int fd;
bool close;
};
struct uc_bpf_map {
struct uc_bpf_fd fd; /* must be first */
unsigned int key_size, val_size;
};
struct uc_bpf_map_iter {
int fd;
unsigned int key_size;
bool has_next;
uint8_t key[];
};
__attribute__((format(printf, 2, 3))) static void
set_error(int errcode, const char *fmt, ...)
{
va_list ap;
free(last_error.msg);
last_error.code = errcode;
last_error.msg = NULL;
if (fmt) {
va_start(ap, fmt);
xvasprintf(&last_error.msg, fmt, ap);
va_end(ap);
}
}
static void init_env(void)
{
static bool init_done = false;
struct rlimit limit = {
.rlim_cur = RLIM_INFINITY,
.rlim_max = RLIM_INFINITY,
};
if (init_done)
return;
setrlimit(RLIMIT_MEMLOCK, &limit);
init_done = true;
}
static uc_value_t *
uc_bpf_error(uc_vm_t *vm, size_t nargs)
{
uc_value_t *numeric = uc_fn_arg(0);
const char *msg = last_error.msg;
int code = last_error.code;
uc_stringbuf_t *buf;
const char *s;
if (last_error.code == 0)
return NULL;
set_error(0, NULL);
if (ucv_is_truish(numeric))
return ucv_int64_new(code);
buf = ucv_stringbuf_new();
if (code < 0 && msg) {
ucv_stringbuf_addstr(buf, msg, strlen(msg));
} else {
s = strerror(code);
ucv_stringbuf_addstr(buf, s, strlen(s));
if (msg)
ucv_stringbuf_printf(buf, ": %s", msg);
}
return ucv_stringbuf_finish(buf);
}
static int
uc_bpf_module_set_opts(struct bpf_object *obj, uc_value_t *opts)
{
uc_value_t *val;
if (!opts)
return 0;
if (ucv_type(opts) != UC_OBJECT)
err_return_int(EINVAL, "options argument");
if ((val = ucv_object_get(opts, "rodata", NULL)) != NULL) {
struct bpf_map *map = NULL;
if (ucv_type(val) != UC_STRING)
err_return_int(EINVAL, "rodata type");
while ((map = bpf_object__next_map(obj, map)) != NULL) {
if (!strstr(bpf_map__name(map), ".rodata"))
continue;
break;
}
if (!map)
err_return_int(errno, "rodata map");
if (bpf_map__set_initial_value(map, ucv_string_get(val),
ucv_string_length(val)))
err_return_int(errno, "rodata");
}
if ((val = ucv_object_get(opts, "program-type", NULL)) != NULL) {
if (ucv_type(val) != UC_OBJECT)
err_return_int(EINVAL, "prog_types argument");
ucv_object_foreach(val, name, type) {
struct bpf_program *prog;
if (ucv_type(type) != UC_INTEGER)
err_return_int(EINVAL, "program %s type", name);
prog = bpf_object__find_program_by_name(obj, name);
if (!prog)
err_return_int(-1, "program %s not found", name);
bpf_program__set_type(prog, ucv_int64_get(type));
}
}
return 0;
}
static uc_value_t *
uc_bpf_open_module(uc_vm_t *vm, size_t nargs)
{
DECLARE_LIBBPF_OPTS(bpf_object_open_opts, bpf_opts);
uc_value_t *path = uc_fn_arg(0);
uc_value_t *opts = uc_fn_arg(1);
struct bpf_object *obj;
if (ucv_type(path) != UC_STRING)
err_return(EINVAL, "module path");
init_env();
obj = bpf_object__open_file(ucv_string_get(path), &bpf_opts);
if (libbpf_get_error(obj))
err_return(errno, NULL);
if (uc_bpf_module_set_opts(obj, opts)) {
bpf_object__close(obj);
return NULL;
}
if (bpf_object__load(obj)) {
bpf_object__close(obj);
err_return(errno, NULL);
}
return uc_resource_new(module_type, obj);
}
static uc_value_t *
uc_bpf_map_create(int fd, unsigned int key_size, unsigned int val_size, bool close)
{
struct uc_bpf_map *uc_map;
uc_map = xalloc(sizeof(*uc_map));
uc_map->fd.fd = fd;
uc_map->key_size = key_size;
uc_map->val_size = val_size;
uc_map->fd.close = close;
return uc_resource_new(map_type, uc_map);
}
static uc_value_t *
uc_bpf_open_map(uc_vm_t *vm, size_t nargs)
{
struct bpf_map_info info;
uc_value_t *path = uc_fn_arg(0);
__u32 len = sizeof(info);
int err;
int fd;
if (ucv_type(path) != UC_STRING)
err_return(EINVAL, "module path");
fd = bpf_obj_get(ucv_string_get(path));
if (fd < 0)
err_return(errno, NULL);
err = bpf_obj_get_info_by_fd(fd, &info, &len);
if (err) {
close(fd);
err_return(errno, NULL);
}
return uc_bpf_map_create(fd, info.key_size, info.value_size, true);
}
static uc_value_t *
uc_bpf_open_program(uc_vm_t *vm, size_t nargs)
{
uc_value_t *path = uc_fn_arg(0);
struct uc_bpf_fd *f;
int fd;
if (ucv_type(path) != UC_STRING)
err_return(EINVAL, "module path");
fd = bpf_obj_get(ucv_string_get(path));
if (fd < 0)
err_return(errno, NULL);
f = xalloc(sizeof(*f));
f->fd = fd;
f->close = true;
return uc_resource_new(program_type, f);
}
static uc_value_t *
uc_bpf_module_get_maps(uc_vm_t *vm, size_t nargs)
{
struct bpf_object *obj = uc_fn_thisval("bpf.module");
struct bpf_map *map = NULL;
uc_value_t *rv;
int i = 0;
if (!obj)
err_return(EINVAL, NULL);
rv = ucv_array_new(vm);
bpf_object__for_each_map(map, obj)
ucv_array_set(rv, i++, ucv_string_new(bpf_map__name(map)));
return rv;
}
static uc_value_t *
uc_bpf_module_get_map(uc_vm_t *vm, size_t nargs)
{
struct bpf_object *obj = uc_fn_thisval("bpf.module");
struct bpf_map *map;
uc_value_t *name = uc_fn_arg(0);
int fd;
if (!obj || ucv_type(name) != UC_STRING)
err_return(EINVAL, NULL);
map = bpf_object__find_map_by_name(obj, ucv_string_get(name));
if (!map)
err_return(errno, NULL);
fd = bpf_map__fd(map);
if (fd < 0)
err_return(EINVAL, NULL);
return uc_bpf_map_create(fd, bpf_map__key_size(map), bpf_map__value_size(map), false);
}
static uc_value_t *
uc_bpf_module_get_programs(uc_vm_t *vm, size_t nargs)
{
struct bpf_object *obj = uc_fn_thisval("bpf.module");
struct bpf_program *prog = NULL;
uc_value_t *rv;
int i = 0;
if (!obj)
err_return(EINVAL, NULL);
rv = ucv_array_new(vm);
bpf_object__for_each_program(prog, obj)
ucv_array_set(rv, i++, ucv_string_new(bpf_program__name(prog)));
return rv;
}
static uc_value_t *
uc_bpf_module_get_program(uc_vm_t *vm, size_t nargs)
{
struct bpf_object *obj = uc_fn_thisval("bpf.module");
struct bpf_program *prog;
uc_value_t *name = uc_fn_arg(0);
struct uc_bpf_fd *f;
int fd;
if (!obj || !name || ucv_type(name) != UC_STRING)
err_return(EINVAL, NULL);
prog = bpf_object__find_program_by_name(obj, ucv_string_get(name));
if (!prog)
err_return(errno, NULL);
fd = bpf_program__fd(prog);
if (fd < 0)
err_return(EINVAL, NULL);
f = xalloc(sizeof(*f));
f->fd = fd;
return uc_resource_new(program_type, f);
}
static void *
uc_bpf_map_arg(uc_value_t *val, const char *kind, unsigned int size)
{
static union {
uint32_t u32;
uint64_t u64;
} val_int;
switch (ucv_type(val)) {
case UC_INTEGER:
if (size == 4)
val_int.u32 = ucv_int64_get(val);
else if (size == 8)
val_int.u64 = ucv_int64_get(val);
else
break;
return &val_int;
case UC_STRING:
if (size != ucv_string_length(val))
break;
return ucv_string_get(val);
default:
err_return(EINVAL, "%s type", kind);
}
err_return(EINVAL, "%s size mismatch (expected: %d)", kind, size);
}
static uc_value_t *
uc_bpf_map_get(uc_vm_t *vm, size_t nargs)
{
struct uc_bpf_map *map = uc_fn_thisval("bpf.map");
uc_value_t *a_key = uc_fn_arg(0);
void *key, *val;
if (!map)
err_return(EINVAL, NULL);
key = uc_bpf_map_arg(a_key, "key", map->key_size);
if (!key)
return NULL;
val = alloca(map->val_size);
if (bpf_map_lookup_elem(map->fd.fd, key, val))
return NULL;
return ucv_string_new_length(val, map->val_size);
}
static uc_value_t *
uc_bpf_map_set(uc_vm_t *vm, size_t nargs)
{
struct uc_bpf_map *map = uc_fn_thisval("bpf.map");
uc_value_t *a_key = uc_fn_arg(0);
uc_value_t *a_val = uc_fn_arg(1);
uc_value_t *a_flags = uc_fn_arg(2);
uint64_t flags;
void *key, *val;
if (!map)
err_return(EINVAL, NULL);
key = uc_bpf_map_arg(a_key, "key", map->key_size);
if (!key)
return NULL;
val = uc_bpf_map_arg(a_val, "value", map->val_size);
if (!val)
return NULL;
if (!a_flags)
flags = BPF_ANY;
else if (ucv_type(a_flags) != UC_INTEGER)
err_return(EINVAL, "flags");
else
flags = ucv_int64_get(a_flags);
if (bpf_map_update_elem(map->fd.fd, key, val, flags))
return NULL;
return ucv_string_new_length(val, map->val_size);
}
static uc_value_t *
uc_bpf_map_delete(uc_vm_t *vm, size_t nargs)
{
struct uc_bpf_map *map = uc_fn_thisval("bpf.map");
uc_value_t *a_key = uc_fn_arg(0);
uc_value_t *a_return = uc_fn_arg(1);
void *key, *val = NULL;
int ret;
if (!map)
err_return(EINVAL, NULL);
key = uc_bpf_map_arg(a_key, "key", map->key_size);
if (!key)
return NULL;
if (!ucv_is_truish(a_return)) {
ret = bpf_map_delete_elem(map->fd.fd, key);
return ucv_boolean_new(ret == 0);
}
val = alloca(map->val_size);
if (bpf_map_lookup_and_delete_elem(map->fd.fd, key, val))
return NULL;
return ucv_string_new_length(val, map->val_size);
}
static uc_value_t *
uc_bpf_map_delete_all(uc_vm_t *vm, size_t nargs)
{
struct uc_bpf_map *map = uc_fn_thisval("bpf.map");
uc_value_t *filter = uc_fn_arg(0);
bool has_next;
void *key, *next;
if (!map)
err_return(EINVAL, NULL);
key = alloca(map->key_size);
next = alloca(map->key_size);
has_next = !bpf_map_get_next_key(map->fd.fd, NULL, next);
while (has_next) {
bool skip = false;
memcpy(key, next, map->key_size);
has_next = !bpf_map_get_next_key(map->fd.fd, next, next);
if (ucv_is_callable(filter)) {
uc_value_t *rv;
uc_value_push(ucv_get(filter));
uc_value_push(ucv_string_new_length((const char *)key, map->key_size));
if (uc_call(1) != EXCEPTION_NONE)
break;
rv = uc_vm_stack_pop(vm);
if (!rv)
break;
skip = !ucv_is_truish(rv);
ucv_put(rv);
}
if (!skip)
bpf_map_delete_elem(map->fd.fd, key);
}
return TRUE;
}
static uc_value_t *
uc_bpf_map_iterator(uc_vm_t *vm, size_t nargs)
{
struct uc_bpf_map *map = uc_fn_thisval("bpf.map");
struct uc_bpf_map_iter *iter;
if (!map)
err_return(EINVAL, NULL);
iter = xalloc(sizeof(*iter) + map->key_size);
iter->fd = map->fd.fd;
iter->key_size = map->key_size;
iter->has_next = !bpf_map_get_next_key(iter->fd, NULL, &iter->key);
return uc_resource_new(map_iter_type, iter);
}
static uc_value_t *
uc_bpf_map_iter_next(uc_vm_t *vm, size_t nargs)
{
struct uc_bpf_map_iter *iter = uc_fn_thisval("bpf.map_iter");
uc_value_t *rv;
if (!iter->has_next)
return NULL;
rv = ucv_string_new_length((const char *)iter->key, iter->key_size);
iter->has_next = !bpf_map_get_next_key(iter->fd, &iter->key, &iter->key);
return rv;
}
static uc_value_t *
uc_bpf_map_iter_next_int(uc_vm_t *vm, size_t nargs)
{
struct uc_bpf_map_iter *iter = uc_fn_thisval("bpf.map_iter");
uint64_t intval;
uc_value_t *rv;
if (!iter->has_next)
return NULL;
if (iter->key_size == 4)
intval = *(uint32_t *)iter->key;
else if (iter->key_size == 8)
intval = *(uint64_t *)iter->key;
else
return NULL;
rv = ucv_int64_new(intval);
iter->has_next = !bpf_map_get_next_key(iter->fd, &iter->key, &iter->key);
return rv;
}
static uc_value_t *
uc_bpf_map_foreach(uc_vm_t *vm, size_t nargs)
{
struct uc_bpf_map *map = uc_fn_thisval("bpf.map");
uc_value_t *func = uc_fn_arg(0);
bool has_next;
void *key, *next;
bool ret = false;
key = alloca(map->key_size);
next = alloca(map->key_size);
has_next = !bpf_map_get_next_key(map->fd.fd, NULL, next);
while (has_next) {
uc_value_t *rv;
bool stop;
memcpy(key, next, map->key_size);
has_next = !bpf_map_get_next_key(map->fd.fd, next, next);
uc_value_push(ucv_get(func));
uc_value_push(ucv_string_new_length((const char *)key, map->key_size));
if (uc_call(1) != EXCEPTION_NONE)
break;
rv = uc_vm_stack_pop(vm);
stop = (ucv_type(rv) == UC_BOOLEAN && !ucv_boolean_get(rv));
ucv_put(rv);
if (stop)
break;
ret = true;
}
return ucv_boolean_new(ret);
}
static uc_value_t *
uc_bpf_obj_pin(uc_vm_t *vm, size_t nargs, const char *type)
{
struct uc_bpf_fd *f = uc_fn_thisval(type);
uc_value_t *path = uc_fn_arg(0);
if (ucv_type(path) != UC_STRING)
err_return(EINVAL, NULL);
if (bpf_obj_pin(f->fd, ucv_string_get(path)))
err_return(errno, NULL);
return TRUE;
}
static uc_value_t *
uc_bpf_program_pin(uc_vm_t *vm, size_t nargs)
{
return uc_bpf_obj_pin(vm, nargs, "bpf.program");
}
static uc_value_t *
uc_bpf_map_pin(uc_vm_t *vm, size_t nargs)
{
return uc_bpf_obj_pin(vm, nargs, "bpf.map");
}
static uc_value_t *
uc_bpf_set_tc_hook(uc_value_t *ifname, uc_value_t *type, uc_value_t *prio,
int fd)
{
DECLARE_LIBBPF_OPTS(bpf_tc_hook, hook);
DECLARE_LIBBPF_OPTS(bpf_tc_opts, attach_tc,
.handle = 1);
const char *type_str;
uint64_t prio_val;
if (ucv_type(ifname) != UC_STRING || ucv_type(type) != UC_STRING ||
ucv_type(prio) != UC_INTEGER)
err_return(EINVAL, NULL);
prio_val = ucv_int64_get(prio);
if (prio_val > 0xffff)
err_return(EINVAL, NULL);
type_str = ucv_string_get(type);
if (!strcmp(type_str, "ingress"))
hook.attach_point = BPF_TC_INGRESS;
else if (!strcmp(type_str, "egress"))
hook.attach_point = BPF_TC_EGRESS;
else
err_return(EINVAL, NULL);
hook.ifindex = if_nametoindex(ucv_string_get(ifname));
if (!hook.ifindex)
goto error;
bpf_tc_hook_create(&hook);
attach_tc.priority = prio_val;
if (bpf_tc_detach(&hook, &attach_tc) < 0 && fd < 0)
goto error;
if (fd < 0)
goto out;
attach_tc.prog_fd = fd;
if (bpf_tc_attach(&hook, &attach_tc) < 0)
goto error;
out:
return TRUE;
error:
if (fd >= 0)
err_return(ENOENT, NULL);
return NULL;
}
static uc_value_t *
uc_bpf_program_tc_attach(uc_vm_t *vm, size_t nargs)
{
struct uc_bpf_fd *f = uc_fn_thisval("bpf.program");
uc_value_t *ifname = uc_fn_arg(0);
uc_value_t *type = uc_fn_arg(1);
uc_value_t *prio = uc_fn_arg(2);
if (!f)
err_return(EINVAL, NULL);
return uc_bpf_set_tc_hook(ifname, type, prio, f->fd);
}
static uc_value_t *
uc_bpf_tc_detach(uc_vm_t *vm, size_t nargs)
{
uc_value_t *ifname = uc_fn_arg(0);
uc_value_t *type = uc_fn_arg(1);
uc_value_t *prio = uc_fn_arg(2);
return uc_bpf_set_tc_hook(ifname, type, prio, -1);
}
static int
uc_bpf_debug_print(enum libbpf_print_level level, const char *format,
va_list args)
{
char buf[256], *str = NULL;
uc_value_t *val;
va_list ap;
int size;
va_copy(ap, args);
size = vsnprintf(buf, sizeof(buf), format, ap);
va_end(ap);
if (size > 0 && (unsigned long)size < ARRAY_SIZE(buf) - 1) {
val = ucv_string_new(buf);
goto out;
}
if (vasprintf(&str, format, args) < 0)
return 0;
val = ucv_string_new(str);
free(str);
out:
uc_vm_stack_push(debug_vm, ucv_get(ucv_array_get(registry, 0)));
uc_vm_stack_push(debug_vm, ucv_int64_new(level));
uc_vm_stack_push(debug_vm, val);
if (uc_vm_call(debug_vm, false, 2) == EXCEPTION_NONE)
ucv_put(uc_vm_stack_pop(debug_vm));
return 0;
}
static uc_value_t *
uc_bpf_set_debug_handler(uc_vm_t *vm, size_t nargs)
{
uc_value_t *handler = uc_fn_arg(0);
if (handler && !ucv_is_callable(handler))
err_return(EINVAL, NULL);
debug_vm = vm;
libbpf_set_print(handler ? uc_bpf_debug_print : NULL);
ucv_array_set(registry, 0, ucv_get(handler));
return NULL;
}
static void
register_constants(uc_vm_t *vm, uc_value_t *scope)
{
#define ADD_CONST(x) ucv_object_add(scope, #x, ucv_int64_new(x))
ADD_CONST(BPF_PROG_TYPE_SCHED_CLS);
ADD_CONST(BPF_PROG_TYPE_SCHED_ACT);
ADD_CONST(BPF_ANY);
ADD_CONST(BPF_NOEXIST);
ADD_CONST(BPF_EXIST);
ADD_CONST(BPF_F_LOCK);
}
static const uc_function_list_t module_fns[] = {
{ "get_map", uc_bpf_module_get_map },
{ "get_maps", uc_bpf_module_get_maps },
{ "get_programs", uc_bpf_module_get_programs },
{ "get_program", uc_bpf_module_get_program },
};
static void module_free(void *ptr)
{
struct bpf_object *obj = ptr;
bpf_object__close(obj);
}
static const uc_function_list_t map_fns[] = {
{ "pin", uc_bpf_map_pin },
{ "get", uc_bpf_map_get },
{ "set", uc_bpf_map_set },
{ "delete", uc_bpf_map_delete },
{ "delete_all", uc_bpf_map_delete_all },
{ "foreach", uc_bpf_map_foreach },
{ "iterator", uc_bpf_map_iterator },
};
static void uc_bpf_fd_free(void *ptr)
{
struct uc_bpf_fd *f = ptr;
if (f->close)
close(f->fd);
free(f);
}
static const uc_function_list_t map_iter_fns[] = {
{ "next", uc_bpf_map_iter_next },
{ "next_int", uc_bpf_map_iter_next_int },
};
static const uc_function_list_t prog_fns[] = {
{ "pin", uc_bpf_program_pin },
{ "tc_attach", uc_bpf_program_tc_attach },
};
static const uc_function_list_t global_fns[] = {
{ "error", uc_bpf_error },
{ "set_debug_handler", uc_bpf_set_debug_handler },
{ "open_module", uc_bpf_open_module },
{ "open_map", uc_bpf_open_map },
{ "open_program", uc_bpf_open_program },
{ "tc_detach", uc_bpf_tc_detach },
};
void uc_module_init(uc_vm_t *vm, uc_value_t *scope)
{
uc_function_list_register(scope, global_fns);
register_constants(vm, scope);
registry = ucv_array_new(vm);
uc_vm_registry_set(vm, "bpf.registry", registry);
module_type = uc_type_declare(vm, "bpf.module", module_fns, module_free);
map_type = uc_type_declare(vm, "bpf.map", map_fns, uc_bpf_fd_free);
map_iter_type = uc_type_declare(vm, "bpf.map_iter", map_iter_fns, free);
program_type = uc_type_declare(vm, "bpf.program", prog_fns, uc_bpf_fd_free);
}

View File

@ -12,9 +12,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/jow-/ucode.git
PKG_SOURCE_DATE:=2022-12-02
PKG_SOURCE_VERSION:=46d93c9cc5da6fce581df86159bd0fc4357de41c
PKG_MIRROR_HASH:=970a47f1bef719f056d40d17398db492bd4de92b98ef9aba4582cb18b4c9b270
PKG_SOURCE_DATE:=2023-01-09
PKG_SOURCE_VERSION:=8dad974baa4696fcba85837fa70cde8b68dd7c12
PKG_MIRROR_HASH:=91494352ac298ac2735d62355837a1f18e366999c9e940613e6fa3265edc0364
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=ISC

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=util-linux
PKG_VERSION:=2.38
PKG_RELEASE:=$(AUTORELEASE)
PKG_VERSION:=2.38.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.38
PKG_HASH:=6d111cbe4d55b336db2f1fbeffbc65b89908704c01136371d32aa9bec373eb64
PKG_HASH:=60492a19b44e6cf9a3ddff68325b333b8b52b6c59ce3ebd6a0ecaa4c5117e84f
PKG_CPE_ID:=cpe:/a:kernel:util-linux
PKG_LICENSE:=GPL-2.0-only

View File

@ -1,20 +0,0 @@
From c387d4fe7a1435a762a5b7d8b75feb13ad613315 Mon Sep 17 00:00:00 2001
From: Anatoly Pugachev <matorola@gmail.com>
Date: Fri, 8 Apr 2022 15:34:16 +0300
Subject: [PATCH] libfdisk: meson.build fix typo
---
libfdisk/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/libfdisk/meson.build
+++ b/libfdisk/meson.build
@@ -11,7 +11,7 @@ libfdisk_h = configure_file(
output : 'libfdisk.h',
configuration : defs,
install : build_libfdisk,
- install_dir : join_paths(get_option('includedir'), 'libfisk'),
+ install_dir : join_paths(get_option('includedir'), 'libfdisk'),
)
lib_fdisk_sources = '''

View File

@ -1,22 +0,0 @@
From 38b15ca2dc4ca32bbe4a2449e1c7b645e4577840 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Fri, 29 Apr 2022 16:53:43 -0700
Subject: [PATCH 1/7] meson: fix compilation without systemd
systemdsystemunitdir is used elsewhere.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
meson.build | 1 +
1 file changed, 1 insertion(+)
--- a/meson.build
+++ b/meson.build
@@ -720,6 +720,7 @@ if fs_search_path_extra != ''
endif
conf.set_quoted('FS_SEARCH_PATH', fs_search_path)
+systemdsystemunitdir = ''
if systemd.found()
systemdsystemunitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
endif

View File

@ -1,21 +0,0 @@
From e51565b653cf09985df57cb7254b16d5af5df223 Mon Sep 17 00:00:00 2001
From: Nicolas Caramelli <caramelli.devel@gmail.com>
Date: Fri, 29 Apr 2022 18:16:36 +0200
Subject: [PATCH] meson: fix when HAVE_CLOCK_GETTIME is set
Signed-off-by: Nicolas Caramelli <caramelli.devel@gmail.com>
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/meson.build
+++ b/meson.build
@@ -602,7 +602,7 @@ if not have
have = cc.has_function('clock_gettime',
dependencies : realtime_libs)
endif
-conf.set('HAVE_CLOCK_GETTIME', have_dirfd ? 1 : false)
+conf.set('HAVE_CLOCK_GETTIME', have ? 1 : false)
thread_libs = dependency('threads')

View File

@ -1,12 +1,10 @@
apply_bootconfig() {
. /lib/functions.sh
local part
case $(board_name) in
zyxel,nwa50ax|\
zyxel,nwa55axe)
mtd_idx=$(find_mtd_index "bootconfig")
mtd_idx=$(find_mtd_index "bootconfig")
zyxel-bootconfig "/dev/mtd$mtd_idx" set-image-status 0 valid
zyxel-bootconfig "/dev/mtd$mtd_idx" set-active-image 0
;;

View File

@ -156,8 +156,8 @@ BUILD_LOG_DIR:=$(if $(call qstrip,$(CONFIG_BUILD_LOG_DIR)),$(call qstrip,$(CONFI
PKG_INFO_DIR := $(STAGING_DIR)/pkginfo
BUILD_DIR_HOST:=$(if $(IS_PACKAGE_BUILD),$(BUILD_DIR_BASE)/hostpkg,$(BUILD_DIR_BASE)/host)
STAGING_DIR_HOST:=$(TOPDIR)/staging_dir/host
STAGING_DIR_HOSTPKG:=$(TOPDIR)/staging_dir/hostpkg
STAGING_DIR_HOST:=$(abspath $(STAGING_DIR)/../host)
STAGING_DIR_HOSTPKG:=$(abspath $(STAGING_DIR)/../hostpkg)
TARGET_PATH:=$(subst $(space),:,$(filter-out .,$(filter-out ./,$(subst :,$(space),$(PATH)))))
TARGET_INIT_PATH:=$(call qstrip,$(CONFIG_TARGET_INIT_PATH))

View File

@ -133,7 +133,7 @@ class Path(object):
def tar(path, subdir, into=None, ts=None):
"""Pack ``path`` into tarball ``into``."""
# --sort=name requires a recent build of GNU tar
args = ['tar', '--numeric-owner', '--owner=0', '--group=0', '--sort=name']
args = ['tar', '--numeric-owner', '--owner=0', '--group=0', '--sort=name', '--mode=a-s']
args += ['-C', path, '-cf', into, subdir]
envs = os.environ.copy()
if ts is not None:

View File

@ -5,16 +5,14 @@ HOST_BUILD_DIR=$(pwd)/"build_dir/host"
HOST_STAGING_DIR_STAMP=$(pwd)/"staging_dir/host/stamp"
refresh_timestamps() {
find "$1" -not -type l -print0 | xargs -0 touch
find -H "$1" -not -type l -print0 | xargs -0 touch
}
extract_prebuilt_tar() {
tar -xf "$1"
}
install_prebuilt_tools() {
extract_prebuilt_tar "$TOOLS_TAR"
refresh_prebuilt_tools() {
if [ ! -d "$HOST_BUILD_DIR" ]; then
echo "Can't find Host Build Dir "$HOST_BUILD_DIR"" >&2
exit 1
@ -33,6 +31,14 @@ install_prebuilt_tools() {
return 0
}
install_prebuilt_tools() {
extract_prebuilt_tar "$TOOLS_TAR"
refresh_prebuilt_tools
return 0
}
while [ -n "$1" ]; do
arg="$1"; shift
case "$arg" in
@ -63,6 +69,12 @@ while [ -n "$1" ]; do
exit $?
;;
--refresh)
refresh_prebuilt_tools
exit $?
;;
-h|--help)
me="$(basename "$0")"
echo -e "\nUsage:\n" >&2
@ -81,8 +93,12 @@ while [ -n "$1" ]; do
echo -e " $me --tools {tar}" >&2
echo -e " Install the prebuilt tools present in the passed" >&2
echo -e " tar and prepare them." >&2
echo -e " To correctly use them it's needed to update the." >&2
echo -e " To correctly use them it's needed to update the" >&2
echo -e " timestamp of each tools to skip recompilation.\n" >&2
echo -e " $me --refresh" >&2
echo -e " Refresh timestamps of already extracted prebuilt" >&2
echo -e " tools to correctly use them and skip" >&2
echo -e " recompilation.\n" >&2
echo -e " $me --help" >&2
echo -e " Display this help text and exit.\n\n" >&2
exit 1

View File

@ -21,7 +21,7 @@ if not file_path.is_file():
def get_titles():
titles = []
for prefix in ["", "ALT0_", "ALT1_", "ALT2_"]:
for prefix in ["", "ALT0_", "ALT1_", "ALT2_", "ALT3_", "ALT4_"]:
title = {}
for var in ["vendor", "model", "variant"]:
if getenv("DEVICE_{}{}".format(prefix, var.upper())):

View File

@ -35,8 +35,11 @@ Available Commands:
info: Show a list of available target profiles
clean: Remove images and temporary build files
image: Build an image (see below for more information).
manifest: Show all package that will be installed into the image
package_whatdepends: Show which packages have a dependency on this
package_depends: Show installation dependency of the package
Building images:
image:
By default 'make image' will create an image with the default
target profile and package set. You can use the following parameters
to change that:
@ -49,7 +52,7 @@ Building images:
make image DISABLED_SERVICES="<svc1> [<svc2> [<svc3> ..]]" # Which services in /etc/init.d/ should be disabled
make image ADD_LOCAL_KEY=1 # store locally generated signing key in built images
Print manifest:
manifest:
List "all" packages which get installed into the image.
You can use the following parameters:
@ -57,6 +60,19 @@ Print manifest:
make manifest PACKAGES="<pkg1> [<pkg2> [<pkg3> ...]]" # include extra packages
make manifest STRIP_ABI=1 # remove ABI version from printed package names
package_whatdepends:
List "all" packages that have a dependency on this package
You can use the following parameters:
make package_whatdepends PACKAGE="<pkg>"
package_depends:
List "all" packages dependency of the package
You can use the following parameters:
make package_depends PACKAGE="<pkg>"
endef
$(eval $(call shexport,Helptext))
@ -255,7 +271,7 @@ manifest: FORCE
$(if $(PROFILE),USER_PROFILE="$(PROFILE_FILTER)") \
$(if $(PACKAGES),USER_PACKAGES="$(PACKAGES)"))
whatdepends: FORCE
package_whatdepends: FORCE
ifeq ($(PACKAGE),)
@echo 'Variable `PACKAGE` is not set but required by `whatdepends`'
@exit 1
@ -263,4 +279,13 @@ endif
@$(MAKE) -s package_reload
@$(OPKG) whatdepends -A $(PACKAGE)
.SILENT: help info image manifest whatdepends
package_depends: FORCE
ifeq ($(PACKAGE),)
@echo 'Variable `PACKAGE` is not set but required by `package_depends`'
@exit 1
endif
@$(MAKE) -s package_reload
@$(OPKG) depends -A $(PACKAGE)
.SILENT: help info image manifest package_whatdepends package_depends

View File

@ -8,4 +8,4 @@ include $(INCLUDE_DIR)/target.mk
export TARGET_BUILD=1
prereq clean download prepare compile install oldconfig menuconfig nconfig xconfig update refresh: FORCE
@+$(NO_TRACE_MAKE) -C $(BOARD) $@
@+$(NO_TRACE_MAKE) -C $(firstword $(wildcard feeds/$(BOARD) $(BOARD))) $@

View File

@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk
ARCH:=aarch64
BOARD:=ipq807x
BOARDNAME:=Qualcomm Atheros IPQ807x
FEATURES:=squashfs ramdisk fpu nand source-only
FEATURES:=squashfs ramdisk fpu nand rtc emmc
KERNELNAME:=Image dtbs
CPU_TYPE:=cortex-a53
SUBTARGETS:=generic

View File

@ -17,6 +17,10 @@ choice
config BINUTILS_USE_VERSION_2_39
bool "Binutils 2.39"
select BINUTILS_VERSION_2_39
config BINUTILS_USE_VERSION_2_40
bool "Binutils 2.40"
select BINUTILS_VERSION_2_40
endchoice
config EXTRA_BINUTILS_CONFIG_OPTIONS

View File

@ -9,8 +9,12 @@ config BINUTILS_VERSION_2_39
default y if !TOOLCHAINOPTS
bool
config BINUTILS_VERSION_2_40
bool
config BINUTILS_VERSION
string
default "2.37" if BINUTILS_VERSION_2_37
default "2.38" if BINUTILS_VERSION_2_38
default "2.39" if BINUTILS_VERSION_2_39
default "2.40" if BINUTILS_VERSION_2_40

View File

@ -27,6 +27,10 @@ ifeq ($(PKG_VERSION),2.39)
PKG_HASH:=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
endif
ifeq ($(PKG_VERSION),2.40)
PKG_HASH:=0f8a4c272d7f17f369ded10a4aca28b8e304828e95526da482b0ccc4dfc9d8e1
endif
HOST_BUILD_PARALLEL:=1
PATCH_DIR:=./patches/$(PKG_VERSION)

View File

@ -0,0 +1,22 @@
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -50,7 +50,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
+scriptdir = $(libdir)
EMUL = @EMUL@
EMULATION_OFILES = @EMULATION_OFILES@
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -573,7 +573,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
+scriptdir = $(libdir)
BASEDIR = $(srcdir)/..
BFDDIR = $(BASEDIR)/bfd
INCDIR = $(BASEDIR)/include

View File

@ -0,0 +1,18 @@
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -8119,6 +8119,7 @@ _bfd_mips_elf_create_dynamic_sections (b
name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING";
bh = NULL;
+ if (0) {
if (!(_bfd_generic_link_add_one_symbol
(info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, 0,
NULL, false, get_elf_backend_data (abfd)->collect, &bh)))
@@ -8131,6 +8132,7 @@ _bfd_mips_elf_create_dynamic_sections (b
if (! bfd_elf_link_record_dynamic_symbol (info, h))
return false;
+ }
if (! mips_elf_hash_table (info)->use_rld_obj_head)
{

View File

@ -0,0 +1,38 @@
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -944,12 +944,12 @@ case "${targ}" in
targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
;;
mips64*el-*-linux*)
- targ_defvec=mips_elf32_ntrad_le_vec
- targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec"
+ targ_defvec=mips_elf64_trad_le_vec
+ targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec"
;;
mips64*-*-linux*)
- targ_defvec=mips_elf32_ntrad_be_vec
- targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
+ targ_defvec=mips_elf64_trad_be_vec
+ targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec"
;;
mips*el-*-linux*)
targ_defvec=mips_elf32_trad_le_vec
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -585,12 +585,12 @@ mips*-*-vxworks*) targ_emul=elf32ebmipvx
;;
mips*-*-windiss) targ_emul=elf32mipswindiss
;;
-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+mips64*el-*-linux-*) targ_emul=elf64ltsmip
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
targ_extra_libpath=$targ_extra_emuls
;;
-mips64*-*-linux-*) targ_emul=elf32btsmipn32
- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+mips64*-*-linux-*) targ_emul=elf64btsmip
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip"
targ_extra_libpath=$targ_extra_emuls
;;
mips*el-*-linux-*) targ_emul=elf32ltsmip

View File

@ -3,7 +3,7 @@
choice
prompt "GCC compiler Version" if TOOLCHAINOPTS
default GCC_USE_VERSION_8 if mips || mipsel || mips64 || mips64el
default GCC_USE_VERSION_11
default GCC_USE_VERSION_12
help
Select the version of gcc you wish to use.

View File

@ -3,12 +3,12 @@ config GCC_VERSION_8
default y if mips || mipsel || mips64 || mips64el
bool
config GCC_VERSION_12
default y if GCC_USE_VERSION_12
config GCC_VERSION_11
default y if GCC_USE_VERSION_11
bool
config GCC_VERSION
string
default "8.4.0" if GCC_VERSION_8
default "12.2.0" if GCC_VERSION_12
default "11.3.0"
default "11.3.0" if GCC_VERSION_11
default "12.2.0"

View File

@ -76,7 +76,7 @@ ifdef CONFIG_INSTALL_GCCGO
endif
ifdef CONFIG_GCC_USE_GRAPHITE
GRAPHITE_CONFIGURE:= --with-isl=$(TOPDIR)/staging_dir/host
GRAPHITE_CONFIGURE:= --with-isl=$(STAGING_DIR_HOST)
else
GRAPHITE_CONFIGURE:= --without-isl --without-cloog
endif
@ -110,9 +110,9 @@ GCC_CONFIGURE:= \
--with-abi=$(call qstrip,$(CONFIG_MIPS64_ABI))) \
$(if $(CONFIG_arc),--with-cpu=$(CONFIG_CPU_TYPE)) \
$(if $(CONFIG_powerpc64), $(if $(CONFIG_USE_MUSL),--with-abi=elfv2)) \
--with-gmp=$(TOPDIR)/staging_dir/host \
--with-mpfr=$(TOPDIR)/staging_dir/host \
--with-mpc=$(TOPDIR)/staging_dir/host \
--with-gmp=$(STAGING_DIR_HOST) \
--with-mpfr=$(STAGING_DIR_HOST) \
--with-mpc=$(STAGING_DIR_HOST) \
--disable-decimal-float \
--with-diagnostics-color=auto-if-env \
--enable-__cxa_atexit \
@ -181,7 +181,7 @@ define Host/SetToolchainInfo
$(SED) 's,GCC_VERSION=.*,GCC_VERSION=$(GCC_VERSION),' $(TOOLCHAIN_DIR)/info.mk
endef
ifdef CONFIG_GCC_USE_VERSION_12
ifeq ($(GCC_MAJOR_VERSION),12)
GCC_VERSION_FILE:=gcc/genversion.cc
else
GCC_VERSION_FILE:=gcc/version.c

View File

@ -9,7 +9,7 @@ GCC_CONFIGURE += \
--enable-threads \
--with-slibdir=$(TOOLCHAIN_DIR)/lib \
--enable-lto \
--with-libelf=$(TOPDIR)/staging_dir/host
--with-libelf=$(STAGING_DIR_HOST)
ifndef CONFIG_USE_GLIBC
GCC_CONFIGURE += --disable-libsanitizer

View File

@ -30,10 +30,10 @@ HOST_CONFIGURE_ARGS = \
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
--with-gmp=$(TOPDIR)/staging_dir/host \
--with-mpfr=$(TOPDIR)/staging_dir/host \
--with-mpc=$(TOPDIR)/staging_dir/host \
--with-expat=$(TOPDIR)/staging_dir/host \
--with-gmp=$(STAGING_DIR_HOST) \
--with-mpfr=$(STAGING_DIR_HOST) \
--with-mpc=$(STAGING_DIR_HOST) \
--with-expat=$(STAGING_DIR_HOST) \
--disable-werror \
--without-uiout \
--enable-tui --disable-gdbtk --without-x \

View File

@ -0,0 +1,61 @@
Fix DT_DEBUG handling on MIPS in musl libc.
With this change gdb will load the symbol files for shared libraries on MIPS too.
This patch was taken from this thread: https://www.openwall.com/lists/musl/2022/01/09/4
--- a/arch/mips/reloc.h
+++ b/arch/mips/reloc.h
@@ -29,6 +29,7 @@
#define NEED_MIPS_GOT_RELOCS 1
#define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP
+#define DT_DEBUG_INDIRECT_REL DT_MIPS_RLD_MAP_REL
#define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT))
#define CRTJMP(pc,sp) __asm__ __volatile__( \
--- a/arch/mips64/reloc.h
+++ b/arch/mips64/reloc.h
@@ -38,6 +38,7 @@
#define NEED_MIPS_GOT_RELOCS 1
#define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP
+#define DT_DEBUG_INDIRECT_REL DT_MIPS_RLD_MAP_REL
#define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT))
#define CRTJMP(pc,sp) __asm__ __volatile__( \
--- a/arch/mipsn32/reloc.h
+++ b/arch/mipsn32/reloc.h
@@ -29,6 +29,7 @@
#define NEED_MIPS_GOT_RELOCS 1
#define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP
+#define DT_DEBUG_INDIRECT_REL DT_MIPS_RLD_MAP_REL
#define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT))
#define CRTJMP(pc,sp) __asm__ __volatile__( \
--- a/ldso/dynlink.c
+++ b/ldso/dynlink.c
@@ -1923,6 +1923,10 @@ void __dls3(size_t *sp, size_t *auxv)
size_t *ptr = (size_t *) app.dynv[i+1];
*ptr = (size_t)&debug;
}
+ if (app.dynv[i]==DT_DEBUG_INDIRECT_REL) {
+ size_t *ptr = (size_t *)((size_t)&app.dynv[i] + app.dynv[i+1]);
+ *ptr = (size_t)&debug;
+ }
}
/* This must be done before final relocations, since it calls
--- a/src/internal/dynlink.h
+++ b/src/internal/dynlink.h
@@ -92,6 +92,10 @@ struct fdpic_dummy_loadmap {
#define DT_DEBUG_INDIRECT 0
#endif
+#ifndef DT_DEBUG_INDIRECT_REL
+#define DT_DEBUG_INDIRECT_REL 0
+#endif
+
#define AUX_CNT 32
#define DYN_CNT 32

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