Merge Mainline

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2021-06-26 16:49:16 +08:00
commit 7e984cf5b0
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
19 changed files with 175 additions and 167 deletions

View File

@ -7,7 +7,7 @@ menu "Global build settings"
config JSON_OVERVIEW_IMAGE_INFO
bool "Create JSON info file overview per target"
default BUILDBOT
default y
help
Create a JSON info file called profiles.json in the target
directory containing machine readable list of built profiles

View File

@ -10,13 +10,22 @@ __target_inc=1
DEVICE_TYPE?=router
# Default packages - the really basic set
DEFAULT_PACKAGES:=base-files libc libgcc dropbear mtd uci opkg netifd fstools uclient-fetch logd urandom-seed urngd \
block-mount kmod-nf-nathelper kmod-nf-nathelper-extra kmod-ipt-raw wget-ssl libustream-openssl ca-certificates \
default-settings luci luci-app-ddns luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \
luci-app-filetransfer luci-app-vsftpd luci-app-ssr-plus luci-app-unblockmusic \
luci-app-arpbind luci-app-vlmcsd luci-app-wol luci-app-ramfree \
luci-app-turboacc luci-app-nlbwmon luci-app-accesscontrol luci-app-cpufreq \
ddns-scripts_aliyun ddns-scripts_dnspod
DEFAULT_PACKAGES:=\
base-files \
ca-bundle \
dropbear \
fstools \
libc \
libgcc \
libustream-openssl \
logd \
mtd \
netifd \
opkg \
uci \
uclient-fetch \
urandom-seed \
urngd
ifneq ($(CONFIG_SELINUX),)
DEFAULT_PACKAGES+=busybox-selinux procd-selinux
@ -24,11 +33,51 @@ else
DEFAULT_PACKAGES+=busybox procd
endif
# For the basic set
DEFAULT_PACKAGES.basic:=
# For nas targets
DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm
DEFAULT_PACKAGES.nas:=\
block-mount \
fdisk \
lsblk \
mdadm
# For router targets
DEFAULT_PACKAGES.router:=dnsmasq-full iptables ppp ppp-mod-pppoe firewall
DEFAULT_PACKAGES.bootloader:=
DEFAULT_PACKAGES.router:=\
dnsmasq-full \
firewall \
iptables \
ppp \
ppp-mod-pppoe
# For easy usage
DEFAULT_PACKAGES.tweak:=\
block-mount \
ca-certificates \
coreutils \
ddns-scripts_aliyun \
ddns-scripts_dnspod \
default-settings \
kmod-ipt-raw \
kmod-nf-nathelper \
kmod-nf-nathelper-extra \
luci \
luci-app-accesscontrol \
luci-app-arpbind \
luci-app-autoreboot \
luci-app-cpufreq \
luci-app-ddns \
luci-app-filetransfer \
luci-app-nlbwmon \
luci-app-turboacc \
luci-app-ramfree \
luci-app-ssr-plus \
luci-app-vlmcsd \
luci-app-wol \
luci-compat \
luci-lib-base \
luci-lib-fs \
luci-lib-ipkg \
luci-proto-relay \
wget-ssl
ifneq ($(DUMP),)
all: dumpinfo
@ -61,6 +110,9 @@ else
endif
endif
# Add tweaked packages
DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.tweak)
# Add device specific packages (here below to allow device type set from subtarget)
DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE))

View File

