Merge Official Source

This commit is contained in:
AmadeusGhost 2021-02-24 12:00:10 +08:00
commit 14d19b5644
391 changed files with 7458 additions and 2936 deletions

View File

@ -35,9 +35,11 @@ menu "Target Images"
bool "lzma" bool "lzma"
config TARGET_INITRAMFS_COMPRESSION_LZO config TARGET_INITRAMFS_COMPRESSION_LZO
depends on !TARGET_ROOTFS_INITRAMFS_SEPERATE
bool "lzo" bool "lzo"
config TARGET_INITRAMFS_COMPRESSION_LZ4 config TARGET_INITRAMFS_COMPRESSION_LZ4
depends on !TARGET_ROOTFS_INITRAMFS_SEPERATE
bool "lz4" bool "lz4"
config TARGET_INITRAMFS_COMPRESSION_XZ config TARGET_INITRAMFS_COMPRESSION_XZ
@ -62,6 +64,15 @@ menu "Target Images"
help help
Ignore the initramfs passed by the bootloader. Ignore the initramfs passed by the bootloader.
config TARGET_ROOTFS_INITRAMFS_SEPERATE
bool "seperate ramdisk"
depends on TARGET_ROOTFS_INITRAMFS && !TARGET_INITRAMFS_FORCE
default y if USES_SEPERATE_INITRAMFS
help
Generate seperate initrd.cpio instead of embedding it.
This is useful for generating images with a dedicated
ramdisk e.g. in U-Boot's uImage and uImage.FIT formats.
comment "Root filesystem archives" comment "Root filesystem archives"
config TARGET_ROOTFS_CPIOGZ config TARGET_ROOTFS_CPIOGZ

View File

@ -90,7 +90,7 @@ endef
define gettext_version_target define gettext_version_target
(cd $(PKG_BUILD_DIR) && \ (cd $(PKG_BUILD_DIR) && \
GETTEXT_VERSION=$(shell $(STAGING_DIR_HOSTPKG)/bin/gettext -V | $(STAGING_DIR_HOST)/bin/sed -ne '1s/.*\([0-9]\.[0-9]\{2\}\.[0-9]\).*/\1/p' ) && \ GETTEXT_VERSION=$(shell $(STAGING_DIR_HOSTPKG)/bin/gettext -V | $(STAGING_DIR_HOST)/bin/sed -rne '1s/.*\b([0-9]\.[0-9]+(\.[0-9]+)?)\b.*/\1/p' ) && \
$(STAGING_DIR_HOST)/bin/sed \ $(STAGING_DIR_HOST)/bin/sed \
-i $(PKG_BUILD_DIR)/configure.ac \ -i $(PKG_BUILD_DIR)/configure.ac \
-e "s/AM_GNU_GETTEXT_VERSION(.*)/AM_GNU_GETTEXT_VERSION(\[$$$$GETTEXT_VERSION\])/g" && \ -e "s/AM_GNU_GETTEXT_VERSION(.*)/AM_GNU_GETTEXT_VERSION(\[$$$$GETTEXT_VERSION\])/g" && \

View File

@ -196,15 +196,28 @@ define Build/eva-image
mv $@.new $@ mv $@.new $@
endef endef
define Build/initrd_compression
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),.bzip2) \
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),.gzip) \
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),.lzma) \
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),.xz) \
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),.zstd)
endef
define Build/fit define Build/fit
$(TOPDIR)/scripts/mkits.sh \ $(TOPDIR)/scripts/mkits.sh \
-D $(DEVICE_NAME) -o $@.its -k $@ \ -D $(DEVICE_NAME) -o $@.its -k $@ \
$(if $(word 2,$(1)),-d $(word 2,$(1))) -C $(word 1,$(1)) \ $(if $(word 2,$(1)),-d $(word 2,$(1))) -C $(word 1,$(1)) \
$(if $(findstring with-rootfs,$(word 3,$(1))),-r $(IMAGE_ROOTFS)) \
$(if $(findstring with-initrd,$(word 3,$(1))), \
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPERATE), \
-i $(KERNEL_BUILD_DIR)/initrd.cpio$(strip $(call Build/initrd_compression)))) \
-a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
$(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \ $(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \ -c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \
-A $(LINUX_KARCH) -v $(LINUX_VERSION) -A $(LINUX_KARCH) -v $(LINUX_VERSION)
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage $(if $(findstring external,$(word 3,$(1))),\
-E -B 0x1000 $(if $(findstring static,$(word 3,$(1))),-p 0x1000)) -f $@.its $@.new
@mv $@.new $@ @mv $@.new $@
endef endef
@ -448,6 +461,22 @@ define Build/uImage
mv $@.new $@ mv $@.new $@
endef endef
define Build/uImage-with-ramdisk
mkimage \
-A $(LINUX_KARCH) \
-O linux \
-T kernel \
-C $(word 1,$(1)) \
-a $(KERNEL_LOADADDR) \
-e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
-i $(KERNEL_BUILD_DIR)/initrd.cpio.$(strip $(call Build/initrd_compression)) \
-n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION))' \
$(if $(UIMAGE_MAGIC),-M $(UIMAGE_MAGIC)) \
$(wordlist 2,$(words $(1)),$(1)) \
-d $@ $@.new
mv $@.new $@
endef
define Build/xor-image define Build/xor-image
$(STAGING_DIR_HOST)/bin/xorimage -i $@ -o $@.xor $(1) $(STAGING_DIR_HOST)/bin/xorimage -i $@ -o $@.xor $(1)
mv $@.xor $@ mv $@.xor $@

View File

@ -48,6 +48,13 @@ else
endif endif
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPERATE),y)
define Kernel/SetInitramfs/PreConfigure
grep -v -e CONFIG_BLK_DEV_INITRD $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
echo 'CONFIG_BLK_DEV_INITRD=y' >> $(LINUX_DIR)/.config
echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config
endef
else
ifeq ($(strip $(CONFIG_EXTERNAL_CPIO)),"") ifeq ($(strip $(CONFIG_EXTERNAL_CPIO)),"")
define Kernel/SetInitramfs/PreConfigure define Kernel/SetInitramfs/PreConfigure
grep -v -e INITRAMFS -e CONFIG_RD_ -e CONFIG_BLK_DEV_INITRD $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config grep -v -e INITRAMFS -e CONFIG_RD_ -e CONFIG_BLK_DEV_INITRD $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
@ -60,14 +67,19 @@ ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
echo 'CONFIG_INITRAMFS_SOURCE="$(call qstrip,$(CONFIG_EXTERNAL_CPIO))"' >> $(LINUX_DIR)/.config echo 'CONFIG_INITRAMFS_SOURCE="$(call qstrip,$(CONFIG_EXTERNAL_CPIO))"' >> $(LINUX_DIR)/.config
endef endef
endif endif
endif
define Kernel/SetInitramfs define Kernel/SetInitramfs
rm -f $(LINUX_DIR)/.config.prev rm -f $(LINUX_DIR)/.config.prev
mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
$(call Kernel/SetInitramfs/PreConfigure) $(call Kernel/SetInitramfs/PreConfigure)
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPERATE),y)
echo 'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> $(LINUX_DIR)/.config echo 'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> $(LINUX_DIR)/.config
echo 'CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)' >> $(LINUX_DIR)/.config echo 'CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)' >> $(LINUX_DIR)/.config
echo "$(if $(CONFIG_TARGET_INITRAMFS_FORCE),CONFIG_INITRAMFS_FORCE=y,# CONFIG_INITRAMFS_FORCE is not set)" >> $(LINUX_DIR)/.config echo "$(if $(CONFIG_TARGET_INITRAMFS_FORCE),CONFIG_INITRAMFS_FORCE=y,# CONFIG_INITRAMFS_FORCE is not set)" >> $(LINUX_DIR)/.config
else
echo "# CONFIG_INITRAMFS_FORCE is not set" >> $(LINUX_DIR)/.config
endif
echo "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE),CONFIG_INITRAMFS_COMPRESSION_NONE=y,# CONFIG_INITRAMFS_COMPRESSION_NONE is not set)" >> $(LINUX_DIR)/.config echo "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE),CONFIG_INITRAMFS_COMPRESSION_NONE=y,# CONFIG_INITRAMFS_COMPRESSION_NONE is not set)" >> $(LINUX_DIR)/.config
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),CONFIG_INITRAMFS_COMPRESSION_GZIP=y\nCONFIG_RD_GZIP=y,# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set\n# CONFIG_RD_GZIP is not set)" >> $(LINUX_DIR)/.config echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),CONFIG_INITRAMFS_COMPRESSION_GZIP=y\nCONFIG_RD_GZIP=y,# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set\n# CONFIG_RD_GZIP is not set)" >> $(LINUX_DIR)/.config
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),CONFIG_INITRAMFS_COMPRESSION_BZIP2=y\nCONFIG_RD_BZIP2=y,# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set\n# CONFIG_RD_BZIP2 is not set)" >> $(LINUX_DIR)/.config echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),CONFIG_INITRAMFS_COMPRESSION_BZIP2=y\nCONFIG_RD_BZIP2=y,# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set\n# CONFIG_RD_BZIP2 is not set)" >> $(LINUX_DIR)/.config
@ -147,6 +159,20 @@ define Kernel/CompileImage/Initramfs
$(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(TARGET_DIR)/init $(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(TARGET_DIR)/init
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR)/init) $(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR)/init)
rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio* rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio*
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPERATE),y)
ifeq ($(CONFIG_EXTERNAL_CPIO),y)
$(CP) $(CONFIG_EXTERNAL_CPIO) $(KERNEL_BUILD_DIR)/initrd.cpio
else
( cd $(TARGET_DIR); find . | cpio -o -H newc -R root:root > $(KERNEL_BUILD_DIR)/initrd.cpio )
endif
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),bzip2 -9 -c < $(KERNEL_BUILD_DIR)/initrd.cpio > $(KERNEL_BUILD_DIR)/initrd.cpio.bzip2)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),gzip -f -S .gzip -9n $(KERNEL_BUILD_DIR)/initrd.cpio)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),$(STAGING_DIR_HOST)/bin/lzma e -lc1 -lp2 -pb2 $(KERNEL_BUILD_DIR)/initrd.cpio $(KERNEL_BUILD_DIR)/initrd.cpio.lzma)
# ? $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),$(STAGING_DIR_HOST)/bin/xz -9 -fz --check=crc32 $(KERNEL_BUILD_DIR)/initrd.cpio)
# ? $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),)
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),$(STAGING_DIR_HOST)/bin/zstd -T0 -f -o $(KERNEL_BUILD_DIR)/initrd.cpio.zstd $(KERNEL_BUILD_DIR)/initrd.cpio)
endif
+$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all) +$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all)
$(call Kernel/CopyImage,-initramfs) $(call Kernel/CopyImage,-initramfs)
endef endef

View File

