From c8d8eb9d13fc6fc8b394a620c27995ee71d29c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 14 Jun 2021 20:18:14 +0200 Subject: [PATCH 1/8] base-files: set MAC for bridge ports (devices) instead of bridge itself MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This restores the original config_generate behaviour. With MAC set for bridged devices the bridge automatically gets its MAC adjusted (it picks the lowest MAC of bridged devices). This fixes confusing interfaces setup (bridge ports not having custom MAC assigned). Reported-by: Koen Vandeputte Fixes: e002179a6d2e ("base-files: simplify setting device MAC") Signed-off-by: Rafał Miłecki --- package/base-files/files/bin/config_generate | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index 0dca5549e8..b3752c5430 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -114,9 +114,17 @@ generate_network() { add network device set network.@device[-1].name='br-$1' set network.@device[-1].type='bridge' - set network.@device[-1].macaddr='$macaddr' EOF for port in $ports; do uci add_list network.@device[-1].ports="$port"; done + [ -n "macaddr" ] && { + for port in $ports; do + uci -q batch <<-EOF + add network device + set network.@device[-1].name='$port' + set network.@device[-1].macaddr='$macaddr' + EOF + done + } device=br-$1 type= macaddr="" From 946019637ec9192450c685a61c589a9cbef7637b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 14 Jun 2021 22:29:49 +0200 Subject: [PATCH 2/8] base-files: fix typo in config_generate MAC check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: 8d8eb9d13fc6 ("base-files: set MAC for bridge ports (devices) instead of bridge itself") Signed-off-by: Rafał Miłecki --- package/base-files/files/bin/config_generate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index b3752c5430..596fcf41fa 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -116,7 +116,7 @@ generate_network() { set network.@device[-1].type='bridge' EOF for port in $ports; do uci add_list network.@device[-1].ports="$port"; done - [ -n "macaddr" ] && { + [ -n "$macaddr" ] && { for port in $ports; do uci -q batch <<-EOF add network device From fbb9b1f8ed0d8a76dd989cc6c16a4e0fda2b6e74 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 15 Jun 2021 09:54:45 +0200 Subject: [PATCH 3/8] build: ensure that dash isn't prepended twice to abi version suffix The ABIV_$(pkgname) variable already is formatted so return it as-is from the GetABISuffix macro and only filter through FormatABISuffix if we read the raw ABI version value from a version stamp file. This ensures that binary intra-package dependencies on ABI versioned libraries are properly formatted. Ref: https://github.com/openwrt/packages/issues/15871 Fixes: f6a03bff5b ("build: prepend ABI suffixes with a dash if package name ends with digit") Signed-off-by: Jo-Philipp Wich --- include/feeds.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/feeds.mk b/include/feeds.mk index e499ac2684..632fecb4a3 100644 --- a/include/feeds.mk +++ b/include/feeds.mk @@ -43,7 +43,7 @@ endef # 1: package name define GetABISuffix -$(call FormatABISuffix,$(1),$(if $(ABIV_$(1)),$(ABIV_$(1)),$(foreach v,$(wildcard $(STAGING_DIR)/pkginfo/$(1).version),$(shell cat $(v))))) +$(if $(ABIV_$(1)),$(ABIV_$(1)),$(call FormatABISuffix,$(1),$(foreach v,$(wildcard $(STAGING_DIR)/pkginfo/$(1).version),$(shell cat $(v))))) endef # 1: package name From 3d026d24257a0e2f3170538d8a54d520315699a1 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 27 May 2021 12:34:38 +0200 Subject: [PATCH 4/8] ugps: start also in case device is absent Don't bail out from init script in case the GPS device is missing. Some modems take time to come up, and some people may use things like 'kplex' to feed ugpsd. Hence it is better to always start ugpsd unconditionally and let procd's respawn take care of retrying. Signed-off-by: Daniel Golle --- package/utils/ugps/files/ugps.init | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/package/utils/ugps/files/ugps.init b/package/utils/ugps/files/ugps.init index 3cd1ca1b8d..77c3603066 100644 --- a/package/utils/ugps/files/ugps.init +++ b/package/utils/ugps/files/ugps.init @@ -16,11 +16,16 @@ start_service() { local disabled="$(uci get gps.@gps[-1].disabled || echo 0)" [ "$disabled" == "0" ] || return + [ "$tty" ] || return - [ -c "$tty" ] || { - tty="/dev/$tty" - [ -c "$tty" ] || return - } + case "$tty" in + "/"*) + true + ;; + *) + tty="/dev/$tty" + ;; + esac procd_open_instance procd_set_param command "$PROG" From a463b96241fbc2d142982387eaed9989e201ac7a Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Mon, 22 Feb 2021 00:18:10 +0100 Subject: [PATCH 5/8] build: preserve profiles.json between builds Keep other profiles.json content if the data belongs to the current build version. Also useful for the ImageBuilder, which builds for a single model each time. Without this commit the profiles.json would only contain the latest build profile information. Signed-off-by: Moritz Warning [improve commit message] Signed-off-by: Paul Spooren --- scripts/json_overview_image_info.py | 32 +++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/scripts/json_overview_image_info.py b/scripts/json_overview_image_info.py index 8dbd24af2d..45c05012b1 100755 --- a/scripts/json_overview_image_info.py +++ b/scripts/json_overview_image_info.py @@ -18,19 +18,33 @@ work_dir = Path(getenv("WORK_DIR")) output = {} + +def get_initial_output(image_info): + # preserve existing profiles.json + if output_path.is_file(): + profiles = json.loads(output_path.read_text()) + if profiles["version_code"] == image_info["version_code"]: + return profiles + return image_info + + for json_file in work_dir.glob("*.json"): image_info = json.loads(json_file.read_text()) + if not output: - output.update(image_info) + output = get_initial_output(image_info) + + # get first and only profile in json file + device_id, profile = next(iter(image_info["profiles"].items())) + if device_id not in output["profiles"]: + output["profiles"][device_id] = profile else: - # get first (and only) profile in json file - device_id = next(iter(image_info["profiles"].keys())) - if device_id not in output["profiles"]: - output["profiles"].update(image_info["profiles"]) - else: - output["profiles"][device_id]["images"].append( - image_info["profiles"][device_id]["images"][0] - ) + output["profiles"][device_id]["images"].extend(profile["images"]) + +# make image lists unique by name, keep last/latest +for device_id, profile in output["profiles"].items(): + profile["images"] = list({e["name"]: e for e in profile["images"]}.values()) + if output: default_packages, output["arch_packages"] = run( From 49ef4dbee519e006bb998de11e3bdf1c10c43e6a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 17 Jun 2021 11:04:27 +0200 Subject: [PATCH 6/8] mac80211: fix processing HE capabilities (FS#3871) Use the right argument to fix setting unsupported capabilities to 0 Signed-off-by: Felix Fietkau --- package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index c9a0fe542a..b6e3302f8b 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -116,7 +116,7 @@ mac80211_add_he_capabilities() { set -- $capab [ "$(($4))" -gt 0 ] || continue [ "$(((0x$2) & $3))" -gt 0 ] || { - eval "$4=0" + eval "$1=0" continue } append base_cfg "$1=1" "$N" From a0f97d8f9cb068305319012b50de092ee01ad7a1 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 17 Jun 2021 12:03:48 +0200 Subject: [PATCH 7/8] mac80211: select iwinfo Since iwinfo is now used in the core scripts, it needs to be present on the system Signed-off-by: Felix Fietkau --- package/kernel/mac80211/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 0ade95e35e..d0620c556a 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -98,7 +98,7 @@ PKG_CONFIG_DEPENDS += \ define KernelPackage/cfg80211 $(call KernelPackage/mac80211/Default) TITLE:=cfg80211 - wireless configuration API - DEPENDS+= +iw +wireless-regdb + DEPENDS+= +iw +iwinfo +wireless-regdb ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE) FILES:= \ $(PKG_BUILD_DIR)/compat/compat.ko \ From db9784beddd01ef960833b6ad6696eb581faf605 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 17 Jun 2021 12:40:15 +0200 Subject: [PATCH 8/8] mac80211: fix minstrel sample time check We need to skip sampling if the next sample time is after jiffies, not before. This patch fixes an issue where in some cases only very little sampling (or none at all) is performed, leading to really bad data rates Signed-off-by: Felix Fietkau --- ...11-minstrel_ht-fix-sample-time-check.patch | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch diff --git a/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch b/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch new file mode 100644 index 0000000000..787254b4df --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch @@ -0,0 +1,23 @@ +From: Felix Fietkau +Date: Thu, 17 Jun 2021 12:05:54 +0200 +Subject: [PATCH] mac80211: minstrel_ht: fix sample time check + +We need to skip sampling if the next sample time is after jiffies, not before. +This patch fixes an issue where in some cases only very little sampling (or none +at all) is performed, leading to really bad data rates + +Fixes: 80d55154b2f8 ("mac80211: minstrel_ht: significantly redesign the rate probing strategy") +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/rc80211_minstrel_ht.c ++++ b/net/mac80211/rc80211_minstrel_ht.c +@@ -1498,7 +1498,7 @@ minstrel_ht_get_rate(void *priv, struct + (info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO)) + return; + +- if (time_is_before_jiffies(mi->sample_time)) ++ if (time_is_after_jiffies(mi->sample_time)) + return; + + mi->sample_time = jiffies + MINSTREL_SAMPLE_INTERVAL;