@ -4,8 +4,7 @@
START=10
USE_PROCD=1
validate_system_section()
{
validate_system_section() {
uci_load_validate system system "$1" "$2" \
'hostname:string:OpenWrt' \
'conloglevel:uinteger' \
@ -23,8 +22,9 @@ system_config() {
echo "$hostname" > /proc/sys/kernel/hostname
[ -z "$conloglevel" -a -z "$buffersize" ] || dmesg ${conloglevel:+-n $conloglevel} ${buffersize:+-s $buffersize}
echo "$timezone" > /tmp/TZ
[ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/$zonename" ] && \
ln -sf "/usr/share/zoneinfo/$zonename" /tmp/localtime && rm -f /tmp/TZ
[ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/${zonename// /_}" ] \
&& ln -sf "/usr/share/zoneinfo/${zonename// /_}" /tmp/localtime \
&& rm -f /tmp/TZ
# apply timezone to kernel
hwclock -u --systz
@ -35,8 +35,7 @@ reload_service() {
config_foreach validate_system_section system system_config
}
service_triggers()
{
service_triggers() {
procd_add_reload_trigger "system"
procd_add_validation validate_system_section
}

View File

@ -55,7 +55,12 @@ enable() {
enabled() {
name="$(basename "${initscript}")"
[ -x "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}" ]
name="${name##[SK][0-9][0-9]}"
{
[ -z "${START:-}" ] || [ -L "$IPKG_INSTROOT/etc/rc.d/S${START}$name" ]
} && {
[ -z "${STOP:-}" ] || [ -L "$IPKG_INSTROOT/etc/rc.d/K${STOP}$name" ]
}
}
depends() {

View File

@ -18,6 +18,9 @@ preinit_ip_config() {
fi
ip link set dev $netdev up
if [ -n "$vid" ]; then
ip link set dev $1 up
fi
ip -4 address add $pi_ip/$pi_netmask broadcast $pi_broadcast dev $1
}
@ -91,6 +94,8 @@ preinit_config_board() {
else
# trim any vlan ids
ifname=${ifname%\.*}
# trim any vlan modifiers like :t
ifname=${ifname%\:*}
fi
pi_ifname=$ifname

View File

@ -7,12 +7,12 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=grub
PKG_CPE_ID:=cpe:/a:gnu:grub2
PKG_VERSION:=2.06~rc1
PKG_VERSION:=2.06
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://alpha.gnu.org/gnu/grub
PKG_HASH:=2c87f1f21e2ab50043e6cd9163c08f1b6c3a6171556bf23ff9ed65b074145484
PKG_SOURCE_URL:=@GNU/grub
PKG_HASH:=b79ea44af91b93d17cd3fe80bdae6ed43770678a9a5ae192ccea803ebb657ee1
HOST_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=grub2/host

View File

@ -18,24 +18,24 @@
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -1720,7 +1720,7 @@ main (int argc, char *argv[])
/* Now perform the installation. */
@@ -1721,7 +1721,7 @@ main (int argc, char *argv[])
if (install_bootsector)
grub_util_bios_setup (platdir, "boot.img", "core.img",
- install_drive, force,
+ NULL, install_drive, force,
fs_probe, allow_floppy, add_rs_codes,
!grub_install_is_short_mbrgap_supported ());
break;
@@ -1747,7 +1747,7 @@ main (int argc, char *argv[])
/* Now perform the installation. */
{
grub_util_bios_setup (platdir, "boot.img", "core.img",
- install_drive, force,
+ NULL, install_drive, force,
fs_probe, allow_floppy, add_rs_codes,
!grub_install_is_short_mbrgap_supported ());
@@ -1752,7 +1752,7 @@ main (int argc, char *argv[])
if (install_bootsector)
grub_util_sparc_setup (platdir, "boot.img", "core.img",
- install_drive, force,
+ NULL, install_drive, force,
fs_probe, allow_floppy,
0 /* unused */, 0 /* unused */ );
break;
{
grub_util_sparc_setup (platdir, "boot.img", "core.img",
- install_drive, force,
+ NULL, install_drive, force,
fs_probe, allow_floppy,
0 /* unused */, 0 /* unused */ );
--- a/util/grub-setup.c
+++ b/util/grub-setup.c
@@ -87,6 +87,8 @@ static struct argp_option options[] = {

View File

@ -1,40 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Hector Marco-Gisbert <hecmargi@upv.es>
Date: Fri, 13 Nov 2015 16:21:09 +0100
Subject: [PATCH] Fix security issue when reading username and password
This patch fixes two integer underflows at:
* grub-core/lib/crypto.c
* grub-core/normal/auth.c
Resolves: CVE-2015-8370
Signed-off-by: Hector Marco-Gisbert <hecmargi@upv.es>
Signed-off-by: Ismael Ripoll-Ripoll <iripoll@disca.upv.es>
---
grub-core/lib/crypto.c | 2 +-
grub-core/normal/auth.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/grub-core/lib/crypto.c
+++ b/grub-core/lib/crypto.c
@@ -468,7 +468,7 @@ grub_password_get (char buf[], unsigned
break;
}
- if (key == '\b')
+ if (key == '\b' && cur_len)
{
if (cur_len)
cur_len--;
--- a/grub-core/normal/auth.c
+++ b/grub-core/normal/auth.c
@@ -172,7 +172,7 @@ grub_username_get (char buf[], unsigned
break;
}
- if (key == GRUB_TERM_BACKSPACE)
+ if (key == GRUB_TERM_BACKSPACE && cur_len)
{
if (cur_len)
{

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ath10k-ct
PKG_RELEASE=1
PKG_RELEASE:=1
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=

View File

@ -360,7 +360,7 @@ $(eval $(call KernelPackage,crypto-hw-geode))
define KernelPackage/crypto-hw-hifn-795x
TITLE:=HIFN 795x crypto accelerator
DEPENDS:=+kmod-random-core +kmod-crypto-manager
DEPENDS:=@PCI_SUPPORT +kmod-random-core +kmod-crypto-manager
KCONFIG:= \
CONFIG_CRYPTO_HW=y \
CONFIG_CRYPTO_DEV_HIFN_795X \

View File

@ -658,7 +658,7 @@ define KernelPackage/igb
CONFIG_IGB_HWMON=y \
CONFIG_IGB_DCA=n
FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/igb/igb.ko
AUTOLOAD:=$(call AutoLoad,35,igb)
AUTOLOAD:=$(call AutoLoad,35,igb,1)
endef
define KernelPackage/igb/description

View File

@ -27,15 +27,13 @@ QEMU seems to also need
Then run normal make or cmake etc.
---
diff -ruNa --binary a/ChangeLog.d/armv8_crypto_extensions.txt b/ChangeLog.d/armv8_crypto_extensions.txt
--- a/ChangeLog.d/armv8_crypto_extensions.txt 1970-01-01 08:00:00.000000000 +0800
+++ b/ChangeLog.d/armv8_crypto_extensions.txt 2021-03-07 15:07:17.781911791 +0800
--- a/ChangeLog.d/armv8_crypto_extensions.txt
+++ b/ChangeLog.d/armv8_crypto_extensions.txt
@@ -0,0 +1,2 @@
+Features
+ * Support ARMv8 Cryptography Extensions for AES and GCM.
diff -ruNa --binary a/include/mbedtls/armv8ce_aes.h b/include/mbedtls/armv8ce_aes.h
--- a/include/mbedtls/armv8ce_aes.h 1970-01-01 08:00:00.000000000 +0800
+++ b/include/mbedtls/armv8ce_aes.h 2021-03-07 15:07:17.781911791 +0800
--- a/include/mbedtls/armv8ce_aes.h
+++ b/include/mbedtls/armv8ce_aes.h
@@ -0,0 +1,63 @@
+/**
+ * \file armv8ce_aes.h
@ -100,9 +98,8 @@ diff -ruNa --binary a/include/mbedtls/armv8ce_aes.h b/include/mbedtls/armv8ce_ae
+ const unsigned char b[16] );
+
+#endif /* MBEDTLS_ARMV8CE_AES_H */
diff -ruNa --binary a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h
--- a/include/mbedtls/check_config.h 2020-12-10 20:54:15.000000000 +0800
+++ b/include/mbedtls/check_config.h 2021-03-07 15:06:45.625543309 +0800
--- a/include/mbedtls/check_config.h
+++ b/include/mbedtls/check_config.h
@@ -95,6 +95,10 @@
#error "MBEDTLS_AESNI_C defined, but not all prerequisites"
#endif
@ -119,9 +116,8 @@ diff -ruNa --binary a/include/mbedtls/check_config.h b/include/mbedtls/check_con
#endif /* MBEDTLS_CHECK_CONFIG_H */
+
diff -ruNa --binary a/include/mbedtls/config.h b/include/mbedtls/config.h
--- a/include/mbedtls/config.h 2020-12-10 20:54:15.000000000 +0800
+++ b/include/mbedtls/config.h 2021-03-07 15:14:27.957855484 +0800
--- a/include/mbedtls/config.h
+++ b/include/mbedtls/config.h
@@ -73,6 +73,7 @@
* Requires support for asm() in compiler.
*
@ -130,7 +126,7 @@ diff -ruNa --binary a/include/mbedtls/config.h b/include/mbedtls/config.h
* library/aria.c
* library/timing.c
* include/mbedtls/bn_mul.h
@@ -1888,6 +1889,21 @@
@@ -1905,6 +1906,21 @@
#define MBEDTLS_AESNI_C
/**
@ -152,9 +148,8 @@ diff -ruNa --binary a/include/mbedtls/config.h b/include/mbedtls/config.h
* \def MBEDTLS_AES_C
*
* Enable the AES block cipher.
diff -ruNa --binary a/library/aes.c b/library/aes.c
--- a/library/aes.c 2020-12-10 20:54:15.000000000 +0800
+++ b/library/aes.c 2021-03-07 15:06:45.625543309 +0800
--- a/library/aes.c
+++ b/library/aes.c
@@ -69,7 +69,9 @@
#if defined(MBEDTLS_AESNI_C)
#include "mbedtls/aesni.h"
@ -178,9 +173,8 @@ diff -ruNa --binary a/library/aes.c b/library/aes.c
#if defined(MBEDTLS_PADLOCK_C) && defined(MBEDTLS_HAVE_X86)
if( aes_padlock_ace )
{
diff -ruNa --binary a/library/armv8ce_aes.c b/library/armv8ce_aes.c
--- a/library/armv8ce_aes.c 1970-01-01 08:00:00.000000000 +0800
+++ b/library/armv8ce_aes.c 2021-03-07 15:07:17.781911791 +0800
--- a/library/armv8ce_aes.c
+++ b/library/armv8ce_aes.c
@@ -0,0 +1,142 @@
+/*
+ * ARMv8 Cryptography Extensions -- Optimized code for AES and GCM
@ -324,9 +318,8 @@ diff -ruNa --binary a/library/armv8ce_aes.c b/library/armv8ce_aes.c
+#endif /* MBEDTLS_GCM_C */
+
+#endif /* MBEDTLS_ARMV8CE_AES_C */
diff -ruNa --binary a/library/CMakeLists.txt b/library/CMakeLists.txt
--- a/library/CMakeLists.txt 2020-12-10 20:54:15.000000000 +0800
+++ b/library/CMakeLists.txt 2021-03-07 15:06:45.625543309 +0800
--- a/library/CMakeLists.txt
+++ b/library/CMakeLists.txt
@@ -7,6 +7,7 @@
aesni.c
arc4.c
@ -335,9 +328,8 @@ diff -ruNa --binary a/library/CMakeLists.txt b/library/CMakeLists.txt
asn1parse.c
asn1write.c
base64.c
diff -ruNa --binary a/library/gcm.c b/library/gcm.c
--- a/library/gcm.c 2020-12-10 20:54:15.000000000 +0800
+++ b/library/gcm.c 2021-03-07 15:06:45.625543309 +0800
--- a/library/gcm.c
+++ b/library/gcm.c
@@ -71,6 +71,10 @@
#include "mbedtls/aesni.h"
#endif
@ -374,9 +366,8 @@ diff -ruNa --binary a/library/gcm.c b/library/gcm.c
#if defined(MBEDTLS_AESNI_C) && defined(MBEDTLS_HAVE_X86_64)
if( mbedtls_aesni_has_support( MBEDTLS_AESNI_CLMUL ) ) {
unsigned char h[16];
diff -ruNa --binary a/library/Makefile b/library/Makefile
--- a/library/Makefile 2020-12-10 20:54:15.000000000 +0800
+++ b/library/Makefile 2021-03-07 15:12:49.277078224 +0800
--- a/library/Makefile
+++ b/library/Makefile
@@ -65,6 +65,7 @@
OBJS_CRYPTO= aes.o aesni.o arc4.o \
@ -385,10 +376,9 @@ diff -ruNa --binary a/library/Makefile b/library/Makefile
base64.o bignum.o blowfish.o \
camellia.o ccm.o chacha20.o \
chachapoly.o cipher.o cipher_wrap.o \
diff -ruNa --binary a/library/version_features.c b/library/version_features.c
--- a/library/version_features.c 2020-12-10 20:54:15.000000000 +0800
+++ b/library/version_features.c 2021-03-07 15:06:45.625543309 +0800
@@ -583,6 +583,9 @@
--- a/library/version_features.c
+++ b/library/version_features.c
@@ -586,6 +586,9 @@
#if defined(MBEDTLS_AESNI_C)
"MBEDTLS_AESNI_C",
#endif /* MBEDTLS_AESNI_C */
@ -398,4 +388,3 @@ diff -ruNa --binary a/library/version_features.c b/library/version_features.c
#if defined(MBEDTLS_AES_C)
"MBEDTLS_AES_C",
#endif /* MBEDTLS_AES_C */

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ustream-ssl
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustream-ssl.git
@ -37,6 +37,7 @@ define Package/libustream-wolfssl
$(Package/libustream/default)
TITLE += (wolfssl)
DEPENDS += +PACKAGE_libustream-wolfssl:libwolfssl
CONFLICTS := libustream-openssl
VARIANT:=wolfssl
endef
@ -44,6 +45,7 @@ define Package/libustream-mbedtls
$(Package/libustream/default)
TITLE += (mbedtls)
DEPENDS += +libmbedtls
CONFLICTS := libustream-openssl libustream-wolfssl
VARIANT:=mbedtls
DEFAULT_VARIANT:=1
endef

View File

@ -1121,7 +1121,10 @@ dnsmasq_start()
config_get_bool dns_redirect "$cfg" dns_redirect 0
config_get dns_port "$cfg" port 53
[ "$dns_redirect" = 1 ] && iptables -t nat -A PREROUTING -m comment --comment "DNSMASQ" -p udp --dport 53 -j REDIRECT --to-ports $dns_port
if [ "$dns_redirect" = 1 ]; then
iptables -t nat -A PREROUTING -m comment --comment "DNSMASQ" -p udp --dport 53 -j REDIRECT --to-ports $dns_port
[ -n "$(command -v ip6tables)" ] && ip6tables -t nat -A PREROUTING -m comment --comment "DNSMASQ" -p udp --dport 53 -j REDIRECT --to-ports $dns_port
fi
}
dnsmasq_stop()
@ -1141,19 +1144,9 @@ dnsmasq_stop()
iptables_clear()
{
nums=$(iptables -t nat -n -L PREROUTING 2>/dev/null | grep -c "DNSMASQ")
if [ -n "$nums" ]; then
until [ "$nums" = 0 ]
do
rules=$(iptables -t nat -n -L PREROUTING --line-num 2>/dev/null | grep "DNSMASQ" | awk '{print $1}')
for rule in $rules
do
iptables -t nat -D PREROUTING $rule 2> /dev/null
break
done
nums=$(expr $nums - 1)
done
fi
config_get dns_port "$cfg" port 53
iptables -t nat -D PREROUTING -m comment --comment "DNSMASQ" -p udp --dport 53 -j REDIRECT --to-ports $dns_port 2>"/dev/null"
[ -n "$(command -v ip6tables)" ] && ip6tables -t nat -D PREROUTING -m comment --comment "DNSMASQ" -p udp --dport 53 -j REDIRECT --to-ports $dns_port 2>"/dev/null"
}
add_interface_trigger()

View File

@ -9,7 +9,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=uci
PKG_RELEASE:=4
PKG_RELEASE:=5
PKG_SOURCE_URL=$(PROJECT_GIT)/project/uci.git
PKG_SOURCE_PROTO:=git

View File

@ -84,6 +84,15 @@ uci_set() {
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set "$PACKAGE.$CONFIG.$OPTION=$VALUE"
}
uci_add_list() {
local PACKAGE="$1"
local CONFIG="$2"
local OPTION="$3"
local VALUE="$4"
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} add_list "$PACKAGE.$CONFIG.$OPTION=$VALUE"
}
uci_get_state() {
uci_get "$1" "$2" "$3" "$4" "/var/state"
}
@ -107,7 +116,7 @@ uci_add() {
local CONFIG="$3"
if [ -z "$CONFIG" ]; then
export ${NO_EXPORT:+-n} CONFIG_SECTION="$(/sbin/uci add "$PACKAGE" "$TYPE")"
export ${NO_EXPORT:+-n} CONFIG_SECTION="$(/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} add "$PACKAGE" "$TYPE")"
else
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set "$PACKAGE.$CONFIG=$TYPE"
export ${NO_EXPORT:+-n} CONFIG_SECTION="$CONFIG"
@ -131,6 +140,23 @@ uci_remove() {
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} del "$PACKAGE.$CONFIG${OPTION:+.$OPTION}"
}
uci_remove_list() {
local PACKAGE="$1"
local CONFIG="$2"
local OPTION="$3"
local VALUE="$4"
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} del_list "$PACKAGE.$CONFIG.$OPTION=$VALUE"
}
uci_revert() {
local PACKAGE="$1"
local CONFIG="$2"
local OPTION="$3"
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} revert "$PACKAGE${CONFIG:+.$CONFIG}${OPTION:+.$OPTION}"
}
uci_commit() {
local PACKAGE="$1"
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} commit $PACKAGE

View File

@ -1,14 +1,11 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2013 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# Copyright (C) 2013-2021 OpenWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=zram-swap
PKG_RELEASE:=8
PKG_RELEASE:=$(AUTORELEASE)
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

View File

@ -25,31 +25,6 @@ zram_getsize() # in megabytes
fi
}
zram_applicable()
{
local zram_dev="$1"
[ -e "$zram_dev" ] || {
logger -s -t zram_applicable -p daemon.crit "[ERROR] device '$zram_dev' not found"
return 1
}
[ -x /sbin/mkswap ] || {
logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox mkswap' not installed"
return 1
}
[ -x /sbin/swapon ] || {
logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox swapon' not installed"
return 1
}
[ -x /sbin/swapoff ] || {
logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox swapoff' not installed"
return 1
}
}
zram_dev()
{
local idx="$1"
@ -159,9 +134,14 @@ start()
return 1
fi
local zram_size="$( zram_getsize )"
local zram_dev="$( zram_getdev )"
zram_applicable "$zram_dev" || return 1
[ -e "$zram_dev" ] || {
logger -s -t zram_start -p daemon.crit "[ERROR] device '$zram_dev' not found"
return 1
}
local zram_size="$( zram_getsize )"
local zram_priority="$( uci -q get system.@system[0].zram_priority )"
zram_priority=${zram_priority:+-p $zram_priority}
@ -170,8 +150,8 @@ start()
zram_reset "$zram_dev" "enforcing defaults"
zram_comp_algo "$zram_dev"
echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize"
/sbin/mkswap "$zram_dev"
/sbin/swapon -d $zram_priority "$zram_dev"
busybox mkswap "$zram_dev"
busybox swapon -d $zram_priority "$zram_dev"
}
stop()
@ -180,7 +160,7 @@ stop()
for zram_dev in $( grep zram /proc/swaps |awk '{print $1}' ); do {
logger -s -t zram_stop -p daemon.debug "deactivate swap $zram_dev"
/sbin/swapoff "$zram_dev" && zram_reset "$zram_dev" "claiming memory back"
busybox swapoff "$zram_dev" && zram_reset "$zram_dev" "claiming memory back"
local dev_index="$( echo $zram_dev | grep -o "[0-9]*$" )"
if [ $dev_index -ne 0 ]; then
logger -s -t zram_stop -p daemon.debug "removing zram $zram_dev"

View File

@ -50,7 +50,7 @@ ipq40xx_setup_interfaces()
;;
avm,fritzbox-7530)
ucidef_add_switch "switch0" \
"0t@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
"0t@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
;;
aruba,ap-303|\
aruba,ap-365|\