@ -3,13 +3,13 @@
. /lib/functions.sh . /lib/functions.sh
# 'kernel' partition on NAND contains the kernel # 'kernel' partition or UBI volume on NAND contains the kernel
CI_KERNPART="${CI_KERNPART:-kernel}" CI_KERNPART="${CI_KERNPART:-kernel}"
# 'ubi' partition on NAND contains UBI # 'ubi' partition on NAND contains UBI
CI_UBIPART="${CI_UBIPART:-ubi}" CI_UBIPART="${CI_UBIPART:-ubi}"
# 'rootfs' partition on NAND contains the rootfs # 'rootfs' UBI volume on NAND contains the rootfs
CI_ROOTPART="${CI_ROOTPART:-rootfs}" CI_ROOTPART="${CI_ROOTPART:-rootfs}"
ubi_mknod() { ubi_mknod() {
@ -117,9 +117,14 @@ nand_restore_config() {
nand_upgrade_prepare_ubi() { nand_upgrade_prepare_ubi() {
local rootfs_length="$1" local rootfs_length="$1"
local rootfs_type="$2" local rootfs_type="$2"
local has_kernel="${3:-0}" local rootfs_data_max="$(fw_printenv -n rootfs_data_max 2>/dev/null)"
[ -n "$rootfs_data_max" ] && rootfs_data_max=$(($rootfs_data_max))
local kernel_length="$3"
local has_env="${4:-0}" local has_env="${4:-0}"
[ -n "$rootfs_length" -o -n "$kernel_length" ] || return 1
local mtdnum="$( find_mtd_index "$CI_UBIPART" )" local mtdnum="$( find_mtd_index "$CI_UBIPART" )"
if [ ! "$mtdnum" ]; then if [ ! "$mtdnum" ]; then
echo "cannot find ubi mtd partition $CI_UBIPART" echo "cannot find ubi mtd partition $CI_UBIPART"
@ -148,23 +153,24 @@ nand_upgrade_prepare_ubi() {
local root_ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )" local root_ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )"
local data_ubivol="$( nand_find_volume $ubidev rootfs_data )" local data_ubivol="$( nand_find_volume $ubidev rootfs_data )"
# remove ubiblock device of rootfs local ubiblk ubiblkvol
local root_ubiblk="ubiblock${root_ubivol:3}" for ubiblk in /dev/ubiblock*_? ; do
if [ "$root_ubivol" -a -e "/dev/$root_ubiblk" ]; then [ -e "$ubiblk" ] || continue
echo "removing $root_ubiblk" echo "removing ubiblock${ubiblk:13}"
if ! ubiblock -r /dev/$root_ubivol; then ubiblkvol=ubi${ubiblk:13}
echo "cannot remove $root_ubiblk" if ! ubiblock -r /dev/$ubiblkvol; then
return 1; echo "cannot remove $ubiblk"
fi return 1
fi fi
done
# kill volumes # kill volumes
[ "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_KERNPART || true [ "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_KERNPART || true
[ "$root_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_ROOTPART || true [ "$root_ubivol" -a "$root_ubivol" != "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_ROOTPART || true
[ "$data_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs_data || true [ "$data_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs_data || true
# update kernel # update kernel
if [ "$has_kernel" = "1" ]; then if [ -n "$kernel_length" ]; then
if ! ubimkvol /dev/$ubidev -N $CI_KERNPART -s $kernel_length; then if ! ubimkvol /dev/$ubidev -N $CI_KERNPART -s $kernel_length; then
echo "cannot create kernel volume" echo "cannot create kernel volume"
return 1; return 1;
@ -172,20 +178,31 @@ nand_upgrade_prepare_ubi() {
fi fi
# update rootfs # update rootfs
local root_size_param if [ -n "$rootfs_length" ]; then
local rootfs_size_param
if [ "$rootfs_type" = "ubifs" ]; then if [ "$rootfs_type" = "ubifs" ]; then
root_size_param="-m" rootfs_size_param="-m"
else else
root_size_param="-s $rootfs_length" rootfs_size_param="-s $rootfs_length"
fi fi
if ! ubimkvol /dev/$ubidev -N $CI_ROOTPART $root_size_param; then if ! ubimkvol /dev/$ubidev -N $CI_ROOTPART $rootfs_size_param; then
echo "cannot create rootfs volume" echo "cannot create rootfs volume"
return 1; return 1;
fi fi
fi
# create rootfs_data for non-ubifs rootfs # create rootfs_data for non-ubifs rootfs
if [ "$rootfs_type" != "ubifs" ]; then if [ "$rootfs_type" != "ubifs" ]; then
if ! ubimkvol /dev/$ubidev -N rootfs_data -m; then local availeb=$(cat /sys/devices/virtual/ubi/$ubidev/avail_eraseblocks)
local ebsize=$(cat /sys/devices/virtual/ubi/$ubidev/eraseblock_size)
local avail_size=$(( $availeb * $ebsize ))
local rootfs_data_size_param="-m"
if [ -n "$rootfs_data_max" ] &&
[ "$rootfs_data_max" != "0" ] &&
[ "$rootfs_data_max" -le "$avail_size" ]; then
rootfs_data_size_param="-s $rootfs_data_max"
fi
if ! ubimkvol /dev/$ubidev -N rootfs_data $rootfs_data_size_param; then
echo "cannot initialize rootfs_data volume" echo "cannot initialize rootfs_data volume"
return 1 return 1
fi fi
@ -232,7 +249,7 @@ nand_upgrade_ubinized() {
nand_upgrade_ubifs() { nand_upgrade_ubifs() {
local rootfs_length=$( (cat $1 | wc -c) 2> /dev/null) local rootfs_length=$( (cat $1 | wc -c) 2> /dev/null)
nand_upgrade_prepare_ubi "$rootfs_length" "ubifs" "0" "0" nand_upgrade_prepare_ubi "$rootfs_length" "ubifs" "" ""
local ubidev="$( nand_find_ubi "$CI_UBIPART" )" local ubidev="$( nand_find_ubi "$CI_UBIPART" )"
local root_ubivol="$(nand_find_volume $ubidev $CI_ROOTPART)" local root_ubivol="$(nand_find_volume $ubidev $CI_ROOTPART)"
@ -241,39 +258,59 @@ nand_upgrade_ubifs() {
nand_do_upgrade_success nand_do_upgrade_success
} }
nand_upgrade_fit() {
local fit_file="$1"
local fit_length="$(wc -c < "$fit_file")"
nand_upgrade_prepare_ubi "" "" "$fit_length" "1"
local fit_ubidev="$(nand_find_ubi "$CI_UBIPART")"
local fit_ubivol="$(nand_find_volume $fit_ubidev "$CI_KERNPART")"
ubiupdatevol /dev/$fit_ubivol -s $fit_length $fit_file
nand_do_upgrade_success
}
nand_upgrade_tar() { nand_upgrade_tar() {
local tar_file="$1" local tar_file="$1"
local kernel_mtd="$(find_mtd_index $CI_KERNPART)" local kernel_mtd="$(find_mtd_index $CI_KERNPART)"
local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') local board_dir=$(tar tf "$tar_file" | grep -m 1 '^sysupgrade-.*/$')
board_dir=${board_dir%/} board_dir=${board_dir%/}
local kernel_length=$( (tar xf $tar_file ${board_dir}/kernel -O | wc -c) 2> /dev/null) kernel_length=$( (tar xf "$tar_file" ${board_dir}/kernel -O | wc -c) 2> /dev/null)
local rootfs_length=$( (tar xf $tar_file ${board_dir}/root -O | wc -c) 2> /dev/null) local has_rootfs=0
local rootfs_length
local rootfs_type
local rootfs_type="$(identify_tar "$tar_file" ${board_dir}/root)" tar tf "$tar_file" ${board_dir}/root 1>/dev/null 2>/dev/null && has_rootfs=1
[ "$has_rootfs" = "1" ] && {
rootfs_length=$( (tar xf "$tar_file" ${board_dir}/root -O | wc -c) 2> /dev/null)
rootfs_type="$(identify_tar "$tar_file" ${board_dir}/root)"
}
local has_kernel=1 local has_kernel=1
local has_env=0 local has_env=0
[ "$kernel_length" != 0 -a -n "$kernel_mtd" ] && { [ "$kernel_length" != 0 -a -n "$kernel_mtd" ] && {
tar xf $tar_file ${board_dir}/kernel -O | mtd write - $CI_KERNPART tar xf "$tar_file" ${board_dir}/kernel -O | mtd write - $CI_KERNPART
} }
[ "$kernel_length" = 0 -o ! -z "$kernel_mtd" ] && has_kernel=0 [ "$kernel_length" = 0 -o ! -z "$kernel_mtd" ] && has_kernel=
nand_upgrade_prepare_ubi "$rootfs_length" "$rootfs_type" "$has_kernel" "$has_env" nand_upgrade_prepare_ubi "$rootfs_length" "$rootfs_type" "${has_kernel:+$kernel_length}" "$has_env"
local ubidev="$( nand_find_ubi "$CI_UBIPART" )" local ubidev="$( nand_find_ubi "$CI_UBIPART" )"
[ "$has_kernel" = "1" ] && { [ "$has_kernel" = "1" ] && {
local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )" local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )"
tar xf $tar_file ${board_dir}/kernel -O | \ tar xf "$tar_file" ${board_dir}/kernel -O | \
ubiupdatevol /dev/$kern_ubivol -s $kernel_length - ubiupdatevol /dev/$kern_ubivol -s $kernel_length -
} }
[ "$has_rootfs" = "1" ] && {
local root_ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )" local root_ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )"
tar xf $tar_file ${board_dir}/root -O | \ tar xf "$tar_file" ${board_dir}/root -O | \
ubiupdatevol /dev/$root_ubivol -s $rootfs_length - ubiupdatevol /dev/$root_ubivol -s $rootfs_length -
}
nand_do_upgrade_success nand_do_upgrade_success
} }
@ -284,6 +321,7 @@ nand_do_upgrade() {
[ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART="rootfs" [ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART="rootfs"
case "$file_type" in case "$file_type" in
"fit") nand_upgrade_fit $1;;
"ubi") nand_upgrade_ubinized $1;; "ubi") nand_upgrade_ubinized $1;;
"ubifs") nand_upgrade_ubifs $1;; "ubifs") nand_upgrade_ubifs $1;;
*) nand_upgrade_tar $1;; *) nand_upgrade_tar $1;;
@ -309,7 +347,7 @@ nand_do_platform_check() {
local control_length=$( (tar xf $tar_file sysupgrade-$board_name/CONTROL -O | wc -c) 2> /dev/null) local control_length=$( (tar xf $tar_file sysupgrade-$board_name/CONTROL -O | wc -c) 2> /dev/null)
local file_type="$(identify $2)" local file_type="$(identify $2)"
[ "$control_length" = 0 -a "$file_type" != "ubi" -a "$file_type" != "ubifs" ] && { [ "$control_length" = 0 -a "$file_type" != "ubi" -a "$file_type" != "ubifs" -a "$file_type" != "fit" ] && {
echo "Invalid sysupgrade file." echo "Invalid sysupgrade file."
return 1 return 1
} }

View File

@ -1,6 +1,6 @@
# #
# Copyright (C) 2017 Hauke Mehrtens # Copyright (C) 2017 Hauke Mehrtens
# Copyright (C) 2020 Daniel Golle # Copyright (C) 2021 Daniel Golle
# #
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
@ -19,9 +19,22 @@ PKG_MIRROR_HASH:=b211b2f9143d4debc7ad8dc959cb606888af20af790855dd66c87e451b6a1bc
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org> PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE+=proprietary
PKG_LICENSE_FILES:=LICENCE.mediatek
BLOBS_TARBALL:=tfa-mtk-files-for-2020-11-09.tgz
BROMIMAGE_EXEC:=bromimage-x64
include $(INCLUDE_DIR)/trusted-firmware-a.mk include $(INCLUDE_DIR)/trusted-firmware-a.mk
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
define Download/tfa-files
URL:=@OPENWRT
URL_FILE:=$(BLOBS_TARBALL)
FILE:=$(BLOBS_TARBALL)
HASH:=689b097e4531d3eeca0c477675ab3dc3cace6ba4ed8a339116a9ede6537839d7
endef
define Download/mt7622-header-emmc define Download/mt7622-header-emmc
URL:=https://raw.githubusercontent.com/frank-w/BPI-R64-ATF/a36efa5f7435b8079479d13b562fedc0aa0d42f0 URL:=https://raw.githubusercontent.com/frank-w/BPI-R64-ATF/a36efa5f7435b8079479d13b562fedc0aa0d42f0
URL_FILE:=header_emmc.bin URL_FILE:=header_emmc.bin
@ -36,74 +49,112 @@ define Download/mt7622-header-sdmmc
HASH:=242908c04e25289d25ba9fab61a1930425af173051c43d275d1ac9877d6accb1 HASH:=242908c04e25289d25ba9fab61a1930425af173051c43d275d1ac9877d6accb1
endef endef
define Package/arm-trusted-firmware-mt7622/Default define Trusted-Firmware-A/Default
SECTION:=boot BUILD_TARGET:=mediatek
CATEGORY:=Boot Loaders BUILD_SUBTARGET:=mt7622
TITLE:=ARM Trusted Firmware for MT7622 PLAT:=mt7622
DEPENDS:=@TARGET_mediatek_mt7622 @BROKEN TFA_IMAGE:=bl2.img bl31.bin
# wait until bromimage gets replace by static build BOOT_DEVICE:=
# libcrypto.so.1.1: version `OPENSSL_1_1_1' not found (required by tools/mediatek/bromimage/bromimage) DDR_BLOB:=
endef endef
define Package/arm-trusted-firmware-mt7622-nor define Trusted-Firmware-A/mt7622-nor-1ddr
$(call Package/arm-trusted-firmware-mt7622/Default) NAME:=MediaTek MT7622 (SPI-NOR, 1x DDR3)
VARIANT:=nor BOOT_DEVICE:=nor
DDR_BLOB:=1
endef endef
define Package/arm-trusted-firmware-mt7622-snand define Trusted-Firmware-A/mt7622-nor-2ddr
$(call Package/arm-trusted-firmware-mt7622/Default) NAME:=MediaTek MT7622 (SPI-NOR, 2x DDR3)
VARIANT:=snand BOOT_DEVICE:=nor
DDR_BLOB:=2
endef endef
define Package/arm-trusted-firmware-mt7622-emmc define Trusted-Firmware-A/mt7622-snand-1ddr
$(call Package/arm-trusted-firmware-mt7622/Default) NAME:=MediaTek MT7622 (SPI-NAND, 1x DDR3)
VARIANT:=emmc BOOT_DEVICE:=snand
DDR_BLOB:=1
endef endef
define Package/arm-trusted-firmware-mt7622-sdmmc define Trusted-Firmware-A/mt7622-snand-2ddr
$(call Package/arm-trusted-firmware-mt7622/Default) NAME:=MediaTek MT7622 (SPI-SNAND, 2x DDR3)
VARIANT:=sdmmc BOOT_DEVICE:=snand
DDR_BLOB:=2
endef endef
MAKE_VARS = \ define Trusted-Firmware-A/mt7622-emmc-1ddr
CROSS_COMPILE="$(TARGET_CROSS)" NAME:=MediaTek MT7622 (eMMC, 1x DDR3)
BOOT_DEVICE:=emmc
DDR_BLOB:=1
endef
MAKE_FLAGS += \ define Trusted-Firmware-A/mt7622-emmc-2ddr
PLAT=mt7622 \ NAME:=MediaTek MT7622 (eMMC, 2x DDR3)
BOOT_DEVICE=$(BUILD_VARIANT) \ BOOT_DEVICE:=emmc
all DDR_BLOB:=2
endef
define Trusted-Firmware-A/mt7622-sdmmc-1ddr
NAME:=MediaTek MT7622 (SDcard, 1x DDR3)
BOOT_DEVICE:=sdmmc
DDR_BLOB:=1
endef
define Trusted-Firmware-A/mt7622-sdmmc-2ddr
NAME:=MediaTek MT7622 (SDcard, 2x DDR3)
BOOT_DEVICE:=sdmmc
DDR_BLOB:=2
endef
TFA_TARGETS:= \
mt7622-nor-1ddr \
mt7622-nor-2ddr \
mt7622-snand-1ddr \
mt7622-snand-2ddr \
mt7622-emmc-1ddr \
mt7622-emmc-2ddr \
mt7622-sdmmc-1ddr \
mt7622-sdmmc-2ddr
TFA_MAKE_FLAGS += BOOT_DEVICE=$(BOOT_DEVICE) all
define Build/Prepare define Build/Prepare
$(call Build/Prepare/Default) $(call Build/Prepare/Default)
ifeq ($(BUILD_VARIANT),emmc) ifeq ($(BOOT_DEVICE),emmc)
$(eval $(call Download,mt7622-header-emmc)) $(eval $(call Download,mt7622-header-emmc))
endif endif
ifeq ($(BUILD_VARIANT),sdmmc) ifeq ($(BOOT_DEVICE),sdmmc)
$(eval $(call Download,mt7622-header-sdmmc)) $(eval $(call Download,mt7622-header-sdmmc))
endif endif
$(eval $(call Download,tfa-files))
# replace 'bromimage' tool by static version
$(TAR) -vxzf $(DL_DIR)/$(BLOBS_TARBALL) --wildcards \
-O "*/$(BROMIMAGE_EXEC)" > $(PKG_BUILD_DIR)/tools/mediatek/bromimage/bromimage
$(TAR) -vxzf $(DL_DIR)/$(BLOBS_TARBALL) --wildcards \
-C $(PKG_BUILD_DIR) \
--strip-components=1 */LICENCE.mediatek
endef endef
define Build/InstallDev define Build/Configure
$(call Build/Configure/Default)
# replace DRAM calib blobs if needed (variant '2' is shipped upstream)
ifeq ($(DDR_BLOB),1)
$(TAR) -vxzf $(DL_DIR)/$(BLOBS_TARBALL) --wildcards \
-C $(PKG_BUILD_DIR)/plat/mediatek/mt7622/drivers/dram/release \
--strip-components=1 */*.o
endif
endef
define Package/trusted-firmware-a/install
$(INSTALL_DIR) $(STAGING_DIR_IMAGE) $(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/build/mt7622/release/bl2.bin $(STAGING_DIR_IMAGE)/mt7622-bl2-$(BUILD_VARIANT).bin $(INSTALL_DATA) $(PKG_BUILD_DIR)/build/mt7622/release/bl2.img $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-bl2.img
$(CP) $(PKG_BUILD_DIR)/build/mt7622/release/bl2.img $(STAGING_DIR_IMAGE)/mt7622-bl2-$(BUILD_VARIANT).img $(INSTALL_DATA) $(PKG_BUILD_DIR)/build/mt7622/release/bl31.bin $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-bl31.bin
# bl31.bin turns out to be identical for all build variants ifeq ($(BOOT_DEVICE),emmc)
$(CP) $(PKG_BUILD_DIR)/build/mt7622/release/bl31.bin $(STAGING_DIR_IMAGE)/mt7622-bl31.bin $(INSTALL_DATA) $(DL_DIR)/mt7622-header_emmc.bin $(STAGING_DIR_IMAGE)/
ifeq ($(BUILD_VARIANT),emmc)
$(CP) $(DL_DIR)/mt7622-header_emmc.bin $(STAGING_DIR_IMAGE)
endif endif
ifeq ($(BUILD_VARIANT),sdmmc) ifeq ($(BOOT_DEVICE),sdmmc)
$(CP) $(DL_DIR)/mt7622-header_sdmmc.bin $(STAGING_DIR_IMAGE) $(INSTALL_DATA) $(DL_DIR)/mt7622-header_sdmmc.bin $(STAGING_DIR_IMAGE)/
endif endif
endef endef
define Package/arm-trusted-firmware-mt7622-nor/install $(eval $(call BuildPackage/Trusted-Firmware-A))
endef
Package/arm-trusted-firmware-mt7622-snand/install = $(Package/arm-trusted-firmware-mt7622-nor/install)
Package/arm-trusted-firmware-mt7622-emmc/install = $(Package/arm-trusted-firmware-mt7622-nor/install)
Package/arm-trusted-firmware-mt7622-sdmmc/install = $(Package/arm-trusted-firmware-mt7622-nor/install)
$(eval $(call BuildPackage,arm-trusted-firmware-mt7622-nor))
$(eval $(call BuildPackage,arm-trusted-firmware-mt7622-snand))
$(eval $(call BuildPackage,arm-trusted-firmware-mt7622-emmc))
$(eval $(call BuildPackage,arm-trusted-firmware-mt7622-sdmmc))

View File

@ -11,6 +11,8 @@ case "$board" in
d-link,dgs-1210-16|\ d-link,dgs-1210-16|\
d-link,dgs-1210-28|\ d-link,dgs-1210-28|\
d-link,dgs-1210-10p|\ d-link,dgs-1210-10p|\
zyxel,gs1900-8hp-v1|\
zyxel,gs1900-8hp-v2|\
zyxel,gs1900-10hp) zyxel,gs1900-10hp)
idx="$(find_mtd_index u-boot-env)" idx="$(find_mtd_index u-boot-env)"
[ -n "$idx" ] && \ [ -n "$idx" ] && \

View File

@ -218,7 +218,7 @@ $(eval $(call KernelPackage,dax))
define KernelPackage/dm define KernelPackage/dm
SUBMENU:=$(BLOCK_MENU) SUBMENU:=$(BLOCK_MENU)
TITLE:=Device Mapper TITLE:=Device Mapper
DEPENDS:=+kmod-crypto-manager +kmod-dax DEPENDS:=+kmod-crypto-manager +kmod-dax +KERNEL_KEYS:kmod-keys-encrypted
# All the "=n" are unnecessary, they're only there # All the "=n" are unnecessary, they're only there
# to stop the config from asking the question. # to stop the config from asking the question.
# MIRROR is M because I've needed it for pvmove. # MIRROR is M because I've needed it for pvmove.

View File

@ -38,7 +38,9 @@ define KernelPackage/crypto-aead
KCONFIG:= \ KCONFIG:= \
CONFIG_CRYPTO_AEAD \ CONFIG_CRYPTO_AEAD \
CONFIG_CRYPTO_AEAD2 CONFIG_CRYPTO_AEAD2
FILES:=$(LINUX_DIR)/crypto/aead.ko FILES:= \
$(LINUX_DIR)/crypto/aead.ko \
$(LINUX_DIR)/crypto/geniv.ko@ge5.10
AUTOLOAD:=$(call AutoLoad,09,aead,1) AUTOLOAD:=$(call AutoLoad,09,aead,1)
$(call AddDepends/crypto, +kmod-crypto-null) $(call AddDepends/crypto, +kmod-crypto-null)
endef endef
@ -48,8 +50,12 @@ $(eval $(call KernelPackage,crypto-aead))
define KernelPackage/crypto-arc4 define KernelPackage/crypto-arc4
TITLE:=ARC4 cipher CryptoAPI module TITLE:=ARC4 cipher CryptoAPI module
KCONFIG:=CONFIG_CRYPTO_ARC4 KCONFIG:= \
FILES:=$(LINUX_DIR)/crypto/arc4.ko CONFIG_CRYPTO_ARC4 \
CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y
FILES:= \
$(LINUX_DIR)/crypto/arc4.ko \
$(LINUX_DIR)/lib/crypto/libarc4.ko
AUTOLOAD:=$(call AutoLoad,09,arc4) AUTOLOAD:=$(call AutoLoad,09,arc4)
$(call AddDepends/crypto) $(call AddDepends/crypto)
endef endef
@ -492,6 +498,7 @@ define KernelPackage/crypto-misc
TITLE:=Other CryptoAPI modules TITLE:=Other CryptoAPI modules
DEPENDS:=+kmod-crypto-xts DEPENDS:=+kmod-crypto-xts
KCONFIG:= \ KCONFIG:= \
CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y \
CONFIG_CRYPTO_CAMELLIA_X86_64 \ CONFIG_CRYPTO_CAMELLIA_X86_64 \
CONFIG_CRYPTO_BLOWFISH_X86_64 \ CONFIG_CRYPTO_BLOWFISH_X86_64 \
CONFIG_CRYPTO_TWOFISH_X86_64 \ CONFIG_CRYPTO_TWOFISH_X86_64 \

View File

@ -368,7 +368,8 @@ define KernelPackage/fs-nfs-common
FILES:= \ FILES:= \
$(LINUX_DIR)/fs/lockd/lockd.ko \ $(LINUX_DIR)/fs/lockd/lockd.ko \
$(LINUX_DIR)/net/sunrpc/sunrpc.ko \ $(LINUX_DIR)/net/sunrpc/sunrpc.ko \
$(LINUX_DIR)/fs/nfs_common/grace.ko $(LINUX_DIR)/fs/nfs_common/grace.ko \
$(LINUX_DIR)/fs/nfs_common/nfs_ssc.ko@ge5.10
AUTOLOAD:=$(call AutoLoad,30,grace sunrpc lockd) AUTOLOAD:=$(call AutoLoad,30,grace sunrpc lockd)
endef endef

View File

@ -146,8 +146,10 @@ define KernelPackage/mdio-gpio
CONFIG_MDIO_BITBANG \ CONFIG_MDIO_BITBANG \
CONFIG_MDIO_GPIO CONFIG_MDIO_GPIO
FILES:= \ FILES:= \
$(LINUX_DIR)/drivers/net/phy/mdio-gpio.ko \ $(LINUX_DIR)/drivers/net/phy/mdio-gpio.ko@lt5.10 \
$(LINUX_DIR)/drivers/net/phy/mdio-bitbang.ko $(LINUX_DIR)/drivers/net/phy/mdio-bitbang.ko@lt5.10 \
$(LINUX_DIR)/drivers/net/mdio/mdio-gpio.ko@ge5.10 \
$(LINUX_DIR)/drivers/net/mdio/mdio-bitbang.ko@ge5.10
AUTOLOAD:=$(call AutoProbe,mdio-gpio) AUTOLOAD:=$(call AutoProbe,mdio-gpio)
endef endef
@ -990,7 +992,8 @@ define KernelPackage/of-mdio
KCONFIG:=CONFIG_OF_MDIO KCONFIG:=CONFIG_OF_MDIO
FILES:= \ FILES:= \
$(LINUX_DIR)/drivers/net/phy/fixed_phy.ko \ $(LINUX_DIR)/drivers/net/phy/fixed_phy.ko \
$(LINUX_DIR)/drivers/of/of_mdio.ko $(LINUX_DIR)/drivers/of/of_mdio.ko@lt5.10 \
$(LINUX_DIR)/drivers/net/mdio/of_mdio.ko@ge5.10
AUTOLOAD:=$(call AutoLoad,41,of_mdio) AUTOLOAD:=$(call AutoLoad,41,of_mdio)
endef endef
@ -1187,7 +1190,8 @@ define KernelPackage/sfp
CONFIG_MDIO_I2C CONFIG_MDIO_I2C
FILES:= \ FILES:= \
$(LINUX_DIR)/drivers/net/phy/sfp.ko \ $(LINUX_DIR)/drivers/net/phy/sfp.ko \
$(LINUX_DIR)/drivers/net/phy/mdio-i2c.ko $(LINUX_DIR)/drivers/net/phy/mdio-i2c.ko@lt5.10 \
$(LINUX_DIR)/drivers/net/mdio/mdio-i2c.ko@ge5.10
AUTOLOAD:=$(call AutoProbe,mdio-i2c sfp) AUTOLOAD:=$(call AutoProbe,mdio-i2c sfp)
endef endef

View File

@ -1126,7 +1126,9 @@ define KernelPackage/keys-trusted
TITLE:=TPM trusted keys on kernel keyring TITLE:=TPM trusted keys on kernel keyring
DEPENDS:=@KERNEL_KEYS +kmod-crypto-hash +kmod-crypto-hmac +kmod-crypto-sha1 +kmod-tpm DEPENDS:=@KERNEL_KEYS +kmod-crypto-hash +kmod-crypto-hmac +kmod-crypto-sha1 +kmod-tpm
KCONFIG:=CONFIG_TRUSTED_KEYS KCONFIG:=CONFIG_TRUSTED_KEYS
FILES:=$(LINUX_DIR)/security/keys/trusted.ko FILES:= \
$(LINUX_DIR)/security/keys/trusted.ko@lt5.10 \
$(LINUX_DIR)/security/keys/trusted-keys/trusted.ko@ge5.10
AUTOLOAD:=$(call AutoLoad,01,trusted-keys,1) AUTOLOAD:=$(call AutoLoad,01,trusted-keys,1)
endef endef

View File

@ -412,7 +412,7 @@ $(eval $(call KernelPackage,usb2-pci))
define KernelPackage/usb-dwc2 define KernelPackage/usb-dwc2
TITLE:=DWC2 USB controller driver TITLE:=DWC2 USB controller driver
DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget +kmod-usb-roles
KCONFIG:= \ KCONFIG:= \
CONFIG_USB_PCI=y \ CONFIG_USB_PCI=y \
CONFIG_USB_DWC2 \ CONFIG_USB_DWC2 \
@ -1326,7 +1326,7 @@ define KernelPackage/usb-net-rtl8152
KCONFIG:=CONFIG_USB_RTL8152 KCONFIG:=CONFIG_USB_RTL8152
FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/r8152.ko FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/r8152.ko
AUTOLOAD:=$(call AutoProbe,r8152) AUTOLOAD:=$(call AutoProbe,r8152)
$(call AddDepends/usb-net) $(call AddDepends/usb-net, +LINUX_5_10:kmod-crypto-hash)
endef endef
define KernelPackage/usb-net-rtl8152/description define KernelPackage/usb-net-rtl8152/description
@ -1588,21 +1588,20 @@ endef
$(eval $(call KernelPackage,usbip-server)) $(eval $(call KernelPackage,usbip-server))
define KernelPackage/usb-chipidea define KernelPackage/usb-chipidea
TITLE:=Host and device support for Chipidea controllers TITLE:=Host and device support for Chipidea controllers
DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget @TARGET_ath79 +kmod-usb-ehci +kmod-usb-phy-nop DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget @TARGET_ath79 +kmod-usb-ehci +kmod-usb-phy-nop +kmod-usb-roles
KCONFIG:= \ KCONFIG:= \
CONFIG_EXTCON \ CONFIG_EXTCON \
CONFIG_USB_CHIPIDEA \ CONFIG_USB_CHIPIDEA \
CONFIG_USB_CHIPIDEA_GENERIC \
CONFIG_USB_CHIPIDEA_HOST=y \ CONFIG_USB_CHIPIDEA_HOST=y \
CONFIG_USB_CHIPIDEA_UDC=y \ CONFIG_USB_CHIPIDEA_UDC=y \
CONFIG_USB_CHIPIDEA_DEBUG=y CONFIG_USB_CHIPIDEA_DEBUG=y
FILES:= \ FILES:= \
$(LINUX_DIR)/drivers/extcon/extcon-core.ko \ $(LINUX_DIR)/drivers/extcon/extcon-core.ko \
$(LINUX_DIR)/drivers/usb/chipidea/ci_hdrc.ko \ $(LINUX_DIR)/drivers/usb/chipidea/ci_hdrc.ko \
$(LINUX_DIR)/drivers/usb/common/ulpi.ko \ $(LINUX_DIR)/drivers/usb/common/ulpi.ko
$(LINUX_DIR)/drivers/usb/roles/roles.ko
AUTOLOAD:=$(call AutoLoad,39,ci_hdrc,1) AUTOLOAD:=$(call AutoLoad,39,ci_hdrc,1)
$(call AddDepends/usb) $(call AddDepends/usb)
endef endef
@ -1700,6 +1699,21 @@ endef
$(eval $(call KernelPackage,usb-net2280)) $(eval $(call KernelPackage,usb-net2280))
define KernelPackage/usb-roles
TITLE:=USB Role Switch Library Module
KCONFIG:=CONFIG_USB_ROLE_SWITCH
HIDDEN:=1
FILES:=$(LINUX_DIR)/drivers/usb/roles/roles.ko
$(call AddDepends/usb)
endef
define KernelPackage/usb-roles/description
Support for USB Role Switch
endef
$(eval $(call KernelPackage,usb-roles))
define KernelPackage/chaoskey define KernelPackage/chaoskey
SUBMENU:=$(USB_MENU) SUBMENU:=$(USB_MENU)
TITLE:=Chaoskey hardware RNG support TITLE:=Chaoskey hardware RNG support

View File

@ -1,16 +1,16 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=rtl8812au-ct PKG_NAME:=rtl8812au-ct
PKG_RELEASE=2 PKG_RELEASE=1
PKG_LICENSE:=GPLv2 PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:= PKG_LICENSE_FILES:=
PKG_SOURCE_URL:=https://github.com/greearb/rtl8812AU_8821AU_linux.git PKG_SOURCE_URL:=https://github.com/greearb/rtl8812AU_8821AU_linux.git
PKG_MIRROR_HASH:=fa689e034cad9e4683ea784b8f3cb590492ab5c68e8babd492a4e8bf2de3b114 PKG_MIRROR_HASH:=09e33b1cede3f4457d4324fe30ea5fb92b240bcd6e647bbb689fa336f3b07968
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2020-01-12 PKG_SOURCE_DATE:=2020-12-07
PKG_SOURCE_VERSION:=e0d586aa93cb8687dd7dc0e593b6a820df2d6e1d PKG_SOURCE_VERSION:=1e9689c89fa627d2d764ba0e8359fd444fe8458f
PKG_MAINTAINER:=Ben Greear <greearb@candelatech.com> PKG_MAINTAINER:=Ben Greear <greearb@candelatech.com>
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1

View File

@ -1,6 +1,6 @@
--- a/os_dep/linux/ioctl_cfg80211.c --- a/os_dep/linux/ioctl_cfg80211.c
+++ b/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c
@@ -5177,6 +5177,14 @@ exit: @@ -5177,6 +5177,15 @@ exit:
return ret; return ret;
} }
@ -11,19 +11,12 @@
+{ +{
+ +
+} +}
+#else
static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct wireless_dev *wdev,
@@ -5205,6 +5213,7 @@ static void cfg80211_rtw_mgmt_frame_regi
exit:
return;
}
+#endif +#endif
+
#if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) #if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy, static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy,
@@ -6019,7 +6028,10 @@ static struct cfg80211_ops rtw_cfg80211_ struct net_device *ndev,
@@ -5990,7 +5999,10 @@ static struct cfg80211_ops rtw_cfg80211_
.cancel_remain_on_channel = cfg80211_rtw_cancel_remain_on_channel, .cancel_remain_on_channel = cfg80211_rtw_cancel_remain_on_channel,
#endif #endif
@ -33,5 +26,5 @@
+ .update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_registrations, + .update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_registrations,
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
.mgmt_tx = cfg80211_rtw_mgmt_tx, .mgmt_tx = cfg80211_rtw_mgmt_tx,
.mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,34) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,35)) #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,34) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,35))
.action = cfg80211_rtw_mgmt_tx,

View File

@ -297,15 +297,4 @@ config OPENSSL_WITH_ASYNC
initiate crypto operations asynchronously. In order to work initiate crypto operations asynchronously. In order to work
this will require the presence of an async capable engine. this will require the presence of an async capable engine.
config OPENSSL_WITH_GOST
bool
prompt "Prepare library for GOST engine"
depends on OPENSSL_ENGINE
help
This option prepares the library to accept engine support
for Russian GOST crypto algorithms.
The gost engine is not included in standard openwrt feeds.
To build such engine yourself, see:
https://github.com/gost-engine/engine
endif endif

View File

@ -11,7 +11,7 @@ PKG_NAME:=openssl
PKG_BASE:=1.1.1 PKG_BASE:=1.1.1
PKG_BUGFIX:=j PKG_BUGFIX:=j
PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX)
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_USE_MIPS16:=0 PKG_USE_MIPS16:=0
ENGINES_DIR=engines-1.1 ENGINES_DIR=engines-1.1
@ -54,7 +54,6 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_OPENSSL_WITH_DTLS \ CONFIG_OPENSSL_WITH_DTLS \
CONFIG_OPENSSL_WITH_EC2M \ CONFIG_OPENSSL_WITH_EC2M \
CONFIG_OPENSSL_WITH_ERROR_MESSAGES \ CONFIG_OPENSSL_WITH_ERROR_MESSAGES \
CONFIG_OPENSSL_WITH_GOST \
CONFIG_OPENSSL_WITH_IDEA \ CONFIG_OPENSSL_WITH_IDEA \
CONFIG_OPENSSL_WITH_MDC2 \ CONFIG_OPENSSL_WITH_MDC2 \
CONFIG_OPENSSL_WITH_NPN \ CONFIG_OPENSSL_WITH_NPN \
@ -291,10 +290,6 @@ else
OPENSSL_OPTIONS += no-engine OPENSSL_OPTIONS += no-engine
endif endif
ifndef CONFIG_OPENSSL_WITH_GOST
OPENSSL_OPTIONS += no-gost
endif
ifndef CONFIG_OPENSSL_WITH_DTLS ifndef CONFIG_OPENSSL_WITH_DTLS
OPENSSL_OPTIONS += no-dtls OPENSSL_OPTIONS += no-dtls
endif endif

View File

@ -1,6 +1,6 @@
--- a/apps/openssl.cnf --- a/apps/openssl.cnf
+++ b/apps/openssl.cnf +++ b/apps/openssl.cnf
@@ -22,6 +22,82 @@ oid_section = new_oids @@ -22,6 +22,99 @@ oid_section = new_oids
# (Alternatively, use a configuration file that has only # (Alternatively, use a configuration file that has only
# X.509v3 extensions in its main [= default] section.) # X.509v3 extensions in its main [= default] section.)
@ -14,6 +14,7 @@
+#devcrypto=devcrypto +#devcrypto=devcrypto
+#afalg=afalg +#afalg=afalg
+#padlock=padlock +#padlock=padlock
+##gost=gost
+ +
+[afalg] +[afalg]
+# Leave this alone and configure algorithms with CIPERS/DIGESTS below +# Leave this alone and configure algorithms with CIPERS/DIGESTS below
@ -79,6 +80,22 @@
+ +
+[padlock] +[padlock]
+default_algorithms = ALL +default_algorithms = ALL
+
+[gost]
+default_algorithms = ALL
+# CRYPT_PARAMS: OID of default GOST 28147-89 parameters It allows the
+# user to choose between different parameter sets of symmetric cipher
+# algorithm. RFC 4357 specifies several parameters for the
+# GOST 28147-89 algorithm, but OpenSSL doesn't provide user interface
+# to choose one when encrypting. So use engine configuration parameter
+# instead.
+# Value of this parameter can be either short name, defined in OpenSSL
+# obj_dat.h header file or numeric representation of OID, defined in
+# RFC 4357. Defaults to id-tc26-gost-28147-param-Z
+#CRYPT_PARAMS = id-tc26-gost-28147-param-Z
+
+# PBE_PARAMS: Shortname of default digest alg for PBE
+#PBE_PARAMS =
+ +
[ new_oids ] [ new_oids ]

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=pcre PKG_NAME:=pcre
PKG_VERSION:=8.44 PKG_VERSION:=8.44
PKG_RELEASE:=3 PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/$(PKG_NAME) PKG_SOURCE_URL:=@SF/$(PKG_NAME)
@ -24,10 +24,8 @@ PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1
PKG_CONFIG_DEPENDS:=\ PKG_CONFIG_DEPENDS:=\
CONFIG_PACKAGE_libpcrecpp \
CONFIG_PCRE_JIT_ENABLED CONFIG_PCRE_JIT_ENABLED
include $(INCLUDE_DIR)/uclibc++.mk
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/host-build.mk
@ -56,19 +54,12 @@ define Package/libpcre32
TITLE:=A Perl Compatible Regular Expression library (32bit support) TITLE:=A Perl Compatible Regular Expression library (32bit support)
endef endef
define Package/libpcrecpp
$(call Package/libpcre/default)
TITLE:=C++ wrapper for Perl Compatible Regular Expression library
DEPENDS:=+libpcre $(CXX_DEPENDS)
endef
HOST_CONFIGURE_ARGS += \ HOST_CONFIGURE_ARGS += \
--enable-utf8 \ --enable-utf8 \
--enable-unicode-properties \ --enable-unicode-properties \
--enable-pcre16 \ --enable-pcre16 \
--with-match-limit-recursion=16000 \ --with-match-limit-recursion=16000 \
--enable-cpp --disable-cpp
TARGET_CFLAGS += $(FPIC) TARGET_CFLAGS += $(FPIC)
@ -79,7 +70,7 @@ CONFIGURE_ARGS += \
--enable-pcre32 \ --enable-pcre32 \
$(if $(CONFIG_PCRE_JIT_ENABLED),--enable-jit,--disable-jit) \ $(if $(CONFIG_PCRE_JIT_ENABLED),--enable-jit,--disable-jit) \
--with-match-limit-recursion=16000 \ --with-match-limit-recursion=16000 \
$(if $(CONFIG_PACKAGE_libpcrecpp),--enable,--disable)-cpp -disable-cpp
MAKE_FLAGS += \ MAKE_FLAGS += \
CFLAGS="$(TARGET_CFLAGS)" CFLAGS="$(TARGET_CFLAGS)"
@ -118,13 +109,7 @@ define Package/libpcre32/install
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre32.so* $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre32.so* $(1)/usr/lib/
endef endef
define Package/libpcrecpp/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcrecpp.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libpcre)) $(eval $(call BuildPackage,libpcre))
$(eval $(call BuildPackage,libpcre16)) $(eval $(call BuildPackage,libpcre16))
$(eval $(call BuildPackage,libpcre32)) $(eval $(call BuildPackage,libpcre32))
$(eval $(call BuildPackage,libpcrecpp))
$(eval $(call HostBuild)) $(eval $(call HostBuild))

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=wolfssl PKG_NAME:=wolfssl
PKG_VERSION:=4.6.0-stable PKG_VERSION:=4.7.0-stable
PKG_RELEASE:=2 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION)
PKG_HASH:=053aefbb02d0b06b27c5e2df6875b4b587318755b7db9d6aa8d72206b310a848 PKG_HASH:=b0e740b31d4d877d540ad50cc539a8873fc41af02bd3091c4357b403f7106e31
PKG_FIXUP:=libtool libtool-abiver PKG_FIXUP:=libtool libtool-abiver
PKG_INSTALL:=1 PKG_INSTALL:=1

View File

@ -1,53 +0,0 @@
From fad1e67677bf7797b6bd6e1f21a513c289d963a7 Mon Sep 17 00:00:00 2001
From: Sean Parkinson <sean@wolfssl.com>
Date: Thu, 21 Jan 2021 08:24:38 +1000
Subject: [PATCH] TLS 1.3: ensure key for signature in CertificateVerify
---
src/tls13.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
--- a/src/tls13.c
+++ b/src/tls13.c
@@ -5624,28 +5624,36 @@ static int DoTls13CertificateVerify(WOLF
#ifdef HAVE_ED25519
if (args->sigAlgo == ed25519_sa_algo &&
!ssl->peerEd25519KeyPresent) {
- WOLFSSL_MSG("Oops, peer sent ED25519 key but not in verify");
+ WOLFSSL_MSG("Peer sent ED22519 sig but not ED22519 cert");
+ ret = SIG_VERIFY_E;
+ goto exit_dcv;
}
#endif
#ifdef HAVE_ED448
if (args->sigAlgo == ed448_sa_algo && !ssl->peerEd448KeyPresent) {
- WOLFSSL_MSG("Oops, peer sent ED448 key but not in verify");
+ WOLFSSL_MSG("Peer sent ED448 sig but not ED448 cert");
+ ret = SIG_VERIFY_E;
+ goto exit_dcv;
}
#endif
#ifdef HAVE_ECC
if (args->sigAlgo == ecc_dsa_sa_algo &&
!ssl->peerEccDsaKeyPresent) {
- WOLFSSL_MSG("Oops, peer sent ECC key but not in verify");
+ WOLFSSL_MSG("Peer sent ECC sig but not ECC cert");
+ ret = SIG_VERIFY_E;
+ goto exit_dcv;
}
#endif
#ifndef NO_RSA
if (args->sigAlgo == rsa_sa_algo) {
- WOLFSSL_MSG("Oops, peer sent PKCS#1.5 signature");
+ WOLFSSL_MSG("Peer sent PKCS#1.5 algo but not in certificate");
ERROR_OUT(INVALID_PARAMETER, exit_dcv);
}
if (args->sigAlgo == rsa_pss_sa_algo &&
(ssl->peerRsaKey == NULL || !ssl->peerRsaKeyPresent)) {
- WOLFSSL_MSG("Oops, peer sent RSA key but not in verify");
+ WOLFSSL_MSG("Peer sent RSA sig but not RSA cert");
+ ret = SIG_VERIFY_E;
+ goto exit_dcv;
}
#endif

View File

@ -1,6 +1,6 @@
--- a/wolfssl/wolfcrypt/settings.h --- a/wolfssl/wolfcrypt/settings.h
+++ b/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h
@@ -2248,7 +2248,7 @@ extern void uITRON4_free(void *p) ; @@ -2255,7 +2255,7 @@ extern void uITRON4_free(void *p) ;
#endif #endif
/* warning for not using harden build options (default with ./configure) */ /* warning for not using harden build options (default with ./configure) */

View File

@ -1,25 +0,0 @@
From 391ecbd647c121300dc7dcf209e412ccb7b8d432 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Fri, 1 Jan 2021 21:57:56 +0100
Subject: [PATCH] Fix linking against hostapd with LTO
When running LTO on wolfssl the ecc_map() function is removed from the
binary by GCC 8.4.0. This function is used by multiple functions from
the crypto_wolfssl.c implementation of hostapd master.
Fixes: 780e8a4619b6 ("Fixes for building `--enable-wpas=small` with WPA Supplicant v2.7.")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
--- a/configure.ac
+++ b/configure.ac
@@ -947,6 +947,7 @@ then
AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA_X509_SMALL"
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PUBLIC_MP"
+ AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PUBLIC_ECC_ADD_DBL"
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DER_LOAD"
AM_CFLAGS="$AM_CFLAGS -DATOMIC_USER"
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"

View File

@ -1,10 +0,0 @@
--- a/configure.ac
+++ b/configure.ac
@@ -943,6 +943,7 @@ then
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_KEEP_SNI"
AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA"
AM_CFLAGS="$AM_CFLAGS -DHAVE_EXT_CACHE"
+ AM_CFLAGS="$AM_CFLAGS -DHAVE_SECRET_CALLBACK"
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_EITHER_SIDE"
AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA_X509_SMALL"

View File

@ -13,14 +13,14 @@ PKG_RELEASE:=6
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/paulusmack/ppp PKG_SOURCE_URL:=https://github.com/paulusmack/ppp
PKG_SOURCE_DATE:=2020-10-03 PKG_SOURCE_DATE:=2021-01-04
PKG_SOURCE_VERSION:=ad3937a0a38a696eb1a37dbf8f92e8e6072cdccb PKG_SOURCE_VERSION:=4fb319056f168bb8379865b91b4fd3e1ada73f1e
PKG_MIRROR_HASH:=c5b39615eb62728431b19f3ae5428eb1e2fc705b4b7b960228fe5b5d7b5a4bca PKG_MIRROR_HASH:=429cb5fcff36e1d8698766130711d4764347f08b83233dfb4831bea21616efef
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name> PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=BSD-4-Clause PKG_LICENSE:=BSD-4-Clause
PKG_CPE_ID:=cpe:/a:samba:ppp PKG_CPE_ID:=cpe:/a:samba:ppp
PKG_RELEASE_VERSION:=2.4.8 PKG_RELEASE_VERSION:=2.4.9
PKG_VERSION:=$(PKG_RELEASE_VERSION).git-$(PKG_SOURCE_DATE) PKG_VERSION:=$(PKG_RELEASE_VERSION).git-$(PKG_SOURCE_DATE)
PKG_BUILD_DEPENDS:=libpcap PKG_BUILD_DEPENDS:=libpcap
@ -242,7 +242,7 @@ endef
define Package/ppp-mod-pppoe/install define Package/ppp-mod-pppoe/install
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION) $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/rp-pppoe.so \ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/pppoe.so \
$(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)/ $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)/
endef endef

View File

@ -241,7 +241,7 @@ proto_pppoe_setup() {
ppp_generic_setup "$config" \ ppp_generic_setup "$config" \
$syncppp_option \ $syncppp_option \
plugin rp-pppoe.so \ plugin pppoe.so \
${ac:+rp_pppoe_ac "$ac"} \ ${ac:+rp_pppoe_ac "$ac"} \
${service:+rp_pppoe_service "$service"} \ ${service:+rp_pppoe_service "$service"} \
${host_uniq:+host-uniq "$host_uniq"} \ ${host_uniq:+host-uniq "$host_uniq"} \
@ -338,7 +338,7 @@ proto_pptp_teardown() {
[ -n "$INCLUDE_ONLY" ] || { [ -n "$INCLUDE_ONLY" ] || {
add_protocol ppp add_protocol ppp
[ -f /usr/lib/pppd/*/rp-pppoe.so ] && add_protocol pppoe [ -f /usr/lib/pppd/*/pppoe.so ] && add_protocol pppoe
[ -f /usr/lib/pppd/*/pppoatm.so ] && add_protocol pppoa [ -f /usr/lib/pppd/*/pppoatm.so ] && add_protocol pppoa
[ -f /usr/lib/pppd/*/pptp.so ] && add_protocol pptp [ -f /usr/lib/pppd/*/pptp.so ] && add_protocol pptp
} }

View File

@ -9,16 +9,16 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/configure --- a/configure
+++ b/configure +++ b/configure
@@ -8,9 +8,9 @@ SYSCONF=/etc @@ -10,9 +10,9 @@ CROSS_COMPILE=
# if [ -d /NextApps ]; then CC=cc
# system="NeXTStep" CFLAGS=
# else
-system=`uname -s` -system=`uname -s`
-release=`uname -r` -release=`uname -r`
-arch=`uname -m` -arch=`uname -m`
+system=${UNAME_S:-`uname -s`} +system=${UNAME_S:-`uname -s`}
+release=${UNAME_R:-`uname -r`} +release=${UNAME_R:-`uname -r`}
+arch=${UNAME_M:-`uname -m`} +arch=${UNAME_M:-`uname -m`}
# fi
state="unknown" state="unknown"
case $system in

View File

@ -1,96 +0,0 @@
pppd: Allow specifying ip-up and ip-down scripts
This patch implements the "ip-up-script" and "ip-down-script" options which
allow to specify the path of the ip-up and ip-down scripts to call.
These options default to _PATH_IPUP and _PATH_IPDOWN to retain the
existing behaviour.
The patch originated from the Debian project.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/ipcp.c
+++ b/pppd/ipcp.c
@@ -1957,7 +1957,7 @@ ipcp_up(f)
*/
if (ipcp_script_state == s_down && ipcp_script_pid == 0) {
ipcp_script_state = s_up;
- ipcp_script(_PATH_IPUP, 0);
+ ipcp_script(path_ipup, 0);
}
}
@@ -2007,7 +2007,7 @@ ipcp_down(f)
/* Execute the ip-down script */
if (ipcp_script_state == s_up && ipcp_script_pid == 0) {
ipcp_script_state = s_down;
- ipcp_script(_PATH_IPDOWN, 0);
+ ipcp_script(path_ipdown, 0);
}
}
@@ -2061,13 +2061,13 @@ ipcp_script_done(arg)
case s_up:
if (ipcp_fsm[0].state != OPENED) {
ipcp_script_state = s_down;
- ipcp_script(_PATH_IPDOWN, 0);
+ ipcp_script(path_ipdown, 0);
}
break;
case s_down:
if (ipcp_fsm[0].state == OPENED) {
ipcp_script_state = s_up;
- ipcp_script(_PATH_IPUP, 0);
+ ipcp_script(path_ipup, 0);
}
break;
}
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -306,6 +306,9 @@ main(argc, argv)
struct protent *protp;
char numbuf[16];
+ strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup));
+ strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown));
+
link_stats_valid = 0;
new_phase(PHASE_INITIALIZE);
--- a/pppd/options.c
+++ b/pppd/options.c
@@ -117,6 +117,8 @@ bool tune_kernel; /* may alter kernel s
int connect_delay = 1000; /* wait this many ms after connect script */
int req_unit = -1; /* requested interface unit */
char req_ifname[MAXIFNAMELEN]; /* requested interface name */
+char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
+char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
bool multilink = 0; /* Enable multilink operation */
char *bundle_name = NULL; /* bundle name for multilink */
bool dump_options; /* print out option values */
@@ -316,6 +318,13 @@ option_t general_options[] = {
"Metric to use for the default route (Linux only; -1 for default behavior)",
OPT_PRIV|OPT_LLIMIT|OPT_INITONLY, NULL, 0, -1 },
+ { "ip-up-script", o_string, path_ipup,
+ "Set pathname of ip-up script",
+ OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
+ { "ip-down-script", o_string, path_ipdown,
+ "Set pathname of ip-down script",
+ OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
+
#ifdef HAVE_MULTILINK
{ "multilink", o_bool, &multilink,
"Enable multilink operation", OPT_PRIO | 1 },
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -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 */
+extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
+extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
extern bool multilink; /* enable multilink operation */
extern bool noendpoint; /* don't send or accept endpt. discrim. */
extern char *bundle_name; /* bundle name for multilink */

View File

@ -1,28 +0,0 @@
pppd: Close already open ppp descriptors
When using the kernel PPPoE driver in conjunction with the "persist" option,
the already open descriptor to /dev/ppp is not closed when the link is
reestablished. This eventually leads to high CPU load because the stray
descriptors are always reported as ready by select().
This patch closes the descriptor if it is already open when establishing a
new connection. It originated from the Debian project.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -467,6 +467,13 @@ int generic_establish_ppp (int fd)
if (new_style_driver) {
int flags;
+ /* if a ppp_fd is already open, close it first */
+ if(ppp_fd > 0) {
+ close(ppp_fd);
+ remove_fd(ppp_fd);
+ ppp_fd = -1;
+ }
+
/* Open an instance of /dev/ppp and connect the channel to it */
if (ioctl(fd, PPPIOCGCHAN, &chindex) == -1) {
error("Couldn't get channel number: %m");

View File

@ -1,23 +0,0 @@
pppd: Fix creation of linkpidfile
When pppd is run without "nodetach" or with "updetach", the linkpidfile is
never created. The call to create_linkpidfile() is protected by a check for
linkpidfile[0] but this is only filled in when create_linkpidfile() is called.
This patch changes to code to allways uncondiationally call
create_linkpidfile(), it originated from the Debian project.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -780,8 +780,7 @@ detach()
/* update pid files if they have been written already */
if (pidfilename[0])
create_pidfile(pid);
- if (linkpidfile[0])
- create_linkpidfile(pid);
+ create_linkpidfile(pid);
exit(0); /* parent dies */
}
setsid();

View File

@ -18,7 +18,7 @@
#ifdef PPP_FILTER #ifdef PPP_FILTER
#include <pcap-bpf.h> #include <pcap-bpf.h>
#endif #endif
@@ -220,6 +224,14 @@ loop_chars(p, n) @@ -218,6 +222,14 @@ loop_chars(unsigned char *p, int n)
int c, rv; int c, rv;
rv = 0; rv = 0;
@ -33,14 +33,12 @@
for (; n > 0; --n) { for (; n > 0; --n) {
c = *p++; c = *p++;
if (c == PPP_FLAG) { if (c == PPP_FLAG) {
@@ -298,17 +310,102 @@ loop_frame(frame, len) @@ -294,16 +306,100 @@ loop_frame(unsigned char *frame, int len
* loopback, now that the real serial link is up. * loopback, now that the real serial link is up.
*/ */
void void
-demand_rexmit(proto) -demand_rexmit(int proto)
+demand_rexmit(proto, newip) +demand_rexmit(int proto, u_int32_t newip)
int proto;
+ u_int32_t newip;
{ {
struct packet *pkt, *prev, *nextpkt; struct packet *pkt, *prev, *nextpkt;
+ unsigned short checksum; + unsigned short checksum;
@ -139,7 +137,7 @@
} else { } else {
--- a/pppd/ipcp.c --- a/pppd/ipcp.c
+++ b/pppd/ipcp.c +++ b/pppd/ipcp.c
@@ -1882,7 +1882,7 @@ ipcp_up(f) @@ -1850,7 +1850,7 @@ ipcp_up(fsm *f)
proxy_arp_set[f->unit] = 1; proxy_arp_set[f->unit] = 1;
} }
@ -150,7 +148,7 @@
} else { } else {
--- a/pppd/ipv6cp.c --- a/pppd/ipv6cp.c
+++ b/pppd/ipv6cp.c +++ b/pppd/ipv6cp.c
@@ -1258,7 +1258,7 @@ ipv6cp_up(f) @@ -1253,7 +1253,7 @@ ipv6cp_up(fsm *f)
if (sif6defaultroute(f->unit, go->ourid, ho->hisid)) if (sif6defaultroute(f->unit, go->ourid, ho->hisid))
default_route_set[f->unit] = 1; default_route_set[f->unit] = 1;
} }
@ -161,12 +159,12 @@
} else { } else {
--- a/pppd/pppd.h --- a/pppd/pppd.h
+++ b/pppd/pppd.h +++ b/pppd/pppd.h
@@ -602,7 +602,7 @@ void demand_conf __P((void)); /* config @@ -598,7 +598,7 @@ void demand_conf(void); /* config interf
void demand_block __P((void)); /* set all NPs to queue up packets */ void demand_block(void); /* set all NPs to queue up packets */
void demand_unblock __P((void)); /* set all NPs to pass packets */ void demand_unblock(void); /* set all NPs to pass packets */
void demand_discard __P((void)); /* set all NPs to discard packets */ void demand_discard(void); /* set all NPs to discard packets */
-void demand_rexmit __P((int)); /* retransmit saved frames for an NP */ -void demand_rexmit(int); /* retransmit saved frames for an NP */
+void demand_rexmit __P((int, u_int32_t)); /* retransmit saved frames for an NP*/ +void demand_rexmit(int, u_int32_t); /* retransmit saved frames for an NP*/
int loop_chars __P((unsigned char *, int)); /* process chars from loopback */ int loop_chars(unsigned char *, int); /* process chars from loopback */
int loop_frame __P((unsigned char *, int)); /* should we bring link up? */ int loop_frame(unsigned char *, int); /* should we bring link up? */

View File

@ -1,47 +0,0 @@
pppd: Implement option to strip domain part from MS CHAP response
This patch implements a new boolean option "chapms-strip-domain" which
strips the leading domain part of the username in a received MS Chap
response.
When the option is set, all leading chars up to and including the last
backslash in the username are stripped. The option defaults to false.
The patch originated from the Debian project.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/chap-new.c
+++ b/pppd/chap-new.c
@@ -58,6 +58,7 @@ int (*chap_verify_hook)(char *name, char
int chap_timeout_time = 3;
int chap_max_transmits = 10;
int chap_rechallenge_time = 0;
+int chapms_strip_domain = 0;
/*
* Command-line options.
@@ -69,6 +70,8 @@ static option_t chap_option_list[] = {
"Set max #xmits for challenge", OPT_PRIO },
{ "chap-interval", o_int, &chap_rechallenge_time,
"Set interval for rechallenge", OPT_PRIO },
+ { "chapms-strip-domain", o_bool, &chapms_strip_domain,
+ "Strip the domain prefix before the Username", 1 },
{ NULL }
};
@@ -336,6 +339,14 @@ chap_handle_response(struct chap_server_
/* Null terminate and clean remote name. */
slprintf(rname, sizeof(rname), "%.*v", len, name);
name = rname;
+
+ /* strip the MS domain name */
+ if (chapms_strip_domain && strrchr(rname, '\\')) {
+ char tmp[MAXNAMELEN+1];
+
+ strcpy(tmp, strrchr(rname, '\\') + 1);
+ strcpy(rname, tmp);
+ }
}
if (chap_verify_hook)

View File

@ -1,25 +0,0 @@
pppoatm: Allow wildcard ATM devices
When operating pppd's pppoatm plugin with an USB ADSL modem, e.g. an
Alcatel Speedtouch, the ATM device number might change when the modem is
reconnected to the USB port or when the host controller resets the USB
device.
This patch allows to specify the ATM device as wildcard which gives
enough flexibility to cope with changing device names.
The patch originated from the Debain project.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/plugins/pppoatm/pppoatm.c
+++ b/pppd/plugins/pppoatm/pppoatm.c
@@ -75,7 +75,7 @@ static int setdevname_pppoatm(const char
//info("PPPoATM setdevname_pppoatm: '%s'", cp);
memset(&addr, 0, sizeof addr);
if (text2atm(cp, (struct sockaddr *) &addr, sizeof(addr),
- T2A_PVC | T2A_NAME) < 0) {
+ T2A_PVC | T2A_NAME | T2A_WILDCARD) < 0) {
if(doit)
info("atm does not recognize: %s", cp);
return 0;

View File

@ -1,314 +0,0 @@
pppd: Add "replacedefaultroute" and "noreplacedefaultroute" options
This patch implements two new options, "replacedefaultroute" to replace any
existing system default route when specified and "noreplacedefaultroute" to
disable the "replacedefaultroute" option, which is useful in multi user
environments where the administrator wants to allow users to dial pppd
connections but not allow them to change the system default route.
The patch originated from the Debian project.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/ipcp.c
+++ b/pppd/ipcp.c
@@ -197,6 +197,14 @@ static option_t ipcp_option_list[] = {
"disable defaultroute option", OPT_ALIAS | OPT_A2CLR,
&ipcp_wantoptions[0].default_route },
+ { "replacedefaultroute", o_bool,
+ &ipcp_wantoptions[0].replace_default_route,
+ "Replace default route", 1
+ },
+ { "noreplacedefaultroute", o_bool,
+ &ipcp_allowoptions[0].replace_default_route,
+ "Never replace default route", OPT_A2COPY,
+ &ipcp_wantoptions[0].replace_default_route },
{ "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp,
"Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp },
{ "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp,
@@ -270,7 +278,7 @@ struct protent ipcp_protent = {
ip_active_pkt
};
-static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t));
+static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t, bool));
static void ipcp_script __P((char *, int)); /* Run an up/down script */
static void ipcp_script_done __P((void *));
@@ -1760,7 +1768,8 @@ ip_demand_conf(u)
if (!sifnpmode(u, PPP_IP, NPMODE_QUEUE))
return 0;
if (wo->default_route)
- if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr))
+ if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr,
+ wo->replace_default_route))
default_route_set[u] = 1;
if (wo->proxy_arp)
if (sifproxyarp(u, wo->hisaddr))
@@ -1848,7 +1857,8 @@ ipcp_up(f)
*/
if (demand) {
if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) {
- ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr);
+ ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr,
+ wo->replace_default_route);
if (go->ouraddr != wo->ouraddr) {
warn("Local IP address changed to %I", go->ouraddr);
script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0);
@@ -1873,7 +1883,8 @@ ipcp_up(f)
/* assign a default route through the interface if required */
if (ipcp_wantoptions[f->unit].default_route)
- if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
+ wo->replace_default_route))
default_route_set[f->unit] = 1;
/* Make a proxy ARP entry if requested. */
@@ -1923,7 +1934,8 @@ ipcp_up(f)
/* assign a default route through the interface if required */
if (ipcp_wantoptions[f->unit].default_route)
- if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
+ wo->replace_default_route))
default_route_set[f->unit] = 1;
/* Make a proxy ARP entry if requested. */
@@ -2001,7 +2013,7 @@ ipcp_down(f)
sifnpmode(f->unit, PPP_IP, NPMODE_DROP);
sifdown(f->unit);
ipcp_clear_addrs(f->unit, ipcp_gotoptions[f->unit].ouraddr,
- ipcp_hisoptions[f->unit].hisaddr);
+ ipcp_hisoptions[f->unit].hisaddr, 0);
}
/* Execute the ip-down script */
@@ -2017,16 +2029,25 @@ ipcp_down(f)
* proxy arp entries, etc.
*/
static void
-ipcp_clear_addrs(unit, ouraddr, hisaddr)
+ipcp_clear_addrs(unit, ouraddr, hisaddr, replacedefaultroute)
int unit;
u_int32_t ouraddr; /* local address */
u_int32_t hisaddr; /* remote address */
+ bool replacedefaultroute;
{
if (proxy_arp_set[unit]) {
cifproxyarp(unit, hisaddr);
proxy_arp_set[unit] = 0;
}
- if (default_route_set[unit]) {
+ /* If replacedefaultroute, sifdefaultroute will be called soon
+ * with replacedefaultroute set and that will overwrite the current
+ * default route. This is the case only when doing demand, otherwise
+ * during demand, this cifdefaultroute would restore the old default
+ * route which is not what we want in this case. In the non-demand
+ * case, we'll delete the default route and restore the old if there
+ * is one saved by an sifdefaultroute with replacedefaultroute.
+ */
+ if (!replacedefaultroute && default_route_set[unit]) {
cifdefaultroute(unit, ouraddr, hisaddr);
default_route_set[unit] = 0;
}
--- a/pppd/ipcp.h
+++ b/pppd/ipcp.h
@@ -70,6 +70,7 @@ typedef struct ipcp_options {
bool old_addrs; /* Use old (IP-Addresses) option? */
bool req_addr; /* Ask peer to send IP address? */
bool default_route; /* Assign default route through interface? */
+ bool replace_default_route; /* Replace default route through interface? */
bool proxy_arp; /* Make proxy ARP entry for peer? */
bool neg_vj; /* Van Jacobson Compression? */
bool old_vj; /* use old (short) form of VJ option? */
--- a/pppd/pppd.8
+++ b/pppd/pppd.8
@@ -133,6 +133,11 @@ the gateway, when IPv6CP negotiation is
This entry is removed when the PPP connection is broken. This option
is privileged if the \fInodefaultroute6\fR option has been specified.
.TP
+.B replacedefaultroute
+This option is a flag to the defaultroute option. If defaultroute is
+set and this flag is also set, pppd replaces an existing default route
+with the new default route.
+.TP
.B disconnect \fIscript
Execute the command specified by \fIscript\fR, by passing it to a
shell, after
@@ -756,7 +761,12 @@ disable both forms of hardware flow cont
.TP
.B nodefaultroute
Disable the \fIdefaultroute\fR option. The system administrator who
-wishes to prevent users from creating default routes with pppd
+wishes to prevent users from adding a default route with pppd
+can do so by placing this option in the /etc/ppp/options file.
+.TP
+.B noreplacedefaultroute
+Disable the \fIreplacedefaultroute\fR option. The system administrator who
+wishes to prevent users from replacing a default route with pppd
can do so by placing this option in the /etc/ppp/options file.
.TP
.B nodefaultroute6
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -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
-int sifdefaultroute __P((int, u_int32_t, u_int32_t));
+int sifdefaultroute __P((int, u_int32_t, u_int32_t, bool replace_default_rt));
/* Create default route through i/f */
int cifdefaultroute __P((int, u_int32_t, u_int32_t));
/* Delete default route through i/f */
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -209,6 +209,8 @@ static int if_is_up; /* Interface has be
static int if6_is_up; /* Interface has been marked up for IPv6, to help differentiate */
static int have_default_route; /* Gateway for default route added */
static int have_default_route6; /* Gateway for default IPv6 route added */
+static struct rtentry old_def_rt; /* Old default route */
+static int default_rt_repl_rest; /* replace and restore old default rt */
static u_int32_t proxy_arp_addr; /* Addr for proxy arp entry added */
static char proxy_arp_dev[16]; /* Device for proxy arp entry */
static u_int32_t our_old_addr; /* for detecting address changes */
@@ -1577,6 +1579,9 @@ static int read_route_table(struct rtent
p = NULL;
}
+ SET_SA_FAMILY (rt->rt_dst, AF_INET);
+ SET_SA_FAMILY (rt->rt_gateway, AF_INET);
+
SIN_ADDR(rt->rt_dst) = strtoul(cols[route_dest_col], NULL, 16);
SIN_ADDR(rt->rt_gateway) = strtoul(cols[route_gw_col], NULL, 16);
SIN_ADDR(rt->rt_genmask) = strtoul(cols[route_mask_col], NULL, 16);
@@ -1649,20 +1654,52 @@ int have_route_to(u_int32_t addr)
/********************************************************************
*
* sifdefaultroute - assign a default route through the address given.
- */
-
-int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
-{
- struct rtentry rt;
-
- if (defaultroute_exists(&rt, dfl_route_metric) && strcmp(rt.rt_dev, ifname) != 0) {
- if (rt.rt_flags & RTF_GATEWAY)
- error("not replacing existing default route via %I with metric %d",
- SIN_ADDR(rt.rt_gateway), dfl_route_metric);
- else
+ *
+ * If the global default_rt_repl_rest flag is set, then this function
+ * already replaced the original system defaultroute with some other
+ * route and it should just replace the current defaultroute with
+ * another one, without saving the current route. Use: demand mode,
+ * when pppd sets first a defaultroute it it's temporary ppp0 addresses
+ * and then changes the temporary addresses to the addresses for the real
+ * ppp connection when it has come up.
+ */
+
+int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway, bool replace)
+{
+ struct rtentry rt, tmp_rt;
+ struct rtentry *del_rt = NULL;
+
+ if (default_rt_repl_rest) {
+ /* We have already reclaced the original defaultroute, if we
+ are called again, we will delete the current default route
+ and set the new default route in this function.
+ - this is normally only the case the doing demand: */
+ if (defaultroute_exists(&tmp_rt, dfl_route_metric))
+ del_rt = &tmp_rt;
+ } else if (defaultroute_exists(&old_def_rt, dfl_route_metric) &&
+ strcmp(old_def_rt.rt_dev, ifname) != 0) {
+ /* We did not yet replace an existing default route, let's
+ check if we should save and replace a default route: */
+ if (old_def_rt.rt_flags & RTF_GATEWAY) {
+ if (!replace) {
+ error("not replacing existing default route via %I with metric %d",
+ SIN_ADDR(old_def_rt.rt_gateway), dfl_route_metric);
+ return 0;
+ } else {
+ /* we need to copy rt_dev because we need it permanent too: */
+ char *tmp_dev = malloc(strlen(old_def_rt.rt_dev) + 1);
+ strcpy(tmp_dev, old_def_rt.rt_dev);
+ old_def_rt.rt_dev = tmp_dev;
+
+ notice("replacing old default route to %s [%I] with metric %d",
+ old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway),
+ dfl_route_metric);
+ default_rt_repl_rest = 1;
+ del_rt = &old_def_rt;
+ }
+ } else
error("not replacing existing default route through %s with metric %d",
- rt.rt_dev, dfl_route_metric);
- return 0;
+ old_def_rt.rt_dev, dfl_route_metric);
}
memset (&rt, 0, sizeof (rt));
@@ -1678,10 +1715,16 @@ int sifdefaultroute (int unit, u_int32_t
rt.rt_flags = RTF_UP;
if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) {
- if ( ! ok_error ( errno ))
+ if (!ok_error(errno))
error("default route ioctl(SIOCADDRT): %m");
return 0;
}
+ if (default_rt_repl_rest && del_rt)
+ if (ioctl(sock_fd, SIOCDELRT, del_rt) < 0) {
+ if (!ok_error(errno))
+ error("del old default route ioctl(SIOCDELRT): %m");
+ return 0;
+ }
have_default_route = 1;
return 1;
@@ -1715,11 +1758,21 @@ int cifdefaultroute (int unit, u_int32_t
rt.rt_flags = RTF_UP;
if (ioctl(sock_fd, SIOCDELRT, &rt) < 0 && errno != ESRCH) {
if (still_ppp()) {
- if ( ! ok_error ( errno ))
+ if (!ok_error(errno))
error("default route ioctl(SIOCDELRT): %m");
return 0;
}
}
+ if (default_rt_repl_rest) {
+ notice("restoring old default route to %s [%I]",
+ old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway));
+ if (ioctl(sock_fd, SIOCADDRT, &old_def_rt) < 0) {
+ if (!ok_error(errno))
+ error("restore default route ioctl(SIOCADDRT): %m");
+ return 0;
+ }
+ default_rt_repl_rest = 0;
+ }
return 1;
}
--- a/pppd/sys-solaris.c
+++ b/pppd/sys-solaris.c
@@ -2120,12 +2120,18 @@ cifaddr(u, o, h)
* sifdefaultroute - assign a default route through the address given.
*/
int
-sifdefaultroute(u, l, g)
+sifdefaultroute(u, l, g, replace)
int u;
u_int32_t l, g;
+ bool replace;
{
struct rtentry rt;
+ if (replace) {
+ error("replacedefaultroute not supported on this platform");
+ return 0;
+ }
+
#if defined(__USLC__)
g = l; /* use the local address as gateway */
#endif

View File

@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/main.c --- a/pppd/main.c
+++ b/pppd/main.c +++ b/pppd/main.c
@@ -308,6 +308,8 @@ main(argc, argv) @@ -295,6 +295,8 @@ main(int argc, char *argv[])
strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup)); strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup));
strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown)); strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown));
@ -23,16 +23,16 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
new_phase(PHASE_INITIALIZE); new_phase(PHASE_INITIALIZE);
--- a/pppd/options.c --- a/pppd/options.c
+++ b/pppd/options.c +++ b/pppd/options.c
@@ -119,6 +119,8 @@ int req_unit = -1; /* requested interfa @@ -118,6 +118,8 @@ int req_unit = -1; /* requested interfa
char req_ifname[MAXIFNAMELEN]; /* requested interface name */
char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */ char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
char req_ifname[MAXIFNAMELEN]; /* requested interface name */
+char path_ipv6up[MAXPATHLEN]; /* pathname of ipv6-up script */ +char path_ipv6up[MAXPATHLEN]; /* pathname of ipv6-up script */
+char path_ipv6down[MAXPATHLEN];/* pathname of ipv6-down script */ +char path_ipv6down[MAXPATHLEN];/* pathname of ipv6-down script */
bool multilink = 0; /* Enable multilink operation */ bool multilink = 0; /* Enable multilink operation */
char *bundle_name = NULL; /* bundle name for multilink */ char *bundle_name = NULL; /* bundle name for multilink */
bool dump_options; /* print out option values */ bool dump_options; /* print out option values */
@@ -325,6 +327,13 @@ option_t general_options[] = { @@ -324,6 +326,13 @@ option_t general_options[] = {
"Set pathname of ip-down script", "Set pathname of ip-down script",
OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
@ -48,7 +48,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
"Enable multilink operation", OPT_PRIO | 1 }, "Enable multilink operation", OPT_PRIO | 1 },
--- a/pppd/ipv6cp.c --- a/pppd/ipv6cp.c
+++ b/pppd/ipv6cp.c +++ b/pppd/ipv6cp.c
@@ -1300,7 +1300,7 @@ ipv6cp_up(f) @@ -1295,7 +1295,7 @@ ipv6cp_up(fsm *f)
*/ */
if (ipv6cp_script_state == s_down && ipv6cp_script_pid == 0) { if (ipv6cp_script_state == s_down && ipv6cp_script_pid == 0) {
ipv6cp_script_state = s_up; ipv6cp_script_state = s_up;
@ -57,7 +57,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
} }
} }
@@ -1352,7 +1352,7 @@ ipv6cp_down(f) @@ -1346,7 +1346,7 @@ ipv6cp_down(fsm *f)
/* Execute the ipv6-down script */ /* Execute the ipv6-down script */
if (ipv6cp_script_state == s_up && ipv6cp_script_pid == 0) { if (ipv6cp_script_state == s_up && ipv6cp_script_pid == 0) {
ipv6cp_script_state = s_down; ipv6cp_script_state = s_down;
@ -66,7 +66,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
} }
} }
@@ -1395,13 +1395,13 @@ ipv6cp_script_done(arg) @@ -1384,13 +1384,13 @@ ipv6cp_script_done(void *arg)
case s_up: case s_up:
if (ipv6cp_fsm[0].state != OPENED) { if (ipv6cp_fsm[0].state != OPENED) {
ipv6cp_script_state = s_down; ipv6cp_script_state = s_down;
@ -84,10 +84,10 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
} }
--- a/pppd/pppd.h --- a/pppd/pppd.h
+++ b/pppd/pppd.h +++ b/pppd/pppd.h
@@ -337,6 +337,8 @@ extern int req_unit; /* interface unit n @@ -328,6 +328,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_ipup[MAXPATHLEN]; /* pathname of ip-up script */
extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */ extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */
+extern char path_ipv6up[MAXPATHLEN]; /* pathname of ipv6-up script */ +extern char path_ipv6up[MAXPATHLEN]; /* pathname of ipv6-up script */
+extern char path_ipv6down[MAXPATHLEN]; /* pathname of ipv6-down script */ +extern char path_ipv6down[MAXPATHLEN]; /* pathname of ipv6-down script */
extern bool multilink; /* enable multilink operation */ extern bool multilink; /* enable multilink operation */

View File

@ -1,36 +0,0 @@
--- a/pppd/plugins/rp-pppoe/pppoe.h
+++ b/pppd/plugins/rp-pppoe/pppoe.h
@@ -48,11 +48,7 @@
#include <netinet/in.h>
/* Ugly header files on some Linux boxes... */
-#if defined(HAVE_LINUX_IF_H)
-#include <linux/if.h>
-#elif defined(HAVE_NET_IF_H)
#include <net/if.h>
-#endif
#ifdef HAVE_NET_IF_TYPES_H
#include <net/if_types.h>
@@ -80,20 +76,7 @@ typedef unsigned long UINT32_t;
#error Could not find a 32-bit integer type
#endif
-#ifdef HAVE_LINUX_IF_ETHER_H
-#include <linux/if_ether.h>
-#endif
-
-#ifdef HAVE_NETINET_IF_ETHER_H
-#include <sys/types.h>
-
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifndef HAVE_SYS_DLPI_H
-#include <netinet/if_ether.h>
-#endif
-#endif
+#include <net/ethernet.h>
/* Ethernet frame types according to RFC 2516 */

View File

@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/Makefile.linux --- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux +++ b/pppd/Makefile.linux
@@ -48,7 +48,7 @@ MPPE=y @@ -49,7 +49,7 @@ MPPE=y
# Uncomment the next line to include support for PPP packet filtering. # Uncomment the next line to include support for PPP packet filtering.
# This requires that the libpcap library and headers be installed # This requires that the libpcap library and headers be installed
# and that the kernel driver support PPP packet filtering. # and that the kernel driver support PPP packet filtering.
@ -16,7 +16,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
# Uncomment the next line to enable multilink PPP (enabled by default) # Uncomment the next line to enable multilink PPP (enabled by default)
# Linux distributions: Please leave multilink ENABLED in your builds # Linux distributions: Please leave multilink ENABLED in your builds
@@ -58,7 +58,7 @@ HAVE_MULTILINK=y @@ -59,7 +59,7 @@ HAVE_MULTILINK=y
# Uncomment the next line to enable the TDB database (enabled by default.) # Uncomment the next line to enable the TDB database (enabled by default.)
# If you enable multilink, then TDB is automatically enabled also. # If you enable multilink, then TDB is automatically enabled also.
# Linux distributions: Please leave TDB ENABLED in your builds. # Linux distributions: Please leave TDB ENABLED in your builds.
@ -25,21 +25,28 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
# Uncomment the next line to enable Type=notify services in systemd # Uncomment the next line to enable Type=notify services in systemd
# If enabled, and the user sets the up_sdnotify option, then # If enabled, and the user sets the up_sdnotify option, then
@@ -85,7 +85,7 @@ MAXOCTETS=y @@ -85,13 +85,13 @@ USE_LIBUTIL=y
endif
# Enable EAP-TLS authentication (requires MPPE support, libssl and libcrypto)
-USE_EAPTLS=y
+#USE_EAPTLS=y
MAXOCTETS=y
INCLUDE_DIRS= -I../include INCLUDE_DIRS= -I../include
-COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -pipe
+COMPILE_FLAGS= -DHAVE_PATHS_H -DHAVE_MMAP +COMPILE_FLAGS= -DHAVE_PATHS_H -DHAVE_MMAP -pipe
CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"' CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
@@ -126,10 +126,10 @@ CFLAGS += -DHAS_SHADOW @@ -143,10 +143,10 @@ CFLAGS += -DHAS_SHADOW
#LIBS += -lshadow $(LIBS) #LIBS += -lshadow $(LIBS)
endif endif
-ifneq ($(wildcard $(shell $(CC) --print-sysroot)/usr/include/crypt.h),) -ifeq ($(shell echo '\#include <crypt.h>' | $(CC) -E - >/dev/null 2>&1 && echo yes),yes)
+#ifneq ($(wildcard $(shell $(CC) --print-sysroot)/usr/include/crypt.h),) +#ifeq ($(shell echo '\#include <crypt.h>' | $(CC) -E - >/dev/null 2>&1 && echo yes),yes)
CFLAGS += -DHAVE_CRYPT_H=1 CFLAGS += -DHAVE_CRYPT_H=1
LIBS += -lcrypt LIBS += -lcrypt
-endif -endif

