Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen
2026-06-15 11:26:42 +08:00
370 changed files with 22207 additions and 2585 deletions
+5 -1
View File
@@ -1,3 +1,7 @@
{
"git.alwaysSignOff": true
"git.alwaysSignOff": true,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.eol": "\n"
}
+2 -1
View File
@@ -63,8 +63,9 @@ Build/Patch:=$(Build/Patch/Default)
ifneq ($(strip $(PKG_UNPACK)),)
define Build/Prepare/Default
$(PKG_UNPACK)
-find $(PKG_BUILD_DIR) -mindepth 1 -type f -not -name '.*' -not -name 'version.date' -printf '%T@\n' 2>/dev/null |\
cut -d. -f1 | sort -n | tail -n1 > $(PKG_BUILD_DIR)/version.date
[ ! -d ./src/ ] || $(CP) ./src/. $(PKG_BUILD_DIR)
-find $(PKG_BUILD_DIR) -mindepth 1 -type f -printf '%T@\n' 2>/dev/null | head -n1 | cut -d. -f1 > $(PKG_BUILD_DIR)/version.date
$(Build/Patch)
endef
endif
+12 -16
View File
@@ -32,27 +32,25 @@ $(eval $(call TestHostCommand,proper-umask, \
ifndef IB
$(eval $(call SetupHostCommand,gcc, \
Please install the GNU C Compiler (gcc) 8 or later, \
$(CC) -dumpversion | grep -E '^([8-9]\.?|1[0-9]\.?)', \
gcc -dumpversion | grep -E '^([8-9]\.?|1[0-9]\.?)', \
gcc-8 -dumpversion | grep -E '^([8-9]\.?|1[0-9]\.?)', \
Please install the GNU C Compiler (gcc) 10 or later, \
$(CC) -dumpversion | grep -E '^(1[0-9]|[2-9][0-9])\.?', \
gcc -dumpversion | grep -E '^(1[0-9]|[2-9][0-9])\.?', \
gcc --version | grep -E 'Apple.(LLVM|clang)' ))
$(eval $(call TestHostCommand,working-gcc, \
Please reinstall the GNU C Compiler (8 or later) - \
Please reinstall the GNU C Compiler (10 or later) - \
it appears to be broken, \
echo 'int main(int argc, char **argv) { return 0; }' | \
$(STAGING_DIR_HOST)/bin/gcc -x c -o $(TMP_DIR)/a.out -))
$(eval $(call SetupHostCommand,g++, \
Please install the GNU C++ Compiler (g++) 8 or later, \
$(CXX) -dumpversion | grep -E '^([8-9]\.?|1[0-9]\.?)', \
g++ -dumpversion | grep -E '^([8-9]\.?|1[0-9]\.?)', \
g++-8 -dumpversion | grep -E '^([8-9]\.?|1[0-9]\.?)', \
Please install the GNU C++ Compiler (g++) 10 or later, \
$(CXX) -dumpversion | grep -E '^(1[0-9]|[2-9][0-9])\.?', \
g++ -dumpversion | grep -E '^(1[0-9]|[2-9][0-9])\.?', \
g++ --version | grep -E 'Apple.(LLVM|clang)' ))
$(eval $(call TestHostCommand,working-g++, \
Please reinstall the GNU C++ Compiler (8 or later) - \
Please reinstall the GNU C++ Compiler (10 or later) - \
it appears to be broken, \
echo 'int main(int argc, char **argv) { return 0; }' | \
$(STAGING_DIR_HOST)/bin/g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
@@ -186,25 +184,23 @@ $(eval $(call SetupHostCommand,install,Please install 'install', \
$(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \
perl --version | grep "perl.*v5"))
$(eval $(call SetupHostCommand,python,Please install Python >= 3.7, \
$(eval $(call SetupHostCommand,python,Please install Python >= 3.8, \
python3.13 -V 2>&1 | grep 'Python 3', \
python3.12 -V 2>&1 | grep 'Python 3', \
python3.11 -V 2>&1 | grep 'Python 3', \
python3.10 -V 2>&1 | grep 'Python 3', \
python3.9 -V 2>&1 | grep 'Python 3', \
python3.8 -V 2>&1 | grep 'Python 3', \
python3.7 -V 2>&1 | grep 'Python 3', \
python3 -V 2>&1 | grep -E 'Python 3\.([7-9]|[0-9][0-9])\.?'))
python3 -V 2>&1 | grep -E 'Python 3\.([8-9]|[0-9][0-9])\.?'))
$(eval $(call SetupHostCommand,python3,Please install Python >= 3.7, \
$(eval $(call SetupHostCommand,python3,Please install Python >= 3.8, \
python3.13 -V 2>&1 | grep 'Python 3', \
python3.12 -V 2>&1 | grep 'Python 3', \
python3.11 -V 2>&1 | grep 'Python 3', \
python3.10 -V 2>&1 | grep 'Python 3', \
python3.9 -V 2>&1 | grep 'Python 3', \
python3.8 -V 2>&1 | grep 'Python 3', \
python3.7 -V 2>&1 | grep 'Python 3', \
python3 -V 2>&1 | grep -E 'Python 3\.([7-9]|[0-9][0-9])\.?'))
python3 -V 2>&1 | grep -E 'Python 3\.([8-9]|[0-9][0-9])\.?'))
$(eval $(call TestHostCommand,python3-distutils, \
Please install the Python3 distutils module, \
+1 -2
View File
@@ -35,8 +35,7 @@ ifdef UBOOT_USE_INTREE_DTC
python3.10-config --includes 2>&1 | grep 'python3', \
python3.9-config --includes 2>&1 | grep 'python3', \
python3.8-config --includes 2>&1 | grep 'python3', \
python3.7-config --includes 2>&1 | grep 'python3', \
python3-config --includes 2>&1 | grep -E 'python3\.([7-9]|[0-9][0-9])\.?'))
python3-config --includes 2>&1 | grep -E 'python3\.([8-9]|[0-9][0-9])\.?'))
$(eval $(call TestHostCommand,python3-setuptools, \
Please install the Python3 setuptools module, \
@@ -16,6 +16,13 @@ NO_EXPORT=1
LOAD_STATE=1
LIST_SEP=" "
# check for valid hexdump and strip common separators and leading/trailing blanks
# input can be single- or multi-line, separators can be none, dash, colon or one or more spaces/tabs
hexdump_2hex() {
[ -z "$1" ] && return
echo -n "$1" | tr '\nA-F' ' a-f' | sed -nr '/^\s*[0-9a-f]{2}((\s+|[:-]?)[0-9a-f]{2})*\s*$/s/[[:space:]:-]*//pg'
}
# xor multiple hex values of the same length
xor() {
local val
+4 -7
View File
@@ -1,11 +1,13 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_VERSION:=2026.01
PKG_HASH:=b60d5865cefdbc75da8da4156c56c458e00de75a49b80c1a2e58a96e30ad0d54
PKG_VERSION:=2026.04
PKG_HASH:=ac7c04b8b7004923b00a4e5d6699c5df4d21233bac9fda690d8cfbc209fff2fd
PKG_BUILD_DEPENDS:=!(TARGET_ramips||TARGET_mediatek_mt7623):arm-trusted-firmware-tools/host
ifdef CONFIG_TARGET_ramips
UBOOT_USE_INTREE_DTC:=1
endif
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
@@ -1470,11 +1472,6 @@ endif
endef
endif
define Build/Configure
$(call Build/Configure/U-Boot)
sed -i 's/CONFIG_TOOLS_LIBCRYPTO=y/# CONFIG_TOOLS_LIBCRYPTO is not set/' $(PKG_BUILD_DIR)/.config
endef
define Build/Compile
$(call Build/Compile/U-Boot)
ifeq ($(UBOOT_IMAGE),u-boot.fip)
@@ -1,75 +0,0 @@
From a1d1fc8d8c8699d80e1b9ab3214752e5882d3740 Mon Sep 17 00:00:00 2001
From: Shiji Yang <yangshiji66@outlook.com>
Date: Sat, 3 Jan 2026 16:42:39 +0800
Subject: [PATCH] pinctrl: mediatek: MT7981: fix GPIO9 register map
Ported from the Mediatek SDK. The upstream Linux kernel also has the
same register map as the SDK.
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
---
drivers/pinctrl/mediatek/pinctrl-mt7981.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/drivers/pinctrl/mediatek/pinctrl-mt7981.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt7981.c
@@ -103,8 +103,8 @@ static const struct mtk_pin_field_calc m
PIN_FIELD_BASE(6, 6, 4, 0x20, 0x10, 3, 1),
PIN_FIELD_BASE(7, 7, 4, 0x20, 0x10, 0, 1),
PIN_FIELD_BASE(8, 8, 4, 0x20, 0x10, 4, 1),
- PIN_FIELD_BASE(9, 9, 4, 0x20, 0x10, 9, 1),
+ PIN_FIELD_BASE(9, 9, 5, 0x20, 0x10, 9, 1),
PIN_FIELD_BASE(10, 10, 5, 0x20, 0x10, 8, 1),
PIN_FIELD_BASE(11, 11, 5, 0x40, 0x10, 10, 1),
PIN_FIELD_BASE(12, 12, 5, 0x20, 0x10, 7, 1),
@@ -172,8 +172,8 @@ static const struct mtk_pin_field_calc m
PIN_FIELD_BASE(6, 6, 4, 0x80, 0x10, 3, 1),
PIN_FIELD_BASE(7, 7, 4, 0x80, 0x10, 0, 1),
PIN_FIELD_BASE(8, 8, 4, 0x80, 0x10, 4, 1),
- PIN_FIELD_BASE(9, 9, 4, 0x80, 0x10, 9, 1),
+ PIN_FIELD_BASE(9, 9, 5, 0x90, 0x10, 9, 1),
PIN_FIELD_BASE(10, 10, 5, 0x90, 0x10, 8, 1),
PIN_FIELD_BASE(11, 11, 5, 0x90, 0x10, 10, 1),
PIN_FIELD_BASE(12, 12, 5, 0x90, 0x10, 7, 1),
@@ -285,8 +285,8 @@ static const struct mtk_pin_field_calc m
PIN_FIELD_BASE(6, 6, 4, 0x00, 0x10, 9, 3),
PIN_FIELD_BASE(7, 7, 4, 0x00, 0x10, 0, 3),
PIN_FIELD_BASE(8, 8, 4, 0x00, 0x10, 12, 3),
- PIN_FIELD_BASE(9, 9, 4, 0x00, 0x10, 27, 3),
+ PIN_FIELD_BASE(9, 9, 5, 0x00, 0x10, 27, 3),
PIN_FIELD_BASE(10, 10, 5, 0x00, 0x10, 24, 3),
PIN_FIELD_BASE(11, 11, 5, 0x00, 0x10, 0, 3),
PIN_FIELD_BASE(12, 12, 5, 0x00, 0x10, 21, 3),
@@ -354,8 +354,8 @@ static const struct mtk_pin_field_calc m
PIN_FIELD_BASE(6, 6, 4, 0x30, 0x10, 3, 1),
PIN_FIELD_BASE(7, 7, 4, 0x30, 0x10, 0, 1),
PIN_FIELD_BASE(8, 8, 4, 0x30, 0x10, 4, 1),
- PIN_FIELD_BASE(9, 9, 4, 0x30, 0x10, 9, 1),
+ PIN_FIELD_BASE(9, 9, 5, 0x30, 0x10, 9, 1),
PIN_FIELD_BASE(10, 10, 5, 0x30, 0x10, 8, 1),
PIN_FIELD_BASE(11, 11, 5, 0x30, 0x10, 10, 1),
PIN_FIELD_BASE(12, 12, 5, 0x30, 0x10, 7, 1),
@@ -404,8 +404,8 @@ static const struct mtk_pin_field_calc m
PIN_FIELD_BASE(6, 6, 4, 0x40, 0x10, 3, 1),
PIN_FIELD_BASE(7, 7, 4, 0x40, 0x10, 0, 1),
PIN_FIELD_BASE(8, 8, 4, 0x40, 0x10, 4, 1),
- PIN_FIELD_BASE(9, 9, 4, 0x40, 0x10, 9, 1),
+ PIN_FIELD_BASE(9, 9, 5, 0x40, 0x10, 9, 1),
PIN_FIELD_BASE(10, 10, 5, 0x40, 0x10, 8, 1),
PIN_FIELD_BASE(11, 11, 5, 0x40, 0x10, 10, 1),
PIN_FIELD_BASE(12, 12, 5, 0x40, 0x10, 7, 1),
@@ -454,8 +454,8 @@ static const struct mtk_pin_field_calc m
PIN_FIELD_BASE(6, 6, 4, 0x50, 0x10, 3, 1),
PIN_FIELD_BASE(7, 7, 4, 0x50, 0x10, 0, 1),
PIN_FIELD_BASE(8, 8, 4, 0x50, 0x10, 4, 1),
- PIN_FIELD_BASE(9, 9, 4, 0x50, 0x10, 9, 1),
+ PIN_FIELD_BASE(9, 9, 5, 0x50, 0x10, 9, 1),
PIN_FIELD_BASE(10, 10, 5, 0x50, 0x10, 8, 1),
PIN_FIELD_BASE(11, 11, 5, 0x50, 0x10, 10, 1),
PIN_FIELD_BASE(12, 12, 5, 0x50, 0x10, 7, 1),
@@ -0,0 +1,75 @@
From 8ef8dee4f3a2b2021decfefd853dbd2a1632b77f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Marcos=20Costa?= <joaomarcos.costa@bootlin.com>
Date: Wed, 29 Apr 2026 16:46:15 +0200
Subject: [PATCH] scripts/dtc: drop yaml in DT validation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The build issues found in dtc/yamltree were partially mitigated by a
previous commit (807bcd844a: "scripts/dtc: Fix pkg-config behavior under
sysroot"), but upstream dtc simply disabled yaml, and the same should be
done here in order to permanently avoid those issues.
Backport the change below from Linux v5.18 [1]:
ef8795f3f1c ("dt-bindings: kbuild: Use DTB files for validation")
I tested this patch with a couple Yocto builds: u-boot and u-boot-tools,
using the current master branch (rev. "c53b0708f9"), having removed
libyaml-native from u-boot-tools's dependencies.
[1] https://git.kernel.org/linus/ef8795f3f1ce
Signed-off-by: João Marcos Costa <joaomarcos.costa@bootlin.com>
Acked-by: Quentin Schulz <quentin.schulz@cherry.de>
---
scripts/Makefile.lib | 6 ------
scripts/dtc/Makefile | 8 --------
scripts/dtc/update-dtc-source.sh | 2 +-
3 files changed, 1 insertion(+), 15 deletions(-)
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -86,12 +86,6 @@ base-dtb-y := $(foreach m, $(multi-dtb-y
extra-y += $(dtb-y)
extra-$(CONFIG_OF_ALL_DTBS) += $(dtb-)
-# U-Boot specific
-ifneq ($(CHECK_DTBS),)
-extra-y += $(patsubst %.dtb,%.dt.yaml, $(dtb-y))
-extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtb,%.dt.yaml, $(dtb-))
-endif
-
# Add subdir path
extra-y := $(addprefix $(obj)/,$(extra-y))
--- a/scripts/dtc/Makefile
+++ b/scripts/dtc/Makefile
@@ -17,15 +17,7 @@ fdtoverlay-objs := $(libfdt) fdtoverlay.
# Source files need to get at the userspace version of libfdt_env.h to compile
HOST_EXTRACFLAGS := -I$(srctree)/$(src)/libfdt
-ifeq ($(wildcard $(PKG_CONFIG_SYSROOT_DIR)/usr/include/yaml.h),)
HOST_EXTRACFLAGS += -DNO_YAML
-else
-dtc-objs += yamltree.o
-# To include <yaml.h> installed in a non-default path
-HOSTCFLAGS_yamltree.o := $(shell pkg-config --cflags yaml-0.1)
-# To link libyaml installed in a non-default path
-HOSTLDLIBS_dtc := $(shell pkg-config --libs yaml-0.1)
-endif
# Generated files need one more search path to include headers in source tree
HOSTCFLAGS_dtc-lexer.lex.o := -I$(src)
--- a/scripts/dtc/update-dtc-source.sh
+++ b/scripts/dtc/update-dtc-source.sh
@@ -32,7 +32,7 @@ DTC_UPSTREAM_PATH=`pwd`/../dtc
DTC_LINUX_PATH=`pwd`/scripts/dtc
DTC_SOURCE="checks.c data.c dtc.c dtc.h flattree.c fstree.c livetree.c srcpos.c \
- srcpos.h treesource.c util.c util.h version_gen.h yamltree.c \
+ srcpos.h treesource.c util.c util.h version_gen.h \
dtc-lexer.l dtc-parser.y"
LIBFDT_SOURCE="fdt.c fdt.h fdt_addresses.c fdt_empty_tree.c \
fdt_overlay.c fdt_ro.c fdt_rw.c fdt_strerror.c fdt_sw.c \
@@ -0,0 +1,43 @@
From de79075f0f6b8795d1f9e30ff36435583b1a119a Mon Sep 17 00:00:00 2001
From: Shiji Yang <yangshiji66@outlook.com>
Date: Sun, 12 Apr 2026 20:12:25 +0800
Subject: [PATCH] mips: mtmips: align MT7621 image blobs to 8-byte boundary
MT7621 doesn't boot on u-boot v2026.04. Fix it by correcting the
u-boot aligned offset.
Fixes: d9e183a04c92 ("MIPS: Assure end of U-Boot is at 8-byte aligned offset")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
---
arch/mips/dts/mt7621-u-boot.dtsi | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/arch/mips/dts/mt7621-u-boot.dtsi
+++ b/arch/mips/dts/mt7621-u-boot.dtsi
@@ -47,13 +47,13 @@
&binman {
u-boot-spl-ddr {
- align = <4>;
- align-size = <4>;
+ align = <8>;
+ align-size = <8>;
filename = "u-boot-spl-ddr.bin";
pad-byte = <0xff>;
u-boot-spl {
- align-end = <4>;
+ align-end = <8>;
filename = "u-boot-spl.bin";
};
@@ -90,7 +90,7 @@
#ifndef CONFIG_MT7621_BOOT_FROM_NAND
u-boot-tpl {
- align-end = <4>;
+ align-end = <8>;
filename = "u-boot-tpl.bin";
};
#endif
@@ -14,7 +14,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1131,6 +1131,9 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
@@ -1130,6 +1130,9 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7986b-sd-rfb.dtb \
mt7986a-emmc-rfb.dtb \
mt7986b-emmc-rfb.dtb \
@@ -1,81 +0,0 @@
From patchwork Wed Mar 4 03:53:38 2026
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
X-Patchwork-Id: 2204640
Return-Path: <u-boot-bounces@lists.denx.de>
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@legolas.ozlabs.org
Date: Wed, 4 Mar 2026 03:53:38 +0000
From: Daniel Golle <daniel@makrotopia.org>
To: Lukasz Majewski <lukma@denx.de>, Ryder Lee <ryder.lee@mediatek.com>,
Weijie Gao <weijie.gao@mediatek.com>,
Chunfeng Yun <chunfeng.yun@mediatek.com>,
Igor Belwon <igor.belwon@mentallysanemainliners.org>,
GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream@mediatek.com>,
Tom Rini <trini@konsulko.com>, David Lechner <dlechner@baylibre.com>,
Daniel Golle <daniel@makrotopia.org>, u-boot@lists.denx.de
Subject: [PATCH] clk: mediatek: mt7622: fix infracfg and pericfg clock
operations
Message-ID:
<a54fd4a7284da506020cb614919096067b195277.1772596281.git.daniel@makrotopia.org>
MIME-Version: 1.0
Content-Disposition: inline
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
The MT7622 infracfg and pericfg drivers both use
mtk_common_clk_infrasys_init() for probe, which populates struct
mtk_clk_priv and stores gate definitions in the clk_tree. However,
both drivers were incorrectly wired to mtk_clk_gate_ops which expects
struct mtk_cg_priv with separately populated gates/num_gates/gates_offs
fields from mtk_common_clk_gate_init().
Since those fields were never set, any attempt to enable an infracfg or
pericfg gate clock (e.g. CLK_INFRA_TRNG) would fail with -EINVAL.
Switch both to mtk_clk_infrasys_ops and struct mtk_clk_priv to match
the init function.
Fixes: 72ab603b201 ("clk: mediatek: add driver for MT7622")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
drivers/clk/mediatek/clk-mt7622.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/clk/mediatek/clk-mt7622.c
+++ b/drivers/clk/mediatek/clk-mt7622.c
@@ -805,8 +805,8 @@ U_BOOT_DRIVER(mtk_clk_infracfg) = {
.id = UCLASS_CLK,
.of_match = mt7622_infracfg_compat,
.probe = mt7622_infracfg_probe,
- .priv_auto = sizeof(struct mtk_cg_priv),
- .ops = &mtk_clk_gate_ops,
+ .priv_auto = sizeof(struct mtk_clk_priv),
+ .ops = &mtk_clk_infrasys_ops,
.flags = DM_FLAG_PRE_RELOC,
};
@@ -815,8 +815,8 @@ U_BOOT_DRIVER(mtk_clk_pericfg) = {
.id = UCLASS_CLK,
.of_match = mt7622_pericfg_compat,
.probe = mt7622_pericfg_probe,
- .priv_auto = sizeof(struct mtk_cg_priv),
- .ops = &mtk_clk_gate_ops,
+ .priv_auto = sizeof(struct mtk_clk_priv),
+ .ops = &mtk_clk_infrasys_ops,
.flags = DM_FLAG_PRE_RELOC,
};
@@ -15,7 +15,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1601,6 +1601,12 @@ config CMD_NAND_WATCH
@@ -1624,6 +1624,12 @@ config CMD_NAND_WATCH
endif # CMD_NAND
@@ -26,7 +26,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1601,6 +1601,14 @@ config CMD_NAND_WATCH
@@ -1624,6 +1624,14 @@ config CMD_NAND_WATCH
endif # CMD_NAND
@@ -50,7 +50,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
config ENV_RANGE
hex "Length of the region in which the environment can be written"
depends on ENV_IS_IN_NAND
@@ -592,7 +608,7 @@ config ENV_ADDR_REDUND
@@ -603,7 +619,7 @@ config ENV_ADDR_REDUND
config ENV_OFFSET
hex "Environment offset"
depends on ENV_IS_IN_EEPROM || ENV_IS_IN_MMC || ENV_IS_IN_NAND || \
@@ -18,7 +18,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1121,6 +1121,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
@@ -1120,6 +1120,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7622-bananapi-bpi-r64.dtb \
mt7623n-bananapi-bpi-r2.dtb \
mt7981-rfb.dtb \
@@ -15,7 +15,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -862,6 +862,14 @@ config MMC_MTK
@@ -863,6 +863,14 @@ config MMC_MTK
This is needed if support for any SD/SDIO/MMC devices is required.
If unsure, say N.
@@ -42,7 +42,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
+endif
--- a/drivers/mmc/mtk-sd.c
+++ b/drivers/mmc/mtk-sd.c
@@ -784,18 +784,24 @@ static int msdc_ops_send_cmd(struct udev
@@ -868,18 +868,24 @@ static int msdc_ops_send_cmd(struct udev
if (cmd_ret &&
!(cmd_ret == -EIO &&
(cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK ||
@@ -14,7 +14,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -703,6 +703,12 @@ config ENV_UBI_VOLUME_REDUND
@@ -714,6 +714,12 @@ config ENV_UBI_VOLUME_REDUND
help
Name of the redundant volume that you want to store the environment in.
@@ -1,6 +1,6 @@
--- a/configs/mt7988_sd_rfb_defconfig
+++ b/configs/mt7988_sd_rfb_defconfig
@@ -1,42 +1,83 @@
@@ -1,41 +1,82 @@
CONFIG_ARM=y
+CONFIG_ARM_SMCCC=y
CONFIG_SYS_HAS_NONCACHED_MEMORY=y
@@ -38,7 +38,6 @@
CONFIG_SYS_PROMPT="MT7988> "
+CONFIG_CMD_CPU=y
+CONFIG_CMD_LICENSE=y
# CONFIG_BOOTM_NETBSD is not set
# CONFIG_BOOTM_PLAN9 is not set
# CONFIG_BOOTM_RTEMS is not set
# CONFIG_BOOTM_VXWORKS is not set
@@ -88,12 +87,10 @@
CONFIG_USE_IPADDR=y
CONFIG_IPADDR="192.168.1.1"
CONFIG_USE_NETMASK=y
@@ -45,28 +86,45 @@ CONFIG_USE_SERVERIP=y
@@ -44,26 +85,45 @@ CONFIG_USE_SERVERIP=y
CONFIG_SERVERIP="192.168.1.2"
CONFIG_PROT_TCP=y
CONFIG_NET_RANDOM_ETHADDR=y
-CONFIG_REGMAP=y
-CONFIG_SYSCON=y
+CONFIG_BUTTON=y
+CONFIG_BUTTON_GPIO=y
CONFIG_CLK=y
@@ -145,7 +142,7 @@
CONFIG_SYS_HAS_NONCACHED_MEMORY=y
CONFIG_POSITION_INDEPENDENT=y
CONFIG_ARCH_MEDIATEK=y
@@ -6,37 +7,78 @@ CONFIG_TEXT_BASE=0x41e00000
@@ -6,36 +7,77 @@ CONFIG_TEXT_BASE=0x41e00000
CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_NR_DRAM_BANKS=1
CONFIG_DEFAULT_DEVICE_TREE="mt7988-rfb"
@@ -175,7 +172,6 @@
CONFIG_SYS_PROMPT="MT7988> "
+CONFIG_CMD_CPU=y
+CONFIG_CMD_LICENSE=y
# CONFIG_BOOTM_NETBSD is not set
# CONFIG_BOOTM_PLAN9 is not set
# CONFIG_BOOTM_RTEMS is not set
# CONFIG_BOOTM_VXWORKS is not set
@@ -229,12 +225,10 @@
CONFIG_USE_IPADDR=y
CONFIG_IPADDR="192.168.1.1"
CONFIG_USE_NETMASK=y
@@ -45,9 +87,13 @@ CONFIG_USE_SERVERIP=y
@@ -44,7 +86,13 @@ CONFIG_USE_SERVERIP=y
CONFIG_SERVERIP="192.168.1.2"
CONFIG_PROT_TCP=y
CONFIG_NET_RANDOM_ETHADDR=y
-CONFIG_REGMAP=y
-CONFIG_SYSCON=y
+CONFIG_BUTTON=y
+CONFIG_BUTTON_GPIO=y
CONFIG_CLK=y
@@ -245,7 +239,7 @@
CONFIG_MMC_HS200_SUPPORT=y
CONFIG_MMC_MTK=y
CONFIG_MTD=y
@@ -65,20 +111,33 @@ CONFIG_SPI_FLASH_WINBOND=y
@@ -62,20 +110,33 @@ CONFIG_SPI_FLASH_WINBOND=y
CONFIG_SPI_FLASH_XMC=y
CONFIG_SPI_FLASH_XTX=y
CONFIG_SPI_FLASH_MTD=y
@@ -1,6 +1,6 @@
--- a/configs/mt7981_rfb_defconfig
+++ b/configs/mt7981_rfb_defconfig
@@ -31,6 +31,9 @@ CONFIG_CMD_MTD=y
@@ -30,6 +30,9 @@ CONFIG_CMD_MTD=y
CONFIG_CMD_SF_TEST=y
CONFIG_CMD_PING=y
CONFIG_CMD_SMC=y
@@ -9,7 +9,7 @@
+CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_REGMAP=y
CONFIG_CLK=y
--- a/configs/mt7981_snfi_nand_rfb_defconfig
+++ b/configs/mt7981_snfi_nand_rfb_defconfig
@@ -5,7 +5,6 @@ CONFIG_ARCH_MEDIATEK=y
@@ -6,7 +6,7 @@
CONFIG_SYS_HAS_NONCACHED_MEMORY=y
CONFIG_POSITION_INDEPENDENT=y
CONFIG_ARCH_MEDIATEK=y
@@ -8,38 +9,58 @@ CONFIG_NR_DRAM_BANKS=1
@@ -8,43 +9,69 @@ CONFIG_NR_DRAM_BANKS=1
CONFIG_ENV_SIZE=0x80000
CONFIG_ENV_OFFSET=0x300000
CONFIG_DEFAULT_DEVICE_TREE="mt7981-emmc-rfb"
@@ -31,7 +31,6 @@
CONFIG_SYS_PROMPT="MT7981> "
+CONFIG_CMD_CPU=y
+CONFIG_CMD_LICENSE=y
# CONFIG_BOOTM_NETBSD is not set
# CONFIG_BOOTM_PLAN9 is not set
# CONFIG_BOOTM_RTEMS is not set
# CONFIG_BOOTM_VXWORKS is not set
@@ -71,10 +70,8 @@
CONFIG_PARTITION_TYPE_GUID=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_MMC=y
@@ -47,7 +68,13 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_REGMAP=y
CONFIG_SYSCON=y
+CONFIG_BUTTON=y
+CONFIG_BUTTON_GPIO=y
CONFIG_CLK=y
@@ -85,7 +82,7 @@
CONFIG_MMC_HS200_SUPPORT=y
CONFIG_MMC_MTK=y
CONFIG_PHY_FIXED=y
@@ -59,7 +86,10 @@ CONFIG_POWER_DOMAIN=y
@@ -56,7 +83,10 @@ CONFIG_POWER_DOMAIN=y
CONFIG_MTK_POWER_DOMAIN=y
CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_FIXED=y
@@ -104,7 +101,7 @@
CONFIG_SYS_HAS_NONCACHED_MEMORY=y
CONFIG_POSITION_INDEPENDENT=y
CONFIG_ARCH_MEDIATEK=y
@@ -6,39 +7,80 @@ CONFIG_TEXT_BASE=0x41e00000
@@ -6,36 +7,77 @@ CONFIG_TEXT_BASE=0x41e00000
CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_NR_DRAM_BANKS=1
CONFIG_DEFAULT_DEVICE_TREE="mt7981-rfb"
@@ -129,7 +126,6 @@
CONFIG_SYS_PROMPT="MT7981> "
+CONFIG_CMD_CPU=y
+CONFIG_CMD_LICENSE=y
# CONFIG_BOOTM_NETBSD is not set
# CONFIG_BOOTM_PLAN9 is not set
# CONFIG_BOOTM_RTEMS is not set
# CONFIG_BOOTM_VXWORKS is not set
@@ -175,8 +171,6 @@
+CONFIG_ENV_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_REGMAP=y
CONFIG_SYSCON=y
+CONFIG_BUTTON=y
+CONFIG_BUTTON_GPIO=y
CONFIG_CLK=y
@@ -187,7 +181,7 @@
# CONFIG_MMC is not set
CONFIG_MTD=y
CONFIG_DM_MTD=y
@@ -62,7 +104,10 @@ CONFIG_PINCONF=y
@@ -59,7 +101,10 @@ CONFIG_PINCONF=y
CONFIG_PINCTRL_MT7981=y
CONFIG_POWER_DOMAIN=y
CONFIG_MTK_POWER_DOMAIN=y
@@ -206,7 +200,7 @@
CONFIG_SYS_HAS_NONCACHED_MEMORY=y
CONFIG_POSITION_INDEPENDENT=y
CONFIG_ARCH_MEDIATEK=y
@@ -8,38 +9,58 @@ CONFIG_NR_DRAM_BANKS=1
@@ -8,43 +9,69 @@ CONFIG_NR_DRAM_BANKS=1
CONFIG_ENV_SIZE=0x80000
CONFIG_ENV_OFFSET=0x300000
CONFIG_DEFAULT_DEVICE_TREE="mt7981-sd-rfb"
@@ -231,7 +225,6 @@
CONFIG_SYS_PROMPT="MT7981> "
+CONFIG_CMD_CPU=y
+CONFIG_CMD_LICENSE=y
# CONFIG_BOOTM_NETBSD is not set
# CONFIG_BOOTM_PLAN9 is not set
# CONFIG_BOOTM_RTEMS is not set
# CONFIG_BOOTM_VXWORKS is not set
@@ -271,10 +264,8 @@
CONFIG_PARTITION_TYPE_GUID=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_MMC=y
@@ -47,7 +68,13 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_REGMAP=y
CONFIG_SYSCON=y
+CONFIG_BUTTON=y
+CONFIG_BUTTON_GPIO=y
CONFIG_CLK=y
@@ -285,7 +276,7 @@
CONFIG_MMC_HS200_SUPPORT=y
CONFIG_MMC_MTK=y
CONFIG_PHY_FIXED=y
@@ -59,7 +86,10 @@ CONFIG_POWER_DOMAIN=y
@@ -56,7 +83,10 @@ CONFIG_POWER_DOMAIN=y
CONFIG_MTK_POWER_DOMAIN=y
CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_FIXED=y
@@ -1,6 +1,6 @@
--- a/Makefile
+++ b/Makefile
@@ -1298,7 +1298,7 @@ quiet_cmd_pad_cat = CAT $@
@@ -1353,7 +1353,7 @@ quiet_cmd_pad_cat = CAT $@
cmd_pad_cat = $(cmd_objcopy) && $(append) || { rm -f $@; false; }
quiet_cmd_lzma = LZMA $@
@@ -79,7 +79,7 @@
{
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
@@ -2054,6 +2054,47 @@ static const char *fit_get_image_type_pr
@@ -2070,6 +2070,47 @@ static const char *fit_get_image_type_pr
return "unknown";
}
@@ -129,7 +129,7 @@
int arch, int ph_type, int bootstage_id,
--- a/include/image.h
+++ b/include/image.h
@@ -1115,6 +1115,7 @@ int fit_parse_subimage(const char *spec,
@@ -1118,6 +1118,7 @@ int fit_parse_subimage(const char *spec,
ulong *addr, const char **image_name);
int fit_get_subimage_count(const void *fit, int images_noffset);
@@ -1,6 +1,6 @@
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -717,6 +717,12 @@ config CMD_ENV_EXISTS
@@ -732,6 +732,12 @@ config CMD_ENV_EXISTS
Check if a variable is defined in the environment for use in
shell scripting.
@@ -1,31 +0,0 @@
From 5f2d5915f8ea4785bc2b8a26955e176a7898c15b Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Tue, 12 Apr 2022 21:00:43 +0100
Subject: [PATCH] image-fdt: save name of FIT configuration in '/chosen' node
It can be useful for the OS (Linux) to know which configuration has
been chosen by U-Boot when launching a FIT image.
Store the name of the FIT configuration node used in a new string
property called 'u-boot,bootconf' in the '/chosen' node in device tree.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
boot/image-fdt.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/boot/image-fdt.c
+++ b/boot/image-fdt.c
@@ -631,6 +631,12 @@ int image_setup_libfdt(struct bootm_head
images->fit_uname_cfg,
strlen(images->fit_uname_cfg) + 1, 1);
+ /* Store name of configuration node as u-boot,bootconf in /chosen node */
+ if (images->fit_uname_cfg)
+ fdt_find_and_setprop(blob, "/chosen", "u-boot,bootconf",
+ images->fit_uname_cfg,
+ strlen(images->fit_uname_cfg) + 1, 1);
+
/* Update ethernet nodes */
fdt_fixup_ethernet(blob);
#if IS_ENABLED(CONFIG_CMD_PSTORE)
@@ -48,7 +48,7 @@
#ifdef CONFIG_ENABLE_NAND_NMBM
--- a/arch/arm/mach-mediatek/Kconfig
+++ b/arch/arm/mach-mediatek/Kconfig
@@ -165,4 +165,11 @@ config MTK_TZ_MOVABLE
@@ -173,4 +173,11 @@ config MTK_TZ_MOVABLE
select OF_SYSTEM_SETUP
bool
@@ -1,6 +1,6 @@
--- a/configs/mt7623n_bpir2_defconfig
+++ b/configs/mt7623n_bpir2_defconfig
@@ -7,34 +7,67 @@ CONFIG_SYS_MALLOC_F_LEN=0x4000
@@ -7,56 +7,106 @@ CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_NR_DRAM_BANKS=1
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x81ffff10
@@ -72,10 +72,8 @@
CONFIG_USE_IPADDR=y
CONFIG_IPADDR="192.168.1.1"
CONFIG_USE_SERVERIP=y
@@ -42,23 +75,40 @@ CONFIG_SERVERIP="192.168.1.2"
CONFIG_SERVERIP="192.168.1.2"
CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_REGMAP=y
CONFIG_SYSCON=y
+CONFIG_SCSI_AHCI=y
+CONFIG_AHCI_PCI=y
+CONFIG_BUTTON=y
@@ -1,6 +1,6 @@
--- a/configs/mt7623a_unielec_u7623_02_defconfig
+++ b/configs/mt7623a_unielec_u7623_02_defconfig
@@ -7,32 +7,65 @@ CONFIG_SYS_MALLOC_F_LEN=0x4000
@@ -7,54 +7,104 @@ CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_NR_DRAM_BANKS=1
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x81ffff10
@@ -70,10 +70,8 @@
CONFIG_USE_IPADDR=y
CONFIG_IPADDR="192.168.1.1"
CONFIG_USE_SERVERIP=y
@@ -40,23 +73,40 @@ CONFIG_SERVERIP="192.168.1.2"
CONFIG_SERVERIP="192.168.1.2"
CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_REGMAP=y
CONFIG_SYSCON=y
+CONFIG_SCSI_AHCI=y
+CONFIG_AHCI_PCI=y
+CONFIG_BUTTON=y
@@ -13,10 +13,10 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
--- a/arch/arm/mach-mediatek/Kconfig
+++ b/arch/arm/mach-mediatek/Kconfig
@@ -158,7 +158,7 @@ config MTK_BROM_HEADER_INFO
@@ -166,7 +166,7 @@ config MTK_BROM_HEADER_INFO
string
default "media=nor" if TARGET_MT8518 || TARGET_MT8512 || TARGET_MT7629
default "media=emmc" if TARGET_MT8516 || TARGET_MT8365 || TARGET_MT8183
default "media=emmc" if TARGET_MT8516 || TARGET_MT8365 || TARGET_MT8183 || TARGET_MT8188
- default "lk=1" if TARGET_MT7623
+ default "lk=1" if TARGET_MT7622 || TARGET_MT7623
@@ -335,7 +335,7 @@
+};
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1119,6 +1119,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
@@ -1118,6 +1118,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7622-rfb.dtb \
mt7623a-unielec-u7623-02-emmc.dtb \
mt7622-bananapi-bpi-r64.dtb \
@@ -746,7 +746,7 @@
+};
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1120,6 +1120,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
@@ -1119,6 +1119,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7623a-unielec-u7623-02-emmc.dtb \
mt7622-bananapi-bpi-r64.dtb \
mt7622-linksys-e8450-ubi.dtb \
@@ -1,6 +1,6 @@
--- /dev/null
+++ b/configs/mt7988a_bananapi_bpi-r4-emmc_defconfig
@@ -0,0 +1,144 @@
@@ -0,0 +1,145 @@
+CONFIG_ARM=y
+CONFIG_ARM_SMCCC=y
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
@@ -44,6 +44,8 @@
+CONFIG_CMD_ASKENV=y
+CONFIG_CMD_ERASEENV=y
+CONFIG_CMD_ENV_FLAGS=y
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_MEMSIZE=y
+CONFIG_CMD_RNG=y
+CONFIG_CMD_STRINGS=y
+CONFIG_CMD_DM=y
@@ -77,7 +79,6 @@
+CONFIG_CMD_FS_UUID=y
+CONFIG_CMD_UBI=y
+CONFIG_CMD_UBI_RENAME=y
+CONFIG_CMD_MEMSIZE=y
+CONFIG_OF_EMBED=y
+CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_IS_IN_MMC=y
@@ -293,7 +294,7 @@
+CONFIG_HEXDUMP=y
--- /dev/null
+++ b/configs/mt7988a_bananapi_bpi-r4-snand_defconfig
@@ -0,0 +1,144 @@
@@ -0,0 +1,145 @@
+CONFIG_ARM=y
+CONFIG_ARM_SMCCC=y
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
@@ -334,6 +335,8 @@
+CONFIG_CMD_ASKENV=y
+CONFIG_CMD_ERASEENV=y
+CONFIG_CMD_ENV_FLAGS=y
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_MEMSIZE=y
+CONFIG_CMD_RNG=y
+CONFIG_CMD_STRINGS=y
+CONFIG_CMD_DM=y
@@ -367,7 +370,6 @@
+CONFIG_CMD_FS_UUID=y
+CONFIG_CMD_UBI=y
+CONFIG_CMD_UBI_RENAME=y
+CONFIG_CMD_MEMSIZE=y
+CONFIG_OF_EMBED=y
+CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_IS_IN_UBI=y
@@ -575,7 +577,7 @@
+emmc_write_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_write_vol
+_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
+_firstboot=setenv _firstboot ; run _select_bl2 ; run _switch_to_menu ; run _init_env ; run boot_first
+_select_bl2=setenv _select_bl2 ; msize g ramsize; if test ${ramsize} = 8; then setenv bootfile_bl2 immortalwrt-mediatek-filogic-bananapi_bpi-r4-snand-preloader-8g.bin;fi
+_select_bl2=setenv _select_bl2 ; memsize ramsize; if test ${ramsize} = 8192; then setenv bootfile_bl2 immortalwrt-mediatek-filogic-bananapi_bpi-r4-snand-preloader-8g.bin;fi
+_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"
--- /dev/null
@@ -636,7 +638,7 @@
+emmc_write_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_write_vol
+_init_env=setenv _init_env ; setenv _create_env ; saveenv ; saveenv
+_firstboot=setenv _firstboot ; run _select_bl2 ; run _switch_to_menu ; run _init_env ; run boot_first
+_select_bl2=setenv _select_bl2 ; msize g ramsize; if test ${ramsize} = 8; then setenv bootfile_bl2 immortalwrt-mediatek-filogic-bananapi_bpi-r4-emmc-preloader-8g.bin;fi
+_select_bl2=setenv _select_bl2 ; memsize ramsize; if test ${ramsize} = 8192; then setenv bootfile_bl2 immortalwrt-mediatek-filogic-bananapi_bpi-r4-emmc-preloader-8g.bin;fi
+_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"
--- /dev/null
@@ -889,7 +891,7 @@
+};
--- /dev/null
+++ b/configs/mt7988a_bananapi_bpi-r4-poe-emmc_defconfig
@@ -0,0 +1,144 @@
@@ -0,0 +1,145 @@
+CONFIG_ARM=y
+CONFIG_ARM_SMCCC=y
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
@@ -933,6 +935,8 @@
+CONFIG_CMD_ASKENV=y
+CONFIG_CMD_ERASEENV=y
+CONFIG_CMD_ENV_FLAGS=y
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_MEMSIZE=y
+CONFIG_CMD_RNG=y
+CONFIG_CMD_STRINGS=y
+CONFIG_CMD_DM=y
@@ -966,7 +970,6 @@
+CONFIG_CMD_FS_UUID=y
+CONFIG_CMD_UBI=y
+CONFIG_CMD_UBI_RENAME=y
+CONFIG_CMD_MEMSIZE=y
+CONFIG_OF_EMBED=y
+CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_IS_IN_MMC=y
@@ -1182,7 +1185,7 @@
+CONFIG_HEXDUMP=y
--- /dev/null
+++ b/configs/mt7988a_bananapi_bpi-r4-poe-snand_defconfig
@@ -0,0 +1,144 @@
@@ -0,0 +1,145 @@
+CONFIG_ARM=y
+CONFIG_ARM_SMCCC=y
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
@@ -1223,6 +1226,8 @@
+CONFIG_CMD_ASKENV=y
+CONFIG_CMD_ERASEENV=y
+CONFIG_CMD_ENV_FLAGS=y
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_MEMSIZE=y
+CONFIG_CMD_RNG=y
+CONFIG_CMD_STRINGS=y
+CONFIG_CMD_DM=y
@@ -1256,7 +1261,6 @@
+CONFIG_CMD_FS_UUID=y
+CONFIG_CMD_UBI=y
+CONFIG_CMD_UBI_RENAME=y
+CONFIG_CMD_MEMSIZE=y
+CONFIG_OF_EMBED=y
+CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_IS_IN_UBI=y
@@ -1385,7 +1389,7 @@
+emmc_write_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_write_vol
+_init_env=setenv _init_env ; setenv _create_env ; saveenv ; saveenv
+_firstboot=setenv _firstboot ; run _select_bl2 ; run _switch_to_menu ; run _init_env ; run boot_first
+_select_bl2=setenv _select_bl2 ; msize g ramsize ; if test ${ramsize} = 8 ; then setenv bootfile_bl2 immortalwrt-mediatek-filogic-bananapi_bpi-r4-poe-emmc-preloader-8g.bin ; fi
+_select_bl2=setenv _select_bl2 ; memsize ramsize ; if test ${ramsize} = 8192 ; then setenv bootfile_bl2 immortalwrt-mediatek-filogic-bananapi_bpi-r4-poe-emmc-preloader-8g.bin ; fi
+_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"
--- /dev/null
@@ -1525,6 +1529,6 @@
+emmc_write_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_write_vol
+_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
+_firstboot=setenv _firstboot ; run _select_bl2 ; run _switch_to_menu ; run _init_env ; run boot_first
+_select_bl2=setenv _select_bl2 ; msize g ramsize; if test ${ramsize} = 8; then setenv bootfile_bl2 immortalwrt-mediatek-filogic-bananapi_bpi-r4-poe-snand-preloader-8g.bin ; fi
+_select_bl2=setenv _select_bl2 ; memsize ramsize; if test ${ramsize} = 8192; then setenv bootfile_bl2 immortalwrt-mediatek-filogic-bananapi_bpi-r4-poe-snand-preloader-8g.bin ; fi
+_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"
@@ -15,7 +15,7 @@ Subject: [PATCH] add xiaomi redmi ax6s
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1122,6 +1122,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
@@ -1121,6 +1121,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7622-linksys-e8450-ubi.dtb \
mt7622-ubnt-unifi-6-lr.dtb \
mt7622-ubnt-unifi-6-lr-v3.dtb \
@@ -280,7 +280,7 @@
+};
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1138,6 +1138,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
@@ -1137,6 +1137,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7986b-emmc-rfb.dtb \
mt7987a-emmc-rfb.dtb \
mt7987a-rfb.dtb \
@@ -995,7 +995,7 @@
+#include "mt7987-emmc.dtsi"
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1136,6 +1136,9 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
@@ -1135,6 +1135,9 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7986b-sd-rfb.dtb \
mt7986a-emmc-rfb.dtb \
mt7986b-emmc-rfb.dtb \
@@ -1,6 +1,6 @@
--- a/configs/mt7987_rfb_defconfig
+++ b/configs/mt7987_rfb_defconfig
@@ -70,6 +70,7 @@ CONFIG_SPI_FLASH_XTX=y
@@ -67,6 +67,7 @@ CONFIG_SPI_FLASH_XTX=y
CONFIG_SPI_FLASH_ZBIT=y
CONFIG_SPI_FLASH_MTD=y
CONFIG_MTD_UBI=y
@@ -10,7 +10,7 @@
CONFIG_PINCTRL=y
--- a/configs/mt7987_emmc_rfb_defconfig
+++ b/configs/mt7987_emmc_rfb_defconfig
@@ -75,6 +75,7 @@ CONFIG_SPI_FLASH_XTX=y
@@ -72,6 +72,7 @@ CONFIG_SPI_FLASH_XTX=y
CONFIG_SPI_FLASH_ZBIT=y
CONFIG_SPI_FLASH_MTD=y
CONFIG_MTD_UBI=y
@@ -20,7 +20,7 @@
CONFIG_PINCTRL=y
--- a/configs/mt7987_sd_rfb_defconfig
+++ b/configs/mt7987_sd_rfb_defconfig
@@ -75,6 +75,7 @@ CONFIG_SPI_FLASH_XTX=y
@@ -72,6 +72,7 @@ CONFIG_SPI_FLASH_XTX=y
CONFIG_SPI_FLASH_ZBIT=y
CONFIG_SPI_FLASH_MTD=y
CONFIG_MTD_UBI=y
@@ -1,117 +0,0 @@
From 83c596f12349fdc77fa76e1d017b4fc8882744ef Mon Sep 17 00:00:00 2001
From: Frank Wunderlich <frank-w@public-files.de>
Date: Sat, 17 Jan 2026 12:38:40 +0100
To: Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de,
Daniel Golle <daniel@makrotopia.org>
Subject: [PATCH v4] cmd: mem: add function for getting ram size for use in
scripts
Add a command for getting detected ram size with possibility to write
to environment variable.
example usage:
BPI-R4> msize
4294967296
BPI-R4> msize m
4096m
BPI-R4> msize g
4g
BPI-R4> msize g ramsize
BPI-R4> printenv ramsize
ramsize=4
BPI-R4>
board with 8GB ram:
BPI-R4> msize
8589934592
BPI-R4> msize m
8192m
BPI-R4> msize g
8g
BPI-R4> msize g ramsize
BPI-R4> printenv ramsize
ramsize=8
BPI-R4>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
v4: drop rounding to full MB/GB as it leads to wrong display
v3: add missing ifdefs
v2: add Kconfig entry
---
cmd/Kconfig | 5 +++++
cmd/mem.c | 32 ++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+)
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -980,6 +980,11 @@ config CMD_RANDOM
help
random - fill memory with random data
+config CMD_MEMSIZE
+ bool "memsize"
+ help
+ Get RAM via command for use in scripts.
+
config CMD_MEMTEST
bool "memtest"
help
--- a/cmd/mem.c
+++ b/cmd/mem.c
@@ -33,6 +33,7 @@
#include <linux/compiler.h>
#include <linux/ctype.h>
#include <linux/delay.h>
+#include <linux/sizes.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -711,6 +712,29 @@ static int do_mem_loopw(struct cmd_tbl *
}
#endif /* CONFIG_LOOPW */
+#ifdef CONFIG_CMD_MEMSIZE
+static int do_mem_size(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
+{
+ u64 memsize = gd->ram_size;
+
+ if (argc > 1) {
+ if (!strcmp(argv[1], "m"))
+ memsize = memsize / SZ_1M;
+ else if (!strcmp(argv[1], "g"))
+ memsize = memsize / SZ_1G;
+ if (argc > 2)
+ env_set_ulong(argv[2], memsize);
+ else
+ printf("%lld%s\n", memsize, argv[1]);
+ } else {
+ printf("%lld\n", memsize);
+ }
+
+ return 0;
+}
+#endif /* CONFIG_CMD_MEMSIZE */
+
#ifdef CONFIG_CMD_MEMTEST
static ulong mem_test_alt(volatile ulong *buf, ulong start_addr, ulong end_addr,
volatile ulong *dummy)
@@ -1404,6 +1428,14 @@ U_BOOT_CMD(
);
#endif /* CONFIG_LOOPW */
+#ifdef CONFIG_CMD_MEMSIZE
+U_BOOT_CMD(
+ msize, 3, 1, do_mem_size,
+ "get detected ram size, optional set env variable with value",
+ "[m, g] [envvar]"
+);
+#endif /* CONFIG_CMD_MEMSIZE */
+
#ifdef CONFIG_CMD_MEMTEST
U_BOOT_CMD(
mtest, 5, 1, do_mem_mtest,
@@ -125,7 +125,8 @@ mercusys,mr90x-v1|\
routerich,ax3000|\
routerich,ax3000-v1|\
tenbay,wr3000k|\
tplink,re6000xd)
tplink,re6000xd|\
wavlink,wl-wn536ax6-a)
ubootenv_add_mtd "u-boot-env" "0x0" "0x20000" "0x20000" "1"
;;
comfast,cf-e393ax|\
@@ -1,26 +0,0 @@
From: Shiji Yang <yangshiji66@outlook.com>
Date: Fri, 9 May 2025 02:36:31 +0800
Subject: [PATCH] add missing header mod_devicetable.h
Fix compilation error:
/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/ltq-ptm-vr9/ltq-ptm/ifxmips_ptm_vdsl.c:969:34: error: array type has incomplete element type 'struct of_device_id'
969 | static const struct of_device_id ltq_ptm_match[] = {
| ^~~~~~~~~~~~~
/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/ltq-ptm-vr9/ltq-ptm/ifxmips_ptm_vdsl.c:969:34: error: 'ltq_ptm_match' defined but not used [-Werror=unused-variable]
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
---
ifxmips_ptm_vdsl.c | 1 +
1 file changed, 1 insertion(+)
--- a/ifxmips_ptm_vdsl.c
+++ b/ifxmips_ptm_vdsl.c
@@ -34,6 +34,7 @@
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/platform_device.h>
+#include <linux/mod_devicetable.h>
#include <linux/of_device.h>
#include <linux/of_net.h>
@@ -1,25 +0,0 @@
From: Shiji Yang <yangshiji66@outlook.com>
Date: Fri, 9 May 2025 21:16:08 +0800
Subject: [PATCH] add missing header "mod_devicetable.h"
Fix compilation error:
/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xway/ltq-ptm-danube/ltq-ptm/ifxmips_ptm_adsl.c:1433:34: error: array type has incomplete element type 'struct of_device_id'
1433 | static const struct of_device_id ltq_ptm_match[] = {
| ^~~~~~~~~~~~~
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
---
ifxmips_ptm_adsl.c | 1 +
1 file changed, 1 insertion(+)
--- a/ifxmips_ptm_adsl.c
+++ b/ifxmips_ptm_adsl.c
@@ -43,6 +43,7 @@
#include <linux/ioctl.h>
#include <linux/etherdevice.h>
#include <linux/interrupt.h>
+#include <linux/mod_devicetable.h>
#include <linux/netdevice.h>
#include <linux/platform_device.h>
#include <linux/of_device.h>
@@ -43,8 +43,8 @@
#include <linux/etherdevice.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/of_device.h>
#include <linux/of_net.h>
#include <linux/uaccess.h>
#include <linux/capability.h>
@@ -32,8 +32,8 @@
#include <linux/etherdevice.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/of_device.h>
#include <linux/of_net.h>
#include "ifxmips_ptm_vdsl.h"
@@ -11,7 +11,6 @@
#include <linux/led-class-multicolor.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/property.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
@@ -13,7 +13,6 @@
#include <linux/led-class-multicolor.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/property.h>
#include <linux/spi/spi.h>
#include <linux/mutex.h>
+2 -5
View File
@@ -557,7 +557,6 @@ define KernelPackage/slhc
SUBMENU:=$(NETWORK_SUPPORT_MENU)
HIDDEN:=1
TITLE:=Serial Line Header Compression
DEPENDS:=+kmod-lib-crc-ccitt
KCONFIG:=CONFIG_SLHC
FILES:=$(LINUX_DIR)/drivers/net/slip/slhc.ko
endef
@@ -695,10 +694,8 @@ $(eval $(call KernelPackage,ipoa))
define KernelPackage/mppe
SUBMENU:=$(NETWORK_SUPPORT_MENU)
TITLE:=Microsoft PPP compression/encryption
DEPENDS:=kmod-ppp +kmod-crypto-arc4 +kmod-crypto-sha1 +kmod-crypto-ecb
KCONFIG:= \
CONFIG_PPP_MPPE_MPPC \
CONFIG_PPP_MPPE
DEPENDS:=kmod-ppp +kmod-crypto-sha1
KCONFIG:=CONFIG_PPP_MPPE
FILES:=$(LINUX_DIR)/drivers/net/ppp/ppp_mppe.ko
AUTOLOAD:=$(call AutoProbe,ppp_mppe)
endef
+14 -1
View File
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libnl
PKG_VERSION:=3.12.0
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl$(subst .,_,$(PKG_VERSION))
@@ -23,6 +23,7 @@ PKG_FIXUP:=autoreconf
PKG_BUILD_FLAGS:=gc-sections
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
define Package/libnl/default
SECTION:=libs
@@ -97,6 +98,10 @@ TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \
--disable-debug
HOST_CONFIGURE_ARGS += \
--disable-debug \
--without-cli
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/libnl3 $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/include/libnl3/* $(1)/usr/include/libnl3/
@@ -111,6 +116,13 @@ define Build/InstallDev
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-cli-3.so $(1)/usr/lib/libnl-cli.so
endef
define Host/Install
$(call Host/Install/Default)
$(INSTALL_DIR) $(STAGING_DIR_HOST)/include/libnl3
$(CP) $(HOST_BUILD_DIR)/include/netlink $(STAGING_DIR_HOST)/include/libnl3/
$(LN) libnl3/netlink $(STAGING_DIR_HOST)/include/netlink
endef
define Package/libnl-core/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-3.so.* $(1)/usr/lib/
@@ -146,3 +158,4 @@ $(eval $(call BuildPackage,libnl-route))
$(eval $(call BuildPackage,libnl-nf))
$(eval $(call BuildPackage,libnl-cli))
$(eval $(call BuildPackage,libnl))
$(eval $(call HostBuild))
@@ -40,9 +40,14 @@ proto_dhcp_get_default_clientid() {
local duid
local iaid
network_generate_iface_iaid iaid "$iface"
duid="$(uci_get network @globals[0] dhcp_default_duid)"
[ -n "$duid" ] && printf "ff%s%s" "$iaid" "$duid"
[ -n "$duid" ] && {
duid="$(hexdump_2hex "$duid")"
[ -z "$duid" ] && logger -p warn -t dhcp "$iface: ignoring invalid dhcp_default_duid value"
}
[ -z "$duid" ] && return
network_generate_iface_iaid iaid "$iface"
printf "ff%s%s" "$iaid" "$duid"
}
proto_dhcp_setup() {
@@ -65,8 +70,12 @@ proto_dhcp_setup() {
[ "$defaultreqopts" = 0 ] && defaultreqopts="-o" || defaultreqopts=
[ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
[ "$norelease" = 1 ] && norelease="" || norelease="-R"
[ -n "$clientid" ] && {
clientid="$(hexdump_2hex "$clientid")"
[ -z "$clientid" ] && logger -p warn -t dhcp "$iface: ignoring invalid clientid value"
}
[ -z "$clientid" ] && clientid="$(proto_dhcp_get_default_clientid "$iface")"
[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}"
[ -n "$clientid" ] && clientid="-x 0x3d:$clientid"
[ -n "$vendorid" ] && append dhcpopts "-x 0x3c:$(echo -n "$vendorid" | hexdump -ve '1/1 "%02x"')"
[ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
[ "$iface6rd" != 0 -a -f /lib/netifd/proto/6rd.sh ] && append dhcpopts "-O 212"
@@ -87,7 +87,15 @@ proto_dhcpv6_setup() {
[ -z "$reqprefix" -o "$reqprefix" = "auto" ] && reqprefix=0
[ "$reqprefix" != "no" ] && append opts "-P$reqprefix"
[ -n "$clientid" ] && {
clientid="$(hexdump_2hex "$clientid")"
[ -z "$clientid" ] && logger -p warn -t dhcpv6 "$iface: ignoring invalid clientid value"
}
[ -z "$clientid" ] && clientid="$(uci_get network @globals[0] dhcp_default_duid)"
[ -n "$clientid" ] && {
clientid="$(hexdump_2hex "$clientid")"
[ -z "$clientid" ] && logger -p warn -t dhcpv6 "$iface: ignoring invalid dhcp_default_duid value"
}
[ -n "$clientid" ] && append opts "-c$clientid"
[ "$defaultreqopts" = "0" ] && append opts "-R"
+3 -3
View File
@@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dnsmasq
PKG_UPSTREAM_VERSION:=2.92
PKG_UPSTREAM_VERSION:=2.93
PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION)))
PKG_RELEASE:=2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz
PKG_SOURCE_URL:=https://thekelleys.org.uk/dnsmasq/
PKG_HASH:=4bf50c2c1018f9fbc26037df51b90ecea0cb73d46162846763b92df0d6c3a458
PKG_HASH:=0c00d4e5c97c8306e5fb932b348b34269c9c29a0e7df0e8e82958b407092bc19
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
@@ -1,29 +0,0 @@
commit ec2fbfbbdaa7d7db1c707dce26ce1a37cfe09660
Author: Simon Kelley <simon@thekelleys.org.uk>
Date: Fri Apr 10 16:29:31 2026 +0100
Fix buffer overflow in struct bigname. CVE-2026-2291
All buffers capable of holding a domain name should be
at least MAXDNAME*2 + 1 bytes long, where MAXDNAME is the maximum
size of a domain name. The accounts for the trailing zero and the
fact that some characters are escaped in the internal representation
of a domain name in dnsmasq.
The declaration of struct bigname get this wrong, with the effect
that a remote attacker capable of asking DNS queries or answering DNS
queries can cause a large OOB write in the heap.
This was first spotted by Andrew S. Fasano.
--- a/src/dnsmasq.h
+++ b/src/dnsmasq.h
@@ -479,7 +479,7 @@ struct interface_name {
};
union bigname {
- char name[MAXDNAME];
+ char name[(2*MAXDNAME) + 1];
union bigname *next; /* freelist */
};
@@ -1,42 +0,0 @@
commit 4fdb707633afe8028118bcaf39b4882f634b5999
Author: Simon Kelley <simon@thekelleys.org.uk>
Date: Fri Apr 10 16:24:02 2026 +0100
Fix NSEC bitmap parsing infinite loop. CVE-2026-4890
Report from Royce M <royce@xchglabs.com>.
Location: dnssec.c:1290-1306, dnssec.c:1450-1463
The bitmap window iteration advances by p[1] instead of p[1]+2
(missing the 2-byte window header). With bitmap_length=0, both rdlen and p are
unchanged, causing an infinite loop and dnsmasq stops responding to all queries.
Reachable before RRSIG validation
(confirmed by the source comment at line 2125), so no valid
DNSSEC signatures are needed.
--- a/src/dnssec.c
+++ b/src/dnssec.c
@@ -1344,8 +1344,8 @@ static int prove_non_existence_nsec(stru
break; /* finished checking */
}
- rdlen -= p[1];
- p += p[1];
+ rdlen -= p[1] + 2;
+ p += p[1] + 2;
}
return 0;
@@ -1508,8 +1508,8 @@ static int check_nsec3_coverage(struct d
break; /* finished checking */
}
- rdlen -= p[1];
- p += p[1];
+ rdlen -= p[1] + 2;
+ p += p[1] + 2;
}
return 1;
@@ -1,32 +0,0 @@
commit 2cacea42e4d45717bd0ce3ccfe8e78960245e5da
Author: Simon Kelley <simon@thekelleys.org.uk>
Date: Wed Mar 25 23:04:08 2026 +0000
Verify rdlen field in RRSIG packets. CVE-2026-4891
Bug report from Royce M <royce@xchglabs.com>
This avoids crafted packets which give a value for rdlen _less_
then the space taken up by the fixed data and the signer's name
and engender a negative calculated length for the signature.
--- a/src/dnssec.c
+++ b/src/dnssec.c
@@ -546,10 +546,14 @@ static int validate_rrset(time_t now, st
*ttl_out = ttl;
}
-
+
+ /* Don't trust rdlen not to be too small and give us a negative sig_len
+ It has already been checked that it doesn't run us off the end
+ of the packet. */
+ if ((sig_len = rdlen - (p - psav)) <= 0)
+ return STAT_BOGUS;
+
sig = p;
- sig_len = rdlen - (p - psav);
-
nsigttl = htonl(orig_ttl);
hash->update(ctx, 18, psav);
@@ -1,28 +0,0 @@
commit 011a36c51438c986535a7248ed2e7f424f8e1078
Author: Simon Kelley <simon@thekelleys.org.uk>
Date: Wed Mar 25 23:16:35 2026 +0000
Fix buffer overflow in helper.c with large CLIDs. CVE-2026-4892
Bug reported bt Royce M <royce@xchglabs.com>
Location: helper.c:265-270
DHCPv6 CLIDs can be up to 65535 bytes. When --dhcp-script is configured,
the helper hex-encodes raw CLID bytes via sprintf("%.2x") into daemon->packet (5131 bytes).
A 1000-byte CLID writes ~3000 bytes. The helper process retains root privileges.
Note: log6_packet() correctly caps CLID to 100 bytes for logging, but the helper code path was missed.
--- a/src/helper.c
+++ b/src/helper.c
@@ -261,8 +261,8 @@ int create_helper(int event_fd, int err_
data.hostname_len + data.ed_len + data.clid_len, RW_READ))
continue;
- /* CLID into packet */
- for (p = daemon->packet, i = 0; i < data.clid_len; i++)
+ /* CLID into packet: limit to 100 bytes to avoid overflowing buffer. */
+ for (p = daemon->packet, i = 0; i < data.clid_len && i < 100; i++)
{
p += sprintf(p, "%.2x", buf[i]);
if (i != data.clid_len - 1)
@@ -1,26 +0,0 @@
commit 434d68f2eb1a58744470698483a3ae09b5a9a870
Author: Simon Kelley <simon@thekelleys.org.uk>
Date: Wed Mar 25 23:22:37 2026 +0000
Fix broken client subnet validation. CVE-2026-4893
Bug report from Royce M <royce@xchglabs.com>
Location: forward.c:713, edns0.c:421
With --add-subnet enabled, process_reply() passes the OPT record
length (~23 bytes) instead of the packet length to check_source().
All internal bounds checks fail, and the function always returns 1.
ECS source validation per RFC 7871 Section 9.2 is completely bypassed.
--- a/src/forward.c
+++ b/src/forward.c
@@ -724,7 +724,7 @@ static size_t process_reply(struct dns_h
/* Get extended RCODE. */
rcode |= sizep[2] << 4;
- if (option_bool(OPT_CLIENT_SUBNET) && !check_source(header, plen, pheader, query_source))
+ if (option_bool(OPT_CLIENT_SUBNET) && !check_source(header, n, pheader, query_source))
{
my_syslog(LOG_WARNING, _("discarding DNS reply: subnet option mismatch"));
return 0;
@@ -1,26 +0,0 @@
commit fa3c8ddef6712b52f562813317e6a997e1210123
Author: Simon Kelley <simon@thekelleys.org.uk>
Date: Mon Mar 30 16:24:33 2026 +0100
Fix buffer overflow vulnerability in extract_addresses() CVE-2026-5172
Thanks to Hugo Martinez Ray for spotting this.
The value of rdlen for an RR can be a lie, allowing the
call to extract_name() at rfc1025.c:952 to advance the value of p1
past the calculated end of the record. The makes the calculation
of bytes remaining in the RR underflow to a huge number and results
in a massive heap OOB read and certain crash.
--- a/src/rfc1035.c
+++ b/src/rfc1035.c
@@ -943,7 +943,8 @@ int extract_addresses(struct dns_header
/* Name, extract it then re-encode. */
int len;
- if (!extract_name(header, qlen, &p1, name, EXTR_NAME_EXTRACT, 0))
+ /* rdlen may lie, and extract_name() advances p1 past where it says the record ends. */
+ if (!extract_name(header, qlen, &p1, name, EXTR_NAME_EXTRACT, 0) || (p1 > endrr))
{
blockdata_free(addr.rrblock.rrdata);
return 2;
@@ -26,7 +26,7 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
--- a/src/dnsmasq.h
+++ b/src/dnsmasq.h
@@ -1298,7 +1298,7 @@ extern struct daemon {
@@ -1310,7 +1310,7 @@ extern struct daemon {
int inotifyfd;
#endif
#if defined(HAVE_LINUX_NETWORK)
@@ -35,7 +35,7 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
#elif defined(HAVE_BSD_NETWORK)
int dhcp_raw_fd, dhcp_icmp_fd, routefd;
#endif
@@ -1519,9 +1519,6 @@ int read_write(int fd, unsigned char *pa
@@ -1544,9 +1544,6 @@ int read_writev(int fd, struct iovec *io
void close_fds(long max_fd, int spare1, int spare2, int spare3);
int wildcard_match(const char* wildcard, const char* match);
int wildcard_matchn(const char* wildcard, const char* match, int num);
@@ -140,11 +140,10 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
my_syslog(LOG_ERR, _("failed to update ipset %s: %s"), setname, strerror(errno));
--- a/src/util.c
+++ b/src/util.c
@@ -930,22 +930,3 @@ int wildcard_matchn(const char* wildcard
@@ -928,25 +928,6 @@ int wildcard_matchn(const char* wildcard
return (!num) || (*wildcard == *match);
}
-
-#ifdef HAVE_LINUX_NETWORK
-int kernel_version(void)
-{
@@ -163,3 +162,7 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
- return version * 256 + (split ? atoi(split) : 0);
-}
-#endif
-
#define hash_ptr(x) (((uintptr_t)(x)) & 0xffffff)
void *whine_malloc_real(const char *func, unsigned int line, size_t size)
@@ -1,6 +1,6 @@
--- a/src/dnsmasq.c
+++ b/src/dnsmasq.c
@@ -2123,6 +2123,10 @@ static void do_tcp_connection(struct lis
@@ -2184,6 +2184,10 @@ static void do_tcp_connection(struct lis
daemon->pipe_to_parent = pipefd[1];
}
@@ -13,7 +13,7 @@
Reset that here. */
--- a/src/dnsmasq.h
+++ b/src/dnsmasq.h
@@ -1722,14 +1722,26 @@ void emit_dbus_signal(int action, struct
@@ -1747,14 +1747,26 @@ void emit_dbus_signal(int action, struct
/* ubus.c */
#ifdef HAVE_UBUS
@@ -65,7 +65,7 @@
/* EXTR_NAME_EXTRACT -> extract name
EXTR_NAME_COMPARE -> compare name, case insensitive
@@ -444,10 +446,65 @@ int private_net6(struct in6_addr *a, int
@@ -452,10 +454,65 @@ int private_net6(struct in6_addr *a, int
((u32 *)a)[0] == htonl(0x20010db8); /* RFC 6303 4.6 */
}
@@ -132,7 +132,7 @@
int done = 0;
if (!(p = skip_questions(header, qlen)))
@@ -464,7 +521,7 @@ int do_doctor(struct dns_header *header,
@@ -472,7 +529,7 @@ int do_doctor(struct dns_header *header,
GETSHORT(qtype, p);
GETSHORT(qclass, p);
@@ -141,7 +141,7 @@
GETSHORT(rdlen, p);
if (qclass == C_IN && qtype == T_A)
@@ -475,6 +532,9 @@ int do_doctor(struct dns_header *header,
@@ -483,6 +540,9 @@ int do_doctor(struct dns_header *header,
if (!CHECK_LEN(header, p, qlen, INADDRSZ))
return done;
@@ -151,7 +151,7 @@
/* alignment */
memcpy(&addr.addr4, p, INADDRSZ);
@@ -504,6 +564,14 @@ int do_doctor(struct dns_header *header,
@@ -512,6 +572,14 @@ int do_doctor(struct dns_header *header,
break;
}
}
+3 -3
View File
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
PKG_MIRROR_HASH:=70ed4340b5345756fd48d76ffbef0daa50a4d2fbfe52cb72cc7621be140f771f
PKG_SOURCE_DATE:=2026-06-04
PKG_SOURCE_VERSION:=1782f3f2aad21cd7971798c898355a12a9611304
PKG_MIRROR_HASH:=f982e7fc12f928359835ccb4b8e650ce935aa67e099bcacded6987d18452ae8d
PKG_SOURCE_DATE:=2026-06-14
PKG_SOURCE_VERSION:=c6792bac3905d4bf726d914e9994f6d4b98c5b57
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=GPL-2.0
+5 -7
View File
@@ -9,14 +9,12 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ppp
PKG_VERSION:=2.5.2
PKG_RELEASE:=3
PKG_VERSION:=2.5.3
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/ppp-project/ppp
PKG_MIRROR_HASH:=381668ce1547afeaf599f08ae37935bfd3d5841747c62bca5a870c11e3e9bedb
PKG_SOURCE_DATE:=2024-12-31
PKG_SOURCE_VERSION:=9f612dc02c34509f062ed63b60bcc7e937e25178
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://download.samba.org/pub/ppp
PKG_HASH:=ddda28dec8aca99a403ab6070d94ffd2b17d63e9a4c5509158e99e148f572d4f
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=BSD-4-Clause
@@ -1,30 +0,0 @@
From 5edcb01f1d8d521c819d45df1f1bb87697252130 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 17 Mar 2025 14:38:26 -0700
Subject: [PATCH] pppd/session: Fixed building with GCC 15
Fixed building with GCC 15 which defaults to C23
and find conflicting declration of getspnam() here
with the one provided by shadow.h (extern struct spwd *getspnam (const char *__name);)
Fixes
../../ppp-2.5.2/pppd/session.c: In function 'session_start':
../../ppp-2.5.2/pppd/session.c:185:18: error: conflicting types for 'getspnam'; have 'struct spwd *(void)'
185 | struct spwd *getspnam();
| ^~~~~~~~
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
pppd/session.c | 1 -
1 file changed, 1 deletion(-)
--- a/pppd/session.c
+++ b/pppd/session.c
@@ -182,7 +182,6 @@ session_start(const int flags, const cha
char *cbuf;
#ifdef HAVE_SHADOW_H
struct spwd *spwd;
- struct spwd *getspnam();
long now = 0;
#endif /* #ifdef HAVE_SHADOW_H */
#endif /* #ifdef PPP_WITH_PAM */
@@ -1,70 +0,0 @@
From c6c84c77c16878745be4955f2f5baac1f2280c96 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad@redhat.com>
Date: Thu, 27 Feb 2025 11:44:08 +0100
Subject: [PATCH] Fixed building with GCC 15
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
GCC 15 defaults to C23 which does not allow K&R declarations.
Credit Yaakov Selkowitz in:
https://src.fedoraproject.org/rpms/ppp/pull-request/12
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
---
pppdump/pppdump.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
--- a/pppdump/pppdump.c
+++ b/pppdump/pppdump.c
@@ -42,14 +42,12 @@ int tot_sent, tot_rcvd;
extern int optind;
extern char *optarg;
-void dumplog();
-void dumpppp();
-void show_time();
+void dumplog(FILE *);
+void dumpppp(FILE *);
+void show_time(FILE *, int);
int
-main(ac, av)
- int ac;
- char **av;
+main(int ac, char **av)
{
int i;
char *p;
@@ -97,8 +95,7 @@ main(ac, av)
}
void
-dumplog(f)
- FILE *f;
+dumplog(FILE *f)
{
int c, n, k, col;
int nb, c2;
@@ -241,8 +238,7 @@ struct pkt {
unsigned char dbuf[8192];
void
-dumpppp(f)
- FILE *f;
+dumpppp(FILE *f)
{
int c, n, k;
int nb, nl, dn, proto, rv;
@@ -375,9 +371,7 @@ dumpppp(f)
}
void
-show_time(f, c)
- FILE *f;
- int c;
+show_time(FILE *f, int c)
{
time_t t;
int n;
@@ -137,7 +137,7 @@
} else {
--- a/pppd/ipcp.c
+++ b/pppd/ipcp.c
@@ -1915,7 +1915,7 @@ ipcp_up(fsm *f)
@@ -1930,7 +1930,7 @@ ipcp_up(fsm *f)
proxy_arp_set[f->unit] = 1;
}
@@ -148,7 +148,7 @@
} else {
--- a/pppd/ipv6cp.c
+++ b/pppd/ipv6cp.c
@@ -1338,7 +1338,7 @@ ipv6cp_up(fsm *f)
@@ -1344,7 +1344,7 @@ ipv6cp_up(fsm *f)
if (sif6defaultroute(f->unit, go->ourid, ho->hisid))
default_route_set[f->unit] = 1;
}
@@ -159,7 +159,7 @@
} else {
--- a/pppd/pppd-private.h
+++ b/pppd/pppd-private.h
@@ -370,7 +370,7 @@ void demand_conf(void); /* config interf
@@ -375,7 +375,7 @@ void demand_conf(void); /* config interf
void demand_block(void); /* set all NPs to queue up packets */
void demand_unblock(void); /* set all NPs to pass packets */
void demand_discard(void); /* set all NPs to discard packets */
@@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -1150,7 +1150,8 @@ get_input(void)
@@ -1159,7 +1159,8 @@ get_input(void)
}
notice("Modem hangup");
hungup = 1;
@@ -23,7 +23,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
#
# SunOS provides a version of libpcap that would work, but SunOS has no support for activity filter
AM_CONDITIONAL([PPP_WITH_FILTER], [ test "x${with_pcap}" = "xyes" && test "x${build_sunos}" != "xyes" ])
@@ -348,6 +351,7 @@ $PACKAGE_NAME version $PACKAGE_VERSION
@@ -349,6 +352,7 @@ $PACKAGE_NAME version $PACKAGE_VERSION
With libatm..........: ${with_atm:-no}
With libpam..........: ${with_pam:-no}
With libpcap.........: ${with_pcap:-no}
@@ -56,7 +56,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
/*
* There have been 3 or 4 different names for this in libpcap CVS, but
* this seems to be what they have settled on...
@@ -182,6 +183,13 @@ static int setlogfile(char **);
@@ -186,6 +187,13 @@ static int setlogfile(char **);
static int loadplugin(char **);
#endif
@@ -70,7 +70,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
#ifdef PPP_WITH_FILTER
static int setpassfilter(char **);
static int setactivefilter(char **);
@@ -391,6 +399,14 @@ struct option general_options[] = {
@@ -404,6 +412,14 @@ struct option general_options[] = {
"set filter for active pkts", OPT_PRIO },
#endif
@@ -85,7 +85,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ "maxoctets", o_int, &maxoctets,
"Set connection traffic limit",
OPT_PRIO | OPT_LLIMIT | OPT_NOINCR | OPT_ZEROINF },
@@ -1666,6 +1682,27 @@ callfile(char **argv)
@@ -1690,6 +1706,27 @@ callfile(char **argv)
return ok;
}
@@ -119,7 +119,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
&& memcmp(vd.dptr, key.dptr, vd.dsize) == 0;
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -980,6 +980,16 @@ void cfg_bundle(int mrru, int mtru, int
@@ -1111,6 +1111,16 @@ void cfg_bundle(int mrru, int mtru, int
add_fd(ppp_dev_fd);
}
@@ -136,7 +136,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
/*
* make_new_bundle - create a new PPP unit (i.e. a bundle)
* and connect our channel to it. This should only get called
@@ -998,6 +1008,8 @@ void make_new_bundle(int mrru, int mtru,
@@ -1129,6 +1139,8 @@ void make_new_bundle(int mrru, int mtru,
/* set the mrru and flags */
cfg_bundle(mrru, mtru, rssn, tssn);
@@ -13,7 +13,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -2247,6 +2247,9 @@ int sifdefaultroute (int unit, u_int32_t
@@ -2374,6 +2374,9 @@ int sifdefaultroute (int unit, u_int32_t
memset (&rt, 0, sizeof (rt));
SET_SA_FAMILY (rt.rt_dst, AF_INET);
@@ -23,7 +23,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
rt.rt_dev = ifname;
rt.rt_metric = dfl_route_metric + 1; /* +1 for binary compatibility */
@@ -2255,7 +2258,7 @@ int sifdefaultroute (int unit, u_int32_t
@@ -2382,7 +2385,7 @@ int sifdefaultroute (int unit, u_int32_t
SIN_ADDR(rt.rt_genmask) = 0L;
}
@@ -10,8 +10,8 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -220,14 +220,10 @@ static fd_set in_fds; /* set of fds tha
static int max_in_fd; /* highest fd set in in_fds */
@@ -218,14 +218,10 @@ static int chindex; /* channel index (n
static unsigned routing_table_id = RT_TABLE_MAIN;
static int has_proxy_arp = 0;
-static int driver_version = 0;
@@ -26,7 +26,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
static char loop_name[20];
static unsigned char inbuf[512]; /* buffer for chars read from loopback */
@@ -245,9 +241,8 @@ static int dynaddr_set; /* 1 if ip_dyna
@@ -241,9 +237,8 @@ static int dynaddr_set; /* 1 if ip_dyna
static int looped; /* 1 if using loop */
static int link_mtu; /* mtu for the link (not bundle) */
@@ -37,7 +37,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
#define MAX_IFS 100
@@ -1966,11 +1961,12 @@ int ccp_fatal_error (int unit)
@@ -2067,11 +2062,12 @@ int ccp_fatal_error (int unit)
*
* path_to_procfs - find the path to the proc file system mount point
*/
@@ -52,7 +52,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
struct mntent *mntent;
FILE *fp;
@@ -1992,6 +1988,7 @@ static char *path_to_procfs(const char *
@@ -2093,6 +2089,7 @@ static char *path_to_procfs(const char *
fclose (fp);
}
}
@@ -60,7 +60,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
strlcpy(proc_path + proc_path_len, tail,
sizeof(proc_path) - proc_path_len);
@@ -2883,6 +2880,8 @@ ppp_registered(void)
@@ -2874,6 +2871,8 @@ ppp_registered(void)
int ppp_check_kernel_support(void)
{
@@ -69,7 +69,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
int s, ok, fd;
struct ifreq ifr;
int size;
@@ -3010,6 +3009,7 @@ int ppp_check_kernel_support(void)
@@ -3001,6 +3000,7 @@ int ppp_check_kernel_support(void)
}
close(s);
return ok;
@@ -77,7 +77,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
}
#ifndef HAVE_LOGWTMP
@@ -3571,6 +3571,7 @@ get_pty(int *master_fdp, int *slave_fdp,
@@ -3562,6 +3562,7 @@ get_pty(int *master_fdp, int *slave_fdp,
}
#endif /* TIOCGPTN */
@@ -85,7 +85,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
if (sfd < 0) {
/* the old way - scan through the pty name space */
for (i = 0; i < 64; ++i) {
@@ -3595,6 +3596,7 @@ get_pty(int *master_fdp, int *slave_fdp,
@@ -3586,6 +3587,7 @@ get_pty(int *master_fdp, int *slave_fdp,
}
}
}
@@ -93,7 +93,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
if (sfd < 0)
return 0;
@@ -3710,6 +3712,7 @@ get_host_seed(void)
@@ -3701,6 +3703,7 @@ get_host_seed(void)
int
sys_check_options(void)
{
@@ -101,7 +101,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
if (demand && driver_is_old) {
ppp_option_error("demand dialling is not supported by kernel driver "
"version %d.%d.%d", driver_version, driver_modification,
@@ -3720,6 +3723,7 @@ sys_check_options(void)
@@ -3711,6 +3714,7 @@ sys_check_options(void)
warn("Warning: multilink is not supported by the kernel driver");
multilink = 0;
}
@@ -147,7 +147,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
info("PPPoE plugin from pppd %s", PPPD_VERSION);
--- a/pppd/plugins/pppol2tp/pppol2tp.c
+++ b/pppd/plugins/pppol2tp/pppol2tp.c
@@ -501,10 +501,6 @@ static void pppol2tp_cleanup(void)
@@ -502,10 +502,6 @@ static void pppol2tp_cleanup(void)
void plugin_init(void)
{
#if defined(__linux__)
@@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -982,14 +982,17 @@ struct protocol_list {
@@ -991,14 +991,17 @@ struct protocol_list {
const char *name;
} protocol_list[] = {
{ 0x21, "IP" },
@@ -25,7 +25,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x33, "Stream Protocol ST-II" },
{ 0x35, "Banyan Vines" },
{ 0x39, "AppleTalk EDDP" },
@@ -1003,8 +1006,11 @@ struct protocol_list {
@@ -1012,8 +1015,11 @@ struct protocol_list {
{ 0x49, "Serial Data Transport Protocol (PPP-SDTP)" },
{ 0x4b, "SNA over 802.2" },
{ 0x4d, "SNA" },
@@ -37,7 +37,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x53, "Encryption" },
{ 0x55, "Individual Link Encryption" },
{ 0x57, "IPv6" },
@@ -1015,12 +1021,15 @@ struct protocol_list {
@@ -1024,12 +1030,15 @@ struct protocol_list {
{ 0x65, "RTP IPHC Compressed non-TCP" },
{ 0x67, "RTP IPHC Compressed UDP 8" },
{ 0x69, "RTP IPHC Compressed RTP 8" },
@@ -53,7 +53,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x0203, "IBM Source Routing BPDU" },
{ 0x0205, "DEC LANBridge100 Spanning Tree" },
{ 0x0207, "Cisco Discovery Protocol" },
@@ -1032,15 +1041,19 @@ struct protocol_list {
@@ -1041,15 +1050,19 @@ struct protocol_list {
{ 0x0231, "Luxcom" },
{ 0x0233, "Sigma Network Systems" },
{ 0x0235, "Apple Client Server Protocol" },
@@ -73,7 +73,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x4001, "Cray Communications Control Protocol" },
{ 0x4003, "CDPD Mobile Network Registration Protocol" },
{ 0x4005, "Expand accelerator protocol" },
@@ -1051,8 +1064,10 @@ struct protocol_list {
@@ -1060,8 +1073,10 @@ struct protocol_list {
{ 0x4023, "RefTek Protocol" },
{ 0x4025, "Fibre Channel" },
{ 0x4027, "EMIT Protocols" },
@@ -84,7 +84,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x8023, "OSI Network Layer Control Protocol" },
{ 0x8025, "Xerox NS IDP Control Protocol" },
{ 0x8027, "DECnet Phase IV Control Protocol" },
@@ -1061,7 +1076,9 @@ struct protocol_list {
@@ -1070,7 +1085,9 @@ struct protocol_list {
{ 0x8031, "Bridging NCP" },
{ 0x8033, "Stream Protocol Control Protocol" },
{ 0x8035, "Banyan Vines Control Protocol" },
@@ -94,7 +94,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x803f, "NETBIOS Framing Control Protocol" },
{ 0x8041, "Cisco Systems Control Protocol" },
{ 0x8043, "Ascom Timeplex" },
@@ -1070,18 +1087,24 @@ struct protocol_list {
@@ -1079,18 +1096,24 @@ struct protocol_list {
{ 0x8049, "Serial Data Control Protocol (PPP-SDCP)" },
{ 0x804b, "SNA over 802.2 Control Protocol" },
{ 0x804d, "SNA Control Protocol" },
@@ -119,7 +119,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x8207, "Cisco Discovery Protocol Control" },
{ 0x8209, "Netcs Twin Routing" },
{ 0x820b, "STP - Control Protocol" },
@@ -1090,24 +1113,29 @@ struct protocol_list {
@@ -1099,24 +1122,29 @@ struct protocol_list {
{ 0x8281, "MPLSCP" },
{ 0x8285, "IEEE p1284.4 standard - Protocol Control" },
{ 0x8287, "ETSI TETRA TNP1 Control Protocol" },
@@ -9,7 +9,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/options.c
+++ b/pppd/options.c
@@ -379,13 +379,14 @@ struct option general_options[] = {
@@ -392,13 +392,14 @@ struct option general_options[] = {
"Enable multilink operation", OPT_PRIOSUB | OPT_ALIAS | 1 },
{ "nomultilink", o_bool, &multilink,
"Disable multilink operation", OPT_PRIOSUB | 0 },
@@ -1,9 +1,9 @@
--- a/configure.ac
+++ b/configure.ac
@@ -333,6 +333,7 @@ AC_CONFIG_FILES([
pppd/plugins/pppoatm/Makefile
@@ -334,6 +334,7 @@ AC_CONFIG_FILES([
pppd/plugins/pppol2tp/Makefile
pppd/plugins/radius/Makefile
pppd/plugins/dhcpv6relay/Makefile
+ pppd/plugins/pptp/Makefile
pppdump/Makefile
pppstats/Makefile
@@ -14,8 +14,8 @@
winbind_la_SOURCES = winbind.c
if !SUNOS
-SUBDIRS = pppoe pppoatm pppol2tp radius
+SUBDIRS = pppoe pppoatm pppol2tp radius pptp
-SUBDIRS = pppoe pppoatm pppol2tp radius dhcpv6relay
+SUBDIRS = pppoe pppoatm pppol2tp radius dhcpv6relay pptp
endif
--- /dev/null
+++ b/pppd/plugins/pptp/Makefile.am
@@ -1,37 +0,0 @@
From f8d994052e3858848ce11318085e04fe7a1cfb28 Mon Sep 17 00:00:00 2001
From: LGA1150 <9155358+LGA1150@users.noreply.github.com>
Date: Thu, 5 Mar 2026 05:41:30 +0800
Subject: [PATCH] pppd: fix memcpy overlap (#579)
memcpy() with overlapping src and dest buffers is an undefined behavior
in C. In the current code, a ConfRej response is generated by copying
input data in-place, where the dest address is lower than the src.
This happens to work in practice because memcpy() forward-copies data,
matching the behavior of memmove() in this case.
However, if FORTIFY_SOURCE or Address Sanitizer is enabled, memcpy()
will detect the overlap at run time and abort the program.
Replace the memcpy() with memmove() to ensure a well-defined behavior.
Reported-by: Filippo Carletti <filippo.carletti@gmail.com>
Closes: #576
Signed-off-by: Qingfang Deng <dqfext@gmail.com>
---
pppd/pppd-private.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pppd/pppd-private.h b/pppd/pppd-private.h
index 5f841824..29ea940c 100644
--- a/pppd/pppd-private.h
+++ b/pppd/pppd-private.h
@@ -525,7 +525,7 @@ int parse_dotted_ip(char *, u_int32_t *)
#define TIMEOUT(r, f, t) ppp_timeout((r), (f), (t), 0)
#define UNTIMEOUT(r, f) ppp_untimeout((r), (f))
-#define BCOPY(s, d, l) memcpy(d, s, l)
+#define BCOPY(s, d, l) memmove(d, s, l)
#define BZERO(s, n) memset(s, 0, n)
#define BCMP(s1, s2, l) memcmp(s1, s2, l)
@@ -0,0 +1,749 @@
From 71d3d3a6703fce993432151d363f405b51e7b75c Mon Sep 17 00:00:00 2001
From: Qingfang Deng <dqfext@gmail.com>
Date: Fri, 12 Jun 2026 10:52:39 +0800
Subject: [PATCH] pppd: relax and simplify permission check
The additional check added in v2.5.3 is intended to mitigate symlink
attacks, but it checks the permissions of every component of a path and
is too strict, breaking existing configurations. Relax and simplify the
check by only checking the opened file descriptor of a path, so the path
is resolved only once.
Signed-off-by: Qingfang Deng <dqfext@gmail.com>
---
configure.ac | 2 +
pppd/auth.c | 146 +++++++++++++++++++++++++-------------------
pppd/main.c | 46 ++++++++++----
pppd/options.c | 56 +++++++++++++----
pppd/pppd-private.h | 2 +-
pppd/pppd.8 | 10 ---
pppd/pppd.h | 2 +-
pppd/utils.c | 84 ++++++-------------------
8 files changed, 184 insertions(+), 164 deletions(-)
--- a/configure.ac
+++ b/configure.ac
@@ -2,6 +2,7 @@ AC_PREREQ([2.69])
AC_INIT([ppp],
[2.5.3],
[https://github.com/ppp-project/ppp])
+AC_USE_SYSTEM_EXTENSIONS
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_CONFIG_MACRO_DIR([m4])
@@ -93,6 +94,7 @@ AC_CHECK_SIZEOF(unsigned short)
# Checks for library functions.
AC_CHECK_FUNCS([ \
+ fexecve \
mmap \
logwtmp \
strerror])
--- a/pppd/auth.c
+++ b/pppd/auth.c
@@ -307,7 +307,7 @@ static int setupapfile (char **);
static int privgroup (char **);
static int set_noauth_addr (char **);
static int set_permitted_number (char **);
-static void check_access (FILE *, char *);
+static void check_access (int, const char *);
static int wordlist_count (struct wordlist *);
static void check_maxoctets (void *);
@@ -532,7 +532,7 @@ setupapfile(char **argv)
free(fname);
return 0;
}
- check_access(ufile, fname);
+ check_access(fileno(ufile), fname);
uafname = fname;
/* get username */
@@ -1543,8 +1543,7 @@ check_passwd(int unit,
* Open the file of pap secrets and scan for a suitable secret
* for authenticating this user.
*/
- if (!ppp_check_access(path_upapfile, &filename, 0, 0))
- return UPAP_AUTHNAK;
+ filename = path_upapfile;
addrs = opts = NULL;
ret = UPAP_AUTHNAK;
f = fopen(filename, "r");
@@ -1552,7 +1551,13 @@ check_passwd(int unit,
error("Can't open PAP password file %s: %m", filename);
} else {
- check_access(f, filename);
+ int fd = fileno(f);
+
+ if (!ppp_check_access(fd, filename, 0)) {
+ fclose(f);
+ return UPAP_AUTHNAK;
+ }
+ check_access(fd, filename);
if (scan_authfile(f, user, our_name, secret, &addrs, &opts, filename, 0) < 0) {
warn("no PAP secret found for %s", user);
} else {
@@ -1586,7 +1591,6 @@ check_passwd(int unit,
}
fclose(f);
}
- free(filename);
if (ret == UPAP_AUTHNAK) {
if (**msg == 0)
@@ -1646,21 +1650,24 @@ null_login(int unit)
* Open the file of pap secrets and scan for a suitable secret.
*/
if (ret <= 0) {
- if (!ppp_check_access(path_upapfile, &filename, 0, 0))
- return 0;
+ int fd;
+
+ filename = path_upapfile;
addrs = NULL;
f = fopen(filename, "r");
- if (f == NULL) {
- free(filename);
+ if (f == NULL)
+ return 0;
+ fd = fileno(f);
+ if (!ppp_check_access(fd, filename, 0)) {
+ fclose(f);
return 0;
}
- check_access(f, filename);
+ check_access(fd, filename);
i = scan_authfile(f, "", our_name, secret, &addrs, &opts, filename, 0);
ret = i >= 0 && secret[0] == 0;
BZERO(secret, sizeof(secret));
fclose(f);
- free(filename);
}
if (ret)
@@ -1701,7 +1708,7 @@ get_pap_passwd(char *passwd)
f = fopen(filename, "r");
if (f == NULL)
return 0;
- check_access(f, filename);
+ check_access(fileno(f), filename);
ret = scan_authfile(f, user,
(remote_name[0]? remote_name: NULL),
secret, NULL, NULL, filename, 0);
@@ -1734,18 +1741,18 @@ have_pap_secret(int *lacks_ipp)
return ret;
}
- if (!ppp_check_access(path_upapfile, &filename, 0, 0))
- return 0;
+ filename = path_upapfile;
f = fopen(filename, "r");
- if (f == NULL) {
- free(filename);
+ if (f == NULL)
return 0;
- }
+ if (!ppp_check_access(fileno(f), filename, 0)) {
+ fclose(f);
+ return 0;
+ }
ret = scan_authfile(f, (explicit_remote? remote_name: NULL), our_name,
NULL, &addrs, NULL, filename, 0);
fclose(f);
- free(filename);
if (ret >= 0 && !some_ip_ok(addrs)) {
if (lacks_ipp != 0)
*lacks_ipp = 1;
@@ -1780,11 +1787,13 @@ have_chap_secret(char *client, char *ser
}
}
- if (!ppp_check_access(path_chapfile, &filename, 0, 0))
- return 0;
+ filename = path_chapfile;
f = fopen(filename, "r");
- if (f == NULL) {
- free(filename);
+ if (f == NULL)
+ return 0;
+
+ if (!ppp_check_access(fileno(f), filename, 0)) {
+ fclose(f);
return 0;
}
@@ -1795,7 +1804,6 @@ have_chap_secret(char *client, char *ser
ret = scan_authfile(f, client, server, NULL, &addrs, NULL, filename, 0);
fclose(f);
- free(filename);
if (ret >= 0 && need_ip && !some_ip_ok(addrs)) {
if (lacks_ipp != 0)
*lacks_ipp = 1;
@@ -1822,11 +1830,13 @@ have_srp_secret(char *client, char *serv
char *filename;
struct wordlist *addrs;
- if (!ppp_check_access(PPP_PATH_SRPFILE, &filename, 0, 0))
- return 0;
+ filename = PPP_PATH_SRPFILE;
f = fopen(filename, "r");
- if (f == NULL) {
- free(filename);
+ if (f == NULL)
+ return 0;
+
+ if (!ppp_check_access(fileno(f), filename, 0)) {
+ fclose(f);
return 0;
}
@@ -1837,7 +1847,6 @@ have_srp_secret(char *client, char *serv
ret = scan_authfile(f, client, server, NULL, &addrs, NULL, filename, 0);
fclose(f);
- free(filename);
if (ret >= 0 && need_ip && !some_ip_ok(addrs)) {
if (lacks_ipp != 0)
*lacks_ipp = 1;
@@ -1874,22 +1883,27 @@ get_secret(int unit, char *client, char
return 0;
}
} else {
- if (!ppp_check_access(path_chapfile, &filename, 0, 0))
- return 0;
+ int fd;
+
+ filename = path_chapfile;
addrs = NULL;
secbuf[0] = 0;
f = fopen(filename, "r");
if (f == NULL) {
error("Can't open chap secret file %s: %m", filename);
- free(filename);
return 0;
}
- check_access(f, filename);
+
+ fd = fileno(f);
+ if (!ppp_check_access(fd, filename, 0)) {
+ fclose(f);
+ return 0;
+ }
+ check_access(fd, filename);
ret = scan_authfile(f, client, server, secbuf, &addrs, &opts, filename, 0);
fclose(f);
- free(filename);
if (ret < 0)
return 0;
@@ -1931,23 +1945,27 @@ get_srp_secret(int unit, char *client, c
if (!am_server && passwd[0] != '\0') {
strlcpy(secret, passwd, MAXWORDLEN);
} else {
- if (!ppp_check_access(PPP_PATH_SRPFILE, &filename, 0, 0))
- return 0;
- addrs = NULL;
+ int fd;
+ filename = PPP_PATH_SRPFILE;
+ addrs = NULL;
fp = fopen(filename, "r");
if (fp == NULL) {
error("Can't open srp secret file %s: %m", filename);
- free(filename);
return 0;
}
- check_access(fp, filename);
+
+ fd = fileno(fp);
+ if (!ppp_check_access(fd, filename, 0)) {
+ fclose(fp);
+ return 0;
+ }
+ check_access(fd, filename);
secret[0] = '\0';
ret = scan_authfile(fp, client, server, secret, &addrs, &opts,
filename, am_server);
fclose(fp);
- free(filename);
if (ret < 0)
return 0;
@@ -2214,11 +2232,11 @@ auth_number(void)
* check_access - complain if a secret file has too-liberal permissions.
*/
static void
-check_access(FILE *f, char *filename)
+check_access(int fd, const char *filename)
{
struct stat sbuf;
- if (fstat(fileno(f), &sbuf) < 0) {
+ if (fstat(fd, &sbuf) < 0) {
warn("cannot stat secret file %s: %m", filename);
} else if ((sbuf.st_mode & (S_IRWXG | S_IRWXO)) != 0) {
warn("Warning - secret file %s has world and/or group access",
@@ -2326,25 +2344,25 @@ scan_authfile(FILE *f, char *client, cha
* Special syntax: @/pathname means read secret from file.
*/
if (word[0] == '@' && word[1] == '/') {
- char *realname;
+ int fd;
strlcpy(atfile, word+1, sizeof(atfile));
- if (!ppp_check_access(atfile, &realname, 0, 0))
- continue;
- if ((sf = fopen(realname, "r")) == NULL) {
+ if ((sf = fopen(atfile, "r")) == NULL) {
warn("can't open indirect secret file %s", atfile);
- free(realname);
continue;
}
- check_access(sf, atfile);
+ fd = fileno(sf);
+ if (!ppp_check_access(fd, atfile, 0)) {
+ fclose(sf);
+ continue;
+ }
+ check_access(fd, atfile);
if (!getword(sf, word, &xxx, atfile)) {
warn("no secret in indirect secret file %s", atfile);
fclose(sf);
- free(realname);
continue;
}
fclose(sf);
- free(realname);
}
strlcpy(lsecret, word, sizeof(lsecret));
}
@@ -2503,14 +2521,15 @@ have_eaptls_secret_server(char *client,
char cacertfile[MAXWORDLEN];
char pkfile[MAXWORDLEN];
- if (!ppp_check_access(PPP_PATH_EAPTLSSERVFILE, &filename, 0, 0))
- return 0;
+ filename = PPP_PATH_EAPTLSSERVFILE;
f = fopen(filename, "r");
- if (f == NULL) {
- free(filename);
+ if (f == NULL)
return 0;
- }
+ if (!ppp_check_access(fileno(f), filename, 0)) {
+ fclose(f);
+ return 0;
+ }
if (client != NULL && client[0] == 0)
client = NULL;
else if (server != NULL && server[0] == 0)
@@ -2522,7 +2541,6 @@ have_eaptls_secret_server(char *client,
0);
fclose(f);
- free(filename);
/*
if (ret >= 0 && !eaptls_init_ssl(1, cacertfile, servcertfile,
@@ -2782,26 +2800,28 @@ get_eaptls_secret(int unit, char *client
}
else
{
+ int fd;
+
filename = (am_server ? PPP_PATH_EAPTLSSERVFILE : PPP_PATH_EAPTLSCLIFILE);
addrs = NULL;
- if (!ppp_check_access(filename, &filename, 0, 0))
- return 0;
fp = fopen(filename, "r");
- if (fp == NULL)
- {
+ if (fp == NULL) {
error("Can't open eap-tls secret file %s: %m", filename);
- free(filename);
return 0;
}
- check_access(fp, filename);
+ fd = fileno(fp);
+ if (!ppp_check_access(fd, filename, 0)) {
+ fclose(fp);
+ return 0;
+ }
+ check_access(fd, filename);
ret = scan_authfile_eaptls(fp, client, server, clicertfile, servcertfile,
cacertfile, pkfile, &addrs, &opts, filename, 0);
fclose(fp);
- free(filename);
if (ret < 0) return 0;
}
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -1952,22 +1952,37 @@ update_script_environment(void)
pid_t
run_program(char *prog, char * const *args, int must_exist, void (*done)(void *), void *arg, int wait)
{
- int pid, status, ret;
- char *rpath;
+ int fd, pid, status, ret;
/*
* First check if the file exists and is executable by root,
* and couldn't have been modified by a non-root process.
*/
- if (!ppp_check_access(prog, &rpath, must_exist, 1))
+#if defined(O_PATH)
+ fd = open(prog, O_PATH);
+#elif defined(O_EXEC)
+ fd = open(prog, O_EXEC);
+#else
+ fd = open(prog, O_RDONLY);
+#endif
+ if (fd < 0) {
+ if (errno != ENOENT || must_exist)
+ error("Can't access %s: %m", prog);
+ return 0;
+ }
+ if (!ppp_check_access(fd, prog, 1)) {
+ close(fd);
return 0;
+ }
pid = ppp_safe_fork(fd_devnull, fd_devnull, fd_devnull);
if (pid == -1) {
error("Failed to create child process for %s: %m", prog);
+ close(fd);
return -1;
}
if (pid != 0) {
+ close(fd);
if (debug)
dbglog("Script %s started (pid %d)", prog, pid);
record_child(pid, prog, done, arg, 0);
@@ -1979,7 +1994,6 @@ run_program(char *prog, char * const *ar
}
forget_child(pid, status);
}
- free(rpath);
return pid;
}
@@ -2007,14 +2021,24 @@ run_program(char *prog, char * const *ar
/* run the program */
update_script_environment();
- execve(rpath, args, script_env);
- if (must_exist || errno != ENOENT) {
- /* have to reopen the log, there's nowhere else
- for the message to go. */
- reopen_log();
- syslog(LOG_ERR, "Can't execute %s: %m", rpath);
- closelog();
+#ifdef HAVE_FEXECVE
+ fexecve(fd, args, script_env);
+#else
+ {
+ char fdpath[32];
+
+ snprintf(fdpath, sizeof(fdpath), "/dev/fd/%d", fd);
+ execve(fdpath, args, script_env);
+ if (errno == ENOENT) {
+ snprintf(fdpath, sizeof(fdpath), "/proc/self/fd/%d", fd);
+ execve(fdpath, args, script_env);
+ }
}
+#endif
+ /* have to reopen the log, there's nowhere else for the message to go. */
+ reopen_log();
+ syslog(LOG_ERR, "Can't execute %s: %m", prog);
+ closelog();
_exit(99);
}
--- a/pppd/options.c
+++ b/pppd/options.c
@@ -210,6 +210,8 @@ static struct option *find_option(char *
static int process_option(struct option *, char *, char **);
static int n_arguments(struct option *);
static int number_option(char *, u_int32_t *, int);
+static int ppp_options_open(const char *, int, int, FILE **);
+static int ppp_options_from_fp(FILE *, const char *, int);
/*
* Structure to store extra lists of options.
@@ -588,14 +590,23 @@ int
ppp_options_from_file(char *filename, int must_exist, int check_prot, int priv)
{
FILE *f;
- int i, newline, ret, err;
- struct option *opt;
- int oldpriv, n;
- char *oldsource;
+
+ if (!ppp_options_open(filename, must_exist, check_prot, &f))
+ return 0;
+ if (f == NULL)
+ return 1;
+ return ppp_options_from_fp(f, filename, priv);
+}
+
+/*
+ * ppp_options_open - Open a file for options
+ */
+static int
+ppp_options_open(const char *filename, int must_exist, int check_prot, FILE **fp)
+{
uid_t euid;
- char *argv[MAXARGS];
- char args[MAXARGS][MAXWORDLEN];
- char cmd[MAXWORDLEN];
+ FILE *f;
+ int err;
euid = geteuid();
if (check_prot && seteuid(getuid()) == -1) {
@@ -606,6 +617,7 @@ ppp_options_from_file(char *filename, in
err = errno;
if (check_prot && seteuid(euid) == -1)
fatal("unable to regain privileges");
+ *fp = f;
if (f == NULL) {
errno = err;
if (!must_exist) {
@@ -616,6 +628,22 @@ ppp_options_from_file(char *filename, in
ppp_option_error("Can't open options file %s: %m", filename);
return 0;
}
+ return 1;
+}
+
+/*
+ * Parse options from an open FILE pointer.
+ */
+static int
+ppp_options_from_fp(FILE *f, const char *filename, int priv)
+{
+ int i, newline, ret;
+ struct option *opt;
+ int oldpriv, n;
+ char *oldsource;
+ char *argv[MAXARGS];
+ char args[MAXARGS][MAXWORDLEN];
+ char cmd[MAXWORDLEN];
oldpriv = privileged_option;
privileged_option = priv;
@@ -1371,7 +1399,7 @@ readable(int fd)
* \<newline> is ignored.
*/
int
-getword(FILE *f, char *word, int *newlinep, char *filename)
+getword(FILE *f, char *word, int *newlinep, const char *filename)
{
int c, len, escape;
int quoted, comment;
@@ -1666,7 +1694,7 @@ callfile(char **argv)
{
char *fname, *arg, *p;
int l, ok;
- char *realname;
+ FILE *f;
arg = *argv;
ok = 1;
@@ -1695,15 +1723,19 @@ callfile(char **argv)
slprintf(fname, l, "%s%s", PPP_PATH_PEERFILES, arg);
ppp_script_setenv("CALL_FILE", arg, 0);
- if (!ppp_check_access(fname, &realname, 1, 0)) {
+ if (!ppp_options_open(fname, 1, 1, &f)) {
+ free(fname);
+ return 0;
+ }
+ if (!ppp_check_access(fileno(f), fname, 0)) {
free(fname);
+ fclose(f);
return 0;
}
- ok = ppp_options_from_file(realname, 1, 1, 1);
+ ok = ppp_options_from_fp(f, fname, 1);
free(fname);
- free(realname);
return ok;
}
--- a/pppd/pppd-private.h
+++ b/pppd/pppd-private.h
@@ -470,7 +470,7 @@ int get_first_ether_hwaddr(unsigned cha
int setipaddr(char *, char **, int); /* Set local/remote ip addresses */
int parse_args(int argc, char **argv);
/* Parse options from arguments given */
-int getword(FILE *f, char *word, int *newlinep, char *filename);
+int getword(FILE *f, char *word, int *newlinep, const char *filename);
/* Read a word from a file */
int options_from_user(void); /* Parse options from user's .ppprc */
int options_for_tty(void); /* Parse options from /etc/ppp/options.tty */
--- a/pppd/pppd.8
+++ b/pppd/pppd.8
@@ -1334,16 +1334,6 @@ file under /etc/ppp/peers, the system ad
establish a ppp connection via a device which they would not normally
have permission to access. Otherwise pppd uses the invoking user's
real UID when opening the device.
-.PP
-To avoid the possibility of privileged options files, secrets files,
-and other files which contain sensitive information being compromised,
-\fIpppd\fR performs a path check on these files before opening them.
-This involves first translating the file path into a real absolute path
-containing no symlinks or ".." components. Then each component from
-the root down is checked to ensure that it is owned by root and that
-its permissions do not permit writing by group or other. Failure to
-conform to these requirements will cause \fIpppd\fR to exit with a
-suitable error message.
.SH AUTHENTICATION
Authentication is the process whereby one peer convinces the other of
its identity. This involves the first peer sending its name to the
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -300,7 +300,7 @@ void pr_log(void *, char *, ...);
void end_pr_log(void);
/* Check that a file can safely be used */
-int ppp_check_access(const char *path, char **path_to_use, int must_exist, int exec);
+int ppp_check_access(int fd, const char *path, int exec);
/*
* Get the current exist status of pppd
--- a/pppd/utils.c
+++ b/pppd/utils.c
@@ -75,98 +75,50 @@ struct buffer_info {
};
/*
- * Check that a file is owned by root, not writable by group or other,
- * and that all the directories in the path leading to it is likewise
- * owned by root and not writable by group or other. The real path to
- * the file is returned in *path_to_use, which should be freed after
- * use (real meaning not containing any symlinks or ".." components).
+ * Check that a file descriptor is owned by root, not writable by group or
+ * other.
* If exec is true, check for execute permission, otherwise for read
* permission.
+ * Note: the path argument is only used for log messages.
* Returns 1 if OK; if not, prints an error message and returns 0.
*/
int
-ppp_check_access(const char *path, char **path_to_use, int must_exist, int exec)
+ppp_check_access(int fd, const char *path, int exec)
{
- char *rpath, *slash, *part;
struct stat sbuf;
int perm;
- /*
- * Resolve symlinks such that we eliminate a few potential ToCToU
- * attack avenues (eg, changing symlinks).
- */
- rpath = realpath(path, NULL);
- if (!rpath) {
- if (errno == ENOMEM)
- fatal("Insufficient memory for real path");
- if (must_exist || errno != ENOENT)
- error("Can't access %s: %m", path);
- return 0;
+ if (fstat(fd, &sbuf) != 0) {
+ error("Can't stat %v: %m", path);
+ goto err;
}
- /*
- * full check the entire path, must be root: owned, and NOT be writable
- * to group/other (which incorporates FACL bits somehow, so we can ignore
- * explicit FACL checks).
- */
- part = "/";
- slash = rpath;
- for (;;) {
- bool ok = false;
- const char *pname = (slash? part: "it");
-
- if (lstat(part, &sbuf) != 0) {
- if (must_exist || errno != ENOENT) {
- if (!slash) {
- error("Can't access %v: %m", rpath);
- } else {
- error("Can't use %v, because of error accessing", path);
- error("path component %v: %m");
- }
- }
- goto err;
- }
-
- if (sbuf.st_uid != 0) {
- error("Can't safely use %v because %v is not owned by root",
- path, pname);
- goto err;
- }
-
- if (0 != (sbuf.st_mode & (S_IWGRP | S_IWOTH))) {
- error("Can't safely use %v because %v is group or other writable",
- path, pname);
- goto err;
- }
-
- if (!slash)
- break;
-
- *slash = '/';
- part = rpath;
-
- slash = strchr(slash + 1, '/');
- if (slash)
- *slash = 0;
+ if (!S_ISREG(sbuf.st_mode)) {
+ error("Can't use %v: not a regular file", path);
+ goto err;
}
- if (!S_ISREG(sbuf.st_mode)) {
- error("Can't use %v: not a regular file", rpath);
+ if (sbuf.st_uid != 0) {
+ error("Can't safely use %v because it is not owned by root", path);
+ goto err;
+ }
+
+ if (0 != (sbuf.st_mode & (S_IWGRP | S_IWOTH))) {
+ error("Can't safely use %v because it is group or other writable",
+ path);
goto err;
}
perm = exec? S_IXUSR : S_IRUSR;
if ((sbuf.st_mode & perm) == 0) {
- error("Can't use %v: not %sable by root", rpath,
+ error("Can't use %v: not %sable by root", path,
exec? "execut": "read");
goto err;
}
- *path_to_use = rpath;
return 1;
err:
- free(rpath);
return 0;
}
@@ -1,28 +0,0 @@
From f691c224e12ee13a1b317a1838d150f1ffef14a1 Mon Sep 17 00:00:00 2001
From: Mateusz Poliwczak <mpoliwczak34@gmail.com>
Date: Wed, 11 Feb 2026 00:40:14 +0100
Subject: [PATCH] Remove MRU limit on PPPoE (#573)
Fixes #331
Signed-off-by: Mateusz Poliwczak <mpoliwczak34@gmail.com>
---
pppd/plugins/pppoe/plugin.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/pppd/plugins/pppoe/plugin.c b/pppd/plugins/pppoe/plugin.c
index b429a2fd..0f672166 100644
--- a/pppd/plugins/pppoe/plugin.c
+++ b/pppd/plugins/pppoe/plugin.c
@@ -446,11 +446,6 @@ void pppoe_check_options(void)
lcp_allowoptions[0].neg_pcompression = 0;
lcp_wantoptions[0].neg_pcompression = 0;
- if (lcp_allowoptions[0].mru > MAX_PPPOE_MTU)
- lcp_allowoptions[0].mru = MAX_PPPOE_MTU;
- if (lcp_wantoptions[0].mru > MAX_PPPOE_MTU)
- lcp_wantoptions[0].mru = MAX_PPPOE_MTU;
-
/* Save configuration */
conn->storedmtu = lcp_allowoptions[0].mru;
conn->storedmru = lcp_wantoptions[0].mru;
@@ -1,6 +1,6 @@
--- a/pppd/chap.c
+++ b/pppd/chap.c
@@ -42,6 +42,9 @@
@@ -36,6 +36,9 @@
#include "chap.h"
#include "chap-md5.h"
@@ -10,7 +10,7 @@
#ifdef PPP_WITH_CHAPMS
#include "chap_ms.h"
#define MDTYPE_ALL (MDTYPE_MICROSOFT_V2 | MDTYPE_MICROSOFT | MDTYPE_MD5)
@@ -520,6 +523,18 @@ chap_respond(struct chap_client_state *c
@@ -514,6 +517,18 @@ chap_respond(struct chap_client_state *c
p[2] = len >> 8;
p[3] = len;
@@ -31,7 +31,7 @@
--- a/pppd/Makefile.am
+++ b/pppd/Makefile.am
@@ -67,6 +67,7 @@ noinst_HEADERS = \
@@ -65,6 +65,7 @@ noinst_HEADERS = \
peap.h \
pppd-private.h \
spinlock.h \
@@ -39,15 +39,15 @@
tls.h \
tdb.h
@@ -85,6 +86,7 @@ pppd_SOURCES = \
main.c \
@@ -84,6 +85,7 @@ pppd_SOURCES = \
event-handler.c \
options.c \
session.c \
+ syncppp.c \
tty.c \
upap.c \
utils.c
@@ -95,7 +97,7 @@ BUILT_SOURCE = \
@@ -94,7 +96,7 @@ nodist_pppd_include_HEADERS = \
pppd_CPPFLAGS = -DSYSCONFDIR=\"${sysconfdir}\" -DPPPD_RUNTIME_DIR='"@PPPD_RUNTIME_DIR@"' -DPPPD_LOGFILE_DIR='"@PPPD_LOGFILE_DIR@"'
pppd_LDFLAGS =
@@ -58,27 +58,27 @@
pppd_CPPFLAGS += -DSYSTEM_CA_PATH='"@SYSTEM_CA_PATH@"'
--- a/pppd/options.c
+++ b/pppd/options.c
@@ -136,6 +136,7 @@ bool show_options; /* print all support
@@ -141,6 +141,7 @@ bool show_options; /* print all support
bool dryrun; /* print out option values and exit */
char *domain; /* domain name set by domain option */
int child_wait = 5; /* # seconds to wait for children at exit */
+int npppd = 0; /* synchronize between multiple pppd */
struct userenv *userenv_list; /* user environment variables */
int dfl_route_metric = -1; /* metric of the default route to set over the PPP link */
@@ -339,6 +340,9 @@ struct option general_options[] = {
#ifdef PPP_WITH_IPV6CP
@@ -351,6 +352,9 @@ struct option general_options[] = {
"Unset user environment variable",
OPT_A2PRINTER | OPT_NOPRINT, (void *)user_unsetprint },
OPT_A2PRINTER | OPT_NOPRINT | OPT_PRIV, (void *)user_unsetprint },
+ { "syncppp", o_int, &npppd,
+ "sync among multiple pppd when sending chap/pap respond", OPT_PRIO },
+
{ "defaultroute-metric", o_int, &dfl_route_metric,
"Metric to use for the default route (Linux only; -1 for default behavior)",
OPT_PRIV|OPT_LLIMIT|OPT_INITONLY, NULL, 0, -1 },
{ "net-init-script", o_string, path_net_init,
"Set pathname of net-init script",
OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
--- a/pppd/pppd-private.h
+++ b/pppd/pppd-private.h
@@ -207,6 +207,7 @@ extern bool dump_options; /* print out o
@@ -214,6 +214,7 @@ extern bool dump_options; /* print out o
extern bool show_options; /* show all option names and descriptions */
extern bool dryrun; /* check everything, print options, exit */
extern int child_wait; /* # seconds to wait for children at end */
+2 -1
View File
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=nftables
PKG_VERSION:=1.1.6
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files
@@ -18,6 +18,7 @@ PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
PKG_BUILD_FLAGS:=lto
@@ -0,0 +1,78 @@
From 2a0ec8a7246e5c5eb85270e3d4de43e20a00c577 Mon Sep 17 00:00:00 2001
From: Jeremy Sowden <jeremy@azazel.net>
Date: Wed, 28 Jan 2026 18:31:05 +0000
Subject: [PATCH] build: simplify the instantation of nftversion.h
Add an nftversion.h.in autoconf input file which configure uses to instantiate
nftversion.h in the usual way.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
configure.ac | 19 +++----------------
nftversion.h.in | 19 +++++++++++++++++++
2 files changed, 22 insertions(+), 16 deletions(-)
create mode 100644 nftversion.h.in
diff --git a/configure.ac b/configure.ac
index 6825474..2c61072 100644
--- a/configure.ac
+++ b/configure.ac
@@ -147,22 +147,8 @@ AM_CONDITIONAL([BUILD_SERVICE], [test "x$unitdir" != x])
AC_ARG_WITH([stable-release], [AS_HELP_STRING([--with-stable-release],
[Stable release number])],
[], [with_stable_release=0])
-AC_CONFIG_COMMANDS([stable_release],
- [STABLE_RELEASE=$stable_release],
- [stable_release=$with_stable_release])
-AC_CONFIG_COMMANDS([nftversion.h], [
-(
- echo "static char nftversion[[]] = {"
- echo " ${VERSION}," | tr '.' ','
- echo " ${STABLE_RELEASE}"
- echo "};"
- echo "static char nftbuildstamp[[]] = {"
- for ((i = 56; i >= 0; i-= 8)); do
- echo " ((uint64_t)MAKE_STAMP >> $i) & 0xff,"
- done
- echo "};"
-) >nftversion.h
-])
+AC_SUBST([STABLE_RELEASE],[$with_stable_release])
+AC_SUBST([NFT_VERSION], [$(echo "${VERSION}" | tr '.' ',')])
# Current date should be fetched exactly once per build,
# so have 'make' call date and pass the value to every 'gcc' call
AC_SUBST([MAKE_STAMP], ["\$(shell date +%s)"])
@@ -175,6 +161,7 @@ AM_CONDITIONAL([BUILD_DISTCHECK], [test "x$enable_distcheck" = "xyes"])
AC_CONFIG_FILES([ \
Makefile \
libnftables.pc \
+ nftversion.h \
])
AC_OUTPUT
diff --git a/nftversion.h.in b/nftversion.h.in
new file mode 100644
index 0000000..6f89771
--- /dev/null
+++ b/nftversion.h.in
@@ -0,0 +1,19 @@
+#ifndef NFTABLES_NFTVERSION_H
+#define NFTABLES_NFTVERSION_H
+
+static char nftversion[] = {
+ @NFT_VERSION@,
+ @STABLE_RELEASE@
+};
+static char nftbuildstamp[] = {
+ ((uint64_t)MAKE_STAMP >> 56) & 0xff,
+ ((uint64_t)MAKE_STAMP >> 48) & 0xff,
+ ((uint64_t)MAKE_STAMP >> 40) & 0xff,
+ ((uint64_t)MAKE_STAMP >> 32) & 0xff,
+ ((uint64_t)MAKE_STAMP >> 24) & 0xff,
+ ((uint64_t)MAKE_STAMP >> 16) & 0xff,
+ ((uint64_t)MAKE_STAMP >> 8) & 0xff,
+ ((uint64_t)MAKE_STAMP >> 0) & 0xff,
+};
+
+#endif /* !defined(NFTABLES_NFTVERSION_H) */
@@ -0,0 +1,83 @@
From b92571cc59ce49fdd9fe2daac9350529adfb2424 Mon Sep 17 00:00:00 2001
From: Jeremy Sowden <jeremy@azazel.net>
Date: Wed, 28 Jan 2026 18:31:06 +0000
Subject: [PATCH] build: generate build time-stamp once at configure
The existing implementation tries to generate a time-stamp once when make is
run. However, it doesn't work and generates one for every compilation. Getting
this right portably in automake is not straightforward. Instead, do it when
configure is run.
Rename the time-stamp variable since it is no longer generated by make.
Fixes: 64c07e38f049 ("table: Embed creating nft version into userdata")
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
Makefile.am | 2 --
configure.ac | 4 +---
nftversion.h.in | 18 ++++++++++--------
3 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index b134330..ceb2225 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -159,8 +159,6 @@ AM_CFLAGS = \
\
$(GCC_FVISIBILITY_HIDDEN) \
\
- -DMAKE_STAMP=$(MAKE_STAMP) \
- \
$(NULL)
AM_YFLAGS = -d -Wno-yacc
diff --git a/configure.ac b/configure.ac
index 2c61072..9859072 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,9 +149,7 @@ AC_ARG_WITH([stable-release], [AS_HELP_STRING([--with-stable-release],
[], [with_stable_release=0])
AC_SUBST([STABLE_RELEASE],[$with_stable_release])
AC_SUBST([NFT_VERSION], [$(echo "${VERSION}" | tr '.' ',')])
-# Current date should be fetched exactly once per build,
-# so have 'make' call date and pass the value to every 'gcc' call
-AC_SUBST([MAKE_STAMP], ["\$(shell date +%s)"])
+AC_SUBST([BUILD_STAMP], [$(date +%s)])
AC_ARG_ENABLE([distcheck],
AS_HELP_STRING([--enable-distcheck], [Build for distcheck]),
diff --git a/nftversion.h.in b/nftversion.h.in
index 6f89771..325b9dc 100644
--- a/nftversion.h.in
+++ b/nftversion.h.in
@@ -1,19 +1,21 @@
#ifndef NFTABLES_NFTVERSION_H
#define NFTABLES_NFTVERSION_H
+#define BUILD_STAMP @BUILD_STAMP@
+
static char nftversion[] = {
@NFT_VERSION@,
@STABLE_RELEASE@
};
static char nftbuildstamp[] = {
- ((uint64_t)MAKE_STAMP >> 56) & 0xff,
- ((uint64_t)MAKE_STAMP >> 48) & 0xff,
- ((uint64_t)MAKE_STAMP >> 40) & 0xff,
- ((uint64_t)MAKE_STAMP >> 32) & 0xff,
- ((uint64_t)MAKE_STAMP >> 24) & 0xff,
- ((uint64_t)MAKE_STAMP >> 16) & 0xff,
- ((uint64_t)MAKE_STAMP >> 8) & 0xff,
- ((uint64_t)MAKE_STAMP >> 0) & 0xff,
+ ((uint64_t)BUILD_STAMP >> 56) & 0xff,
+ ((uint64_t)BUILD_STAMP >> 48) & 0xff,
+ ((uint64_t)BUILD_STAMP >> 40) & 0xff,
+ ((uint64_t)BUILD_STAMP >> 32) & 0xff,
+ ((uint64_t)BUILD_STAMP >> 24) & 0xff,
+ ((uint64_t)BUILD_STAMP >> 16) & 0xff,
+ ((uint64_t)BUILD_STAMP >> 8) & 0xff,
+ ((uint64_t)BUILD_STAMP >> 0) & 0xff,
};
#endif /* !defined(NFTABLES_NFTVERSION_H) */
@@ -0,0 +1,33 @@
From ca86f206c92704170a295b8dc7a41f6448835dde Mon Sep 17 00:00:00 2001
From: Jeremy Sowden <jeremy@azazel.net>
Date: Wed, 28 Jan 2026 18:31:07 +0000
Subject: [PATCH] build: support `SOURCE_DATE_EPOCH` for build time-stamp
In order to support reproducible builds, set the build time-stamp to the value
of the environment variable, `SOURCE_DATE_EPOCH`, if set, and fall back to
calling `date`, otherwise.
Link: https://reproducible-builds.org/docs/source-date-epoch/
Fixes: 64c07e38f049 ("table: Embed creating nft version into userdata")
Reported-by: Arnout Engelen <arnout@bzzt.net>
Closes: https://github.com/NixOS/nixpkgs/issues/478048
Suggested-by: Philipp Bartsch <phil@grmr.de>
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 9859072..0226086 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,7 +149,7 @@ AC_ARG_WITH([stable-release], [AS_HELP_STRING([--with-stable-release],
[], [with_stable_release=0])
AC_SUBST([STABLE_RELEASE],[$with_stable_release])
AC_SUBST([NFT_VERSION], [$(echo "${VERSION}" | tr '.' ',')])
-AC_SUBST([BUILD_STAMP], [$(date +%s)])
+AC_SUBST([BUILD_STAMP], [${SOURCE_DATE_EPOCH:-$(date +%s)}])
AC_ARG_ENABLE([distcheck],
AS_HELP_STRING([--enable-distcheck], [Build for distcheck]),
@@ -0,0 +1,11 @@
--- a/src/genhelp.lua
+++ b/src/genhelp.lua
@@ -168,7 +168,7 @@ function scapp:compress(data)
f:write(data)
f:close()
- local p = io.popen(('gzip -%d < %s'):format(level, tmp), 'r')
+ local p = io.popen(('gzip -n%d < %s'):format(level, tmp), 'r')
if p ~= nil then
ret = p:read("*all")
p:close()
+1 -1
View File
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=busybox
PKG_VERSION:=1.38.0
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_FLAGS:=essential
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
@@ -0,0 +1,34 @@
From 8a7c45305f37bc7138c329d8f7debef8a4c9ddad Mon Sep 17 00:00:00 2001
From: Seo Suchan <tjtncks@gmail.com>
Date: Fri, 12 Jun 2026 11:37:18 +0900
Subject: [PATCH] ash: clear bb_got_signal for non-interactive shell
Patch itself origianlly submitted by Ian Cooper <iancooper@hotmail.com>
preadfd doesn't run in non-interactive shells, but it can set in non_interactive shells too.
we always need to clear bb_got_signal otherwise it wll infinite loop.
clean this flag when ash processes trap as backup.
Fixes: #23745
Upstream-Status: Reported https://github.com/vda-linux/busybox_mirror/issues/16
Suggested-by: Ian Cooper <iancooper@hotmail.com>
Signed-off-by: Seo Suchan <tjtncks@gmail.com>
---
shell/ash.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/shell/ash.c b/shell/ash.c
index fb887f31b..3eb73eaa4 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -9608,6 +9608,9 @@ dotrap(void)
savestatus = status;
}
pending_sig = 0;
+#if ENABLE_FEATURE_EDITING
+ bb_got_signal = 0;
+#endif
barrier();
TRACE(("dotrap entered\n"));
+6 -6
View File
@@ -91,14 +91,14 @@ static int do_unset(nvram_handle_t *nvram, const char *var)
static int do_set(nvram_handle_t *nvram, const char *pair)
{
char *val = strstr(pair, "=");
char var[strlen(pair)];
char *var;
int stat = 1;
if( val != NULL )
{
memset(var, 0, sizeof(var));
strncpy(var, pair, (int)(val-pair));
stat = nvram_set(nvram, var, (char *)(val + 1));
if (val) {
var = strndup(pair, val - pair);
if (var)
stat = nvram_set(nvram, var, (char *)(val + 1));
free(var);
}
return stat;
+16 -21
View File
@@ -73,11 +73,11 @@ static nvram_tuple_t * _nvram_realloc( nvram_handle_t *h, nvram_tuple_t *t,
return NULL;
if (!t) {
if (!(t = malloc(sizeof(nvram_tuple_t) + strlen(name) + 1)))
t = malloc(sizeof(nvram_tuple_t) + strlen(name) + 1);
if (!t)
return NULL;
/* Copy name */
t->name = (char *) &t[1];
strcpy(t->name, name);
t->value = NULL;
@@ -86,7 +86,8 @@ static nvram_tuple_t * _nvram_realloc( nvram_handle_t *h, nvram_tuple_t *t,
/* Copy value */
if (!t->value || strcmp(t->value, value))
{
if(!(t->value = (char *) realloc(t->value, strlen(value)+1)))
t->value = realloc(t->value, strlen(value) + 1);
if(!t->value)
return NULL;
strcpy(t->value, value);
@@ -185,7 +186,8 @@ int nvram_set(nvram_handle_t *h, const char *name, const char *value)
t && strcmp(t->name, name); prev = &t->next, t = *prev);
/* (Re)allocate tuple */
if (!(u = _nvram_realloc(h, t, name, value)))
u = _nvram_realloc(h, t, name, value);
if (!u)
return -12; /* -ENOMEM */
/* Value reallocated */
@@ -242,17 +244,13 @@ nvram_tuple_t * nvram_getall(nvram_handle_t *h)
for (i = 0; i < NVRAM_ARRAYSIZE(h->nvram_hash); i++) {
for (t = h->nvram_hash[i]; t; t = t->next) {
if( (x = (nvram_tuple_t *) malloc(sizeof(nvram_tuple_t))) != NULL )
{
x->name = t->name;
x->value = t->value;
x->next = l;
l = x;
}
else
{
x = malloc(sizeof(*x) + strlen(t->name) + 1);
if(!x)
break;
}
strcpy(x->name, t->name);
x->value = t->value;
x->next = l;
l = x;
}
}
@@ -389,10 +387,9 @@ nvram_handle_t * nvram_open(const char *file, int rdonly)
close(fd);
return NULL;
}
else if( (h = malloc(sizeof(nvram_handle_t))) != NULL )
h = calloc(1, sizeof(nvram_handle_t));
if(h)
{
memset(h, 0, sizeof(nvram_handle_t));
h->fd = fd;
h->mmap = mmap_area;
h->length = nvram_part_size;
@@ -451,11 +448,9 @@ char * nvram_find_mtd(void)
sprintf(dev, "/dev/mtdblock%d", i);
if( stat(dev, &s) > -1 && (s.st_mode & S_IFBLK) )
{
if( (path = (char *) malloc(strlen(dev)+1)) != NULL )
{
strncpy(path, dev, strlen(dev)+1);
path = strdup(dev);
if (path)
break;
}
}
}
}
+1 -1
View File
@@ -38,9 +38,9 @@ struct nvram_header {
} __attribute__((__packed__));
struct nvram_tuple {
char *name;
char *value;
struct nvram_tuple *next;
char name[];
};
struct nvram_handle {
@@ -122,7 +122,7 @@
};
/* Uart divisor latch read */
@@ -2766,6 +2774,12 @@ serial8250_do_set_termios(struct uart_po
@@ -2769,6 +2777,12 @@ serial8250_do_set_termios(struct uart_po
baud = serial8250_get_baud_rate(port, termios, old);
quot = serial8250_get_divisor(port, baud, &frac);
+1 -2
View File
@@ -9,8 +9,7 @@ CPU_TYPE:=464fp
FEATURES:=fpu dt gpio ramdisk squashfs usb
SUBTARGETS:=nand sata
KERNEL_PATCHVER:=6.12
KERNEL_TESTING_PATCHVER:=6.18
KERNEL_PATCHVER:=6.18
define Target/Description
Build images for AppliedMicro APM821xx based boards.
-276
View File
@@ -1,276 +0,0 @@
# CONFIG_440_CPU is not set
CONFIG_44x=y
CONFIG_464_CPU=y
CONFIG_4xx=y
# CONFIG_ADVANCED_OPTIONS is not set
CONFIG_APM821xx=y
# CONFIG_APOLLO3G is not set
# CONFIG_ARCHES is not set
CONFIG_ARCH_32BIT_OFF_T=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_KEEP_MEMBLOCK=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
CONFIG_ARCH_MMAP_RND_BITS=11
CONFIG_ARCH_MMAP_RND_BITS_MAX=17
CONFIG_ARCH_MMAP_RND_BITS_MIN=11
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=17
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
CONFIG_ARCH_PKEY_BITS=5
CONFIG_ARCH_SPLIT_ARG64=y
CONFIG_ARCH_STACKWALK=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARCH_WEAK_RELEASE_ACQUIRE=y
CONFIG_AUDIT_ARCH=y
# CONFIG_BAMBOO is not set
# CONFIG_BLK_DEV_INITRD is not set
CONFIG_BLK_MQ_PCI=y
CONFIG_BLUESTONE=y
CONFIG_BOOKE=y
CONFIG_BOOKE_WDT=y
# CONFIG_CANYONLANDS is not set
CONFIG_CLONE_BACKWARDS=y
CONFIG_CMDLINE="rootfstype=squashfs noinitrd"
CONFIG_CMDLINE_FROM_BOOTLOADER=y
CONFIG_COMMON_CLK=y
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
CONFIG_COMPAT_32BIT_TIME=y
CONFIG_CPU_BIG_ENDIAN=y
CONFIG_CPU_MITIGATIONS=y
CONFIG_CRC16=y
CONFIG_CRYPTO_DEFLATE=y
CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_JITTERENTROPY=y
CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKS=64
CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE=32
CONFIG_CRYPTO_JITTERENTROPY_OSR=1
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
CONFIG_CRYPTO_LIB_GF128MUL=y
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=1
CONFIG_CRYPTO_LIB_UTILS=y
CONFIG_CRYPTO_LZO=y
# CONFIG_CRYPTO_MD5_PPC is not set
CONFIG_CRYPTO_RNG=y
# CONFIG_CRYPTO_SHA1_PPC is not set
CONFIG_CRYPTO_SHA3=y
CONFIG_DATA_SHIFT=12
CONFIG_DEBUG_INFO=y
CONFIG_DMADEVICES=y
CONFIG_DMA_DIRECT_REMAP=y
CONFIG_DMA_ENGINE=y
CONFIG_DMA_NEED_SYNC=y
CONFIG_DMA_OF=y
CONFIG_DTC=y
CONFIG_DW_DMAC=y
CONFIG_DW_DMAC_CORE=y
CONFIG_EARLY_PRINTK=y
# CONFIG_EBONY is not set
CONFIG_EDAC_ATOMIC_SCRUB=y
CONFIG_EDAC_SUPPORT=y
# CONFIG_EIGER is not set
CONFIG_EXCLUSIVE_SYSTEM_RAM=y
CONFIG_EXTRA_TARGETS="uImage"
CONFIG_FIXED_PHY=y
CONFIG_FORCE_NR_CPUS=y
CONFIG_FORCE_PCI=y
# CONFIG_FSL_LBC is not set
CONFIG_FS_IOMAP=y
CONFIG_FUNCTION_ALIGNMENT=4
CONFIG_FUNCTION_ALIGNMENT_4B=y
CONFIG_FWNODE_MDIO=y
CONFIG_FW_LOADER_PAGED_BUF=y
CONFIG_FW_LOADER_SYSFS=y
CONFIG_GENERIC_ALLOCATOR=y
CONFIG_GENERIC_ATOMIC64=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_GENERIC_CPU_AUTOPROBE=y
CONFIG_GENERIC_EARLY_IOREMAP=y
CONFIG_GENERIC_GETTIMEOFDAY=y
CONFIG_GENERIC_IDLE_POLL_SETUP=y
CONFIG_GENERIC_IOREMAP=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_MSI_IRQ=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_PHY=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GENERIC_TIME_VSYSCALL=y
# CONFIG_GEN_RTC is not set
# CONFIG_GLACIER is not set
CONFIG_GPIO_CDEV=y
CONFIG_GPIO_GENERIC=y
CONFIG_GPIO_GENERIC_PLATFORM=y
CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_IOPORT_MAP=y
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_IBM_IIC=y
CONFIG_IBM_EMAC=y
CONFIG_IBM_EMAC_EMAC4=y
CONFIG_IBM_EMAC_POLL_WEIGHT=32
CONFIG_IBM_EMAC_RGMII=y
CONFIG_IBM_EMAC_RXB=128
CONFIG_IBM_EMAC_RX_COPY_THRESHOLD=256
CONFIG_IBM_EMAC_TAH=y
CONFIG_IBM_EMAC_TXB=128
# CONFIG_ICON is not set
CONFIG_ILLEGAL_POINTER_VALUE=0
CONFIG_IRQCHIP=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_DOMAIN_HIERARCHY=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_IRQ_WORK=y
CONFIG_ISA_DMA_API=y
# CONFIG_JFFS2_FS is not set
# CONFIG_KATMAI is not set
CONFIG_KERNEL_START=0xc0000000
CONFIG_LEDS_TRIGGER_MTD=y
CONFIG_LEDS_TRIGGER_PATTERN=y
CONFIG_LIBFDT=y
CONFIG_LOCK_DEBUGGING_SUPPORT=y
CONFIG_LOWMEM_SIZE=0x30000000
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
# CONFIG_MATH_EMULATION is not set
CONFIG_MDIO_BUS=y
CONFIG_MDIO_DEVICE=y
CONFIG_MDIO_DEVRES=y
CONFIG_MIGRATION=y
CONFIG_MMU_GATHER_MERGE_VMAS=y
CONFIG_MMU_GATHER_PAGE_SIZE=y
CONFIG_MMU_LAZY_TLB_REFCOUNT=y
CONFIG_MODULES_SIZE=1
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS=y
CONFIG_MTD_CFI_ADV_OPTIONS=y
# CONFIG_MTD_CFI_GEOMETRY is not set
# CONFIG_MTD_SPLIT_SQUASHFS_ROOT is not set
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_PER_CPU_KM=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_NET_EGRESS=y
CONFIG_NET_INGRESS=y
CONFIG_NET_SELFTESTS=y
CONFIG_NET_XGRESS=y
CONFIG_NOT_COHERENT_CACHE=y
CONFIG_NO_HZ=y
CONFIG_NO_HZ_COMMON=y
CONFIG_NO_HZ_IDLE=y
CONFIG_NR_CPUS=1
CONFIG_NR_IRQS=512
CONFIG_NVMEM=y
CONFIG_NVMEM_LAYOUTS=y
CONFIG_NVMEM_SYSFS=y
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_FLATTREE=y
CONFIG_OF_GPIO=y
CONFIG_OF_GPIO_MM_GPIOCHIP=y
CONFIG_OF_IRQ=y
CONFIG_OF_KOBJ=y
CONFIG_OF_MDIO=y
CONFIG_OLD_SIGACTION=y
CONFIG_OLD_SIGSUSPEND=y
CONFIG_PACKING=y
CONFIG_PAGE_OFFSET=0xc0000000
CONFIG_PAGE_POOL=y
CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
CONFIG_PCI=y
CONFIG_PCIEAER=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_MSI=y
CONFIG_PCI_MSI_ARCH_FALLBACKS=y
CONFIG_PGTABLE_LEVELS=2
CONFIG_PHYLIB=y
CONFIG_PHYLIB_LEDS=y
CONFIG_PHYSICAL_START=0x00000000
CONFIG_PHYS_64BIT=y
CONFIG_PHYS_ADDR_T_64BIT=y
# CONFIG_PMU_SYSFS is not set
CONFIG_PPC=y
CONFIG_PPC32=y
CONFIG_PPC44x_SIMPLE=y
CONFIG_PPC4xx_GPIO=y
CONFIG_PPC4xx_PCI_EXPRESS=y
# CONFIG_PPC64 is not set
# CONFIG_PPC_47x is not set
# CONFIG_PPC_85xx is not set
# CONFIG_PPC_8xx is not set
CONFIG_PPC_ADV_DEBUG_DACS=2
CONFIG_PPC_ADV_DEBUG_DAC_RANGE=y
CONFIG_PPC_ADV_DEBUG_DVCS=2
CONFIG_PPC_ADV_DEBUG_IACS=4
CONFIG_PPC_ADV_DEBUG_REGS=y
# CONFIG_PPC_BOOK3S_32 is not set
CONFIG_PPC_DCR=y
CONFIG_PPC_DCR_NATIVE=y
# CONFIG_PPC_EARLY_DEBUG is not set
CONFIG_PPC_FPU=y
CONFIG_PPC_FPU_REGS=y
CONFIG_PPC_INDIRECT_PCI=y
CONFIG_PPC_KUAP=y
# CONFIG_PPC_KUAP_DEBUG is not set
CONFIG_PPC_KUEP=y
CONFIG_PPC_MMU_NOHASH=y
# CONFIG_PPC_PCI_BUS_NUM_DOMAIN_DEPENDENT is not set
CONFIG_PPC_UDBG_16550=y
CONFIG_PPC_WERROR=y
CONFIG_PTE_64BIT=y
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
# CONFIG_RAINIER is not set
CONFIG_RANDSTRUCT_NONE=y
CONFIG_RAS=y
CONFIG_RATIONAL=y
CONFIG_REGULATOR=y
CONFIG_RSEQ=y
CONFIG_RUSTC_HAS_UNNECESSARY_TRANSMUTES=y
# CONFIG_SAM440EP is not set
# CONFIG_SCOM_DEBUGFS is not set
# CONFIG_SEQUOIA is not set
CONFIG_SERIAL_8250_FSL=y
CONFIG_SERIAL_MCTRL_GPIO=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SGL_ALLOC=y
CONFIG_SMT_NUM_THREADS_DYNAMIC=y
CONFIG_SOFTIRQ_ON_OWN_STACK=y
CONFIG_SPARSE_IRQ=y
# CONFIG_STATIC_CALL_SELFTEST is not set
CONFIG_SWPHY=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
# CONFIG_TAISHAN is not set
CONFIG_TARGET_CPU="464"
CONFIG_TARGET_CPU_BOOL=y
CONFIG_TASK_SIZE=0xc0000000
CONFIG_THREAD_INFO_IN_TASK=y
CONFIG_THREAD_SHIFT=13
CONFIG_TICK_CPU_ACCOUNTING=y
CONFIG_TINY_SRCU=y
# CONFIG_TOOLCHAIN_DEFAULT_CPU is not set
CONFIG_USB_SUPPORT=y
CONFIG_VDSO32=y
CONFIG_VDSO_GETRANDOM=y
# CONFIG_VIRTIO_MENU is not set
# CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set
# CONFIG_WARP is not set
CONFIG_WATCHDOG_CORE=y
CONFIG_XZ_DEC_BCJ=y
CONFIG_XZ_DEC_POWERPC=y
# CONFIG_YOSEMITE is not set
CONFIG_ZLIB_DEFLATE=y
CONFIG_ZLIB_INFLATE=y
@@ -1,30 +0,0 @@
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -118,6 +118,17 @@ config CANYONLANDS
help
This option enables support for the AMCC PPC460EX evaluation board.
+config APOLLO3G
+ bool "Apollo3G"
+ depends on 44x
+ default n
+ select PPC44x_SIMPLE
+ select APM821xx
+ select IBM_EMAC_RGMII
+ select 460EX
+ help
+ This option enables support for the AMCC Apollo 3G board.
+
config GLACIER
bool "Glacier"
depends on 44x
--- a/arch/powerpc/platforms/44x/ppc44x_simple.c
+++ b/arch/powerpc/platforms/44x/ppc44x_simple.c
@@ -46,6 +46,7 @@ machine_device_initcall(ppc44x_simple, p
* board.c file for it rather than adding it to this list.
*/
static char *board[] __initdata = {
+ "amcc,apollo3g",
"amcc,arches",
"amcc,bamboo",
"apm,bluestone",
@@ -1,51 +0,0 @@
--- a/arch/powerpc/platforms/44x/pci.c
+++ b/arch/powerpc/platforms/44x/pci.c
@@ -1058,15 +1058,24 @@ static int __init apm821xx_pciex_init_po
u32 val;
/*
- * Do a software reset on PCIe ports.
- * This code is to fix the issue that pci drivers doesn't re-assign
- * bus number for PCIE devices after Uboot
- * scanned and configured all the buses (eg. PCIE NIC IntelPro/1000
- * PT quad port, SAS LSI 1064E)
+ * Only reset the PHY when no link is currently established.
+ * This is for the Atheros PCIe board which has problems to establish
+ * the link (again) after this PHY reset. All other currently tested
+ * PCIe boards don't show this problem.
*/
-
- mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x0);
- mdelay(10);
+ val = mfdcri(SDR0, port->sdr_base + PESDRn_LOOP);
+ if (!(val & 0x00001000)) {
+ /*
+ * Do a software reset on PCIe ports.
+ * This code is to fix the issue that pci drivers doesn't re-assign
+ * bus number for PCIE devices after Uboot
+ * scanned and configured all the buses (eg. PCIE NIC IntelPro/1000
+ * PT quad port, SAS LSI 1064E)
+ */
+
+ mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x0);
+ mdelay(10);
+ }
if (port->endpoint)
val = PTYPE_LEGACY_ENDPOINT << 20;
@@ -1083,9 +1092,12 @@ static int __init apm821xx_pciex_init_po
mtdcri(SDR0, PESDR0_460EX_L0DRV, 0x00000130);
mtdcri(SDR0, PESDR0_460EX_L0CLK, 0x00000006);
- mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x10000000);
- mdelay(50);
- mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x30000000);
+ val = mfdcri(SDR0, port->sdr_base + PESDRn_LOOP);
+ if (!(val & 0x00001000)) {
+ mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x10000000);
+ mdelay(50);
+ mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x30000000);
+ }
mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET,
mfdcri(SDR0, port->sdr_base + PESDRn_RCSSET) |
@@ -1,14 +0,0 @@
--- a/arch/powerpc/platforms/44x/pci.c
+++ b/arch/powerpc/platforms/44x/pci.c
@@ -1800,9 +1800,9 @@ static void __init ppc4xx_configure_pcie
* if it works
*/
out_le32(mbase + PECFG_PIM0LAL, 0x00000000);
- out_le32(mbase + PECFG_PIM0LAH, 0x00000000);
+ out_le32(mbase + PECFG_PIM0LAH, 0x00000008);
out_le32(mbase + PECFG_PIM1LAL, 0x00000000);
- out_le32(mbase + PECFG_PIM1LAH, 0x00000000);
+ out_le32(mbase + PECFG_PIM1LAH, 0x0000000c);
out_le32(mbase + PECFG_PIM01SAH, 0xffff0000);
out_le32(mbase + PECFG_PIM01SAL, 0x00000000);
@@ -1,29 +0,0 @@
From c9395ad54e2cabb87d408becc37566f3d8248933 Mon Sep 17 00:00:00 2001
From: Christian Lamparter <chunkeey@gmail.com>
Date: Sun, 1 Dec 2019 02:08:23 +0100
Subject: [PATCH] powerpc: bootwrapper: force gzip as mkimage's compression
method
Due to CONFIG_KERNEL_XZ symbol, the bootwrapper code tries to
instruct the mkimage to use the xz compression, which isn't
supported. This patch forces the gzip compression, which is
supported and doesn't matter because the generated uImage for
the apm821xx target gets ignored as the OpenWrt toolchain will
do separate U-Boot kernel images for each device individually.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
---
arch/powerpc/boot/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -271,7 +271,7 @@ compressor-$(CONFIG_KERNEL_LZO) := lzo
# args (to if_changed): 1 = (this rule), 2 = platform, 3 = dts 4=dtb 5=initrd
quiet_cmd_wrap = WRAP $@
- cmd_wrap =$(CONFIG_SHELL) $(wrapper) -Z $(compressor-y) -c -o $@ -p $2 \
+ cmd_wrap =$(CONFIG_SHELL) $(wrapper) -Z gzip -c -o $@ -p $2 \
$(CROSSWRAP) $(if $3, -s $3)$(if $4, -d $4)$(if $5, -i $5) \
vmlinux
@@ -19,6 +19,7 @@
led-failsafe = &led_power_orange;
led-running = &led_power_green;
led-upgrade = &led_power_orange;
label-mac-device = &ath9k;
};
leds {
@@ -64,7 +65,7 @@
phy-mode = "rgmii";
phy-handle = <&phy1>;
nvmem-cells = <&macaddr_art_0>;
nvmem-cells = <&macaddr_art_120c 10>;
nvmem-cell-names = "mac-address";
};
@@ -115,17 +116,9 @@
#address-cells = <1>;
#size-cells = <1>;
macaddr_art_0: macaddr@0 {
reg = <0x0 0x6>;
};
macaddr_art_120c: macaddr@120c {
reg = <0x120c 0x6>;
};
macaddr_art_520c: macaddr@520c {
compatible = "mac-base";
reg = <0x520c 0x6>;
reg = <0x120c 0x6>;
#nvmem-cell-cells = <1>;
};
@@ -145,10 +138,10 @@
&pcie0 {
status = "okay";
wifi@11,0 {
ath9k: wifi@11,0 {
compatible = "pci168c,0029";
reg = <0x8800 0 0 0 0>;
nvmem-cells = <&macaddr_art_120c>, <&calibration_art_1000>;
nvmem-cells = <&macaddr_art_120c 0>, <&calibration_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
led {
@@ -160,7 +153,7 @@
wifi@12,0 {
compatible = "pci168c,0029";
reg = <0x9000 0 0 0 0>;
nvmem-cells = <&macaddr_art_520c 1>, <&calibration_art_5000>;
nvmem-cells = <&macaddr_art_120c 8>, <&calibration_art_5000>;
nvmem-cell-names = "mac-address", "calibration";
led {
@@ -108,6 +108,9 @@
phy-mode = "rgmii-id";
phy-handle = <&phy0>;
nvmem-cells = <&macaddr_cfg1_ethaddr>;
nvmem-cell-names = "mac-address";
};
&spi {
@@ -145,6 +148,14 @@
label = "cfg1";
reg = <0xe80000 0x40000>;
read-only;
nvmem-layout {
compatible = "u-boot,env-redundant-bool";
env-size = <0x10000>;
macaddr_cfg1_ethaddr: ethaddr {
};
};
};
partition@ec0000 {
@@ -74,6 +74,7 @@
partition@300000 {
label = "rootfs";
reg = <0x300000 0xc60000>;
linux,rootfs;
};
};
@@ -71,6 +71,14 @@
partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x010000>;
nvmem-layout {
compatible = "u-boot,env";
macaddr_uboot_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
};
partition@50000 {
@@ -126,6 +134,9 @@
phy-mode = "rgmii";
phy-handle = <&phy0>;
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
nvmem-cell-names = "mac-address";
gmac-config {
device = <&gmac>;
@@ -91,6 +91,7 @@
partition@300000 {
label = "rootfs";
reg = <0x300000 0xc60000>;
linux,rootfs;
};
};
@@ -17,7 +17,6 @@
#include <linux/platform_device.h>
#include <linux/gpio/driver.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/version.h>
#include <mfd/rb4xx-cpld.h>
@@ -55,6 +54,8 @@ static int rb4xx_gpio_cpld_set(struct rb4xx_gpio *gpio, unsigned int offset,
ret = cpld->gpio_set_0_7(cpld, values & 0xff);
} else if (offset == 8) {
ret = cpld->gpio_set_8(cpld, values >> 8);
} else {
ret = -EINVAL;
}
if(likely(!ret))
@@ -67,7 +68,7 @@ unlock:
static int rb4xx_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
{
return 0; /* All 9 GPIOs are out */
return GPIO_LINE_DIRECTION_OUT;
}
static int rb4xx_gpio_direction_input(struct gpio_chip *chip,
@@ -95,18 +96,19 @@ static int rb4xx_gpio_get(struct gpio_chip *chip, unsigned int offset)
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0)
static int
static int rb4xx_gpio_set(struct gpio_chip *chip, unsigned int offset,
int value)
{
return rb4xx_gpio_cpld_set(gpiochip_get_data(chip), offset, value);
}
#else
static void
#endif
rb4xx_gpio_set(struct gpio_chip *chip, unsigned int offset,
int value)
{
rb4xx_gpio_cpld_set(gpiochip_get_data(chip), offset, value);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0)
return 0;
#endif
}
#endif
static int rb4xx_gpio_probe(struct platform_device *pdev)
{
@@ -128,7 +130,7 @@ static int rb4xx_gpio_probe(struct platform_device *pdev)
gpio->dev = dev;
gpio->values = 0;
err = devm_mutex_init(&pdev->dev, &gpio->lock);
err = devm_mutex_init(dev, &gpio->lock);
if (err)
return err;
@@ -144,10 +146,10 @@ static int rb4xx_gpio_probe(struct platform_device *pdev)
gpio->chip.base = -1;
gpio->chip.can_sleep = 1;
if (!of_property_read_u32(dev->of_node, "base", &val))
if (!device_property_read_u32(dev, "base", &val))
gpio->chip.base = val;
return devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio);
return devm_gpiochip_add_data(dev, &gpio->chip, gpio);
}
static struct platform_driver rb4xx_gpio_driver = {
@@ -167,6 +167,7 @@ static int gpio_rb91x_key_probe(struct platform_device *pdev)
gc = &drvdata->gc;
gc->label = GPIO_RB91X_KEY_DRIVER_NAME;
gc->parent = dev;
gc->owner = THIS_MODULE;
gc->can_sleep = 1;
gc->base = -1;
gc->ngpio = GPIO_RB91X_KEY_NGPIOS;
@@ -21,7 +21,6 @@
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/reset.h>
#define AR934X_NFC_DRIVER_NAME "ar934x-nand"
@@ -1397,8 +1396,7 @@ static int ar934x_nfc_probe(struct platform_device *pdev)
}
nfc->parent = &pdev->dev;
nfc->swap_dma = of_property_read_bool(pdev->dev.of_node,
"qca,nand-swap-dma");
nfc->swap_dma = device_property_present(&pdev->dev, "qca,nand-swap-dma");
nand = &nfc->nand_chip;
mtd = nand_to_mtd(nand);
@@ -18,7 +18,6 @@
#include <linux/mtd/rawnand.h>
#include <linux/gpio/consumer.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/version.h>
#include <mfd/rb4xx-cpld.h>
@@ -730,8 +730,7 @@ ath79_setup_macs()
label_mac=$(mtd_get_mac_binary u-boot 0x1fc00)
;;
iodata,etg3-r)
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
wan_mac=$(macaddr_add "$lan_mac" -1)
wan_mac=$(macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" -1)
label_mac=$wan_mac
;;
iodata,wn-ac1167dgr|\

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