Merge Mainline
This commit is contained in:
commit
c3991c204a
@ -157,7 +157,7 @@ define BuildKernel
|
||||
compile: $(LINUX_DIR)/.modules
|
||||
$(MAKE) -C image compile TARGET_BUILD=
|
||||
|
||||
oldconfig menuconfig nconfig: $(STAMP_PREPARED) $(STAMP_CHECKED) FORCE
|
||||
oldconfig menuconfig nconfig xconfig: $(STAMP_PREPARED) $(STAMP_CHECKED) FORCE
|
||||
rm -f $(LINUX_DIR)/.config.prev
|
||||
rm -f $(STAMP_CONFIGURED)
|
||||
$(LINUX_RECONF_CMD) > $(LINUX_DIR)/.config
|
||||
|
||||
@ -6,14 +6,14 @@ ifdef CONFIG_TESTING_KERNEL
|
||||
KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
|
||||
endif
|
||||
|
||||
LINUX_VERSION-4.9 = .229
|
||||
LINUX_VERSION-4.14 = .187
|
||||
LINUX_VERSION-4.19 = .131
|
||||
LINUX_VERSION-4.9 = .230
|
||||
LINUX_VERSION-4.14 = .188
|
||||
LINUX_VERSION-4.19 = .132
|
||||
LINUX_VERSION-5.4 = .51
|
||||
|
||||
LINUX_KERNEL_HASH-4.9.229 = 3256c2835fd95a1a739603e78b02d363eac2ce73a39fa19b13b32da4fc370fdc
|
||||
LINUX_KERNEL_HASH-4.14.187 = 5b223475eaeea196aa7e127d3f253bca5c35d8afdc72ca75230ce1ecdd1454bd
|
||||
LINUX_KERNEL_HASH-4.19.131 = 19dfb9f6cc4ba30104b65dcce7d78240a4ae188cb366747d5f8eae35e98964ba
|
||||
LINUX_KERNEL_HASH-4.9.230 = d5ba9256e3ebf1cead127f323acc8124965d89cc88e75eca377fcca3bd6c037c
|
||||
LINUX_KERNEL_HASH-4.14.188 = 766fe01387b1d1b7bd37ca45a5048cdad13e3a51c6c43746dbb657a0ba67064b
|
||||
LINUX_KERNEL_HASH-4.19.132 = d7d7ee94962ce4cc070e8db7f7f3755cbef122a3fd77c436d5381a61819a7d44
|
||||
LINUX_KERNEL_HASH-5.4.51 = 9e8bea8b4cd636726b7e495a3b467c8ffe96f8eddc159a45fe4a7e6e07a2069d
|
||||
|
||||
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
|
||||
|
||||
@ -18,6 +18,18 @@ IPKG_REMOVE:= \
|
||||
|
||||
IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/opkg
|
||||
|
||||
# Generates a make statement to return a wildcard for candidate ipkg files
|
||||
# 1: package name
|
||||
define gen_ipkg_wildcard
|
||||
$(1)$$(if $$(filter -%,$$(ABIV_$(1))),,[^a-z-])*
|
||||
endef
|
||||
|
||||
# 1: package name
|
||||
# 2: candidate ipk files
|
||||
define remove_ipkg_files
|
||||
$(if $(strip $(2)),$(IPKG_REMOVE) $(1) $(2))
|
||||
endef
|
||||
|
||||
# 1: package name
|
||||
# 2: variable name
|
||||
# 3: variable suffix
|
||||
@ -185,7 +197,8 @@ $(_endef)
|
||||
$$(IPKG_$(1)) : export DESCRIPTION=$$(Package/$(1)/description)
|
||||
$$(IPKG_$(1)) : export PATH=$$(TARGET_PATH_PKG)
|
||||
$(PKG_INFO_DIR)/$(1).provides $$(IPKG_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-ipkg.mk
|
||||
@rm -rf $$(IDIR_$(1)) $$(if $$(call opkg_package_files,$(1)*),; $$(IPKG_REMOVE) $(1) $$(call opkg_package_files,$(1)*))
|
||||
@rm -rf $$(IDIR_$(1)); \
|
||||
$$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(call gen_ipkg_wildcard,$(1))))
|
||||
mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL $(PKG_INFO_DIR)
|
||||
$(call Package/$(1)/install,$$(IDIR_$(1)))
|
||||
$(if $(Package/$(1)/install-overlay),mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/rootfs-overlay)
|
||||
@ -253,7 +266,7 @@ $(_endef)
|
||||
@[ -f $$(IPKG_$(1)) ]
|
||||
|
||||
$(1)-clean:
|
||||
$$(if $$(call opkg_package_files,$(1)*),$$(IPKG_REMOVE) $(1) $$(call opkg_package_files,$(1)*))
|
||||
$$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(call gen_ipkg_wildcard,$(1))))
|
||||
|
||||
clean: $(1)-clean
|
||||
|
||||
|
||||
@ -179,8 +179,8 @@ ifeq ($(DUMP),1)
|
||||
CPU_CFLAGS_octeonplus = -march=octeon+ -mabi=64
|
||||
endif
|
||||
ifeq ($(ARCH),i386)
|
||||
CPU_TYPE ?= pentium
|
||||
CPU_CFLAGS_pentium = -march=pentium-mmx
|
||||
CPU_TYPE ?= pentium-mmx
|
||||
CPU_CFLAGS_pentium-mmx = -march=pentium-mmx
|
||||
CPU_CFLAGS_pentium4 = -march=pentium4
|
||||
endif
|
||||
ifneq ($(findstring arm,$(ARCH)),)
|
||||
|
||||
@ -169,6 +169,7 @@ kernel_oldconfig: prepare_kernel_conf
|
||||
ifneq ($(DISTRO_PKG_CONFIG),)
|
||||
kernel_menuconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
|
||||
kernel_nconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
|
||||
kernel_xconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
|
||||
endif
|
||||
kernel_menuconfig: prepare_kernel_conf
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -C target/linux menuconfig
|
||||
@ -176,6 +177,9 @@ kernel_menuconfig: prepare_kernel_conf
|
||||
kernel_nconfig: prepare_kernel_conf
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -C target/linux nconfig
|
||||
|
||||
kernel_xconfig: prepare_kernel_conf
|
||||
$(_SINGLE)$(NO_TRACE_MAKE) -C target/linux xconfig
|
||||
|
||||
staging_dir/host/.prereq-build: include/prereq-build.mk
|
||||
mkdir -p tmp
|
||||
@$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \
|
||||
|
||||
@ -160,7 +160,7 @@ default_prerm() {
|
||||
ret=$?
|
||||
fi
|
||||
|
||||
local shell="$(which bash)"
|
||||
local shell="$(command -v bash)"
|
||||
for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do
|
||||
if [ -n "$root" ]; then
|
||||
${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" disable
|
||||
@ -242,7 +242,7 @@ default_postinst() {
|
||||
|
||||
[ -n "$root" ] || rm -f /tmp/luci-indexcache 2>/dev/null
|
||||
|
||||
local shell="$(which bash)"
|
||||
local shell="$(command -v bash)"
|
||||
for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do
|
||||
if [ -n "$root" ]; then
|
||||
${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" enable
|
||||
|
||||
@ -7,12 +7,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=subconverter
|
||||
PKG_VERSION:=0.6.0-6629f86
|
||||
PKG_VERSION:=0.6.1-081b5ad
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/tindy2013/subconverter.git
|
||||
PKG_SOURCE_VERSION:=6629f861da73fc673e5b9a89e1d9168fd1815d38
|
||||
PKG_SOURCE_VERSION:=081b5adb71f9dee918dc0a026d350efe6ff392b5
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
|
||||
9
package/firmware/linux-firmware/misc.mk
Normal file
9
package/firmware/linux-firmware/misc.mk
Normal file
@ -0,0 +1,9 @@
|
||||
Package/eip197-mini-firmware = $(call Package/firmware-default,Inside Secure EIP197 mini firmware)
|
||||
define Package/eip197-mini-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/inside-secure/eip197_minifw
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/inside-secure/eip197_minifw/ifpp.bin \
|
||||
$(PKG_BUILD_DIR)/inside-secure/eip197_minifw/ipue.bin \
|
||||
$(1)/lib/firmware/inside-secure/eip197_minifw
|
||||
endef
|
||||
$(eval $(call BuildPackage,eip197-mini-firmware))
|
||||
@ -271,6 +271,32 @@ endef
|
||||
$(eval $(call KernelPackage,dm-raid))
|
||||
|
||||
|
||||
define KernelPackage/iscsi-initiator
|
||||
SUBMENU:=$(BLOCK_MENU)
|
||||
TITLE:=iSCSI Initiator over TCP/IP
|
||||
DEPENDS:=+kmod-scsi-core +kmod-crypto-hash
|
||||
KCONFIG:= \
|
||||
CONFIG_INET \
|
||||
CONFIG_SCSI_LOWLEVEL=y \
|
||||
CONFIG_ISCSI_TCP \
|
||||
CONFIG_SCSI_ISCSI_ATTRS=y
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/scsi/iscsi_tcp.ko \
|
||||
$(LINUX_DIR)/drivers/scsi/libiscsi.ko \
|
||||
$(LINUX_DIR)/drivers/scsi/libiscsi_tcp.ko \
|
||||
$(LINUX_DIR)/drivers/scsi/scsi_transport_iscsi.ko
|
||||
AUTOLOAD:=$(call AutoProbe,libiscsi libiscsi_tcp scsi_transport_iscsi iscsi_tcp)
|
||||
endef
|
||||
|
||||
define KernelPackage/iscsi-initiator/description
|
||||
The iSCSI Driver provides a host with the ability to access storage through an
|
||||
IP network. The driver uses the iSCSI protocol to transport SCSI requests and
|
||||
responses over a TCP/IP network between the host (the "initiator") and "targets".
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,iscsi-initiator))
|
||||
|
||||
|
||||
define KernelPackage/md-mod
|
||||
SUBMENU:=$(BLOCK_MENU)
|
||||
TITLE:=MD RAID
|
||||
|
||||
@ -377,7 +377,7 @@ $(eval $(call KernelPackage,crypto-hw-padlock))
|
||||
|
||||
define KernelPackage/crypto-hw-safexcel
|
||||
TITLE:= MVEBU SafeXcel Crypto Engine module
|
||||
DEPENDS:=@!LINUX_4_14 @(TARGET_mvebu_cortexa53||TARGET_mvebu_cortexa72) \
|
||||
DEPENDS:=@!LINUX_4_14 @(TARGET_mvebu_cortexa53||TARGET_mvebu_cortexa72) +eip197-mini-firmware \
|
||||
+kmod-crypto-authenc +kmod-crypto-md5 +kmod-crypto-hmac +kmod-crypto-sha256 +kmod-crypto-sha512
|
||||
KCONFIG:= \
|
||||
CONFIG_CRYPTO_HW=y \
|
||||
@ -392,9 +392,11 @@ MVEBU's EIP97 and EIP197 Cryptographic Engine driver designed by
|
||||
Inside Secure. This is found on Marvell Armada 37xx/7k/8k SoCs.
|
||||
|
||||
Particular version of these IP (EIP197B and EIP197D) require firmware.
|
||||
Unfortunately it's not freely available and needs signed Non-Disclosure
|
||||
Agreement (NDA) with Marvell. For those who have signed NDA the firmware can be
|
||||
obtained at https://extranet.marvell.com.
|
||||
The mini firmware package provides limited functionality, for most operations
|
||||
a full-featured firmware is required. Unfortunately the "full" firmware is not
|
||||
freely available and needs signed Non-Disclosure Agreement (NDA) with Marvell.
|
||||
For those who have signed NDA the firmware can be obtained at
|
||||
https://extranet.marvell.com.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,crypto-hw-safexcel))
|
||||
|
||||
@ -147,7 +147,6 @@ define KernelPackage/lib-lz4
|
||||
SUBMENU:=$(LIB_MENU)
|
||||
TITLE:=LZ4 support
|
||||
DEPENDS:=+!LINUX_4_9:kmod-crypto-acompress
|
||||
HIDDEN:=1
|
||||
KCONFIG:= \
|
||||
CONFIG_CRYPTO_LZ4@ge4.9 \
|
||||
CONFIG_LZ4_COMPRESS \
|
||||
|
||||
@ -720,6 +720,23 @@ endef
|
||||
|
||||
$(eval $(call KernelPackage,rtc-rx8025))
|
||||
|
||||
define KernelPackage/rtc-s35390a
|
||||
SUBMENU:=$(OTHER_MENU)
|
||||
TITLE:=Seico S-35390A
|
||||
DEFAULT:=m if ALL_KMODS && RTC_SUPPORT
|
||||
DEPENDS:=+kmod-i2c-core
|
||||
KCONFIG:=CONFIG_RTC_DRV_S35390A \
|
||||
CONFIG_RTC_CLASS=y
|
||||
FILES:=$(LINUX_DIR)/drivers/rtc/rtc-s35390a.ko
|
||||
AUTOLOAD:=$(call AutoLoad,50,rtc-s35390a,1)
|
||||
endef
|
||||
|
||||
define KernelPackage/rtc-s35390a/description
|
||||
Kernel module for Seiko Instruments S-35390A I2C RTC chip
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,rtc-s35390a))
|
||||
|
||||
|
||||
define KernelPackage/mtdtests
|
||||
SUBMENU:=$(OTHER_MENU)
|
||||
@ -901,15 +918,14 @@ $(eval $(call KernelPackage,ikconfig))
|
||||
define KernelPackage/zram
|
||||
SUBMENU:=$(OTHER_MENU)
|
||||
TITLE:=ZRAM
|
||||
DEPENDS:=+kmod-lib-lzo +kmod-lib-lz4
|
||||
DEPENDS:=+kmod-lib-lzo
|
||||
KCONFIG:= \
|
||||
CONFIG_ZSMALLOC \
|
||||
CONFIG_ZRAM \
|
||||
CONFIG_ZRAM_DEBUG=n \
|
||||
CONFIG_PGTABLE_MAPPING=n \
|
||||
CONFIG_ZRAM_WRITEBACK=n \
|
||||
CONFIG_ZSMALLOC_STAT=n \
|
||||
CONFIG_ZRAM_LZ4_COMPRESS=y
|
||||
CONFIG_ZSMALLOC_STAT=n
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/mm/zsmalloc.ko \
|
||||
$(LINUX_DIR)/drivers/block/zram/zram.ko
|
||||
|
||||
@ -27,7 +27,7 @@ include $(INCLUDE_DIR)/nls.mk
|
||||
define Package/gmediarender
|
||||
SECTION:=multimedia
|
||||
CATEGORY:=Multimedia
|
||||
DEPENDS:= +gstreamer1 +libgstreamer1 +glib2 +libupnp
|
||||
DEPENDS:= +gstreamer1 +libgstreamer1 +gstreamer1-libs +glib2 +libupnp
|
||||
TITLE:=A Headless UPnP Renderer
|
||||
endef
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ipv6helper
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_LICENSE:=GPLv3
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
@ -23,7 +23,7 @@ define Package/ipv6helper
|
||||
SECTION:=ipv6
|
||||
TITLE:=IPv6 Helper and Dynamic Update he.net of ip
|
||||
PKGARCH:=all
|
||||
DEPENDS:=+luci-proto-ipv6 +wget +ip6tables +ip6tables-mod-nat +kmod-ipt-nat6 +kmod-nf-nat6 +odhcpd-ipv6only +odhcp6c +6in4
|
||||
DEPENDS:=+luci-proto-ipv6 +wget ++libip6tc +ip6tables +ip6tables-mod-nat +kmod-ipt-nat6 +kmod-nf-nat6 +odhcpd-ipv6only +odhcp6c +6in4
|
||||
endef
|
||||
|
||||
define Package/ipv6helper/description
|
||||
|
||||
@ -6,10 +6,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI support for IPSec VPN Server (IKEv1 with PSK and Xauth)
|
||||
LUCI_DEPENDS:=+strongswan-minimal +strongswan-mod-xauth-generic
|
||||
LUCI_DEPENDS:=+strongswan +strongswan-minimal +strongswan-mod-xauth-generic +strongswan-mod-kernel-libipsec
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=7
|
||||
PKG_RELEASE:=9
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
|
||||
@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI page for Web Admin
|
||||
LUCI_DEPENDS:=+uhttpd
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
|
||||
@ -21,8 +21,8 @@ msgstr "Web 管理页面设置"
|
||||
msgid "Web Admin Settings Page"
|
||||
msgstr "设置更改Web管理页面端口,绑定地址,是否允许从互联网访问等"
|
||||
|
||||
msgid "HTTP listeners (address:port)\""
|
||||
msgstr "HTTP 监听 (IP地址:端口)\""
|
||||
msgid "HTTP listeners (address:port)"
|
||||
msgstr "HTTP 监听 (IP地址:端口)"
|
||||
|
||||
msgid "Bind to specific interface:port (by specifying interface address"
|
||||
msgstr "绑定到指定的IP地址:端口"
|
||||
|
||||
@ -5,9 +5,9 @@
|
||||
|
||||
case "$ACTION" in
|
||||
ifup)
|
||||
/etc/init.d/xlnetacc start
|
||||
/etc/init.d/xlnetacc restart
|
||||
;;
|
||||
ifdown)
|
||||
/etc/init.d/xlnetacc stop
|
||||
#/etc/init.d/xlnetacc stop
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -9,19 +9,20 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=lzo
|
||||
PKG_VERSION:=2.10
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://www.oberhumer.com/opensource/lzo/download/
|
||||
PKG_HASH:=c0f892943208266f9b6543b3ae308fab6284c5c90e627931446fb49b4221a072
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_INSTALL:=1
|
||||
PKG_LICENSE:=GPL-2.0+
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
CMAKE_BINARY_SUBDIR:=openwrt-build
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/liblzo
|
||||
SECTION:=libs
|
||||
@ -36,17 +37,18 @@ define Package/liblzo/description
|
||||
in real-time. This means it favours speed over compression ratio.
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-shared \
|
||||
--enable-static \
|
||||
|
||||
TARGET_CFLAGS += $(FPIC)
|
||||
MAKE_FLAGS += CFLAGS_O="$(TARGET_CFLAGS)"
|
||||
CMAKE_OPTIONS += \
|
||||
-DENABLE_SHARED=ON \
|
||||
-DENABLE_STATIC=ON \
|
||||
\
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DCMAKE_SKIP_INSTALL_RPATH=ON
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/lzo $(1)/usr/include/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzo2.{a,so*} $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lzo2.pc $(1)/usr/lib/pkgconfig
|
||||
endef
|
||||
|
||||
define Package/liblzo/install
|
||||
|
||||
@ -55,6 +55,14 @@ ifeq ($(CONFIG_USE_MUSL),y)
|
||||
SSP_LIB=-lssp_nonshared
|
||||
endif
|
||||
|
||||
ifeq (${V}, s)
|
||||
MAKE_VARS+= \
|
||||
V=1
|
||||
else ifeq (${V}, sc)
|
||||
MAKE_VARS+= \
|
||||
V=2
|
||||
endif
|
||||
|
||||
MAKE_FLAGS:= \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
CPU_CFLAGS="$(TARGET_CFLAGS)" \
|
||||
|
||||
@ -13,9 +13,9 @@ PKG_RELEASE:=5
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/paulusmack/ppp
|
||||
PKG_SOURCE_DATE:=2020-03-21
|
||||
PKG_SOURCE_VERSION:=41a73232c16e9a063cfe3fad461c94af3f450f6c
|
||||
PKG_MIRROR_HASH:=7b966003b7c1bec95156159119b52583778405f0229dc7590911fa93f031552b
|
||||
PKG_SOURCE_DATE:=2020-05-25
|
||||
PKG_SOURCE_VERSION:=ddd57c279f467e18c4fb3a661f21a069a5a37a1f
|
||||
PKG_MIRROR_HASH:=aac65e65dd25eaf8978a7a0b3258c863d90e29e247dd33d95276c0c189bcd424
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=BSD-4-Clause
|
||||
PKG_CPE_ID:=cpe:/a:samba:ppp
|
||||
|
||||
@ -85,7 +85,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
"Enable multilink operation", OPT_PRIO | 1 },
|
||||
--- a/pppd/pppd.h
|
||||
+++ b/pppd/pppd.h
|
||||
@@ -334,6 +334,8 @@ extern int connect_delay; /* Time to del
|
||||
@@ -335,6 +335,8 @@ extern int connect_delay; /* Time to del
|
||||
extern int max_data_rate; /* max bytes/sec through charshunt */
|
||||
extern int req_unit; /* interface unit number to use */
|
||||
extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */
|
||||
|
||||
@ -161,7 +161,7 @@
|
||||
} else {
|
||||
--- a/pppd/pppd.h
|
||||
+++ b/pppd/pppd.h
|
||||
@@ -601,7 +601,7 @@ void demand_conf __P((void)); /* config
|
||||
@@ -602,7 +602,7 @@ void demand_conf __P((void)); /* config
|
||||
void demand_block __P((void)); /* set all NPs to queue up packets */
|
||||
void demand_unblock __P((void)); /* set all NPs to pass packets */
|
||||
void demand_discard __P((void)); /* set all NPs to discard packets */
|
||||
|
||||
@ -137,7 +137,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
.B disconnect \fIscript
|
||||
Execute the command specified by \fIscript\fR, by passing it to a
|
||||
shell, after
|
||||
@@ -746,7 +751,12 @@ disable both forms of hardware flow cont
|
||||
@@ -751,7 +756,12 @@ disable both forms of hardware flow cont
|
||||
.TP
|
||||
.B nodefaultroute
|
||||
Disable the \fIdefaultroute\fR option. The system administrator who
|
||||
@ -153,7 +153,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
.B nodefaultroute6
|
||||
--- a/pppd/pppd.h
|
||||
+++ b/pppd/pppd.h
|
||||
@@ -683,7 +683,7 @@ int sif6addr __P((int, eui64_t, eui64_t
|
||||
@@ -684,7 +684,7 @@ int sif6addr __P((int, eui64_t, eui64_t
|
||||
int cif6addr __P((int, eui64_t, eui64_t));
|
||||
/* Remove an IPv6 address from i/f */
|
||||
#endif
|
||||
@ -292,7 +292,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
}
|
||||
--- a/pppd/sys-solaris.c
|
||||
+++ b/pppd/sys-solaris.c
|
||||
@@ -2119,12 +2119,18 @@ cifaddr(u, o, h)
|
||||
@@ -2120,12 +2120,18 @@ cifaddr(u, o, h)
|
||||
* sifdefaultroute - assign a default route through the address given.
|
||||
*/
|
||||
int
|
||||
|
||||
@ -84,7 +84,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
}
|
||||
--- a/pppd/pppd.h
|
||||
+++ b/pppd/pppd.h
|
||||
@@ -336,6 +336,8 @@ extern int req_unit; /* interface unit n
|
||||
@@ -337,6 +337,8 @@ extern int req_unit; /* interface unit n
|
||||
extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */
|
||||
extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
|
||||
extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
|
||||
|
||||
@ -1,56 +0,0 @@
|
||||
--- a/pppd/lcp.c
|
||||
+++ b/pppd/lcp.c
|
||||
@@ -72,6 +72,7 @@ static void lcp_delayed_up __P((void *))
|
||||
*/
|
||||
int lcp_echo_interval = 0; /* Interval between LCP echo-requests */
|
||||
int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */
|
||||
+bool lcp_echo_adaptive = 0; /* request echo only if the link was idle */
|
||||
bool lax_recv = 0; /* accept control chars in asyncmap */
|
||||
bool noendpoint = 0; /* don't send/accept endpoint discriminator */
|
||||
|
||||
@@ -150,6 +151,8 @@ static option_t lcp_option_list[] = {
|
||||
OPT_PRIO },
|
||||
{ "lcp-echo-interval", o_int, &lcp_echo_interval,
|
||||
"Set time in seconds between LCP echo requests", OPT_PRIO },
|
||||
+ { "lcp-echo-adaptive", o_bool, &lcp_echo_adaptive,
|
||||
+ "Suppress LCP echo requests if traffic was received", 1 },
|
||||
{ "lcp-restart", o_int, &lcp_fsm[0].timeouttime,
|
||||
"Set time in seconds between LCP retransmissions", OPT_PRIO },
|
||||
{ "lcp-max-terminate", o_int, &lcp_fsm[0].maxtermtransmits,
|
||||
@@ -2330,6 +2333,22 @@ LcpSendEchoRequest (f)
|
||||
}
|
||||
}
|
||||
|
||||
+ /*
|
||||
+ * If adaptive echos have been enabled, only send the echo request if
|
||||
+ * no traffic was received since the last one.
|
||||
+ */
|
||||
+ if (lcp_echo_adaptive) {
|
||||
+ static unsigned int last_pkts_in = 0;
|
||||
+
|
||||
+ update_link_stats(f->unit);
|
||||
+ link_stats_valid = 0;
|
||||
+
|
||||
+ if (link_stats.pkts_in != last_pkts_in) {
|
||||
+ last_pkts_in = link_stats.pkts_in;
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Make and send the echo request frame.
|
||||
*/
|
||||
--- a/pppd/pppd.8
|
||||
+++ b/pppd/pppd.8
|
||||
@@ -575,6 +575,11 @@ to 1) if the \fIproxyarp\fR option is us
|
||||
dynamic IP address option (i.e. set /proc/sys/net/ipv4/ip_dynaddr to
|
||||
1) in demand mode if the local address changes.
|
||||
.TP
|
||||
+.B lcp\-echo\-adaptive
|
||||
+If this option is used with the \fIlcp\-echo\-failure\fR option then
|
||||
+pppd will send LCP echo\-request frames only if no traffic was received
|
||||
+from the peer since the last echo\-request was sent.
|
||||
+.TP
|
||||
.B lcp\-echo\-failure \fIn
|
||||
If this option is given, pppd will presume the peer to be dead
|
||||
if \fIn\fR LCP echo\-requests are sent without receiving a valid LCP
|
||||
@ -1,94 +0,0 @@
|
||||
pppd: Watch out for time warps
|
||||
|
||||
On many embedded systems there is no battery backed RTC and a proper system
|
||||
time only becomes available through NTP after establishing a connection.
|
||||
|
||||
When the clock suddenly jumps forward, the internal accounting (connect time)
|
||||
is confused resulting in unreliable data.
|
||||
|
||||
This patch implements periodic clock checking to look for time warps, if one
|
||||
is detected, the internal counters are adjusted accordingly.
|
||||
|
||||
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/main.c
|
||||
+++ b/pppd/main.c
|
||||
@@ -89,6 +89,7 @@
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
+#include <sys/sysinfo.h>
|
||||
|
||||
#include "pppd.h"
|
||||
#include "magic.h"
|
||||
@@ -226,6 +227,7 @@ static struct subprocess *children;
|
||||
|
||||
/* Prototypes for procedures local to this file. */
|
||||
|
||||
+static void check_time(void);
|
||||
static void setup_signals __P((void));
|
||||
static void create_pidfile __P((int pid));
|
||||
static void create_linkpidfile __P((int pid));
|
||||
@@ -525,6 +527,7 @@ main(argc, argv)
|
||||
info("Starting link");
|
||||
}
|
||||
|
||||
+ check_time();
|
||||
gettimeofday(&start_time, NULL);
|
||||
script_unsetenv("CONNECT_TIME");
|
||||
script_unsetenv("BYTES_SENT");
|
||||
@@ -1274,6 +1277,36 @@ struct callout {
|
||||
|
||||
static struct callout *callout = NULL; /* Callout list */
|
||||
static struct timeval timenow; /* Current time */
|
||||
+static long uptime_diff = 0;
|
||||
+static int uptime_diff_set = 0;
|
||||
+
|
||||
+static void check_time(void)
|
||||
+{
|
||||
+ long new_diff;
|
||||
+ struct timeval t;
|
||||
+ struct sysinfo i;
|
||||
+ struct callout *p;
|
||||
+
|
||||
+ gettimeofday(&t, NULL);
|
||||
+ sysinfo(&i);
|
||||
+ new_diff = t.tv_sec - i.uptime;
|
||||
+
|
||||
+ if (!uptime_diff_set) {
|
||||
+ uptime_diff = new_diff;
|
||||
+ uptime_diff_set = 1;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if ((new_diff - 5 > uptime_diff) || (new_diff + 5 < uptime_diff)) {
|
||||
+ /* system time has changed, update counters and timeouts */
|
||||
+ info("System time change detected.");
|
||||
+ start_time.tv_sec += new_diff - uptime_diff;
|
||||
+
|
||||
+ for (p = callout; p != NULL; p = p->c_next)
|
||||
+ p->c_time.tv_sec += new_diff - uptime_diff;
|
||||
+ }
|
||||
+ uptime_diff = new_diff;
|
||||
+}
|
||||
|
||||
/*
|
||||
* timeout - Schedule a timeout.
|
||||
@@ -1344,6 +1377,8 @@ calltimeout()
|
||||
{
|
||||
struct callout *p;
|
||||
|
||||
+ check_time();
|
||||
+
|
||||
while (callout != NULL) {
|
||||
p = callout;
|
||||
|
||||
@@ -1371,6 +1406,8 @@ timeleft(tvp)
|
||||
{
|
||||
if (callout == NULL)
|
||||
return NULL;
|
||||
+
|
||||
+ check_time();
|
||||
|
||||
gettimeofday(&timenow, NULL);
|
||||
tvp->tv_sec = callout->c_time.tv_sec - timenow.tv_sec;
|
||||
@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/main.c
|
||||
+++ b/pppd/main.c
|
||||
@@ -1055,7 +1055,8 @@ get_input()
|
||||
@@ -1052,7 +1052,8 @@ get_input()
|
||||
}
|
||||
notice("Modem hangup");
|
||||
hungup = 1;
|
||||
|
||||
@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/pppd.h
|
||||
+++ b/pppd/pppd.h
|
||||
@@ -325,7 +325,6 @@ extern int holdoff; /* Dead time before
|
||||
@@ -326,7 +326,6 @@ extern int holdoff; /* Dead time before
|
||||
extern bool holdoff_specified; /* true if user gave a holdoff value */
|
||||
extern bool notty; /* Stdin/out is not a tty */
|
||||
extern char *pty_socket; /* Socket to connect to pty */
|
||||
|
||||
@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
--- a/pppd/main.c
|
||||
+++ b/pppd/main.c
|
||||
@@ -886,14 +886,17 @@ struct protocol_list {
|
||||
@@ -883,14 +883,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" },
|
||||
@@ -907,8 +910,11 @@ struct protocol_list {
|
||||
@@ -904,8 +907,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" },
|
||||
@@ -919,12 +925,15 @@ struct protocol_list {
|
||||
@@ -916,12 +922,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" },
|
||||
@@ -936,15 +945,19 @@ struct protocol_list {
|
||||
@@ -933,15 +942,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" },
|
||||
@@ -955,8 +968,10 @@ struct protocol_list {
|
||||
@@ -952,8 +965,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" },
|
||||
@@ -965,7 +980,9 @@ struct protocol_list {
|
||||
@@ -962,7 +977,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" },
|
||||
@@ -974,18 +991,24 @@ struct protocol_list {
|
||||
@@ -971,18 +988,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" },
|
||||
@@ -994,24 +1017,29 @@ struct protocol_list {
|
||||
@@ -991,24 +1014,29 @@ struct protocol_list {
|
||||
{ 0x8281, "MPLSCP" },
|
||||
{ 0x8285, "IEEE p1284.4 standard - Protocol Control" },
|
||||
{ 0x8287, "ETSI TETRA TNP1 Control Protocol" },
|
||||
|
||||
@ -9,22 +9,21 @@
|
||||
#ifdef CHAPMS
|
||||
#include "chap_ms.h"
|
||||
#define MDTYPE_ALL (MDTYPE_MICROSOFT_V2 | MDTYPE_MICROSOFT | MDTYPE_MD5)
|
||||
@@ -492,6 +494,19 @@ chap_respond(struct chap_client_state *c
|
||||
@@ -481,6 +483,18 @@ chap_respond(struct chap_client_state *cs, int id,
|
||||
p[2] = len >> 8;
|
||||
p[3] = len;
|
||||
|
||||
+ if (npppd > 1) {
|
||||
+ if (syncppp(npppd) < 0) {
|
||||
+ error("syncppp sync fail");
|
||||
+ sem_unlink(SEM_COUNT_NAME);
|
||||
+ sem_unlink(SEM_BLOCK_NAME);
|
||||
+ } else {
|
||||
+ info("syncppp sync succeeded");
|
||||
+ }
|
||||
+ } else {
|
||||
+ info("syncppp not active");
|
||||
+ }
|
||||
+
|
||||
+ if (npppd > 1) {
|
||||
+ if (syncppp(npppd) < 0) {
|
||||
+ error("syncppp sync fail");
|
||||
+ sem_unlink(SEM_COUNT_NAME);
|
||||
+ sem_unlink(SEM_BLOCK_NAME);
|
||||
+ } else {
|
||||
+ info("syncppp sync succeeded");
|
||||
+ }
|
||||
+ } else {
|
||||
+ info("syncppp not active");
|
||||
+ }
|
||||
+
|
||||
output(0, response, PPP_HDRLEN + len);
|
||||
}
|
||||
@ -55,39 +54,38 @@
|
||||
# CC = gcc
|
||||
#
|
||||
COPTS = -O2 -pipe -Wall -g
|
||||
-LIBS =
|
||||
-LIBS = -lrt
|
||||
+LIBS = -lpthread
|
||||
|
||||
# Uncomment the next line to include support for Microsoft's
|
||||
# MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux.
|
||||
--- a/pppd/options.c
|
||||
+++ b/pppd/options.c
|
||||
@@ -128,6 +128,7 @@ bool dump_options; /* print out option
|
||||
@@ -123,6 +123,7 @@ bool dump_options; /* print out option values */
|
||||
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 */
|
||||
+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 */
|
||||
|
||||
@@ -342,6 +343,10 @@ option_t general_options[] = {
|
||||
"Set pathname of ipv6-down script",
|
||||
OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
|
||||
@@ -312,6 +313,9 @@ option_t general_options[] = {
|
||||
"Unset user environment variable",
|
||||
OPT_A2PRINTER | OPT_NOPRINT, (void *)user_unsetprint },
|
||||
|
||||
+ { "syncppp", o_int, &npppd,
|
||||
+ "sync among multiple pppd when sending chap/pap respond", OPT_PRIO },
|
||||
+
|
||||
+
|
||||
#ifdef HAVE_MULTILINK
|
||||
{ "multilink", o_bool, &multilink,
|
||||
"Enable multilink operation", OPT_PRIO | 1 },
|
||||
{ "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 },
|
||||
--- a/pppd/pppd.h
|
||||
+++ b/pppd/pppd.h
|
||||
@@ -343,6 +343,7 @@ extern char *bundle_name; /* bundle name
|
||||
@@ -341,6 +341,7 @@ extern char *bundle_name; /* bundle name for multilink */
|
||||
extern bool dump_options; /* print out option values */
|
||||
extern bool dryrun; /* check everything, print options, exit */
|
||||
extern int child_wait; /* # seconds to wait for children at end */
|
||||
+extern int npppd; /* synchronize between multiple pppd */
|
||||
+extern int npppd; /* synchronize between multiple pppd */
|
||||
|
||||
#ifdef MAXOCTETS
|
||||
extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */
|
||||
@ -199,9 +197,8 @@
|
||||
+ }
|
||||
+ } else {
|
||||
+ info("syncppp not active");
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
output(u->us_unit, outpacket_buf, outlen + PPP_HDRLEN);
|
||||
|
||||
TIMEOUT(upap_timeout, u, u->us_timeouttime);
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875.
|
||||
+++ b/pppd/Makefile.linux
|
||||
@@ -35,10 +35,10 @@ endif
|
||||
COPTS = -O2 -pipe -Wall -g
|
||||
LIBS =
|
||||
LIBS = -lpthread
|
||||
|
||||
-# Uncomment the next line to include support for Microsoft's
|
||||
+# Uncomment the next 2 lines to include support for Microsoft's
|
||||
|
||||
@ -27,7 +27,7 @@ check_peer_activity() {
|
||||
config_get public_key "${cfg}" "public_key"
|
||||
config_get endpoint_host "${cfg}" "endpoint_host"
|
||||
config_get endpoint_port "${cfg}" "endpoint_port"
|
||||
persistent_keepalive=`wg show ${iface} persistent-keepalive | grep ${public_key} | awk '{print $2}'`
|
||||
persistent_keepalive=$(wg show ${iface} persistent-keepalive | grep ${public_key} | awk '{print $2}')
|
||||
|
||||
# only process peers with endpoints and keepalive set
|
||||
[ -z ${endpoint_host} ] && return 0;
|
||||
@ -42,16 +42,16 @@ check_peer_activity() {
|
||||
[ -n "${IPV4}" -o -n "${IPV6}" ] && return 0;
|
||||
|
||||
# re-resolve endpoint hostname if not responding for too long
|
||||
last_handshake=`wg show ${iface} latest-handshakes | grep ${public_key} | awk '{print $2}'`
|
||||
last_handshake=$(wg show ${iface} latest-handshakes | grep ${public_key} | awk '{print $2}')
|
||||
[ -z ${last_handshake} ] && return 0;
|
||||
idle_seconds=$((`date +%s`-${last_handshake}))
|
||||
idle_seconds=$(($(date +%s)-${last_handshake}))
|
||||
[ ${idle_seconds} -lt 150 ] && return 0;
|
||||
logger -t "wireguard_monitor" "${iface} endpoint ${endpoint_host}:${endpoint_port} is not responding for ${idle_seconds} seconds, trying to re-resolve hostname"
|
||||
wg set ${iface} peer ${public_key} endpoint "${endpoint_host}:${endpoint_port}"
|
||||
}
|
||||
|
||||
# query ubus for all active wireguard interfaces
|
||||
wg_ifaces=`ubus -S call network.interface dump | jsonfilter -e '@.interface[@.up=true]' | jsonfilter -a -e '@[@.proto="wireguard"].interface' | tr "\n" " "`
|
||||
wg_ifaces=$(ubus -S call network.interface dump | jsonfilter -e '@.interface[@.up=true]' | jsonfilter -a -e '@[@.proto="wireguard"].interface' | tr "\n" " ")
|
||||
|
||||
# check every peer in every active wireguard interface
|
||||
config_load network
|
||||
|
||||
@ -18,7 +18,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/zram-swap
|
||||
SECTION:=utils
|
||||
CATEGORY:=Base system
|
||||
DEPENDS:=+kmod-zram +!BUSYBOX_CONFIG_MKSWAP:swap-utils +!BUSYBOX_CONFIG_SWAPONOFF:block-mount
|
||||
DEPENDS:=+kmod-zram +!(BUSYBOX_CONFIG_MKSWAP&&BUSYBOX_CONFIG_SWAPON&&BUSYBOX_CONFIG_SWAPOFF):swap-utils
|
||||
TITLE:=ZRAM swap scripts
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
@ -126,7 +126,7 @@ start()
|
||||
zram_comp_streams "$zram_dev"
|
||||
echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize"
|
||||
mkswap "$zram_dev"
|
||||
swapon "$zram_dev"
|
||||
swapon -d $zram_priority "$zram_dev"
|
||||
}
|
||||
|
||||
stop()
|
||||
|
||||
@ -24,7 +24,7 @@ config BUSYBOX_DEFAULT_FEATURE_VERBOSE_USAGE
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_FEATURE_COMPRESS_USAGE
|
||||
bool
|
||||
default y
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_LFS
|
||||
bool
|
||||
default y
|
||||
@ -303,7 +303,7 @@ config BUSYBOX_DEFAULT_FEATURE_SKIP_ROOTFS
|
||||
default n
|
||||
config BUSYBOX_DEFAULT_MONOTONIC_SYSCALL
|
||||
bool
|
||||
default n
|
||||
default y
|
||||
config BUSYBOX_DEFAULT_IOCTL_HEX2STR_ERROR
|
||||
bool
|
||||
default y
|
||||
|
||||
12
scripts/env
12
scripts/env
@ -22,7 +22,7 @@ Commands:
|
||||
Options:
|
||||
|
||||
EOF
|
||||
exit ${1:-1}
|
||||
exit "${1:-1}"
|
||||
}
|
||||
|
||||
error() {
|
||||
@ -42,7 +42,7 @@ ask_bool() {
|
||||
local VAL
|
||||
|
||||
echo -n "$* ($defstr): "
|
||||
read VAL
|
||||
read -r VAL
|
||||
case "$VAL" in
|
||||
y*|Y*) val=0;;
|
||||
n*|N*) val=1;;
|
||||
@ -57,7 +57,7 @@ env_init() {
|
||||
if [ -z "$CREATE" ]; then
|
||||
[ -d "$ENVDIR" ] || exit 0
|
||||
fi
|
||||
[ -x "$(which git 2>/dev/null)" ] || error "Git is not installed"
|
||||
command -v git || error "Git is not installed"
|
||||
mkdir -p "$ENVDIR" || error "Failed to create the environment directory"
|
||||
cd "$ENVDIR" || error "Failed to switch to the environment directory"
|
||||
[ -d .git ] || {
|
||||
@ -73,7 +73,7 @@ env_init() {
|
||||
}
|
||||
|
||||
env_sync_data() {
|
||||
[ \! -L "$BASEDIR/.config" ] && [ -f "$BASEDIR/.config" ] && mv "$BASEDIR/.config" "$ENVDIR"
|
||||
[ ! -L "$BASEDIR/.config" ] && [ -f "$BASEDIR/.config" ] && mv "$BASEDIR/.config" "$ENVDIR"
|
||||
git add .
|
||||
git add -u
|
||||
}
|
||||
@ -147,7 +147,7 @@ env_clear() {
|
||||
else
|
||||
rm -rf "$BASEDIR/files" "$BASEDIR/.config"
|
||||
fi
|
||||
cd "$BASEDIR"
|
||||
cd "$BASEDIR" || exit 1
|
||||
rm -rf "$ENVDIR"
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ env_new() {
|
||||
git checkout -b "$1" "$from"
|
||||
if [ -f "$BASEDIR/.config" ] || [ -d "$BASEDIR/files" ]; then
|
||||
if ask_bool 1 "Do you want to start your configuration repository with the current configuration?"; then
|
||||
if [ -d "$BASEDIR/files" ] && [ \! -L "$BASEDIR/files" ]; then
|
||||
if [ -d "$BASEDIR/files" ] && [ ! -L "$BASEDIR/files" ]; then
|
||||
mkdir -p "$ENVDIR/files"
|
||||
shopt -s dotglob
|
||||
mv "$BASEDIR/files/"* "$ENVDIR/files/" 2>/dev/null
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2006-2012 OpenWrt.org
|
||||
set -e -x
|
||||
[ $# == 5 -o $# == 6 ] || {
|
||||
if [ $# -ne 5 ] && [ $# -ne 6 ]; then
|
||||
echo "SYNTAX: $0 <file> <kernel size> <kernel directory> <rootfs size> <rootfs image> [<align>]"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
||||
OUTPUT="$1"
|
||||
KERNELSIZE="$2"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
#
|
||||
# Licensed under the terms of the GNU GPL License version 2 or later.
|
||||
#
|
||||
@ -15,18 +15,19 @@
|
||||
#
|
||||
|
||||
usage() {
|
||||
echo "Usage: $(basename $0) -A arch -C comp -a addr -e entry" \
|
||||
"-v version -k kernel [-D name -d dtb] -o its_file"
|
||||
echo -e "\t-A ==> set architecture to 'arch'"
|
||||
echo -e "\t-C ==> set compression type 'comp'"
|
||||
echo -e "\t-c ==> set config name 'config'"
|
||||
echo -e "\t-a ==> set load address to 'addr' (hex)"
|
||||
echo -e "\t-e ==> set entry point to 'entry' (hex)"
|
||||
echo -e "\t-v ==> set kernel version to 'version'"
|
||||
echo -e "\t-k ==> include kernel image 'kernel'"
|
||||
echo -e "\t-D ==> human friendly Device Tree Blob 'name'"
|
||||
echo -e "\t-d ==> include Device Tree Blob 'dtb'"
|
||||
echo -e "\t-o ==> create output file 'its_file'"
|
||||
printf "Usage: %s -A arch -C comp -a addr -e entry" "$(basename "$0")"
|
||||
printf " -v version -k kernel [-D name -d dtb] -o its_file"
|
||||
|
||||
printf "\n\t-A ==> set architecture to 'arch'"
|
||||
printf "\n\t-C ==> set compression type 'comp'"
|
||||
printf "\n\t-c ==> set config name 'config'"
|
||||
printf "\n\t-a ==> set load address to 'addr' (hex)"
|
||||
printf "\n\t-e ==> set entry point to 'entry' (hex)"
|
||||
printf "\n\t-v ==> set kernel version to 'version'"
|
||||
printf "\n\t-k ==> include kernel image 'kernel'"
|
||||
printf "\n\t-D ==> human friendly Device Tree Blob 'name'"
|
||||
printf "\n\t-d ==> include Device Tree Blob 'dtb'"
|
||||
printf "\n\t-o ==> create output file 'its_file'\n"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@ -43,7 +44,7 @@ do
|
||||
k ) KERNEL=$OPTARG;;
|
||||
o ) OUTPUT=$OPTARG;;
|
||||
v ) VERSION=$OPTARG;;
|
||||
* ) echo "Invalid option passed to '$0' (options:$@)"
|
||||
* ) echo "Invalid option passed to '$0' (options:$*)"
|
||||
usage;;
|
||||
esac
|
||||
done
|
||||
@ -55,7 +56,7 @@ if [ -z "${ARCH}" ] || [ -z "${COMPRESS}" ] || [ -z "${LOAD_ADDR}" ] || \
|
||||
usage
|
||||
fi
|
||||
|
||||
ARCH_UPPER=$(echo $ARCH | tr '[:lower:]' '[:upper:]')
|
||||
ARCH_UPPER=$(echo "$ARCH" | tr '[:lower:]' '[:upper:]')
|
||||
|
||||
# Conditionally create fdt information
|
||||
if [ -n "${DTB}" ]; then
|
||||
@ -115,4 +116,4 @@ ${FDT_NODE}
|
||||
};"
|
||||
|
||||
# Write .its file to disk
|
||||
echo "$DATA" > ${OUTPUT}
|
||||
echo "$DATA" > "${OUTPUT}"
|
||||
|
||||
@ -9,5 +9,5 @@ include $(INCLUDE_DIR)/target.mk
|
||||
|
||||
export TARGET_BUILD=1
|
||||
|
||||
prereq clean download prepare compile install menuconfig nconfig oldconfig update refresh: FORCE
|
||||
prereq clean download prepare compile install oldconfig menuconfig nconfig xconfig update refresh: FORCE
|
||||
@+$(NO_TRACE_MAKE) -C $(BOARD) $@
|
||||
|
||||
@ -733,7 +733,7 @@
|
||||
static struct fib6_node *node_alloc(void)
|
||||
--- a/net/netfilter/nf_conntrack_proto_tcp.c
|
||||
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
|
||||
@@ -447,7 +447,7 @@ static void tcp_sack(const struct sk_buf
|
||||
@@ -453,7 +453,7 @@ static void tcp_sack(const struct sk_buf
|
||||
|
||||
/* Fast path for timestamp-only option */
|
||||
if (length == TCPOLEN_TSTAMP_ALIGNED
|
||||
|
||||
@ -704,7 +704,7 @@
|
||||
struct fib6_info *fib6_info_alloc(gfp_t gfp_flags)
|
||||
--- a/net/netfilter/nf_conntrack_proto_tcp.c
|
||||
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
|
||||
@@ -423,7 +423,7 @@ static void tcp_sack(const struct sk_buf
|
||||
@@ -429,7 +429,7 @@ static void tcp_sack(const struct sk_buf
|
||||
|
||||
/* Fast path for timestamp-only option */
|
||||
if (length == TCPOLEN_TSTAMP_ALIGNED
|
||||
|
||||
@ -9,7 +9,7 @@ Subject: [PATCH] kbuild: Ignore dtco targets when filtering symbols
|
||||
|
||||
--- a/scripts/Kbuild.include
|
||||
+++ b/scripts/Kbuild.include
|
||||
@@ -287,7 +287,7 @@ ksym_dep_filter =
|
||||
@@ -288,7 +288,7 @@ ksym_dep_filter =
|
||||
$(CPP) $(call flags_nodeps,c_flags) -D__KSYM_DEPS__ $< ;; \
|
||||
as_*_S|cpp_s_S) \
|
||||
$(CPP) $(call flags_nodeps,a_flags) -D__KSYM_DEPS__ $< ;; \
|
||||
|
||||
@ -18,7 +18,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
|
||||
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
|
||||
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
|
||||
@@ -2153,7 +2153,7 @@ static void bcmgenet_init_tx_ring(struct
|
||||
@@ -2151,7 +2151,7 @@ static void bcmgenet_init_tx_ring(struct
|
||||
|
||||
bcmgenet_tdma_ring_writel(priv, index, 0, TDMA_PROD_INDEX);
|
||||
bcmgenet_tdma_ring_writel(priv, index, 0, TDMA_CONS_INDEX);
|
||||
@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
/* Disable rate control for now */
|
||||
bcmgenet_tdma_ring_writel(priv, index, flow_period_val,
|
||||
TDMA_FLOW_PERIOD);
|
||||
@@ -3584,9 +3584,12 @@ static int bcmgenet_probe(struct platfor
|
||||
@@ -3582,9 +3582,12 @@ static int bcmgenet_probe(struct platfor
|
||||
netif_set_real_num_rx_queues(priv->dev, priv->hw_params->rx_queues + 1);
|
||||
|
||||
/* Set default coalescing parameters */
|
||||
|
||||
@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
||||
|
||||
--- a/drivers/usb/host/xhci.c
|
||||
+++ b/drivers/usb/host/xhci.c
|
||||
@@ -1427,6 +1427,103 @@ command_cleanup:
|
||||
@@ -1428,6 +1428,103 @@ command_cleanup:
|
||||
}
|
||||
|
||||
/*
|
||||
@ -119,7 +119,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
||||
* non-error returns are a promise to giveback() the urb later
|
||||
* we drop ownership so next owner (or urb unlink) can get it
|
||||
*/
|
||||
@@ -5219,6 +5316,7 @@ static const struct hc_driver xhci_hc_dr
|
||||
@@ -5226,6 +5323,7 @@ static const struct hc_driver xhci_hc_dr
|
||||
.endpoint_reset = xhci_endpoint_reset,
|
||||
.check_bandwidth = xhci_check_bandwidth,
|
||||
.reset_bandwidth = xhci_reset_bandwidth,
|
||||
|
||||
@ -38,7 +38,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
static inline void bcmgenet_writel(u32 value, void __iomem *offset)
|
||||
{
|
||||
/* MIPS chips strapped for BE will automagically configure the
|
||||
@@ -1999,6 +2003,11 @@ static void reset_umac(struct bcmgenet_p
|
||||
@@ -1997,6 +2001,11 @@ static void reset_umac(struct bcmgenet_p
|
||||
bcmgenet_rbuf_ctrl_set(priv, 0);
|
||||
udelay(10);
|
||||
|
||||
|
||||
@ -2927,6 +2927,7 @@ CONFIG_MODULE_UNLOAD=y
|
||||
# CONFIG_MPL115_SPI is not set
|
||||
# CONFIG_MPL3115 is not set
|
||||
# CONFIG_MPLS is not set
|
||||
# CONFIG_MPLS_ROUTING is not set
|
||||
# CONFIG_MPU3050_I2C is not set
|
||||
# CONFIG_MQ_IOSCHED_DEADLINE is not set
|
||||
# CONFIG_MQ_IOSCHED_KYBER is not set
|
||||
@ -4069,7 +4070,6 @@ CONFIG_RFKILL=y
|
||||
# CONFIG_ROMFS_FS is not set
|
||||
# CONFIG_ROSE is not set
|
||||
# CONFIG_RPCSEC_GSS_KRB5 is not set
|
||||
# CONFIG_RPI_AXIPERF is not set
|
||||
# CONFIG_RPMSG_QCOM_GLINK_RPM is not set
|
||||
# CONFIG_RPMSG_VIRTIO is not set
|
||||
# CONFIG_RPR0521 is not set
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
|
||||
#include "routerboot.h"
|
||||
|
||||
#define RB_HARDCONFIG_VER "0.04"
|
||||
#define RB_HARDCONFIG_VER "0.05"
|
||||
#define RB_HC_PR_PFX "[rb_hardconfig] "
|
||||
|
||||
/* ID values for hardware settings */
|
||||
@ -58,6 +58,7 @@
|
||||
#define RB_ID_BOARD_IDENTIFIER 0x17
|
||||
#define RB_ID_PRODUCT_NAME 0x21
|
||||
#define RB_ID_DEFCONF 0x26
|
||||
#define RB_ID_BOARD_REVISION 0x27
|
||||
|
||||
/* Bit definitions for hardware options */
|
||||
#define RB_HW_OPT_NO_UART BIT(0)
|
||||
@ -415,6 +416,10 @@ static struct hc_attr {
|
||||
.tag_id = RB_ID_DEFCONF,
|
||||
.tshow = routerboot_tag_show_string,
|
||||
.kattr = __ATTR(defconf, S_IRUSR, hc_attr_show, NULL),
|
||||
}, {
|
||||
.tag_id = RB_ID_BOARD_REVISION,
|
||||
.tshow = routerboot_tag_show_string,
|
||||
.kattr = __ATTR(board_revision, S_IRUSR, hc_attr_show, NULL),
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@
|
||||
|
||||
#include "routerboot.h"
|
||||
|
||||
#define RB_SOFTCONFIG_VER "0.02"
|
||||
#define RB_SOFTCONFIG_VER "0.03"
|
||||
#define RB_SC_PR_PFX "[rb_softconfig] "
|
||||
|
||||
/*
|
||||
@ -121,22 +121,36 @@
|
||||
#define RB_BOOT_DEVICE_FLSHONCE 8 // "boot in flash configuration mode once, then NAND"
|
||||
|
||||
/*
|
||||
* ATH79 CPU frequency indices.
|
||||
* ATH79 9xxx CPU frequency indices.
|
||||
* It is unknown if they apply to all ATH79 RBs, and some do not seem to feature
|
||||
* the up levels (QCA955x), while U3 is presumably AR9344-only.
|
||||
* the upper levels (QCA955x), while F is presumably AR9344-only.
|
||||
*/
|
||||
#define RB_CPU_FREQ_IDX_ATH79_D2 (0 << 3)
|
||||
#define RB_CPU_FREQ_IDX_ATH79_D1 (1 << 3) // 0x8
|
||||
#define RB_CPU_FREQ_IDX_ATH79_N0 (2 << 3) // 0x10 - factory freq for many devices
|
||||
#define RB_CPU_FREQ_IDX_ATH79_U1 (3 << 3) // 0x18
|
||||
#define RB_CPU_FREQ_IDX_ATH79_U2 (4 << 3) // 0x20
|
||||
#define RB_CPU_FREQ_IDX_ATH79_U3 (5 << 3) // 0x28
|
||||
#define RB_CPU_FREQ_IDX_ATH79_9X_A (0 << 3)
|
||||
#define RB_CPU_FREQ_IDX_ATH79_9X_B (1 << 3) // 0x8
|
||||
#define RB_CPU_FREQ_IDX_ATH79_9X_C (2 << 3) // 0x10 - factory freq for many devices
|
||||
#define RB_CPU_FREQ_IDX_ATH79_9X_D (3 << 3) // 0x18
|
||||
#define RB_CPU_FREQ_IDX_ATH79_9X_E (4 << 3) // 0x20
|
||||
#define RB_CPU_FREQ_IDX_ATH79_9X_F (5 << 3) // 0x28
|
||||
|
||||
#define RB_CPU_FREQ_IDX_ATH79_MIN 0 // all devices support lowest setting
|
||||
#define RB_CPU_FREQ_IDX_ATH79_AR9334_MAX 5 // stops at U3
|
||||
#define RB_CPU_FREQ_IDX_ATH79_QCA953X_MAX 4 // stops at U2
|
||||
#define RB_CPU_FREQ_IDX_ATH79_QCA9556_MAX 2 // stops at N0
|
||||
#define RB_CPU_FREQ_IDX_ATH79_QCA9558_MAX 3 // stops at U1
|
||||
#define RB_CPU_FREQ_IDX_ATH79_9X_MIN 0 // all devices support lowest setting
|
||||
#define RB_CPU_FREQ_IDX_ATH79_9X_AR9334_MAX 5 // stops at F
|
||||
#define RB_CPU_FREQ_IDX_ATH79_9X_QCA953X_MAX 4 // stops at E
|
||||
#define RB_CPU_FREQ_IDX_ATH79_9X_QCA9556_MAX 2 // stops at C
|
||||
#define RB_CPU_FREQ_IDX_ATH79_9X_QCA9558_MAX 3 // stops at D
|
||||
|
||||
/* ATH79 7xxx CPU frequency indices. */
|
||||
#define RB_CPU_FREQ_IDX_ATH79_7X_A ((0 * 9) << 4)
|
||||
#define RB_CPU_FREQ_IDX_ATH79_7X_B ((1 * 9) << 4)
|
||||
#define RB_CPU_FREQ_IDX_ATH79_7X_C ((2 * 9) << 4)
|
||||
#define RB_CPU_FREQ_IDX_ATH79_7X_D ((3 * 9) << 4)
|
||||
#define RB_CPU_FREQ_IDX_ATH79_7X_E ((4 * 9) << 4)
|
||||
#define RB_CPU_FREQ_IDX_ATH79_7X_F ((5 * 9) << 4)
|
||||
#define RB_CPU_FREQ_IDX_ATH79_7X_G ((6 * 9) << 4)
|
||||
#define RB_CPU_FREQ_IDX_ATH79_7X_H ((7 * 9) << 4)
|
||||
|
||||
#define RB_CPU_FREQ_IDX_ATH79_7X_MIN 0 // all devices support lowest setting
|
||||
#define RB_CPU_FREQ_IDX_ATH79_7X_AR724X_MAX 3 // stops at D
|
||||
#define RB_CPU_FREQ_IDX_ATH79_7X_AR7161_MAX 7 // stops at H - check if applies to all AR71xx devices
|
||||
|
||||
#define RB_SC_CRC32_OFFSET 4 // located right after magic
|
||||
|
||||
@ -168,8 +182,9 @@ static ssize_t sc_tag_show_u32tvs(const u8 *pld, u16 pld_len, char *buf,
|
||||
u32 data; // cpu-endian
|
||||
int i;
|
||||
|
||||
// fallback to raw hex output if we can't handle the input
|
||||
if (tvselmts < 0)
|
||||
return tvselmts;
|
||||
return routerboot_tag_show_u32s(pld, pld_len, buf);
|
||||
|
||||
if (sizeof(data) != pld_len)
|
||||
return -EINVAL;
|
||||
@ -387,39 +402,71 @@ static ssize_t sc_tag_store_bootdelays(const u8 *pld, u16 pld_len, const char *b
|
||||
|
||||
/* Support CPU frequency accessors only when the tag format has been asserted */
|
||||
#if defined(CONFIG_ATH79)
|
||||
static struct sc_u32tvs const sc_cpufreq_indexes_ath79[] = {
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_D2, "-2"),
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_D1, "-1"),
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_N0, "0"),
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_U1, "+1"),
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_U2, "+2"),
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_U3, "+3"),
|
||||
/* Use the same letter-based nomenclature as RouterBOOT */
|
||||
static struct sc_u32tvs const sc_cpufreq_indexes_ath79_9x[] = {
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_A, "a"),
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_B, "b"),
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_C, "c"),
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_D, "d"),
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_E, "e"),
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_F, "f"),
|
||||
};
|
||||
|
||||
static int sc_tag_cpufreq_ath79_idxmax(void)
|
||||
{
|
||||
int idx_max = -EOPNOTSUPP;
|
||||
static struct sc_u32tvs const sc_cpufreq_indexes_ath79_7x[] = {
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_A, "a"),
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_B, "b"),
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_C, "c"),
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_D, "d"),
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_E, "e"),
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_F, "f"),
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_G, "g"),
|
||||
RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_H, "h"),
|
||||
};
|
||||
|
||||
if (soc_is_ar9344())
|
||||
idx_max = RB_CPU_FREQ_IDX_ATH79_AR9334_MAX;
|
||||
static int sc_tag_cpufreq_ath79_arraysize(void)
|
||||
{
|
||||
int idx_max;
|
||||
|
||||
if (ATH79_SOC_AR7161 == ath79_soc)
|
||||
idx_max = RB_CPU_FREQ_IDX_ATH79_7X_AR7161_MAX+1;
|
||||
else if (soc_is_ar724x())
|
||||
idx_max = RB_CPU_FREQ_IDX_ATH79_7X_AR724X_MAX+1;
|
||||
else if (soc_is_ar9344())
|
||||
idx_max = RB_CPU_FREQ_IDX_ATH79_9X_AR9334_MAX+1;
|
||||
else if (soc_is_qca953x())
|
||||
idx_max = RB_CPU_FREQ_IDX_ATH79_QCA953X_MAX;
|
||||
idx_max = RB_CPU_FREQ_IDX_ATH79_9X_QCA953X_MAX+1;
|
||||
else if (soc_is_qca9556())
|
||||
idx_max = RB_CPU_FREQ_IDX_ATH79_QCA9556_MAX;
|
||||
idx_max = RB_CPU_FREQ_IDX_ATH79_9X_QCA9556_MAX+1;
|
||||
else if (soc_is_qca9558())
|
||||
idx_max = RB_CPU_FREQ_IDX_ATH79_QCA9558_MAX;
|
||||
idx_max = RB_CPU_FREQ_IDX_ATH79_9X_QCA9558_MAX+1;
|
||||
else
|
||||
idx_max = -EOPNOTSUPP;
|
||||
|
||||
return idx_max;
|
||||
}
|
||||
|
||||
static ssize_t sc_tag_show_cpufreq_indexes(const u8 *pld, u16 pld_len, char * buf)
|
||||
static ssize_t sc_tag_show_cpufreq_indexes(const u8 *pld, u16 pld_len, char *buf)
|
||||
{
|
||||
return sc_tag_show_u32tvs(pld, pld_len, buf, sc_cpufreq_indexes_ath79, sc_tag_cpufreq_ath79_idxmax()+1);
|
||||
const struct sc_u32tvs *tvs;
|
||||
|
||||
if (soc_is_ar71xx() || soc_is_ar724x())
|
||||
tvs = sc_cpufreq_indexes_ath79_7x;
|
||||
else
|
||||
tvs = sc_cpufreq_indexes_ath79_9x;
|
||||
|
||||
return sc_tag_show_u32tvs(pld, pld_len, buf, tvs, sc_tag_cpufreq_ath79_arraysize());
|
||||
}
|
||||
|
||||
static ssize_t sc_tag_store_cpufreq_indexes(const u8 *pld, u16 pld_len, const char *buf, size_t count)
|
||||
{
|
||||
return sc_tag_store_u32tvs(pld, pld_len, buf, count, sc_cpufreq_indexes_ath79, sc_tag_cpufreq_ath79_idxmax()+1);
|
||||
const struct sc_u32tvs *tvs;
|
||||
|
||||
if (soc_is_ar71xx() || soc_is_ar724x())
|
||||
tvs = sc_cpufreq_indexes_ath79_7x;
|
||||
else
|
||||
tvs = sc_cpufreq_indexes_ath79_9x;
|
||||
|
||||
return sc_tag_store_u32tvs(pld, pld_len, buf, count, tvs, sc_tag_cpufreq_ath79_arraysize());
|
||||
}
|
||||
#else
|
||||
/* By default we only show the raw value to help with reverse-engineering */
|
||||
|
||||
@ -194,18 +194,18 @@ ssize_t routerboot_tag_show_string(const u8 *pld, u16 pld_len, char *buf)
|
||||
ssize_t routerboot_tag_show_u32s(const u8 *pld, u16 pld_len, char *buf)
|
||||
{
|
||||
char *out = buf;
|
||||
u32 data; // cpu-endian
|
||||
u32 *data; // cpu-endian
|
||||
|
||||
/* Caller ensures pld_len > 0 */
|
||||
if (pld_len % sizeof(data))
|
||||
if (pld_len % sizeof(*data))
|
||||
return -EINVAL;
|
||||
|
||||
data = *(u32 *)pld;
|
||||
data = (u32 *)pld;
|
||||
|
||||
do {
|
||||
out += sprintf(out, "0x%08x\n", data);
|
||||
out += sprintf(out, "0x%08x\n", *data);
|
||||
data++;
|
||||
} while ((pld_len -= sizeof(data)));
|
||||
} while ((pld_len -= sizeof(*data)));
|
||||
|
||||
return out - buf;
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
depends on NETFILTER_ADVANCED
|
||||
help
|
||||
H.323 is a VoIP signalling protocol from ITU-T. As one of the most
|
||||
@@ -1077,7 +1076,6 @@ config NETFILTER_XT_TARGET_SECMARK
|
||||
@@ -1089,7 +1088,6 @@ config NETFILTER_XT_TARGET_SECMARK
|
||||
|
||||
config NETFILTER_XT_TARGET_TCPMSS
|
||||
tristate '"TCPMSS" target support'
|
||||
|
||||
@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
EXPORT_SYMBOL(default_qdisc_ops);
|
||||
|
||||
/* Main transmission queue. */
|
||||
@@ -1026,7 +1026,7 @@ static void attach_one_default_qdisc(str
|
||||
@@ -1034,7 +1034,7 @@ static void attach_one_default_qdisc(str
|
||||
void *_unused)
|
||||
{
|
||||
struct Qdisc *qdisc;
|
||||
|
||||
@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/sched/sch_generic.c
|
||||
+++ b/net/sched/sch_generic.c
|
||||
@@ -613,207 +613,6 @@ struct Qdisc_ops noqueue_qdisc_ops __rea
|
||||
@@ -621,207 +621,6 @@ struct Qdisc_ops noqueue_qdisc_ops __rea
|
||||
.owner = THIS_MODULE,
|
||||
};
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
*/
|
||||
--- a/include/linux/skbuff.h
|
||||
+++ b/include/linux/skbuff.h
|
||||
@@ -2547,6 +2547,10 @@ static inline int pskb_trim(struct sk_bu
|
||||
@@ -2566,6 +2566,10 @@ static inline int pskb_trim(struct sk_bu
|
||||
return (len < skb->len) ? __pskb_trim(skb, len) : 0;
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
/**
|
||||
* pskb_trim_unique - remove end from a paged unique (not cloned) buffer
|
||||
* @skb: buffer to alter
|
||||
@@ -2678,16 +2682,6 @@ static inline struct sk_buff *dev_alloc_
|
||||
@@ -2697,16 +2701,6 @@ static inline struct sk_buff *dev_alloc_
|
||||
}
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
help
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -3251,10 +3251,20 @@ static int xmit_one(struct sk_buff *skb,
|
||||
@@ -3259,10 +3259,20 @@ static int xmit_one(struct sk_buff *skb,
|
||||
#endif
|
||||
dev_queue_xmit_nit(skb, dev);
|
||||
|
||||
@ -136,7 +136,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
#include <net/protocol.h>
|
||||
#include <net/dst.h>
|
||||
@@ -503,6 +504,22 @@ skb_fail:
|
||||
@@ -555,6 +556,22 @@ skb_fail:
|
||||
}
|
||||
EXPORT_SYMBOL(__napi_alloc_skb);
|
||||
|
||||
|
||||
@ -1132,7 +1132,7 @@
|
||||
/* Interface address info used in eth_type_trans() */
|
||||
unsigned char *dev_addr;
|
||||
|
||||
@@ -3940,6 +3945,19 @@ static inline void netif_tx_unlock_bh(st
|
||||
@@ -3959,6 +3964,19 @@ static inline void netif_tx_unlock_bh(st
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/include/linux/skbuff.h
|
||||
+++ b/include/linux/skbuff.h
|
||||
@@ -2511,7 +2511,7 @@ static inline int pskb_network_may_pull(
|
||||
@@ -2530,7 +2530,7 @@ static inline int pskb_network_may_pull(
|
||||
* NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)
|
||||
*/
|
||||
#ifndef NET_SKB_PAD
|
||||
|
||||
@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
__u16 tc_index; /* traffic control index */
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -5473,6 +5473,9 @@ static enum gro_result dev_gro_receive(s
|
||||
@@ -5471,6 +5471,9 @@ static enum gro_result dev_gro_receive(s
|
||||
int same_flow;
|
||||
int grow;
|
||||
|
||||
@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (netif_elide_gro(skb->dev))
|
||||
goto normal;
|
||||
|
||||
@@ -7131,6 +7134,48 @@ static void __netdev_adjacent_dev_unlink
|
||||
@@ -7129,6 +7132,48 @@ static void __netdev_adjacent_dev_unlink
|
||||
&upper_dev->adj_list.lower);
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
static int __netdev_upper_dev_link(struct net_device *dev,
|
||||
struct net_device *upper_dev, bool master,
|
||||
void *upper_priv, void *upper_info,
|
||||
@@ -7181,6 +7226,7 @@ static int __netdev_upper_dev_link(struc
|
||||
@@ -7179,6 +7224,7 @@ static int __netdev_upper_dev_link(struc
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
|
||||
&changeupper_info.info);
|
||||
ret = notifier_to_errno(ret);
|
||||
@@ -7273,6 +7319,7 @@ void netdev_upper_dev_unlink(struct net_
|
||||
@@ -7271,6 +7317,7 @@ void netdev_upper_dev_unlink(struct net_
|
||||
|
||||
__netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
|
||||
|
||||
@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
|
||||
&changeupper_info.info);
|
||||
|
||||
@@ -7912,6 +7959,7 @@ int dev_set_mac_address(struct net_devic
|
||||
@@ -7910,6 +7957,7 @@ int dev_set_mac_address(struct net_devic
|
||||
if (err)
|
||||
return err;
|
||||
dev->addr_assign_type = NET_ADDR_SET;
|
||||
|
||||
@ -24,7 +24,7 @@ DEFAULT_PACKAGES += \
|
||||
kmod-ata-core kmod-ata-ahci kmod-ata-ahci-platform \
|
||||
kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \
|
||||
kmod-usb3 kmod-usb-dwc3-of-simple kmod-usb-phy-qcom-dwc3 kmod-usb-dwc3-qcom \
|
||||
kmod-ath10k-ct wpad uboot-envtools e2fsprogs autocore-arm \
|
||||
kmod-ath10k-ct wpad uboot-envtools e2fsprogs \
|
||||
automount autosamba v2ray shadowsocks-libev-ss-redir shadowsocksr-libev-server \
|
||||
luci-app-ipsec-vpnd luci-app-unblockmusic luci-app-zerotier ca-certificates
|
||||
|
||||
|
||||
@ -15,10 +15,10 @@
|
||||
#
|
||||
|
||||
PROGNAME=$0
|
||||
REALNAME=$(readlink -f $0)
|
||||
REALNAME=$(readlink -f "$0")
|
||||
|
||||
REALNAME_BASE=$(basename $REALNAME)
|
||||
REALNAME_DIR=$(dirname $REALNAME)
|
||||
REALNAME_BASE=$(basename "$REALNAME")
|
||||
REALNAME_DIR=$(dirname "$REALNAME")
|
||||
|
||||
TARGET_FUNDAMENTAL_ASFLAGS=''
|
||||
TARGET_FUNDAMENTAL_CFLAGS=''
|
||||
@ -30,7 +30,7 @@ TARGET_TOOLCHAIN_TRIPLET=${REALNAME_BASE%-*}
|
||||
BINARY=${PROGNAME##*-}
|
||||
|
||||
# Parse our tool name, splitting it at '-' characters.
|
||||
IFS=- read TOOLCHAIN_ARCH TOOLCHAIN_BUILDROOT TOOLCHAIN_OS TOOLCHAIN_PLATFORM PROGNAME << EOF
|
||||
IFS=- read -r _ _ _ TOOLCHAIN_PLATFORM PROGNAME << EOF
|
||||
$REALNAME_BASE
|
||||
EOF
|
||||
|
||||
@ -71,16 +71,16 @@ esac
|
||||
#
|
||||
case $BINARY in
|
||||
cc|gcc|g++|c++|cpp)
|
||||
exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $GCC_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_CFLAGS $TARGET_ROOTFS_CFLAGS "$@"
|
||||
exec "$TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin" $GCC_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_CFLAGS $TARGET_ROOTFS_CFLAGS "$@"
|
||||
;;
|
||||
ld)
|
||||
exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $LD_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_LDFLAGS "$@"
|
||||
exec "$TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin" $LD_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_LDFLAGS "$@"
|
||||
;;
|
||||
as)
|
||||
exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $TARGET_FUNDAMENTAL_ASFLAGS "$@"
|
||||
exec "$TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin" $TARGET_FUNDAMENTAL_ASFLAGS "$@"
|
||||
;;
|
||||
*)
|
||||
exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin "$@"
|
||||
exec "$TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin" "$@"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
@ -7,23 +7,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gdb
|
||||
|
||||
ifeq ($(CONFIG_arc),y)
|
||||
PKG_VERSION:=arc-2017.09-gdb
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2017.09-gdb
|
||||
PKG_HASH:=7e3c2a763bf500a40c5c4591a7e22c591dafc1f214b1d514895c1096e85c883a
|
||||
GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION)
|
||||
PATCH_DIR:=./patches-arc
|
||||
else
|
||||
PKG_VERSION:=8.3.1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@GNU/gdb
|
||||
PKG_HASH:=1e55b4d7cdca7b34be12f4ceae651623aa73b2fd640152313f9f66a7149757c4
|
||||
GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
endif
|
||||
|
||||
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GDB_DIR)
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
#ifndef FW_INCLUDED
|
||||
#define FW_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#define MAGIC_HEADER "OPEN"
|
||||
@ -30,16 +31,16 @@
|
||||
#define PART_NAME_LENGTH 16
|
||||
|
||||
typedef struct header {
|
||||
char magic[MAGIC_LENGTH];
|
||||
char version[256];
|
||||
uint8_t magic[MAGIC_LENGTH];
|
||||
uint8_t version[256];
|
||||
u_int32_t crc;
|
||||
u_int32_t pad;
|
||||
} __attribute__ ((packed)) header_t;
|
||||
|
||||
typedef struct part {
|
||||
char magic[MAGIC_LENGTH];
|
||||
char name[PART_NAME_LENGTH];
|
||||
char pad[12];
|
||||
uint8_t magic[MAGIC_LENGTH];
|
||||
uint8_t name[PART_NAME_LENGTH];
|
||||
uint8_t pad[12];
|
||||
u_int32_t memaddr;
|
||||
u_int32_t index;
|
||||
u_int32_t baseaddr;
|
||||
@ -54,13 +55,13 @@ typedef struct part_crc {
|
||||
} __attribute__ ((packed)) part_crc_t;
|
||||
|
||||
typedef struct signature {
|
||||
char magic[MAGIC_LENGTH];
|
||||
uint8_t magic[MAGIC_LENGTH];
|
||||
u_int32_t crc;
|
||||
u_int32_t pad;
|
||||
} __attribute__ ((packed)) signature_t;
|
||||
|
||||
typedef struct signature_rsa {
|
||||
char magic[MAGIC_LENGTH];
|
||||
uint8_t magic[MAGIC_LENGTH];
|
||||
// u_int32_t crc;
|
||||
unsigned char rsa_signature[256];
|
||||
u_int32_t pad;
|
||||
|
||||
@ -183,6 +183,7 @@ int main ( int argc, char** argv )
|
||||
char* filebuffer = malloc ( buf.st_size+10 );
|
||||
FILE* fd = fopen ( input,"r" );
|
||||
fread ( filebuffer, 1, buf.st_size,fd );
|
||||
fclose (fd);
|
||||
if (!output)
|
||||
{
|
||||
output = malloc(strlen(input+5));
|
||||
@ -194,10 +195,13 @@ int main ( int argc, char** argv )
|
||||
if (!fd_out)
|
||||
{
|
||||
fprintf(stderr, "Failed to open output file: %s\n", output);
|
||||
free(filebuffer);
|
||||
exit(1);
|
||||
}
|
||||
fwrite ( head,1,sizeof ( ldr_header_t ),fd_out );
|
||||
fwrite ( filebuffer,1,buf.st_size,fd_out );
|
||||
printf("Firmware image %s is ready\n", output);
|
||||
free(filebuffer);
|
||||
fclose(fd_out);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
#include <limits.h>
|
||||
#include <stdbool.h>
|
||||
#include "fw.h"
|
||||
#include "utils.h"
|
||||
|
||||
typedef struct fw_layout_data {
|
||||
u_int32_t kern_start;
|
||||
@ -204,21 +205,20 @@ static void write_header(void* mem, const char *magic, const char* version)
|
||||
header_t* header = mem;
|
||||
memset(header, 0, sizeof(header_t));
|
||||
|
||||
memcpy(header->magic, magic, MAGIC_LENGTH);
|
||||
strncpy(header->version, version, sizeof(header->version));
|
||||
header->crc = htonl(crc32(0L, (unsigned char *)header,
|
||||
sizeof(header_t) - 2 * sizeof(u_int32_t)));
|
||||
FW_MEMCPY_STR(header->magic, magic);
|
||||
FW_MEMCPY_STR(header->version, version);
|
||||
header->crc = htonl(crc32(0L, (uint8_t*) header,
|
||||
sizeof(header_t) - 2 * sizeof(u_int32_t)));
|
||||
header->pad = 0L;
|
||||
}
|
||||
|
||||
|
||||
static void write_signature(void* mem, u_int32_t sig_offset)
|
||||
{
|
||||
/* write signature */
|
||||
signature_t* sign = (signature_t*)(mem + sig_offset);
|
||||
memset(sign, 0, sizeof(signature_t));
|
||||
|
||||
memcpy(sign->magic, MAGIC_END, MAGIC_LENGTH);
|
||||
FW_MEMCPY_STR(sign->magic, MAGIC_END);
|
||||
sign->crc = htonl(crc32(0L,(unsigned char *)mem, sig_offset));
|
||||
sign->pad = 0L;
|
||||
}
|
||||
@ -229,7 +229,7 @@ static void write_signature_rsa(void* mem, u_int32_t sig_offset)
|
||||
signature_rsa_t* sign = (signature_rsa_t*)(mem + sig_offset);
|
||||
memset(sign, 0, sizeof(signature_rsa_t));
|
||||
|
||||
memcpy(sign->magic, MAGIC_ENDS, MAGIC_LENGTH);
|
||||
FW_MEMCPY_STR(sign->magic, MAGIC_ENDS);
|
||||
// sign->crc = htonl(crc32(0L,(unsigned char *)mem, sig_offset));
|
||||
sign->pad = 0L;
|
||||
}
|
||||
@ -259,8 +259,8 @@ static int write_part(void* mem, part_data_t* d)
|
||||
munmap(addr, d->stats.st_size);
|
||||
|
||||
memset(p->name, 0, PART_NAME_LENGTH);
|
||||
memcpy(p->magic, MAGIC_PART, MAGIC_LENGTH);
|
||||
memcpy(p->name, d->partition_name, PART_NAME_LENGTH);
|
||||
FW_MEMCPY_STR(p->magic, MAGIC_PART);
|
||||
FW_MEMCPY_STR(p->name, d->partition_name);
|
||||
|
||||
p->index = htonl(d->partition_index);
|
||||
p->data_size = htonl(d->stats.st_size);
|
||||
|
||||
11
tools/firmware-utils/src/utils.h
Normal file
11
tools/firmware-utils/src/utils.h
Normal file
@ -0,0 +1,11 @@
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
#define FW_MEMCPY_STR(dst, src) \
|
||||
do { \
|
||||
size_t slen = strlen(src); \
|
||||
size_t dlen = sizeof(dst); \
|
||||
memcpy(dst, src, slen > dlen ? dlen : slen); \
|
||||
} while (0);
|
||||
Loading…
Reference in New Issue
Block a user