View File

@ -88,7 +88,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
*/ */
--- a/pppd/ccp.c --- a/pppd/ccp.c
+++ b/pppd/ccp.c +++ b/pppd/ccp.c
@@ -61,12 +61,10 @@ static int setdeflate __P((char **)); @@ -61,12 +61,10 @@ static int setdeflate (char **);
static char bsd_value[8]; static char bsd_value[8];
static char deflate_value[8]; static char deflate_value[8];
@ -197,7 +197,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
/* /*
* Local state (mainly for handling reset-reqs and reset-acks). * Local state (mainly for handling reset-reqs and reset-acks).
@@ -343,6 +323,100 @@ setdeflate(argv) @@ -341,6 +321,100 @@ setdeflate(char **argv)
return 1; return 1;
} }
@ -298,7 +298,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
/* /*
* ccp_init - initialize CCP. * ccp_init - initialize CCP.
*/ */
@@ -377,6 +451,30 @@ ccp_init(unit) @@ -374,6 +448,30 @@ ccp_init(int unit)
ccp_allowoptions[0].bsd_bits = BSD_MAX_BITS; ccp_allowoptions[0].bsd_bits = BSD_MAX_BITS;
ccp_allowoptions[0].predictor_1 = 1; ccp_allowoptions[0].predictor_1 = 1;
@ -329,7 +329,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
} }
/* /*
@@ -454,11 +552,11 @@ ccp_input(unit, p, len) @@ -443,11 +541,11 @@ ccp_input(int unit, u_char *p, int len)
if (oldstate == OPENED && p[0] == TERMREQ && f->state != OPENED) { if (oldstate == OPENED && p[0] == TERMREQ && f->state != OPENED) {
notice("Compression disabled by peer."); notice("Compression disabled by peer.");
#ifdef MPPE #ifdef MPPE
@ -343,7 +343,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
} }
/* /*
@@ -486,6 +584,15 @@ ccp_extcode(f, code, id, p, len) @@ -471,6 +569,15 @@ ccp_extcode(fsm *f, int code, int id, u_
break; break;
/* send a reset-ack, which the transmitter will see and /* send a reset-ack, which the transmitter will see and
reset its compression state. */ reset its compression state. */
@ -359,7 +359,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
fsm_sdata(f, CCP_RESETACK, id, NULL, 0); fsm_sdata(f, CCP_RESETACK, id, NULL, 0);
break; break;
@@ -514,12 +621,11 @@ ccp_protrej(unit) @@ -498,12 +605,11 @@ ccp_protrej(int unit)
fsm_lowerdown(&ccp_fsm[unit]); fsm_lowerdown(&ccp_fsm[unit]);
#ifdef MPPE #ifdef MPPE
@ -374,7 +374,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
} }
/* /*
@@ -536,7 +642,7 @@ ccp_resetci(f) @@ -519,7 +625,7 @@ ccp_resetci(fsm *f)
all_rejected[f->unit] = 0; all_rejected[f->unit] = 0;
#ifdef MPPE #ifdef MPPE
@ -382,11 +382,27 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
+ if (go->mppe || go->mppc) { + if (go->mppe || go->mppc) {
ccp_options *ao = &ccp_allowoptions[f->unit]; ccp_options *ao = &ccp_allowoptions[f->unit];
int auth_mschap_bits = auth_done[f->unit]; int auth_mschap_bits = auth_done[f->unit];
int numbits; #ifdef USE_EAPTLS
@@ -550,80 +656,109 @@ ccp_resetci(f) @@ -536,95 +642,124 @@ ccp_resetci(fsm *f)
* NB: If MPPE is required, all other compression opts are invalid. * NB: If MPPE is required, all other compression opts are invalid.
* So, we return right away if we can't do it. * So, we return right away if we can't do it.
*/ */
-
- /* Leave only the mschap auth bits set */
- auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER |
- CHAP_MS2_WITHPEER | CHAP_MS2_PEER);
- /* Count the mschap auths */
- auth_mschap_bits >>= CHAP_MS_SHIFT;
- numbits = 0;
- do {
- numbits += auth_mschap_bits & 1;
- auth_mschap_bits >>= 1;
- } while (auth_mschap_bits);
- if (numbits > 1) {
- error("MPPE required, but auth done in both directions.");
- lcp_close(f->unit, "MPPE required but not available");
- return;
- }
+ if (ccp_wantoptions[f->unit].mppe) { + if (ccp_wantoptions[f->unit].mppe) {
+ /* Leave only the mschap auth bits set */ + /* Leave only the mschap auth bits set */
+ auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | + auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER |
@ -403,33 +419,42 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
+ lcp_close(f->unit, "MPPE required but not available"); + lcp_close(f->unit, "MPPE required but not available");
+ return; + return;
+ } + }
#ifdef USE_EAPTLS
- /*
- * MPPE is also possible in combination with EAP-TLS.
- * It is not possible to detect if we're doing EAP or EAP-TLS
- * at this stage, hence we accept all forms of EAP. If TLS is
- * not used then the MPPE keys will not be derived anyway.
- */
- /* Leave only the eap auth bits set */
- auth_eap_bits &= (EAP_WITHPEER | EAP_PEER );
+ /*
+ * MPPE is also possible in combination with EAP-TLS.
+ * It is not possible to detect if we're doing EAP or EAP-TLS
+ * at this stage, hence we accept all forms of EAP. If TLS is
+ * not used then the MPPE keys will not be derived anyway.
+ */
+ /* Leave only the eap auth bits set */
+ auth_eap_bits &= (EAP_WITHPEER | EAP_PEER );
- if ((numbits == 0) && (auth_eap_bits == 0)) {
- error("MPPE required, but MS-CHAP[v2] nor EAP-TLS auth are performed.");
+ if ((numbits == 0) && (auth_eap_bits == 0)) {
+ error("MPPE required, but MS-CHAP[v2] nor EAP-TLS auth are performed.");
#else
- if (!numbits) {
- error("MPPE required, but MS-CHAP[v2] auth not performed.");
+ if (!numbits) { + if (!numbits) {
+ error("MPPE required, but MS-CHAP[v2] auth not performed."); + error("MPPE required, but MS-CHAP[v2] auth not performed.");
#endif
- lcp_close(f->unit, "MPPE required but not available");
- return;
- }
+ lcp_close(f->unit, "MPPE required but not available"); + lcp_close(f->unit, "MPPE required but not available");
+ return; + return;
+ } + }
- /* Leave only the mschap auth bits set */
- auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER |
- CHAP_MS2_WITHPEER | CHAP_MS2_PEER);
- /* Count the mschap auths */
- auth_mschap_bits >>= CHAP_MS_SHIFT;
- numbits = 0;
- do {
- numbits += auth_mschap_bits & 1;
- auth_mschap_bits >>= 1;
- } while (auth_mschap_bits);
- if (numbits > 1) {
- error("MPPE required, but auth done in both directions.");
- lcp_close(f->unit, "MPPE required but not available");
- return;
- }
- if (!numbits) {
- error("MPPE required, but MS-CHAP[v2] auth not performed.");
- lcp_close(f->unit, "MPPE required but not available");
- return;
- }
-
- /* A plugin (eg radius) may not have obtained key material. */ - /* A plugin (eg radius) may not have obtained key material. */
- if (!mppe_keys_set) { - if (!mppe_keys_set) {
- error("MPPE required, but keys are not available. " - error("MPPE required, but keys are not available. "
@ -559,7 +584,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
if (go->bsd_compress) { if (go->bsd_compress) {
opt_buf[0] = CI_BSD_COMPRESS; opt_buf[0] = CI_BSD_COMPRESS;
opt_buf[1] = CILEN_BSD_COMPRESS; opt_buf[1] = CILEN_BSD_COMPRESS;
@@ -679,7 +814,8 @@ ccp_cilen(f) @@ -679,7 +814,8 @@ static int
+ (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0) + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0)
+ (go->predictor_1? CILEN_PREDICTOR_1: 0) + (go->predictor_1? CILEN_PREDICTOR_1: 0)
+ (go->predictor_2? CILEN_PREDICTOR_2: 0) + (go->predictor_2? CILEN_PREDICTOR_2: 0)
@ -569,7 +594,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
} }
/* /*
@@ -693,6 +829,8 @@ ccp_addci(f, p, lenp) @@ -690,6 +826,8 @@ static void
{ {
int res; int res;
ccp_options *go = &ccp_gotoptions[f->unit]; ccp_options *go = &ccp_gotoptions[f->unit];
@ -578,7 +603,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
u_char *p0 = p; u_char *p0 = p;
/* /*
@@ -701,22 +839,43 @@ ccp_addci(f, p, lenp) @@ -698,22 +836,43 @@ static void
* in case it gets Acked. * in case it gets Acked.
*/ */
#ifdef MPPE #ifdef MPPE
@ -631,7 +656,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
if (go->deflate) { if (go->deflate) {
p[0] = go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT; p[0] = go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT;
p[1] = CILEN_DEFLATE; p[1] = CILEN_DEFLATE;
@@ -802,7 +961,7 @@ ccp_addci(f, p, lenp) @@ -799,30 +958,50 @@ static void
/* /*
* ccp_ackci - process a received configure-ack, and return * ccp_ackci - process a received configure-ack, and return
@ -639,9 +664,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
+ * 1 if the packet was OK. + * 1 if the packet was OK.
*/ */
static int static int
ccp_ackci(f, p, len) ccp_ackci(fsm *f, u_char *p, int len)
@@ -811,24 +970,44 @@ ccp_ackci(f, p, len)
int len;
{ {
ccp_options *go = &ccp_gotoptions[f->unit]; ccp_options *go = &ccp_gotoptions[f->unit];
+ ccp_options *ao = &ccp_allowoptions[f->unit]; + ccp_options *ao = &ccp_allowoptions[f->unit];
@ -694,8 +717,8 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
if (go->deflate) { if (go->deflate) {
if (len < CILEN_DEFLATE if (len < CILEN_DEFLATE
|| p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT)
@@ -901,6 +1080,8 @@ ccp_nakci(f, p, len, treat_as_reject) @@ -891,6 +1070,8 @@ static int
int treat_as_reject; ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject)
{ {
ccp_options *go = &ccp_gotoptions[f->unit]; ccp_options *go = &ccp_gotoptions[f->unit];
+ ccp_options *ao = &ccp_allowoptions[f->unit]; + ccp_options *ao = &ccp_allowoptions[f->unit];
@ -703,7 +726,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
ccp_options no; /* options we've seen already */ ccp_options no; /* options we've seen already */
ccp_options try; /* options to ask for next time */ ccp_options try; /* options to ask for next time */
@@ -908,28 +1089,100 @@ ccp_nakci(f, p, len, treat_as_reject) @@ -898,28 +1079,100 @@ static int
try = *go; try = *go;
#ifdef MPPE #ifdef MPPE
@ -822,7 +845,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
if (go->deflate && len >= CILEN_DEFLATE if (go->deflate && len >= CILEN_DEFLATE
&& p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT)
&& p[1] == CILEN_DEFLATE) { && p[1] == CILEN_DEFLATE) {
@@ -1002,14 +1255,50 @@ ccp_rejci(f, p, len) @@ -989,14 +1242,50 @@ ccp_rejci(fsm *f, u_char *p, int len)
return -1; return -1;
#ifdef MPPE #ifdef MPPE
@ -877,8 +900,8 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
if (go->deflate_correct && len >= CILEN_DEFLATE if (go->deflate_correct && len >= CILEN_DEFLATE
&& p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) { && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) {
if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size)
@@ -1073,14 +1362,15 @@ ccp_reqci(f, p, lenp, dont_nak) @@ -1056,14 +1345,15 @@ static int
int dont_nak; ccp_reqci(fsm *f, u_char *p, int *lenp, int dont_nak)
{ {
int ret, newret, res; int ret, newret, res;
- u_char *p0, *retp; - u_char *p0, *retp;
@ -897,7 +920,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
ret = CONFACK; ret = CONFACK;
retp = p0 = p; retp = p0 = p;
@@ -1103,106 +1393,302 @@ ccp_reqci(f, p, lenp, dont_nak) @@ -1086,106 +1376,302 @@ ccp_reqci(fsm *f, u_char *p, int *lenp,
switch (type) { switch (type) {
#ifdef MPPE #ifdef MPPE
case CI_MPPE: case CI_MPPE:
@ -910,10 +933,6 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
- -
- /* Nak if anything unsupported or unknown are set. */ - /* Nak if anything unsupported or unknown are set. */
- if (ho->mppe & MPPE_OPT_UNSUPPORTED) { - if (ho->mppe & MPPE_OPT_UNSUPPORTED) {
- newret = CONFNAK;
- ho->mppe &= ~MPPE_OPT_UNSUPPORTED;
- }
- if (ho->mppe & MPPE_OPT_UNKNOWN) {
+ p2 = p[2]; + p2 = p[2];
+ p5 = p[5]; + p5 = p[5];
+ /* not sure what they want, tell 'em what we got */ + /* not sure what they want, tell 'em what we got */
@ -922,6 +941,10 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
+ MPPE_MPPC)) != 0 || p[5] == 0) || + MPPE_MPPC)) != 0 || p[5] == 0) ||
+ (p[2] == 0 && p[3] == 0 && p[4] == 0 && p[5] == 0)) { + (p[2] == 0 && p[3] == 0 && p[4] == 0 && p[5] == 0)) {
newret = CONFNAK; newret = CONFNAK;
- ho->mppe &= ~MPPE_OPT_UNSUPPORTED;
- }
- if (ho->mppe & MPPE_OPT_UNKNOWN) {
- newret = CONFNAK;
- ho->mppe &= ~MPPE_OPT_UNKNOWN; - ho->mppe &= ~MPPE_OPT_UNKNOWN;
- } - }
- -
@ -1293,7 +1316,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
case CI_DEFLATE: case CI_DEFLATE:
case CI_DEFLATE_DRAFT: case CI_DEFLATE_DRAFT:
if (!ao->deflate || clen != CILEN_DEFLATE if (!ao->deflate || clen != CILEN_DEFLATE
@@ -1344,12 +1830,6 @@ ccp_reqci(f, p, lenp, dont_nak) @@ -1327,12 +1813,6 @@ ccp_reqci(fsm *f, u_char *p, int *lenp,
else else
*lenp = retp - p0; *lenp = retp - p0;
} }
@ -1306,7 +1329,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
return ret; return ret;
} }
@@ -1371,24 +1851,35 @@ method_name(opt, opt2) @@ -1353,24 +1833,35 @@ method_name(ccp_options *opt, ccp_option
char *p = result; char *p = result;
char *q = result + sizeof(result); /* 1 past result */ char *q = result + sizeof(result); /* 1 past result */
@ -1358,7 +1381,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
case CI_DEFLATE: case CI_DEFLATE:
case CI_DEFLATE_DRAFT: case CI_DEFLATE_DRAFT:
if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) if (opt2 != NULL && opt2->deflate_size != opt->deflate_size)
@@ -1444,12 +1935,12 @@ ccp_up(f) @@ -1425,12 +1916,12 @@ ccp_up(fsm *f)
} else if (ANY_COMPRESS(*ho)) } else if (ANY_COMPRESS(*ho))
notice("%s transmit compression enabled", method_name(ho, NULL)); notice("%s transmit compression enabled", method_name(ho, NULL));
#ifdef MPPE #ifdef MPPE
@ -1373,7 +1396,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
} }
/* /*
@@ -1472,7 +1963,7 @@ ccp_down(f) @@ -1452,7 +1943,7 @@ ccp_down(fsm *f)
lcp_close(f->unit, "MPPE disabled"); lcp_close(f->unit, "MPPE disabled");
} }
} }
@ -1382,7 +1405,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
} }
/* /*
@@ -1532,24 +2023,28 @@ ccp_printpkt(p, plen, printer, arg) @@ -1509,24 +2000,28 @@ ccp_printpkt(u_char *p, int plen,
#ifdef MPPE #ifdef MPPE
case CI_MPPE: case CI_MPPE:
if (optlen >= CILEN_MPPE) { if (optlen >= CILEN_MPPE) {
@ -1423,7 +1446,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
case CI_DEFLATE: case CI_DEFLATE:
case CI_DEFLATE_DRAFT: case CI_DEFLATE_DRAFT:
if (optlen >= CILEN_DEFLATE) { if (optlen >= CILEN_DEFLATE) {
@@ -1635,6 +2130,7 @@ ccp_datainput(unit, pkt, len) @@ -1609,6 +2104,7 @@ ccp_datainput(int unit, u_char *pkt, int
error("Lost compression sync: disabling compression"); error("Lost compression sync: disabling compression");
ccp_close(unit, "Lost compression sync"); ccp_close(unit, "Lost compression sync");
#ifdef MPPE #ifdef MPPE
@ -1431,7 +1454,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
/* /*
* If we were doing MPPE, we must also take the link down. * If we were doing MPPE, we must also take the link down.
*/ */
@@ -1642,9 +2138,18 @@ ccp_datainput(unit, pkt, len) @@ -1616,9 +2112,18 @@ ccp_datainput(int unit, u_char *pkt, int
error("Too many MPPE errors, closing LCP"); error("Too many MPPE errors, closing LCP");
lcp_close(unit, "Too many MPPE errors"); lcp_close(unit, "Too many MPPE errors");
} }

View File

@ -1,88 +0,0 @@
build: Do not strip binaries on install
Strippign executables should be handled by the distro packaging, not by ppp
itself. This patch removes the "-s" (strip) switch from all "install" commands
in order to install unstripped binaries into the destination prefix.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/chat/Makefile.linux
+++ b/chat/Makefile.linux
@@ -25,7 +25,7 @@ chat.o: chat.c
install: chat
mkdir -p $(BINDIR) $(MANDIR)
- $(INSTALL) -s -c chat $(BINDIR)
+ $(INSTALL) -c chat $(BINDIR)
$(INSTALL) -c -m 644 chat.8 $(MANDIR)
clean:
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
@@ -108,7 +108,7 @@ ifdef USE_SRP
CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto
TARGETS += srp-entry
-EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry
+EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
MANPAGES += srp-entry.8
EXTRACLEAN += srp-entry.o
NEEDDES=y
@@ -220,7 +220,7 @@ all: $(TARGETS)
install: pppd
mkdir -p $(BINDIR) $(MANDIR)
$(EXTRAINSTALL)
- $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
+ $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd
if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
chmod o-rx,u+s $(BINDIR)/pppd; fi
$(INSTALL) -c -m 444 pppd.8 $(MANDIR)
--- a/pppd/plugins/radius/Makefile.linux
+++ b/pppd/plugins/radius/Makefile.linux
@@ -36,9 +36,9 @@ all: $(PLUGIN)
install: all
$(INSTALL) -d -m 755 $(LIBDIR)
- $(INSTALL) -s -c -m 755 radius.so $(LIBDIR)
- $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR)
- $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR)
+ $(INSTALL) -c -m 755 radius.so $(LIBDIR)
+ $(INSTALL) -c -m 755 radattr.so $(LIBDIR)
+ $(INSTALL) -c -m 755 radrealms.so $(LIBDIR)
$(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)
$(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
--- a/pppd/plugins/rp-pppoe/Makefile.linux
+++ b/pppd/plugins/rp-pppoe/Makefile.linux
@@ -43,9 +43,9 @@ rp-pppoe.so: plugin.o discovery.o if.o c
install: all
$(INSTALL) -d -m 755 $(LIBDIR)
- $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR)
+ $(INSTALL) -c -m 4550 rp-pppoe.so $(LIBDIR)
$(INSTALL) -d -m 755 $(BINDIR)
- $(INSTALL) -s -c -m 555 pppoe-discovery $(BINDIR)
+ $(INSTALL) -c -m 555 pppoe-discovery $(BINDIR)
clean:
rm -f *.o *.so pppoe-discovery
--- a/pppdump/Makefile.linux
+++ b/pppdump/Makefile.linux
@@ -17,5 +17,5 @@ clean:
install:
mkdir -p $(BINDIR) $(MANDIR)
- $(INSTALL) -s -c pppdump $(BINDIR)
+ $(INSTALL) -c pppdump $(BINDIR)
$(INSTALL) -c -m 444 pppdump.8 $(MANDIR)
--- a/pppstats/Makefile.linux
+++ b/pppstats/Makefile.linux
@@ -22,7 +22,7 @@ all: pppstats
install: pppstats
-mkdir -p $(MANDIR)
- $(INSTALL) -s -c pppstats $(BINDIR)
+ $(INSTALL) -c pppstats $(BINDIR)
$(INSTALL) -c -m 444 pppstats.8 $(MANDIR)
pppstats: $(PPPSTATSRCS)

View File

@ -8,17 +8,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/plugins/radius/Makefile.linux --- a/pppd/plugins/radius/Makefile.linux
+++ b/pppd/plugins/radius/Makefile.linux +++ b/pppd/plugins/radius/Makefile.linux
@@ -12,7 +12,8 @@ VERSION = $(shell awk -F '"' '/VERSION/ @@ -47,13 +47,13 @@ install: all
INSTALL = install
PLUGIN=radius.so radattr.so radrealms.so
-CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
+COPTS = -O2
+CFLAGS=-I. -I../.. -I../../../include $(COPTS) -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
# Uncomment the next line to include support for Microsoft's
# MS-CHAP authentication protocol.
@@ -43,13 +44,13 @@ install: all
$(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR) $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
radius.so: radius.o libradiusclient.a radius.so: radius.o libradiusclient.a
@ -35,26 +25,14 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \ CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \
clientid.o sendserver.o lock.o util.o md5.o clientid.o sendserver.o lock.o util.o md5.o
--- a/pppdump/Makefile.linux --- a/pppd/plugins/pppoe/Makefile.linux
+++ b/pppdump/Makefile.linux +++ b/pppd/plugins/pppoe/Makefile.linux
@@ -2,7 +2,8 @@ DESTDIR = $(INSTROOT)@DESTDIR@ @@ -38,7 +38,7 @@ debug.o: debug.c
BINDIR = $(DESTDIR)/sbin
MANDIR = $(DESTDIR)/share/man/man8
-CFLAGS= -O -I../include/net
+COPTS = -O
+CFLAGS= $(COPTS) -I../include/net
OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
INSTALL= install
--- a/pppd/plugins/rp-pppoe/Makefile.linux
+++ b/pppd/plugins/rp-pppoe/Makefile.linux
@@ -39,7 +39,7 @@ debug.o: debug.c
$(CC) $(CFLAGS) -I../../.. -c -o debug.o debug.c $(CC) $(CFLAGS) -I../../.. -c -o debug.o debug.c
rp-pppoe.so: plugin.o discovery.o if.o common.o pppoe.so: plugin.o discovery.o if.o common.o
- $(CC) $(LDFLAGS) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o - $(CC) $(LDFLAGS) -o pppoe.so -shared plugin.o discovery.o if.o common.o
+ $(CC) $(LDFLAGS) -fPIC -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o + $(CC) $(LDFLAGS) -fPIC -o pppoe.so -shared plugin.o discovery.o if.o common.o
install: all install: all
$(INSTALL) -d -m 755 $(LIBDIR) $(INSTALL) -d -m 755 $(LIBDIR)

View File

@ -5,8 +5,8 @@ discovery attempts.
Signed-off-by: Jo-Philipp Wich <jo@mein.io> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/plugins/rp-pppoe/discovery.c --- a/pppd/plugins/pppoe/discovery.c
+++ b/pppd/plugins/rp-pppoe/discovery.c +++ b/pppd/plugins/pppoe/discovery.c
@@ -632,7 +632,9 @@ discovery(PPPoEConnection *conn) @@ -632,7 +632,9 @@ discovery(PPPoEConnection *conn)
conn->discoveryState = STATE_SENT_PADI; conn->discoveryState = STATE_SENT_PADI;
waitForPADO(conn, timeout); waitForPADO(conn, timeout);

View File

@ -8,7 +8,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/lcp.c --- a/pppd/lcp.c
+++ b/pppd/lcp.c +++ b/pppd/lcp.c
@@ -1916,12 +1916,12 @@ lcp_up(f) @@ -1862,12 +1862,12 @@ lcp_up(fsm *f)
* the interface MTU is set to the lowest of that, the * the interface MTU is set to the lowest of that, the
* MTU we want to use, and our link MRU. * MTU we want to use, and our link MRU.
*/ */

View File

@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/main.c --- a/pppd/main.c
+++ b/pppd/main.c +++ b/pppd/main.c
@@ -1052,7 +1052,8 @@ get_input() @@ -1034,7 +1034,8 @@ get_input(void)
} }
notice("Modem hangup"); notice("Modem hangup");
hungup = 1; hungup = 1;

View File

@ -7,14 +7,14 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/Makefile.linux --- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux +++ b/pppd/Makefile.linux
@@ -190,8 +190,8 @@ endif @@ -210,8 +210,8 @@ LIBS += -ldl
endif
ifdef FILTER ifdef FILTER
ifneq ($(wildcard /usr/include/pcap-bpf.h),)
-LIBS += -lpcap -LIBS += -lpcap
-CFLAGS += -DPPP_FILTER -CFLAGS += -DPPP_FILTER
+LIBS += -lpcap -L$(STAGING_DIR)/usr/lib +LIBS += -lpcap -L$(STAGING_DIR)/usr/lib
+CFLAGS += -DPPP_FILTER -I$(STAGING_DIR)/usr/include +CFLAGS += -DPPP_FILTER -I$(STAGING_DIR)/usr/include
endif endif
endif
ifdef HAVE_INET6

View File

@ -13,7 +13,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/Makefile.linux --- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux +++ b/pppd/Makefile.linux
@@ -50,6 +50,9 @@ MPPE=y @@ -51,6 +51,9 @@ MPPE=y
# and that the kernel driver support PPP packet filtering. # and that the kernel driver support PPP packet filtering.
#FILTER=y #FILTER=y
@ -23,8 +23,8 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
# Uncomment the next line to enable multilink PPP (enabled by default) # Uncomment the next line to enable multilink PPP (enabled by default)
# Linux distributions: Please leave multilink ENABLED in your builds # Linux distributions: Please leave multilink ENABLED in your builds
# of pppd! # of pppd!
@@ -195,6 +198,14 @@ CFLAGS += -DPPP_FILTER -I$(STAGING_DIR) @@ -214,6 +217,14 @@ LIBS += -lpcap -L$(STAGING_DIR)/usr/l
endif CFLAGS += -DPPP_FILTER -I$(STAGING_DIR)/usr/include
endif endif
+ifdef PRECOMPILED_FILTER +ifdef PRECOMPILED_FILTER
@ -40,7 +40,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
HEADERS += ipv6cp.h eui64.h HEADERS += ipv6cp.h eui64.h
--- a/pppd/options.c --- a/pppd/options.c
+++ b/pppd/options.c +++ b/pppd/options.c
@@ -57,6 +57,7 @@ @@ -56,6 +56,7 @@
#ifdef PPP_FILTER #ifdef PPP_FILTER
#include <pcap.h> #include <pcap.h>
@ -48,21 +48,21 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
/* /*
* There have been 3 or 4 different names for this in libpcap CVS, but * There have been 3 or 4 different names for this in libpcap CVS, but
* this seems to be what they have settled on... * this seems to be what they have settled on...
@@ -169,6 +170,13 @@ static int setlogfile __P((char **)); @@ -168,6 +169,13 @@ static int setlogfile(char **);
static int loadplugin __P((char **)); static int loadplugin(char **);
#endif #endif
+#ifdef PPP_PRECOMPILED_FILTER +#ifdef PPP_PRECOMPILED_FILTER
+#include "pcap_pcc.h" +#include "pcap_pcc.h"
+static int setprecompiledpassfilter __P((char **)); +static int setprecompiledpassfilter(char **);
+static int setprecompiledactivefilter __P((char **)); +static int setprecompiledactivefilter(char **);
+#undef PPP_FILTER +#undef PPP_FILTER
+#endif +#endif
+ +
#ifdef PPP_FILTER #ifdef PPP_FILTER
static int setpassfilter __P((char **)); static int setpassfilter(char **);
static int setactivefilter __P((char **)); static int setactivefilter(char **);
@@ -361,6 +369,14 @@ option_t general_options[] = { @@ -360,6 +368,14 @@ option_t general_options[] = {
"set filter for active pkts", OPT_PRIO }, "set filter for active pkts", OPT_PRIO },
#endif #endif
@ -77,7 +77,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
#ifdef MAXOCTETS #ifdef MAXOCTETS
{ "maxoctets", o_int, &maxoctets, { "maxoctets", o_int, &maxoctets,
"Set connection traffic limit", "Set connection traffic limit",
@@ -1516,6 +1532,29 @@ callfile(argv) @@ -1468,6 +1484,27 @@ callfile(char **argv)
return ok; return ok;
} }
@ -87,8 +87,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
+ * precompiled expression + * precompiled expression
+ */ + */
+static int +static int
+setprecompiledpassfilter(argv) +setprecompiledpassfilter(char **argv)
+ char **argv;
+{ +{
+ return pcap_pre_compiled (*argv, &pass_filter); + return pcap_pre_compiled (*argv, &pass_filter);
+} +}
@ -97,8 +96,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
+ * setactivefilter - Set the active filter for packets + * setactivefilter - Set the active filter for packets
+ */ + */
+static int +static int
+setprecompiledactivefilter(argv) +setprecompiledactivefilter(char **argv)
+ char **argv;
+{ +{
+ return pcap_pre_compiled (*argv, &active_filter); + return pcap_pre_compiled (*argv, &active_filter);
+} +}

View File

@ -16,17 +16,17 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
#include "pppd.h" #include "pppd.h"
#include "fsm.h" #include "fsm.h"
@@ -56,7 +57,8 @@ static void iterate_bundle_links __P((vo @@ -56,7 +57,8 @@ static void iterate_bundle_links(void (*
static int get_default_epdisc __P((struct epdisc *)); static int get_default_epdisc(struct epdisc *);
static int parse_num __P((char *str, const char *key, int *valp)); static int parse_num(char *str, const char *key, int *valp);
-static int owns_unit __P((TDB_DATA pid, int unit)); -static int owns_unit(TDB_DATA pid, int unit);
+static int parse_str __P((char *str, const char *key, char *buf, int buflen)); +static int parse_str(char *str, const char *key, char *buf, int buflen);
+static int owns_link __P((TDB_DATA pid, char *ifname)); +static int owns_link(TDB_DATA pid, char *ifname);
#define set_ip_epdisc(ep, addr) do { \ #define set_ip_epdisc(ep, addr) do { \
ep->length = 4; \ ep->length = 4; \
@@ -197,35 +199,38 @@ mp_join_bundle() @@ -197,35 +199,38 @@ mp_join_bundle(void)
key.dptr = bundle_id; key.dptr = bundle_id;
key.dsize = p - bundle_id; key.dsize = p - bundle_id;
pid = tdb_fetch(pppdb, key); pid = tdb_fetch(pppdb, key);
@ -73,16 +73,12 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
} }
/* we have to make a new bundle */ /* we have to make a new bundle */
@@ -408,22 +413,45 @@ parse_num(str, key, valp) @@ -405,20 +410,39 @@ parse_num(char *str, const char *key, in
return 0; return 0;
} }
+static int +static int
+parse_str(str, key, buf, buflen) +parse_str(char *str, const char *key, char *buf, int buflen)
+ char *str;
+ const char *key;
+ char *buf;
+ int buflen;
+{ +{
+ char *p, *endp; + char *p, *endp;
+ int i; + int i;
@ -103,11 +99,8 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
+ * Check whether the pppd identified by `key' still owns ppp link `ifname'. + * Check whether the pppd identified by `key' still owns ppp link `ifname'.
*/ */
static int static int
-owns_unit(key, unit) -owns_unit(TDB_DATA key, int unit)
+owns_link(key, ifname) +owns_link(TDB_DATA key, char *ifname)
TDB_DATA key;
- int unit;
+ char *ifname;
{ {
- char ifkey[32]; - char ifkey[32];
+ char ifkey[7 + IFNAMSIZ]; + char ifkey[7 + IFNAMSIZ];
@ -126,7 +119,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
&& memcmp(vd.dptr, key.dptr, vd.dsize) == 0; && memcmp(vd.dptr, key.dptr, vd.dsize) == 0;
--- a/pppd/sys-linux.c --- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c +++ b/pppd/sys-linux.c
@@ -700,6 +700,16 @@ void cfg_bundle(int mrru, int mtru, int @@ -706,6 +706,16 @@ void cfg_bundle(int mrru, int mtru, int
add_fd(ppp_dev_fd); add_fd(ppp_dev_fd);
} }
@ -143,7 +136,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
/* /*
* make_new_bundle - create a new PPP unit (i.e. a bundle) * make_new_bundle - create a new PPP unit (i.e. a bundle)
* and connect our channel to it. This should only get called * and connect our channel to it. This should only get called
@@ -718,6 +728,8 @@ void make_new_bundle(int mrru, int mtru, @@ -724,6 +734,8 @@ void make_new_bundle(int mrru, int mtru,
/* set the mrru and flags */ /* set the mrru and flags */
cfg_bundle(mrru, mtru, rssn, tssn); cfg_bundle(mrru, mtru, rssn, tssn);

View File

@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/sys-linux.c --- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c +++ b/pppd/sys-linux.c
@@ -1767,6 +1767,7 @@ int cifdefaultroute (int unit, u_int32_t @@ -1770,6 +1770,7 @@ int cifdefaultroute (int unit, u_int32_t
SIN_ADDR(rt.rt_genmask) = 0L; SIN_ADDR(rt.rt_genmask) = 0L;
} }

View File

@ -13,7 +13,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/sys-linux.c --- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c +++ b/pppd/sys-linux.c
@@ -1717,6 +1717,9 @@ int sifdefaultroute (int unit, u_int32_t @@ -1720,6 +1720,9 @@ int sifdefaultroute (int unit, u_int32_t
memset (&rt, 0, sizeof (rt)); memset (&rt, 0, sizeof (rt));
SET_SA_FAMILY (rt.rt_dst, AF_INET); 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_dev = ifname;
rt.rt_metric = dfl_route_metric + 1; /* +1 for binary compatibility */ rt.rt_metric = dfl_route_metric + 1; /* +1 for binary compatibility */
@@ -1725,7 +1728,7 @@ int sifdefaultroute (int unit, u_int32_t @@ -1728,7 +1731,7 @@ int sifdefaultroute (int unit, u_int32_t
SIN_ADDR(rt.rt_genmask) = 0L; SIN_ADDR(rt.rt_genmask) = 0L;
} }

View File

@ -10,7 +10,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/sys-linux.c --- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c +++ b/pppd/sys-linux.c
@@ -200,7 +200,7 @@ static int driver_is_old = 0; @@ -206,7 +206,7 @@ static int driver_is_old = 0;
static int restore_term = 0; /* 1 => we've munged the terminal */ static int restore_term = 0; /* 1 => we've munged the terminal */
static struct termios inittermios; /* Initial TTY termios */ static struct termios inittermios; /* Initial TTY termios */
@ -19,7 +19,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
static char loop_name[20]; static char loop_name[20];
static unsigned char inbuf[512]; /* buffer for chars read from loopback */ static unsigned char inbuf[512]; /* buffer for chars read from loopback */
@@ -219,8 +219,8 @@ static int looped; /* 1 if using loop @@ -225,8 +225,8 @@ static int looped; /* 1 if using loop
static int link_mtu; /* mtu for the link (not bundle) */ static int link_mtu; /* mtu for the link (not bundle) */
static struct utsname utsname; /* for the kernel version */ static struct utsname utsname; /* for the kernel version */
@ -29,7 +29,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
#define MAX_IFS 100 #define MAX_IFS 100
@@ -1453,11 +1453,12 @@ int ccp_fatal_error (int unit) @@ -1455,11 +1455,12 @@ int ccp_fatal_error (int unit)
* *
* path_to_procfs - find the path to the proc file system mount point * path_to_procfs - find the path to the proc file system mount point
*/ */
@ -44,7 +44,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
struct mntent *mntent; struct mntent *mntent;
FILE *fp; FILE *fp;
@@ -1479,6 +1480,7 @@ static char *path_to_procfs(const char * @@ -1481,6 +1482,7 @@ static char *path_to_procfs(const char *
fclose (fp); fclose (fp);
} }
} }
@ -52,7 +52,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
strlcpy(proc_path + proc_path_len, tail, strlcpy(proc_path + proc_path_len, tail,
sizeof(proc_path) - proc_path_len); sizeof(proc_path) - proc_path_len);
@@ -2332,15 +2334,19 @@ int ppp_available(void) @@ -2365,15 +2367,19 @@ int ppp_available(void)
int my_version, my_modification, my_patch; int my_version, my_modification, my_patch;
int osmaj, osmin, ospatch; int osmaj, osmin, ospatch;
@ -72,7 +72,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
/* XXX should get from driver */ /* XXX should get from driver */
driver_version = 2; driver_version = 2;
@@ -2400,6 +2406,7 @@ int ppp_available(void) @@ -2433,6 +2439,7 @@ int ppp_available(void)
if (ok && ((ifr.ifr_hwaddr.sa_family & ~0xFF) != ARPHRD_PPP)) if (ok && ((ifr.ifr_hwaddr.sa_family & ~0xFF) != ARPHRD_PPP))
ok = 0; ok = 0;
@ -80,7 +80,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
/* /*
* This is the PPP device. Validate the version of the driver at this * This is the PPP device. Validate the version of the driver at this
@@ -2936,6 +2943,7 @@ get_pty(master_fdp, slave_fdp, slave_nam @@ -3106,6 +3113,7 @@ get_pty(int *master_fdp, int *slave_fdp,
} }
#endif /* TIOCGPTN */ #endif /* TIOCGPTN */
@ -88,7 +88,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
if (sfd < 0) { if (sfd < 0) {
/* the old way - scan through the pty name space */ /* the old way - scan through the pty name space */
for (i = 0; i < 64; ++i) { for (i = 0; i < 64; ++i) {
@@ -2954,6 +2962,7 @@ get_pty(master_fdp, slave_fdp, slave_nam @@ -3124,6 +3132,7 @@ get_pty(int *master_fdp, int *slave_fdp,
} }
} }
} }
@ -98,11 +98,11 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
return 0; return 0;
--- a/pppd/plugins/pppoatm/pppoatm.c --- a/pppd/plugins/pppoatm/pppoatm.c
+++ b/pppd/plugins/pppoatm/pppoatm.c +++ b/pppd/plugins/pppoatm/pppoatm.c
@@ -168,14 +168,6 @@ static void disconnect_pppoatm(void) @@ -171,14 +171,6 @@ static void disconnect_pppoatm(void)
void plugin_init(void) void plugin_init(void)
{ {
-#if defined(__linux__) -#ifdef linux
- extern int new_style_driver; /* From sys-linux.c */ - extern int new_style_driver; /* From sys-linux.c */
- if (!ppp_available() && !new_style_driver) - if (!ppp_available() && !new_style_driver)
- fatal("Kernel doesn't support ppp_generic - " - fatal("Kernel doesn't support ppp_generic - "
@ -110,12 +110,12 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-#else -#else
- fatal("No PPPoATM support on this OS"); - fatal("No PPPoATM support on this OS");
-#endif -#endif
info("PPPoATM plugin_init");
add_options(pppoa_options); add_options(pppoa_options);
} }
--- a/pppd/plugins/rp-pppoe/plugin.c
+++ b/pppd/plugins/rp-pppoe/plugin.c --- a/pppd/plugins/pppoe/plugin.c
@@ -59,9 +59,6 @@ static char const RCSID[] = +++ b/pppd/plugins/pppoe/plugin.c
@@ -58,9 +58,6 @@ static char const RCSID[] =
char pppd_version[] = VERSION; char pppd_version[] = VERSION;
@ -125,7 +125,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
char *pppd_pppoe_service = NULL; char *pppd_pppoe_service = NULL;
static char *acName = NULL; static char *acName = NULL;
static char *existingSession = NULL; static char *existingSession = NULL;
@@ -394,10 +391,6 @@ PPPoEDevnameHook(char *cmd, char **argv, @@ -407,10 +404,6 @@ PPPoEDevnameHook(char *cmd, char **argv,
void void
plugin_init(void) plugin_init(void)
{ {
@ -135,7 +135,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
- -
add_options(Options); add_options(Options);
info("RP-PPPoE plugin version %s compiled against pppd %s", info("PPPoE plugin from pppd %s", VERSION);
--- a/pppd/plugins/pppol2tp/pppol2tp.c --- a/pppd/plugins/pppol2tp/pppol2tp.c
+++ b/pppd/plugins/pppol2tp/pppol2tp.c +++ b/pppd/plugins/pppol2tp/pppol2tp.c
@@ -490,12 +490,7 @@ static void pppol2tp_cleanup(void) @@ -490,12 +490,7 @@ static void pppol2tp_cleanup(void)

View File

@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/pppd.h --- a/pppd/pppd.h
+++ b/pppd/pppd.h +++ b/pppd/pppd.h
@@ -326,7 +326,6 @@ extern int holdoff; /* Dead time before @@ -317,7 +317,6 @@ extern int holdoff; /* Dead time before
extern bool holdoff_specified; /* true if user gave a holdoff value */ extern bool holdoff_specified; /* true if user gave a holdoff value */
extern bool notty; /* Stdin/out is not a tty */ extern bool notty; /* Stdin/out is not a tty */
extern char *pty_socket; /* Socket to connect to pty */ extern char *pty_socket; /* Socket to connect to pty */
@ -17,7 +17,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
extern char linkname[MAXPATHLEN]; /* logical name for link */ extern char linkname[MAXPATHLEN]; /* logical name for link */
--- a/pppd/tty.c --- a/pppd/tty.c
+++ b/pppd/tty.c +++ b/pppd/tty.c
@@ -145,7 +145,7 @@ char *disconnect_script = NULL; /* Scrip @@ -143,7 +143,7 @@ char *disconnect_script = NULL; /* Scrip
char *welcomer = NULL; /* Script to run after phys link estab. */ char *welcomer = NULL; /* Script to run after phys link estab. */
char *ptycommand = NULL; /* Command to run on other side of pty */ char *ptycommand = NULL; /* Command to run on other side of pty */
bool notty = 0; /* Stdin/out is not a tty */ bool notty = 0; /* Stdin/out is not a tty */
@ -26,7 +26,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
int max_data_rate; /* max bytes/sec through charshunt */ int max_data_rate; /* max bytes/sec through charshunt */
bool sync_serial = 0; /* Device is synchronous serial device */ bool sync_serial = 0; /* Device is synchronous serial device */
char *pty_socket = NULL; /* Socket to connect to pty */ char *pty_socket = NULL; /* Socket to connect to pty */
@@ -201,8 +201,10 @@ option_t tty_options[] = { @@ -199,8 +199,10 @@ option_t tty_options[] = {
"Send and receive over socket, arg is host:port", "Send and receive over socket, arg is host:port",
OPT_PRIO | OPT_DEVNAM }, OPT_PRIO | OPT_DEVNAM },

View File

@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/sys-linux.c --- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c +++ b/pppd/sys-linux.c
@@ -2470,6 +2470,7 @@ int ppp_available(void) @@ -2503,6 +2503,7 @@ int ppp_available(void)
void logwtmp (const char *line, const char *name, const char *host) void logwtmp (const char *line, const char *name, const char *host)
{ {
@ -15,7 +15,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
struct utmp ut, *utp; struct utmp ut, *utp;
pid_t mypid = getpid(); pid_t mypid = getpid();
#if __GLIBC__ < 2 #if __GLIBC__ < 2
@@ -2535,6 +2536,7 @@ void logwtmp (const char *line, const ch @@ -2568,6 +2569,7 @@ void logwtmp (const char *line, const ch
close (wtmp); close (wtmp);
} }
#endif #endif

View File

@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/main.c --- a/pppd/main.c
+++ b/pppd/main.c +++ b/pppd/main.c
@@ -883,14 +883,17 @@ struct protocol_list { @@ -866,14 +866,17 @@ struct protocol_list {
const char *name; const char *name;
} protocol_list[] = { } protocol_list[] = {
{ 0x21, "IP" }, { 0x21, "IP" },
@ -25,7 +25,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x33, "Stream Protocol ST-II" }, { 0x33, "Stream Protocol ST-II" },
{ 0x35, "Banyan Vines" }, { 0x35, "Banyan Vines" },
{ 0x39, "AppleTalk EDDP" }, { 0x39, "AppleTalk EDDP" },
@@ -904,8 +907,11 @@ struct protocol_list { @@ -887,8 +890,11 @@ struct protocol_list {
{ 0x49, "Serial Data Transport Protocol (PPP-SDTP)" }, { 0x49, "Serial Data Transport Protocol (PPP-SDTP)" },
{ 0x4b, "SNA over 802.2" }, { 0x4b, "SNA over 802.2" },
{ 0x4d, "SNA" }, { 0x4d, "SNA" },
@ -37,7 +37,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x53, "Encryption" }, { 0x53, "Encryption" },
{ 0x55, "Individual Link Encryption" }, { 0x55, "Individual Link Encryption" },
{ 0x57, "IPv6" }, { 0x57, "IPv6" },
@@ -916,12 +922,15 @@ struct protocol_list { @@ -899,12 +905,15 @@ struct protocol_list {
{ 0x65, "RTP IPHC Compressed non-TCP" }, { 0x65, "RTP IPHC Compressed non-TCP" },
{ 0x67, "RTP IPHC Compressed UDP 8" }, { 0x67, "RTP IPHC Compressed UDP 8" },
{ 0x69, "RTP IPHC Compressed RTP 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" }, { 0x0203, "IBM Source Routing BPDU" },
{ 0x0205, "DEC LANBridge100 Spanning Tree" }, { 0x0205, "DEC LANBridge100 Spanning Tree" },
{ 0x0207, "Cisco Discovery Protocol" }, { 0x0207, "Cisco Discovery Protocol" },
@@ -933,15 +942,19 @@ struct protocol_list { @@ -916,15 +925,19 @@ struct protocol_list {
{ 0x0231, "Luxcom" }, { 0x0231, "Luxcom" },
{ 0x0233, "Sigma Network Systems" }, { 0x0233, "Sigma Network Systems" },
{ 0x0235, "Apple Client Server Protocol" }, { 0x0235, "Apple Client Server Protocol" },
@ -73,7 +73,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x4001, "Cray Communications Control Protocol" }, { 0x4001, "Cray Communications Control Protocol" },
{ 0x4003, "CDPD Mobile Network Registration Protocol" }, { 0x4003, "CDPD Mobile Network Registration Protocol" },
{ 0x4005, "Expand accelerator protocol" }, { 0x4005, "Expand accelerator protocol" },
@@ -952,8 +965,10 @@ struct protocol_list { @@ -935,8 +948,10 @@ struct protocol_list {
{ 0x4023, "RefTek Protocol" }, { 0x4023, "RefTek Protocol" },
{ 0x4025, "Fibre Channel" }, { 0x4025, "Fibre Channel" },
{ 0x4027, "EMIT Protocols" }, { 0x4027, "EMIT Protocols" },
@ -84,7 +84,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x8023, "OSI Network Layer Control Protocol" }, { 0x8023, "OSI Network Layer Control Protocol" },
{ 0x8025, "Xerox NS IDP Control Protocol" }, { 0x8025, "Xerox NS IDP Control Protocol" },
{ 0x8027, "DECnet Phase IV Control Protocol" }, { 0x8027, "DECnet Phase IV Control Protocol" },
@@ -962,7 +977,9 @@ struct protocol_list { @@ -945,7 +960,9 @@ struct protocol_list {
{ 0x8031, "Bridging NCP" }, { 0x8031, "Bridging NCP" },
{ 0x8033, "Stream Protocol Control Protocol" }, { 0x8033, "Stream Protocol Control Protocol" },
{ 0x8035, "Banyan Vines 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" }, { 0x803f, "NETBIOS Framing Control Protocol" },
{ 0x8041, "Cisco Systems Control Protocol" }, { 0x8041, "Cisco Systems Control Protocol" },
{ 0x8043, "Ascom Timeplex" }, { 0x8043, "Ascom Timeplex" },
@@ -971,18 +988,24 @@ struct protocol_list { @@ -954,18 +971,24 @@ struct protocol_list {
{ 0x8049, "Serial Data Control Protocol (PPP-SDCP)" }, { 0x8049, "Serial Data Control Protocol (PPP-SDCP)" },
{ 0x804b, "SNA over 802.2 Control Protocol" }, { 0x804b, "SNA over 802.2 Control Protocol" },
{ 0x804d, "SNA Control Protocol" }, { 0x804d, "SNA Control Protocol" },
@ -119,7 +119,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{ 0x8207, "Cisco Discovery Protocol Control" }, { 0x8207, "Cisco Discovery Protocol Control" },
{ 0x8209, "Netcs Twin Routing" }, { 0x8209, "Netcs Twin Routing" },
{ 0x820b, "STP - Control Protocol" }, { 0x820b, "STP - Control Protocol" },
@@ -991,24 +1014,29 @@ struct protocol_list { @@ -974,24 +997,29 @@ struct protocol_list {
{ 0x8281, "MPLSCP" }, { 0x8281, "MPLSCP" },
{ 0x8285, "IEEE p1284.4 standard - Protocol Control" }, { 0x8285, "IEEE p1284.4 standard - Protocol Control" },
{ 0x8287, "ETSI TETRA TNP1 Control Protocol" }, { 0x8287, "ETSI TETRA TNP1 Control Protocol" },

View File

@ -9,7 +9,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/options.c --- a/pppd/options.c
+++ b/pppd/options.c +++ b/pppd/options.c
@@ -349,13 +349,14 @@ option_t general_options[] = { @@ -348,13 +348,14 @@ option_t general_options[] = {
"Enable multilink operation", OPT_PRIOSUB | OPT_ALIAS | 1 }, "Enable multilink operation", OPT_PRIOSUB | OPT_ALIAS | 1 },
{ "nomultilink", o_bool, &multilink, { "nomultilink", o_bool, &multilink,
"Disable multilink operation", OPT_PRIOSUB | 0 }, "Disable multilink operation", OPT_PRIOSUB | 0 },

View File

@ -1,8 +1,8 @@
--- a/configure --- a/configure
+++ b/configure +++ b/configure
@@ -195,7 +195,7 @@ if [ -d "$ksrc" ]; then @@ -133,7 +133,7 @@ if [ -d "$ksrc" ]; then
mkmkf $ksrc/Makedefs$compiletype Makedefs.com mkmkf $ksrc/Makedefs$compiletype Makedefs.com
for dir in pppd pppstats chat pppdump pppd/plugins pppd/plugins/rp-pppoe \ for dir in pppd pppstats chat pppdump pppd/plugins pppd/plugins/pppoe \
pppd/plugins/radius pppd/plugins/pppoatm \ pppd/plugins/radius pppd/plugins/pppoatm \
- pppd/plugins/pppol2tp; do - pppd/plugins/pppol2tp; do
+ pppd/plugins/pppol2tp pppd/plugins/pptp ; do + pppd/plugins/pppol2tp pppd/plugins/pptp ; do
@ -11,12 +11,12 @@
if [ -f $ksrc/Makefile.$makext$archvariant ]; then if [ -f $ksrc/Makefile.$makext$archvariant ]; then
--- a/pppd/plugins/Makefile.linux --- a/pppd/plugins/Makefile.linux
+++ b/pppd/plugins/Makefile.linux +++ b/pppd/plugins/Makefile.linux
@@ -9,7 +9,7 @@ BINDIR = $(DESTDIR)/sbin @@ -14,7 +14,7 @@ INSTALL = install
MANDIR = $(DESTDIR)/share/man/man8 # EAP-TLS
LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION) CFLAGS += -DUSE_EAPTLS=1
-SUBDIRS := rp-pppoe pppoatm pppol2tp -SUBDIRS := pppoe pppoatm pppol2tp
+SUBDIRS := rp-pppoe pppoatm pppol2tp pptp +SUBDIRS := pppoe pppoatm pppol2tp pptp
# Uncomment the next line to include the radius authentication plugin # Uncomment the next line to include the radius authentication plugin
SUBDIRS += radius SUBDIRS += radius
PLUGINS := minconn.so passprompt.so passwordfd.so winbind.so PLUGINS := minconn.so passprompt.so passwordfd.so winbind.so

View File

@ -15,9 +15,9 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875.
--- a/pppd/Makefile.linux --- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux +++ b/pppd/Makefile.linux
@@ -35,10 +35,10 @@ endif @@ -36,10 +36,10 @@ endif
COPTS = -O2 -pipe -Wall -g
LIBS = -lpthread LIBS = -lrt
-# Uncomment the next line to include support for Microsoft's -# Uncomment the next line to include support for Microsoft's
+# Uncomment the next 2 lines to include support for Microsoft's +# Uncomment the next 2 lines to include support for Microsoft's
@ -28,19 +28,19 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875.
# Don't use MSLANMAN unless you really know what you're doing. # Don't use MSLANMAN unless you really know what you're doing.
#MSLANMAN=y #MSLANMAN=y
# Uncomment the next line to include support for MPPE. CHAPMS (above) must # Uncomment the next line to include support for MPPE. CHAPMS (above) must
@@ -141,8 +141,7 @@ endif @@ -158,8 +158,7 @@ endif
ifdef NEEDDES ifdef NEEDDES
ifndef USE_CRYPT ifndef USE_CRYPT
-CFLAGS += -I$(shell $(CC) --print-sysroot)/usr/include/openssl -CFLAGS += -I$(shell $(CC) --print-sysroot)/usr/include/openssl
-LIBS += -lcrypto -NEEDCRYPTOLIB = y
+LIBS += -ldes $(LIBS) +LIBS += -ldes $(LIBS)
else else
CFLAGS += -DUSE_CRYPT=1 CFLAGS += -DUSE_CRYPT=1
endif endif
--- a/pppd/pppcrypt.c --- a/pppd/pppcrypt.c
+++ b/pppd/pppcrypt.c +++ b/pppd/pppcrypt.c
@@ -64,7 +64,7 @@ u_char *des_key; /* OUT 64 bit DES key w @@ -62,7 +62,7 @@ MakeKey(u_char *key, u_char *des_key)
des_key[7] = Get7Bits(key, 49); des_key[7] = Get7Bits(key, 49);
#ifndef USE_CRYPT #ifndef USE_CRYPT
@ -49,7 +49,7 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875.
#endif #endif
} }
@@ -158,25 +158,25 @@ u_char *clear; /* OUT 8 octets */ @@ -147,30 +147,30 @@ DesDecrypt(u_char *cipher, u_char *clear
} }
#else /* USE_CRYPT */ #else /* USE_CRYPT */
@ -57,8 +57,7 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875.
+static des_key_schedule key_schedule; +static des_key_schedule key_schedule;
bool bool
DesSetkey(key) DesSetkey(u_char *key)
u_char *key;
{ {
- DES_cblock des_key; - DES_cblock des_key;
+ des_cblock des_key; + des_cblock des_key;
@ -69,10 +68,7 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875.
} }
bool bool
-DesEncrypt(clear, cipher) DesEncrypt(u_char *clear, u_char *cipher)
+DesEncrypt(clear, key, cipher)
u_char *clear; /* IN 8 octets */
u_char *cipher; /* OUT 8 octets */
{ {
- DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher, - DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher,
- &key_schedule, 1); - &key_schedule, 1);
@ -81,9 +77,8 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875.
return (1); return (1);
} }
@@ -185,8 +185,8 @@ DesDecrypt(cipher, clear) bool
u_char *cipher; /* IN 8 octets */ DesDecrypt(u_char *cipher, u_char *clear)
u_char *clear; /* OUT 8 octets */
{ {
- DES_ecb_encrypt((DES_cblock *)cipher, (DES_cblock *)clear, - DES_ecb_encrypt((DES_cblock *)cipher, (DES_cblock *)clear,
- &key_schedule, 0); - &key_schedule, 0);

View File

@ -50,7 +50,7 @@ endef
define Package/wireguard define Package/wireguard
$(call Package/wireguard/Default) $(call Package/wireguard/Default)
TITLE:=WireGuard meta-package TITLE:=WireGuard meta-package
DEPENDS:=+wireguard-tools +kmod-wireguard DEPENDS:=+wireguard-tools +kmod-wireguard @LINUX_5_4
endef endef
include $(INCLUDE_DIR)/kernel-defaults.mk include $(INCLUDE_DIR)/kernel-defaults.mk
@ -73,7 +73,7 @@ define KernelPackage/wireguard
CATEGORY:=Kernel modules CATEGORY:=Kernel modules
SUBMENU:=Network Support SUBMENU:=Network Support
TITLE:=WireGuard kernel module TITLE:=WireGuard kernel module
DEPENDS:=+IPV6:kmod-udptunnel6 +kmod-udptunnel4 DEPENDS:=+IPV6:kmod-udptunnel6 +kmod-udptunnel4 @LINUX_5_4
FILES:= $(PKG_BUILD_DIR)/src/wireguard.$(LINUX_KMOD_SUFFIX) FILES:= $(PKG_BUILD_DIR)/src/wireguard.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoProbe,wireguard) AUTOLOAD:=$(call AutoProbe,wireguard)
endef endef

View File

@ -12,9 +12,9 @@ PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git
PKG_SOURCE_DATE:=2021-02-08 PKG_SOURCE_DATE:=2021-02-23
PKG_SOURCE_VERSION:=08938fe1cbc06eeaafa39448057368391d165272 PKG_SOURCE_VERSION:=37eed131e9967a35f47bacb3437a9d3c8a57b3f4
PKG_MIRROR_HASH:=efc3deac56057e929789d44742858b2a16d976f6bfa0a2036e413d10afcaeee4 PKG_MIRROR_HASH:=2b0131ff9055ccf987cbeb5f36c2c2585dc780999df6be312fbbbcd61ce676d4
CMAKE_INSTALL:=1 CMAKE_INSTALL:=1
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0

View File

@ -23,18 +23,26 @@ usage() {
printf "\n\t-c ==> set config name 'config'" printf "\n\t-c ==> set config name 'config'"
printf "\n\t-a ==> set load address to 'addr' (hex)" printf "\n\t-a ==> set load address to 'addr' (hex)"
printf "\n\t-e ==> set entry point to 'entry' (hex)" printf "\n\t-e ==> set entry point to 'entry' (hex)"
printf "\n\t-f ==> set device tree compatible string"
printf "\n\t-i ==> include initrd Blob 'initrd'"
printf "\n\t-v ==> set kernel version to 'version'" printf "\n\t-v ==> set kernel version to 'version'"
printf "\n\t-k ==> include kernel image 'kernel'" printf "\n\t-k ==> include kernel image 'kernel'"
printf "\n\t-D ==> human friendly Device Tree Blob 'name'" printf "\n\t-D ==> human friendly Device Tree Blob 'name'"
printf "\n\t-n ==> fdt unit-address 'address'" printf "\n\t-n ==> fdt unit-address 'address'"
printf "\n\t-d ==> include Device Tree Blob 'dtb'" printf "\n\t-d ==> include Device Tree Blob 'dtb'"
printf "\n\t-r ==> include RootFS blob 'rootfs'"
printf "\n\t-H ==> specify hash algo instead of SHA1"
printf "\n\t-o ==> create output file 'its_file'\n" printf "\n\t-o ==> create output file 'its_file'\n"
exit 1 exit 1
} }
FDTNUM=1 FDTNUM=1
ROOTFSNUM=1
INITRDNUM=1
HASH=sha1
LOADABLES=
while getopts ":A:a:c:C:D:d:e:k:n:o:v:" OPTION while getopts ":A:a:c:C:D:d:e:f:i:k:n:o:v:r:S" OPTION
do do
case $OPTION in case $OPTION in
A ) ARCH=$OPTARG;; A ) ARCH=$OPTARG;;
@ -44,9 +52,13 @@ do
D ) DEVICE=$OPTARG;; D ) DEVICE=$OPTARG;;
d ) DTB=$OPTARG;; d ) DTB=$OPTARG;;
e ) ENTRY_ADDR=$OPTARG;; e ) ENTRY_ADDR=$OPTARG;;
f ) COMPATIBLE=$OPTARG;;
i ) INITRD=$OPTARG;;
k ) KERNEL=$OPTARG;; k ) KERNEL=$OPTARG;;
n ) FDTNUM=$OPTARG;; n ) FDTNUM=$OPTARG;;
o ) OUTPUT=$OPTARG;; o ) OUTPUT=$OPTARG;;
r ) ROOTFS=$OPTARG;;
S ) HASH=$OPTARG;;
v ) VERSION=$OPTARG;; v ) VERSION=$OPTARG;;
* ) echo "Invalid option passed to '$0' (options:$*)" * ) echo "Invalid option passed to '$0' (options:$*)"
usage;; usage;;
@ -62,11 +74,16 @@ fi
ARCH_UPPER=$(echo "$ARCH" | tr '[:lower:]' '[:upper:]') ARCH_UPPER=$(echo "$ARCH" | tr '[:lower:]' '[:upper:]')
if [ -n "${COMPATIBLE}" ]; then
COMPATIBLE_PROP="compatible = \"${COMPATIBLE}\";"
fi
# Conditionally create fdt information # Conditionally create fdt information
if [ -n "${DTB}" ]; then if [ -n "${DTB}" ]; then
FDT_NODE=" FDT_NODE="
fdt@$FDTNUM { fdt@$FDTNUM {
description = \"${ARCH_UPPER} OpenWrt ${DEVICE} device tree blob\"; description = \"${ARCH_UPPER} OpenWrt ${DEVICE} device tree blob\";
${COMPATIBLE_PROP}
data = /incbin/(\"${DTB}\"); data = /incbin/(\"${DTB}\");
type = \"flat_dt\"; type = \"flat_dt\";
arch = \"${ARCH}\"; arch = \"${ARCH}\";
@ -75,13 +92,55 @@ if [ -n "${DTB}" ]; then
algo = \"crc32\"; algo = \"crc32\";
}; };
hash@2 { hash@2 {
algo = \"sha1\"; algo = \"${HASH}\";
}; };
}; };
" "
FDT_PROP="fdt = \"fdt@$FDTNUM\";" FDT_PROP="fdt = \"fdt@$FDTNUM\";"
fi fi
if [ -n "${INITRD}" ]; then
INITRD_NODE="
initrd@$INITRDNUM {
description = \"${ARCH_UPPER} OpenWrt ${DEVICE} initrd\";
${COMPATIBLE_PROP}
data = /incbin/(\"${INITRD}\");
type = \"ramdisk\";
arch = \"${ARCH}\";
os = \"linux\";
hash@1 {
algo = \"crc32\";
};
hash@2 {
algo = \"${HASH}\";
};
};
"
INITRD_PROP="ramdisk=\"initrd@${INITRDNUM}\";"
fi
if [ -n "${ROOTFS}" ]; then
dd if="${ROOTFS}" of="${ROOTFS}.pagesync" bs=4096 conv=sync
ROOTFS_NODE="
rootfs@$ROOTFSNUM {
description = \"${ARCH_UPPER} OpenWrt ${DEVICE} rootfs\";
${COMPATIBLE_PROP}
data = /incbin/(\"${ROOTFS}.pagesync\");
type = \"filesystem\";
arch = \"${ARCH}\";
compression = \"none\";
hash@1 {
algo = \"crc32\";
};
hash@2 {
algo = \"${HASH}\";
};
};
"
LOADABLES="${LOADABLES:+$LOADABLES, }\"rootfs@${ROOTFSNUM}\""
fi
# Create a default, fully populated DTS file # Create a default, fully populated DTS file
DATA="/dts-v1/; DATA="/dts-v1/;
@ -103,18 +162,23 @@ DATA="/dts-v1/;
algo = \"crc32\"; algo = \"crc32\";
}; };
hash@2 { hash@2 {
algo = \"sha1\"; algo = \"$HASH\";
}; };
}; };
${INITRD_NODE}
${FDT_NODE} ${FDT_NODE}
${ROOTFS_NODE}
}; };
configurations { configurations {
default = \"${CONFIG}\"; default = \"${CONFIG}\";
${CONFIG} { ${CONFIG} {
description = \"OpenWrt\"; description = \"OpenWrt ${DEVICE}\";
kernel = \"kernel@1\"; kernel = \"kernel@1\";
${FDT_PROP} ${FDT_PROP}
${LOADABLES:+loadables = ${LOADABLES};}
${COMPATIBLE_PROP}
${INITRD_PROP}
}; };
}; };
};" };"

View File

@ -33,6 +33,7 @@ sub target_config_features(@) {
/^fpu$/ and $ret .= "\tselect HAS_FPU\n"; /^fpu$/ and $ret .= "\tselect HAS_FPU\n";
/^spe_fpu$/ and $ret .= "\tselect HAS_SPE_FPU\n"; /^spe_fpu$/ and $ret .= "\tselect HAS_SPE_FPU\n";
/^ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n"; /^ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n";
/^seperate_ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n\tselect USES_SEPERATE_INITRAMFS\n";
/^powerpc64$/ and $ret .= "\tselect powerpc64\n"; /^powerpc64$/ and $ret .= "\tselect powerpc64\n";
/^nommu$/ and $ret .= "\tselect NOMMU\n"; /^nommu$/ and $ret .= "\tselect NOMMU\n";
/^mips16$/ and $ret .= "\tselect HAS_MIPS16\n"; /^mips16$/ and $ret .= "\tselect HAS_MIPS16\n";

View File

@ -51,6 +51,9 @@ config USES_DEVICETREE
config USES_INITRAMFS config USES_INITRAMFS
bool bool
config USES_SEPERATE_INITRAMFS
bool
config USES_SQUASHFS config USES_SQUASHFS
bool bool

View File

@ -196,10 +196,6 @@
status = "okay"; status = "okay";
}; };
&uart {
status = "okay";
};
&usb { &usb {
status = "okay"; status = "okay";
}; };

View File

@ -150,10 +150,6 @@
}; };
}; };
&uart {
status = "okay";
};
&usb { &usb {
status = "okay"; status = "okay";
}; };

View File

@ -41,8 +41,6 @@
reg-io-width = <4>; reg-io-width = <4>;
reg-shift = <2>; reg-shift = <2>;
no-loopback-test; no-loopback-test;
status = "disabled";
}; };
usb_phy: usb-phy@18030000 { usb_phy: usb-phy@18030000 {

View File

@ -48,10 +48,6 @@
}; };
}; };
&uart {
status = "okay";
};
&gpio { &gpio {
ngpios = <31>; ngpios = <31>;
gpio-line-names = gpio-line-names =

View File

@ -91,7 +91,3 @@
}; };
}; };
}; };
&uart {
status = "okay";
};

View File

@ -120,10 +120,6 @@
}; };
}; };
&uart {
status = "okay";
};
&mdio0 { &mdio0 {
status = "okay"; status = "okay";

View File

@ -212,10 +212,6 @@
}; };
}; };
&uart {
status = "okay";
};
&pll { &pll {
clocks = <&extosc>; clocks = <&extosc>;
}; };

View File

@ -159,10 +159,6 @@
}; };
}; };
&uart {
status = "okay";
};
&pll { &pll {
clocks = <&extosc>; clocks = <&extosc>;
}; };

View File

@ -117,7 +117,3 @@
}; };
}; };
}; };
&uart {
status = "okay";
};

View File

@ -102,10 +102,6 @@
clocks = <&extosc>; clocks = <&extosc>;
}; };
&uart {
status = "okay";
};
&mdio0 { &mdio0 {
status = "okay"; status = "okay";

View File

@ -188,10 +188,6 @@
}; };
}; };
&uart {
status = "okay";
};
&spi { &spi {
status = "okay"; status = "okay";

View File

@ -75,10 +75,6 @@
status = "okay"; status = "okay";
}; };
&uart {
status = "okay";
};
&mdio0 { &mdio0 {
status = "okay"; status = "okay";

View File

@ -67,10 +67,6 @@
}; };
}; };
&uart {
status = "okay";
};
&usb_phy { &usb_phy {
status = "okay"; status = "okay";
}; };

View File

@ -181,7 +181,3 @@
pinctrl-single,bits = <0x0 0x0 0xf8>; pinctrl-single,bits = <0x0 0x0 0xf8>;
}; };
}; };
&uart {
status = "okay";
};

View File

@ -157,7 +157,3 @@
pinctrl-single,bits = <0x0 0x0 0xf8>; pinctrl-single,bits = <0x0 0x0 0xf8>;
}; };
}; };
&uart {
status = "okay";
};

View File

@ -1,10 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "ar7240.dtsi" #include "ar7240.dtsi"
#include "ar724x_senao_loader.dtsi"
#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h> #include <dt-bindings/input/input.h>
#include <dt-bindings/mtd/partitions/uimage.h>
/ { / {
compatible = "engenius,enh202-v1", "qca,ar7240"; compatible = "engenius,enh202-v1", "qca,ar7240";
@ -69,96 +69,6 @@
linux,default-trigger = "phy0tpt"; linux,default-trigger = "phy0tpt";
}; };
}; };
virtual_flash {
compatible = "mtd-concat";
devices = <&fwconcat0 &fwconcat1>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
compatible = "openwrt,uimage", "denx,uimage";
openwrt,ih-magic = <IH_MAGIC_OKLI>;
label = "firmware";
reg = <0x0 0x0>;
};
};
};
};
&uart {
status = "okay";
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <20000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x40000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x40000 0x10000>;
};
partition@50000 {
label = "custom";
reg = <0x50000 0x50000>;
read-only;
};
partition@a0000 {
label = "loader";
reg = <0xa0000 0x10000>;
read-only;
};
fwconcat1: partition@b0000 {
label = "fwconcat1";
reg = <0xb0000 0xf0000>;
};
partition@1a0000 {
label = "fakeroot";
reg = <0x1a0000 0x10000>;
read-only;
};
fwconcat0: partition@1b0000 {
label = "fwconcat0";
reg = <0x1b0000 0x4c0000>;
};
partition@670000 {
label = "failsafe";
reg = <0x670000 0x180000>;
read-only;
};
art: partition@7f0000 {
label = "art";
reg = <0x7f0000 0x10000>;
read-only;
};
};
};
}; };
&eth0 { &eth0 {

View File

@ -196,7 +196,3 @@
gpio-controller; gpio-controller;
}; };
}; };
&uart {
status = "okay";
};

View File

@ -129,7 +129,3 @@
gpio-controller; gpio-controller;
}; };
}; };
&uart {
status = "okay";
};

View File

@ -115,7 +115,3 @@
pinctrl-single,bits = <0x0 0x0 0xf8>; pinctrl-single,bits = <0x0 0x0 0xf8>;
}; };
}; };
&uart {
status = "okay";
};

View File

@ -201,7 +201,3 @@
gpio-controller; gpio-controller;
}; };
}; };
&uart {
status = "okay";
};

View File

@ -185,10 +185,6 @@
}; };
}; };
&uart {
status = "okay";
};
&usb_phy { &usb_phy {
status = "okay"; status = "okay";
}; };

View File

@ -104,7 +104,3 @@
mtd-mac-address = <&uboot 0x1fc00>; mtd-mac-address = <&uboot 0x1fc00>;
mtd-mac-address-increment = <1>; mtd-mac-address-increment = <1>;
}; };
&uart {
status = "okay";
};

View File

@ -150,7 +150,3 @@
mtd-mac-address = <&uboot 0x1fc00>; mtd-mac-address = <&uboot 0x1fc00>;
mtd-mac-address-increment = <1>; mtd-mac-address-increment = <1>;
}; };
&uart {
status = "okay";
};

View File

@ -27,10 +27,6 @@
}; };
}; };
&uart {
status = "okay";
};
&pll { &pll {
clocks = <&extosc>; clocks = <&extosc>;
}; };

View File

@ -133,10 +133,6 @@
}; };
}; };
&uart {
status = "okay";
};
&pcie { &pcie {
status = "okay"; status = "okay";

View File

@ -144,10 +144,6 @@
clocks = <&extosc>; clocks = <&extosc>;
}; };
&uart {
status = "okay";
};
&usb_phy { &usb_phy {
status = "okay"; status = "okay";
}; };

View File

@ -217,10 +217,6 @@
clocks = <&extosc>; clocks = <&extosc>;
}; };
&uart {
status = "okay";
};
&usb_phy { &usb_phy {
status = "okay"; status = "okay";
}; };

View File

@ -1,10 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "ar7242.dtsi" #include "ar7242.dtsi"
#include "ar724x_senao_loader.dtsi"
#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h> #include <dt-bindings/input/input.h>
#include <dt-bindings/mtd/partitions/uimage.h>
/ { / {
compatible = "engenius,eap350-v1", "qca,ar7242"; compatible = "engenius,eap350-v1", "qca,ar7242";
@ -48,96 +48,6 @@
linux,default-trigger = "phy0tpt"; linux,default-trigger = "phy0tpt";
}; };
}; };
virtual_flash {
compatible = "mtd-concat";
devices = <&fwconcat0 &fwconcat1>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
compatible = "openwrt,uimage", "denx,uimage";
openwrt,ih-magic = <IH_MAGIC_OKLI>;
label = "firmware";
reg = <0x0 0x0>;
};
};
};
};
&uart {
status = "okay";
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <20000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x40000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x40000 0x10000>;
};
partition@50000 {
label = "custom";
reg = <0x50000 0x50000>;
read-only;
};
partition@a0000 {
label = "loader";
reg = <0xa0000 0x10000>;
read-only;
};
fwconcat1: partition@b0000 {
label = "fwconcat1";
reg = <0xb0000 0xf0000>;
};
partition@1a0000 {
label = "fakeroot";
reg = <0x1a0000 0x10000>;
read-only;
};
fwconcat0: partition@1b0000 {
label = "fwconcat0";
reg = <0x1b0000 0x4c0000>;
};
partition@670000 {
label = "failsafe";
reg = <0x670000 0x180000>;
read-only;
};
art: partition@7f0000 {
label = "art";
reg = <0x7f0000 0x10000>;
read-only;
};
};
};
}; };
&mdio0 { &mdio0 {

View File

@ -1,10 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "ar7242.dtsi" #include "ar7242.dtsi"
#include "ar724x_senao_loader.dtsi"
#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h> #include <dt-bindings/input/input.h>
#include <dt-bindings/mtd/partitions/uimage.h>
/ { / {
compatible = "engenius,ecb350-v1", "qca,ar7242"; compatible = "engenius,ecb350-v1", "qca,ar7242";
@ -48,96 +48,6 @@
linux,default-trigger = "phy0tpt"; linux,default-trigger = "phy0tpt";
}; };
}; };
virtual_flash {
compatible = "mtd-concat";
devices = <&fwconcat0 &fwconcat1>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
compatible = "openwrt,uimage", "denx,uimage";
openwrt,ih-magic = <IH_MAGIC_OKLI>;
label = "firmware";
reg = <0x0 0x0>;
};
};
};
};
&uart {
status = "okay";
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <20000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x40000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x40000 0x10000>;
};
partition@50000 {
label = "custom";
reg = <0x50000 0x50000>;
read-only;
};
partition@a0000 {
label = "loader";
reg = <0xa0000 0x10000>;
read-only;
};
fwconcat1: partition@b0000 {
label = "fwconcat1";
reg = <0xb0000 0xf0000>;
};
partition@1a0000 {
label = "fakeroot";
reg = <0x1a0000 0x10000>;
read-only;
};
fwconcat0: partition@1b0000 {
label = "fwconcat0";
reg = <0x1b0000 0x4c0000>;
};
partition@670000 {
label = "failsafe";
reg = <0x670000 0x180000>;
read-only;
};
art: partition@7f0000 {
label = "art";
reg = <0x7f0000 0x10000>;
read-only;
};
};
};
}; };
&mdio0 { &mdio0 {

View File

@ -90,10 +90,6 @@
clocks = <&extosc>; clocks = <&extosc>;
}; };
&uart {
status = "okay";
};
&mdio0 { &mdio0 {
status = "okay"; status = "okay";

View File

@ -134,10 +134,6 @@
}; };
}; };
&uart {
status = "okay";
};
&usb { &usb {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View File

@ -128,10 +128,6 @@
status = "okay"; status = "okay";
}; };
&uart {
status = "okay";
};
&eth1 { &eth1 {
status = "okay"; status = "okay";

View File

@ -45,8 +45,6 @@
reg-io-width = <4>; reg-io-width = <4>;
reg-shift = <2>; reg-shift = <2>;
no-loopback-test; no-loopback-test;
status = "disabled";
}; };
gpio: gpio@18040000 { gpio: gpio@18040000 {

View File

@ -0,0 +1,91 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include <dt-bindings/mtd/partitions/uimage.h>
/ {
virtual_flash {
compatible = "mtd-concat";
devices = <&fwconcat0 &fwconcat1>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
compatible = "openwrt,uimage", "denx,uimage";
openwrt,ih-magic = <IH_MAGIC_OKLI>;
label = "firmware";
reg = <0x0 0x0>;
};
};
};
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <20000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x40000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x40000 0x10000>;
};
partition@50000 {
label = "custom";
reg = <0x50000 0x50000>;
read-only;
};
partition@a0000 {
label = "loader";
reg = <0xa0000 0x10000>;
read-only;
};
fwconcat1: partition@b0000 {
label = "fwconcat1";
reg = <0xb0000 0xf0000>;
};
partition@1a0000 {
label = "fakeroot";
reg = <0x1a0000 0x10000>;
read-only;
};
fwconcat0: partition@1b0000 {
label = "fwconcat0";
reg = <0x1b0000 0x4c0000>;
};
partition@670000 {
label = "failsafe";
reg = <0x670000 0x180000>;
read-only;
};
art: partition@7f0000 {
label = "art";
reg = <0x7f0000 0x10000>;
read-only;
};
};
};
};

View File

@ -15,10 +15,6 @@
}; };
}; };
&uart {
status = "okay";
};
&spi { &spi {
status = "okay"; status = "okay";

View File

@ -72,8 +72,6 @@
reg-io-width = <4>; reg-io-width = <4>;
reg-shift = <2>; reg-shift = <2>;
no-loopback-test; no-loopback-test;
status = "disabled";
}; };
gpio: gpio@18040000 { gpio: gpio@18040000 {

View File

@ -62,10 +62,6 @@
}; };
}; };
&uart {
status = "okay";
};
&pll { &pll {
clocks = <&extosc>; clocks = <&extosc>;
}; };

View File

@ -79,10 +79,6 @@
}; };
}; };
&uart {
status = "okay";
};
&pll { &pll {
clocks = <&extosc>; clocks = <&extosc>;
}; };

View File

@ -106,10 +106,6 @@
}; };
}; };
&uart {
status = "okay";
};
&spi { &spi {
status = "okay"; status = "okay";

View File

@ -8,6 +8,10 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
aliases {
serial0 = &uart;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
@ -41,8 +45,6 @@
clocks = <&pll ATH79_CLK_REF>; clocks = <&pll ATH79_CLK_REF>;
clock-names = "uart"; clock-names = "uart";
status = "disabled";
}; };
gpio: gpio@18040000 { gpio: gpio@18040000 {

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