[PATCH 5/5] build: remove shell.sh
Handling common shell usage may have been valuable in the past. Yet now this is almost unused, so inline the single remaining use. Then delete the old file. Signed-off-by: Elliott Mitchell --- I've tried to test the removal. I'm unsure I actually achieved coverage, so a careful look at package/kernel/mac80211/Makefile by someone else would be good. --- include/shell.sh | 15 --- include/unpack.mk| 4 ++-- package/kernel/mac80211/Makefile | 2 +- rules.mk | 1 - 4 files changed, 3 insertions(+), 19 deletions(-) delete mode 100644 include/shell.sh diff --git a/include/shell.sh b/include/shell.sh deleted file mode 100644 index 6ee0cf6030..00 --- a/include/shell.sh +++ /dev/null @@ -1,15 +0,0 @@ -getvar() { - eval "echo \"\${$1}\"" -} - -var2file() { - local var - eval "var=\"\${$1}\"" - if [ -n "$var" ]; then echo "$var" > "$2"; fi -} - -isset() { - local var - eval "var=\"\${$1}\"" - [ -n "$var" ] -} diff --git a/include/unpack.mk b/include/unpack.mk index 5959d55f4b..a120a6093d 100644 --- a/include/unpack.mk +++ b/include/unpack.mk @@ -62,10 +62,10 @@ ifeq ($(strip $(UNPACK_CMD)),) endif ifdef PKG_BUILD_DIR - PKG_UNPACK ?= $(SH_FUNC) $(call UNPACK_CMD,$(PKG_BUILD_DIR)) + PKG_UNPACK ?= $(call UNPACK_CMD,$(PKG_BUILD_DIR)) endif ifdef HOST_BUILD_DIR - HOST_UNPACK ?= $(SH_FUNC) $(call UNPACK_CMD,$(HOST_BUILD_DIR)) + HOST_UNPACK ?= $(call UNPACK_CMD,$(HOST_BUILD_DIR)) endif endif # PKG_SOURCE diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 9016e2a525..8aef63d868 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -365,7 +365,7 @@ define Quilt/Refresh/Package endef define Build/Compile - $(SH_FUNC) var2file "$(call shvar,mac80211_config)" $(PKG_BUILD_DIR)/.config + [ -z "{$(call shvar,mac80211_config)}" ] || echo "{$(call shvar,mac80211_config)}" > "$(PKG_BUILD_DIR)/.config" $(MAKE) $(MAKE_OPTS) allnoconfig $(call Build/Compile/kmod) endef diff --git a/rules.mk b/rules.mk index 6f05047f26..f09ea1ecc4 100644 --- a/rules.mk +++ b/rules.mk @@ -234,7 +234,6 @@ endif export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH)) export PATH:=$(TARGET_PATH) export STAGING_DIR STAGING_DIR_HOST STAGING_DIR_HOSTPKG -export SH_FUNC:=. $(INCLUDE_DIR)/shell.sh; PKG_CONFIG:=$(STAGING_DIR_HOST)/bin/pkg-config -- (\___(\___(\__ --=> 8-) EHM <=-- __/)___/)___/) \BS (| ehem+open...@m5p.com PGP 87145445 |) / \_CS\ | _ -O #include O- _ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[PATCH 4/5] scripts/kconfig.pl: consistently call parse_expr() with 2 args
The inconsistent calling had already been noticed. Now the trap has been spotted, so clean this up. Signed-off-by: Elliott Mitchell --- scripts/kconfig.pl | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/kconfig.pl b/scripts/kconfig.pl index 5a53e2154b..5f0741ee5c 100755 --- a/scripts/kconfig.pl +++ b/scripts/kconfig.pl @@ -125,9 +125,9 @@ sub dump_config($) { } } -sub parse_expr { - my $pos = shift; - my $mod_plus = shift; +sub parse_expr($$); +sub parse_expr($$) { + my ($pos, $mod_plus) = @_; my $arg = $arg[$$pos++]; my %ops = ( @@ -142,7 +142,7 @@ sub parse_expr { die "Parse error" if (!$arg); if (exists($ops{$arg})) { - my $arg1 = parse_expr($pos); + my $arg1 = parse_expr($pos, 0); my $arg2 = parse_expr($pos, ($arg eq 'm+') ? 1 : 0); return &{$ops{$arg}->[0]}($arg1, $arg2, $ops{$arg}->[1]); } else { @@ -163,5 +163,5 @@ while (@ARGV > 0 and $ARGV[0] =~ /^-\w+$/) { @arg = @ARGV; my $pos = 0; -dump_config(parse_expr(\$pos)); +dump_config(parse_expr(\$pos, 0)); die "Parse error" if ($arg[$pos]); -- (\___(\___(\__ --=> 8-) EHM <=-- __/)___/)___/) \BS (| ehem+open...@m5p.com PGP 87145445 |) / \_CS\ | _ -O #include O- _ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[PATCH 3/5] scripts/kconfig.pl: switch to using function references/hash for operators
Ah, the wonders of pointers. Simplifies the configuration parsing as all these cases are otherwise identical. Signed-off-by: Elliott Mitchell --- Oy vey. I only spotted passing the second arg to parse_expr() *just* before I was initially planning to send this. That is quite the boody trap lurking there. --- scripts/kconfig.pl | 35 --- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/scripts/kconfig.pl b/scripts/kconfig.pl index dd286479b3..5a53e2154b 100755 --- a/scripts/kconfig.pl +++ b/scripts/kconfig.pl @@ -130,32 +130,21 @@ sub parse_expr { my $mod_plus = shift; my $arg = $arg[$$pos++]; + my %ops = ( + '&' => [\&config_and, undef], + '+' => [\&config_add, 0], + 'm+'=> [\&config_add, 1], + '>' => [\&config_diff, 0], + '>+'=> [\&config_diff, 1], + '-' => [\&config_sub, undef], + ); + die "Parse error" if (!$arg); - if ($arg eq '&') { - my $arg1 = parse_expr($pos); - my $arg2 = parse_expr($pos); - return config_and($arg1, $arg2, undef); - } elsif ($arg =~ /^\+/) { - my $arg1 = parse_expr($pos); - my $arg2 = parse_expr($pos); - return config_add($arg1, $arg2, 0); - } elsif ($arg =~ /^m\+/) { - my $arg1 = parse_expr($pos); - my $arg2 = parse_expr($pos, 1); - return config_add($arg1, $arg2, 1); - } elsif ($arg eq '>') { - my $arg1 = parse_expr($pos); - my $arg2 = parse_expr($pos); - return config_diff($arg1, $arg2, 0); - } elsif ($arg eq '>+') { - my $arg1 = parse_expr($pos); - my $arg2 = parse_expr($pos); - return config_diff($arg1, $arg2, 1); - } elsif ($arg eq '-') { + if (exists($ops{$arg})) { my $arg1 = parse_expr($pos); - my $arg2 = parse_expr($pos); - return config_sub($arg1, $arg2, undef); + my $arg2 = parse_expr($pos, ($arg eq 'm+') ? 1 : 0); + return &{$ops{$arg}->[0]}($arg1, $arg2, $ops{$arg}->[1]); } else { return load_config($arg, $mod_plus); } -- (\___(\___(\__ --=> 8-) EHM <=-- __/)___/)___/) \BS (| ehem+open...@m5p.com PGP 87145445 |) / \_CS\ | _ -O #include O- _ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[PATCH 2/5] scripts/kconfig.pl: modify config_and()/config_sub() to match other ops
Having all operator-handling functions match the same prototype has advantages. Signed-off-by: Elliott Mitchell --- scripts/kconfig.pl | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/kconfig.pl b/scripts/kconfig.pl index f7b3814cdd..dd286479b3 100755 --- a/scripts/kconfig.pl +++ b/scripts/kconfig.pl @@ -43,8 +43,8 @@ sub load_config($$) { } -sub config_and($$) { - my ($cfg1, $cfg2) = @_; +sub config_and($$$) { + my ($cfg1, $cfg2, $mod_plus_discarded) = @_; my %config; foreach my $config (keys %$cfg1) { @@ -89,8 +89,8 @@ sub config_diff($$$) { return \%config } -sub config_sub($$) { - my ($cfg1, $cfg2) = @_; +sub config_sub($$$) { + my ($cfg1, $cfg2, $mod_plus_discarded) = @_; my %config = %{$cfg1}; my @keys = map { my $expr = $_; @@ -135,7 +135,7 @@ sub parse_expr { if ($arg eq '&') { my $arg1 = parse_expr($pos); my $arg2 = parse_expr($pos); - return config_and($arg1, $arg2); + return config_and($arg1, $arg2, undef); } elsif ($arg =~ /^\+/) { my $arg1 = parse_expr($pos); my $arg2 = parse_expr($pos); @@ -155,7 +155,7 @@ sub parse_expr { } elsif ($arg eq '-') { my $arg1 = parse_expr($pos); my $arg2 = parse_expr($pos); - return config_sub($arg1, $arg2); + return config_sub($arg1, $arg2, undef); } else { return load_config($arg, $mod_plus); } -- (\___(\___(\__ --=> 8-) EHM <=-- __/)___/)___/) \BS (| ehem+open...@m5p.com PGP 87145445 |) / \_CS\ | _ -O #include O- _ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[PATCH 0/5] Scripting tweaks
Due to needing to figure out how the build process functions, I ended up looking at scripts/kconfig.pl. Part of figuring out any program is looking at them and figuring out their operation. My understanding is still incomplete, but I do know more about the function. I can state `kconfig.pl` takes arguments in a form similar to `expr`, but uses operator prefix notation. I decided I didn't need to dig further. I'm glad I spotted the situation with parse_expr() during my review, I almost sent a version with a bug. The file is presently marked as GPLv2. I propose moving to GPLv2 or later, which is easy right now with only 2 authors. Then when looking at this, the situation with include/shell.sh jumped out. Seems like a good removal. I've attempted to test, but I fear I may not have quite confirmed I got the removal right. I fear the e-mail situation is still unresolved. Alas, this is what spam has done to e-mail. It used to be rather faster and more reliable than letters, yet now. Elliott Mitchell (5): scripts/kconfig.pl: fixup subroutine style scripts/kconfig.pl: modify config_and()/config_sub() to match other ops scripts/kconfig.pl: switch to using function references/hash for operators scripts/kconfig.pl: consistently call parse_expr() with 2 args build: remove shell.sh include/shell.sh | 15 --- include/unpack.mk| 4 +- package/kernel/mac80211/Makefile | 2 +- rules.mk | 1 - scripts/kconfig.pl | 76 5 files changed, 30 insertions(+), 68 deletions(-) delete mode 100644 include/shell.sh -- (\___(\___(\__ --=> 8-) EHM <=-- __/)___/)___/) \BS (| ehem+open...@m5p.com PGP 87145445 |) / \_CS\ | _ -O #include O- _ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[PATCH 1/5] scripts/kconfig.pl: fixup subroutine style
Match usual Perl style to make the operation of the script easier to understand for future developers. Signed-off-by: Elliott Mitchell --- scripts/kconfig.pl | 27 --- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/scripts/kconfig.pl b/scripts/kconfig.pl index 392f1d5841..f7b3814cdd 100755 --- a/scripts/kconfig.pl +++ b/scripts/kconfig.pl @@ -13,10 +13,7 @@ my @arg; my $PREFIX = "CONFIG_"; sub set_config() { - my $config = shift; - my $idx = shift; - my $newval = shift; - my $mod_plus = shift; + my ($config, $idx, $newval, $mod_plus) = @_; if (!defined($config->{$idx}) or !$mod_plus or $config->{$idx} eq '#undef' or $newval eq 'y') { @@ -25,8 +22,7 @@ sub set_config() { } sub load_config($$) { - my $file = shift; - my $mod_plus = shift; + my ($file, $mod_plus) = @_; my %config; open FILE, "$file" or die "can't open file '$file'"; @@ -48,8 +44,7 @@ sub load_config($$) { sub config_and($$) { - my $cfg1 = shift; - my $cfg2 = shift; + my ($cfg1, $cfg2) = @_; my %config; foreach my $config (keys %$cfg1) { @@ -64,9 +59,7 @@ sub config_and($$) { sub config_add($$$) { - my $cfg1 = shift; - my $cfg2 = shift; - my $mod_plus = shift; + my ($cfg1, $cfg2, $mod_plus) = @_; my %config; for ($cfg1, $cfg2) { @@ -84,9 +77,7 @@ sub config_add($$$) { } sub config_diff($$$) { - my $cfg1 = shift; - my $cfg2 = shift; - my $new_only = shift; + my ($cfg1, $cfg2, $new_only) = @_; my %config; foreach my $config (keys %$cfg2) { @@ -99,8 +90,7 @@ sub config_diff($$$) { } sub config_sub($$) { - my $cfg1 = shift; - my $cfg2 = shift; + my ($cfg1, $cfg2) = @_; my %config = %{$cfg1}; my @keys = map { my $expr = $_; @@ -117,8 +107,7 @@ sub config_sub($$) { } sub print_cfgline($$) { - my $name = shift; - my $val = shift; + my ($name, $val) = @_; if ($val eq '#undef' or $val eq 'n') { print "# $PREFIX$name is not set\n"; } else { @@ -128,7 +117,7 @@ sub print_cfgline($$) { sub dump_config($) { - my $cfg = shift; + my ($cfg) = @_; die "argument error in dump_config" unless ($cfg); my %config = %$cfg; foreach my $config (sort keys %config) { -- (\___(\___(\__ --=> 8-) EHM <=-- __/)___/)___/) \BS (| ehem+open...@m5p.com PGP 87145445 |) / \_CS\ | _ -O #include O- _ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
OpenWrt 22.03.6 sixth service release
Hi, The OpenWrt community is proud to announce the newest stable release of the OpenWrt 22.03 stable version series. It fixes security issues, improves device support, and brings a few bug fixes. Download firmware images using the OpenWrt Firmware Selector: * https://firmware-selector.openwrt.org/?version=22.03.6 Download firmware images directly from our download servers: * https://downloads.openwrt.org/releases/22.03.6/targets/ OpenWrt 23.03 EOL in April 2024 The OpenWrt 22.03 series will be supported till April 2024 according to the OpenWrt security policy. The last release from the OpenWrt 22.03 series is planned for April 2024, after this date we will not provide any updates for OpenWrt 22.03, not even for severe security problems. We encourage everyone to upgrade to OpenWrt 23.05 which will be supported till 2025. Main changes between OpenWrt 22.03.5 and OpenWrt 22.03.6: Device support == * Support for the following devices was added: * ramips: Cudy X6 v2 * ramips: Keenetic Lite III rev. A * ramips: SNR-CPE-W4N-MT router * ath79: WLR-7100: fix packetloss * ath79: wpj563: enable 2nd USB controller * ath79: TP-Link Archer C7 v2: increase the rfkill debounce interval * bmips: NETGEAR DGND3700v2: fix boot loop * ipq40xx: switch to performance governor by default * ramips: Cudy X6: fixes / improvements Various fixes and improvements == * build: generate index.json * build: fix generation of large .vdi images * lua: fix integer overflow in LNUM patch * dropbear: add ed25519 for failsafe key * treewide: add PKG_CPE_ID to multiple packages * mac80211: fix not set noscan option for wpa_supplicant * hostapd: fix broke noscan option for mesh * hostapd: permit also channel 7 for 2.5GHz to be set to HT40PLUS Core components update == * Update Linux kernel from 5.10.176 to 5.10.201 * Update openssl from 1.1.1t to 1.1.1w * Update wolfssl from 5.5.4 to 5.6.4 * Update mbedtls from 2.28.2 to 2.28.5 * Update mt76 22.03 from 2022-09-06 to 2023-09-11 * Update wireless-regdb from 2023.02.13 to 2023.09.01 * Update linux-firmware from 20220411 to 20230804 * Update intel-microcode from 20220809 to 20230808 * Update ca-certificates from 20211016 to 20230311 * Update uhttpd from 2022-10-31 to 2023-06-25 * Update urngd from 2020-01-21 to 2023-11-01 - Full release notes and upgrade instructions are available at https://openwrt.org/releases/22.03/notes-22.03.6 In particular, make sure to read the regressions and known issues before upgrading: https://openwrt.org/releases/22.03/notes-22.03.6#known_issues For a detailed list of all changes since 22.03.5, refer to https://openwrt.org/releases/22.03/changelog-22.03.6 To download the 22.03.6 images, navigate to: https://downloads.openwrt.org/releases/22.03.6/targets/ Use OpenWrt Firmware Selector to download: https://firmware-selector.openwrt.org/?version=22.03.6 As always, a big thank you goes to all our active package maintainers, testers, documenters and supporters. Have fun! The OpenWrt Community --- To stay informed of new OpenWrt releases and security advisories, there are new channels available: * a low-volume mailing list for important announcements: https://lists.openwrt.org/mailman/listinfo/openwrt-announce * a dedicated "announcements" section in the forum: https://forum.openwrt.org/c/announcements/14 * other announcement channels (such as RSS feeds) might be added in the future, they will be listed at https://openwrt.org/contact ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [PATCH] mediatek: filogic: use fixed layout cell "mac-base" for Xiaomi WR30U
On 28.07.2023 13:28, Rafał Miłecki wrote: From: Rafał Miłecki Cc: Hank Moretti Cc: Hauke Mehrtens Signed-off-by: Rafał Miłecki --- Hank: can you runtime test this, please? It remained unanswered but change got handled by Rosen: 405bc5be130a ("mediatek: convert to nvmem-layout") 3eb899fd3675 ("mediatek: use mac-base") --- .../dts/mt7981b-xiaomi-mi-router-wr30u.dtsi | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-wr30u.dtsi b/target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-wr30u.dtsi index 9467b18a7e..4f8c3046d2 100644 --- a/target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-wr30u.dtsi +++ b/target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-wr30u.dtsi @@ -73,9 +73,8 @@ reg = <0>; phy-mode = "2500base-x"; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; fixed-link { speed = <2500>; @@ -177,12 +176,16 @@ reg = <0x18 0x20>; read-only; -compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; -macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
New parts in stock/offering
The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software.--- Begin Message --- Hi, We are interested in collaborating with your company. I am writing to you because we supply high-quality metal parts for sports cars to wholesalers and distribution networks worldwide, which could enrich your offerings. Whether you need engine components, suspension systems, body modification kits, or interior enhancements, we offer a wide range of products that can meet your customers' needs. Let us know if you're interested in additional profit while maintaining competitive prices and attractive margins. Best regards Stanislav Kováč --- End Message --- ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel