Re: OpenWrt 21.02-rc1

2021-04-06 Thread Jason A. Donenfeld
On Tue, Apr 6, 2021 at 5:33 PM Ilya Lipnitskiy
 wrote:
>
> Hi Hauke,
>
> On Tue, Apr 6, 2021 at 3:43 PM Hauke Mehrtens  wrote:
> >
> > Hi,
> >
> > How do we want to go forward with OpenWrt 21.02-rc1?
> >
> > * I think the base system is ok.
> > * The http (original wolfssl) problem reported by jow is fixed
> > * LuCI in the 21.02 branch still misses DSA support, this was merged
> > into master some time ago as far as I understood.
> >
> > Jow reported this end of March:
> >  > I found some serious regressions in the luci device config support.
> >  > not sure yet how long it'll take to sort out. The netifd uci config
> >  > grew so complex that it'll take a while to try all cases
> >  > * changing interface settings after previously enabling certain
> >  >   options results in a brick
> >  > * wireless networks with custom ifnames are improperly bridged
> >  > * option ipv6 for ppp based protocols is broken because it clashes
> >  >   with option ipv6 in device sections
> >
> > I would like to merge this update of iproute2 if Russel is fine with it,
> > but I do not see this blocking 21.02-rc1:
> > https://github.com/openwrt/openwrt/pull/4025
> >
> > If there are some other bugs in the 21.02 branch which are fixed in
> > master, we can backport the fixed as long as they are not so big. If
> > there is something missing, just ask on the mainling list.
> Can we get a decision on the in-tree WireGuard migration PR?
> https://github.com/openwrt/openwrt/pull/3960

Indeed this should happen for 21.02. I won't be supporting the prior
compat module in OpenWRT any longer.

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: OpenWrt 21.02-rc1

2021-04-06 Thread Ilya Lipnitskiy
Hi Hauke,

On Tue, Apr 6, 2021 at 3:43 PM Hauke Mehrtens  wrote:
>
> Hi,
>
> How do we want to go forward with OpenWrt 21.02-rc1?
>
> * I think the base system is ok.
> * The http (original wolfssl) problem reported by jow is fixed
> * LuCI in the 21.02 branch still misses DSA support, this was merged
> into master some time ago as far as I understood.
>
> Jow reported this end of March:
>  > I found some serious regressions in the luci device config support.
>  > not sure yet how long it'll take to sort out. The netifd uci config
>  > grew so complex that it'll take a while to try all cases
>  > * changing interface settings after previously enabling certain
>  >   options results in a brick
>  > * wireless networks with custom ifnames are improperly bridged
>  > * option ipv6 for ppp based protocols is broken because it clashes
>  >   with option ipv6 in device sections
>
> I would like to merge this update of iproute2 if Russel is fine with it,
> but I do not see this blocking 21.02-rc1:
> https://github.com/openwrt/openwrt/pull/4025
>
> If there are some other bugs in the 21.02 branch which are fixed in
> master, we can backport the fixed as long as they are not so big. If
> there is something missing, just ask on the mainling list.
Can we get a decision on the in-tree WireGuard migration PR?
https://github.com/openwrt/openwrt/pull/3960

Ilya

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


OpenWrt 21.02-rc1

2021-04-06 Thread Hauke Mehrtens

Hi,

How do we want to go forward with OpenWrt 21.02-rc1?

* I think the base system is ok.
* The http (original wolfssl) problem reported by jow is fixed
* LuCI in the 21.02 branch still misses DSA support, this was merged 
into master some time ago as far as I understood.


Jow reported this end of March:
> I found some serious regressions in the luci device config support.
> not sure yet how long it'll take to sort out. The netifd uci config
> grew so complex that it'll take a while to try all cases
> * changing interface settings after previously enabling certain
>   options results in a brick
> * wireless networks with custom ifnames are improperly bridged
> * option ipv6 for ppp based protocols is broken because it clashes
>   with option ipv6 in device sections

I would like to merge this update of iproute2 if Russel is fine with it, 
but I do not see this blocking 21.02-rc1:

https://github.com/openwrt/openwrt/pull/4025

If there are some other bugs in the 21.02 branch which are fixed in 
master, we can backport the fixed as long as they are not so big. If 
there is something missing, just ask on the mainling list.


In would like to get 21.02-rc1 soon, so more users start testing it and 
we get more bug reports.


How should we continue?
1. Tag 21.02-rc1 and do the release in the next days with the current
   state.

2. Merge the LuCI DSA changes from master to 21.02 branch now and do
   21.02-rc1 ~3 days to see if some big problems come up.

3. Wait till the problems reported by jow are fixed and do the 21.02-rc1
   them.

4. Wait an other 2 weeks and see how it looks them.


I would prefer if we merge the LuCI DSA changes from master to 21.02 
branch now and do 21.02-rc1 soon. We should list the problems as known 
problems.


It would be nice if someone else could also look into these problems and 
propose fixes.


Hauke

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3 1/1] ltq-vdsl-app: extent dsl metrics with boolean power and line states

2021-04-06 Thread Florian Eckert
With the old ubus dsl API, the numbers for the individual line_states and
power_states were also returned. These were not ported to the new DSL
C-API. This commit changes the following JSON output.

Instead of outputting the "line_state" and "power_state" numbers directly, the
values is now printed as boolean. This has the advantage that the
internal numbers are not shown, which can change in the future.

* current JSON output for state:
"state": "Showtime with TC-Layer sync"

* new JSON output for state:
"line_state": {
"exception": false,
"idle": false,
"silent": false,
"handshake": false,
"full-init": false,
"showtime-without-sync": false,
"showtime-with-sync": true,
"resync": false,
"not-initialized": false,
"string": "Showtime with TC-Layer sync"
},

* current JSON output for power_state:
"power_state": "L0 - Synchronized"

* new JSON outpug for power_state:
"power_state": {
"NA": false,
"L0": true,
"L1": false,
"L2": false,
"L3": false,
"string": "L0 - Synchronized"
}

Signed-off-by: Florian Eckert 
---
 package/network/config/ltq-vdsl-app/Makefile  |  2 +-
 .../ltq-vdsl-app/src/src/dsl_cpe_ubus.c   | 32 ---
 2 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/package/network/config/ltq-vdsl-app/Makefile 
b/package/network/config/ltq-vdsl-app/Makefile
index 0823a0e7e9..f5c561078d 100644
--- a/package/network/config/ltq-vdsl-app/Makefile
+++ b/package/network/config/ltq-vdsl-app/Makefile
@@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-vdsl-app
 PKG_VERSION:=4.17.18.6
-PKG_RELEASE:=8
+PKG_RELEASE:=9
 PKG_BASE_NAME:=dsl_cpe_control
 PKG_SOURCE:=$(PKG_BASE_NAME)_vrx-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@OPENWRT
diff --git a/package/network/config/ltq-vdsl-app/src/src/dsl_cpe_ubus.c 
b/package/network/config/ltq-vdsl-app/src/src/dsl_cpe_ubus.c
index 8eefdfe4d5..2ab35ac056 100644
--- a/package/network/config/ltq-vdsl-app/src/src/dsl_cpe_ubus.c
+++ b/package/network/config/ltq-vdsl-app/src/src/dsl_cpe_ubus.c
@@ -306,6 +306,7 @@ static void version_information(int fd) {
 static void line_state(int fd) {
IOCTL(DSL_LineState_t, DSL_FIO_LINE_STATE_GET)
 
+   void *c;
const char *str;
switch (out.data.nLineState) {
STR_CASE(DSL_LINESTATE_NOT_INITIALIZED, "Not initialized")
@@ -351,8 +352,21 @@ static void line_state(int fd) {
str = NULL;
break;
};
-   if (str)
-   m_str("state", str);
+
+   if (str) {
+   c = blobmsg_open_table(, "line_state");
+   m_bool("exception", out.data.nLineState == 
DSL_LINESTATE_EXCEPTION);
+   m_bool("idle", out.data.nLineState == DSL_LINESTATE_IDLE);
+   m_bool("silent", out.data.nLineState == DSL_LINESTATE_SILENT);
+   m_bool("handshake", out.data.nLineState == 
DSL_LINESTATE_HANDSHAKE);
+   m_bool("full-init", out.data.nLineState == 
DSL_LINESTATE_FULL_INIT);
+   m_bool("showtime-without-sync", out.data.nLineState == 
DSL_LINESTATE_SHOWTIME_NO_SYNC);
+   m_bool("showtime-with-sync", out.data.nLineState == 
DSL_LINESTATE_SHOWTIME_TC_SYNC);
+   m_bool("resync", out.data.nLineState == DSL_LINESTATE_RESYNC);
+   m_bool("not-initialized", out.data.nLineState == 
DSL_LINESTATE_NOT_INITIALIZED);
+   m_str("string", str);
+   blobmsg_close_table(, c);
+   }
 
m_bool("up", out.data.nLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC);
 }
@@ -377,6 +391,7 @@ static void g997_line_inventory(int fd) {
 static void g997_power_management_status(int fd) {
IOCTL(DSL_G997_PowerManagementStatus_t, 
DSL_FIO_G997_POWER_MANAGEMENT_STATUS_GET)
 
+   void *c;
const char *str;
switch (out.data.nPowerManagementStatus) {
STR_CASE(DSL_G997_PMS_NA, "Power management state is not available")
@@ -388,8 +403,17 @@ static void g997_power_management_status(int fd) {
str = NULL;
break;
};
-   if (str)
-   m_str("power_state", str);
+
+   if (str) {
+   c = blobmsg_open_table(, "power_state");
+   m_bool("NA", out.data.nPowerManagementStatus == 
DSL_G997_PMS_NA);
+   m_bool("L0", out.data.nPowerManagementStatus == 
DSL_G997_PMS_L0);
+   m_bool("L1", out.data.nPowerManagementStatus == 
DSL_G997_PMS_L1);
+   m_bool("L2", out.data.nPowerManagementStatus == 
DSL_G997_PMS_L2);
+   m_bool("L3", out.data.nPowerManagementStatus == 
DSL_G997_PMS_L3);
+   m_str("string", str);
+   blobmsg_close_table(, c);
+   }
 }
 
 static void g997_xtu_system_enabling(int fd, standard_t *standard) {
-- 
2.20.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: Official OpenWrt project endorsement [Was: Re: crowdfunding to create Right to Repair laws in the USA]

2021-04-06 Thread Petr Štetiar
John Crispin  [2021-04-06 11:08:41]:

> context ?

https://lists.infradead.org/pipermail/openwrt-devel/2021-April/034537.html

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3 3/3] realtek: allow writing to "u-boot-env2"

2021-04-06 Thread Bjørn Mork
U-Boot uses the "bootpartition" variable stored in
"u-boot-env2" to select the active system partition. Allow
updates to enable system switching from OpenWrt.

Signed-off-by: Bjørn Mork 
---
 target/linux/realtek/dts/rtl8380_netgear_gigabit.dtsi| 1 -
 target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi   | 1 -
 target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts  | 1 -
 target/linux/realtek/dts/rtl8382_d-link_dgs-1210-10p.dts | 1 -
 target/linux/realtek/dts/rtl8382_d-link_dgs-1210.dtsi| 1 -
 5 files changed, 5 deletions(-)

diff --git a/target/linux/realtek/dts/rtl8380_netgear_gigabit.dtsi 
b/target/linux/realtek/dts/rtl8380_netgear_gigabit.dtsi
index d31eb7400145..0d34ca5dc221 100644
--- a/target/linux/realtek/dts/rtl8380_netgear_gigabit.dtsi
+++ b/target/linux/realtek/dts/rtl8380_netgear_gigabit.dtsi
@@ -61,7 +61,6 @@
partition@f {
label = "u-boot-env2";
reg = <0x00f 0x001>;
-   read-only;
};
 
partition@10 {
diff --git a/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi 
b/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi
index c4441ec30eef..d61ac3b2b8f0 100644
--- a/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi
+++ b/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi
@@ -79,7 +79,6 @@
partition@5 {
label = "u-boot-env2";
reg = <0x5 0x1>;
-   read-only;
};
partition@6 {
label = "jffs";
diff --git a/target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts 
b/target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts
index 681d699e8a32..fdcc01fdac41 100644
--- a/target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts
+++ b/target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts
@@ -79,7 +79,6 @@
partition@9 {
label = "u-boot-env2";
reg = <0x9 0x1>;
-   read-only;
};
 
partition@a {
diff --git a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-10p.dts 
b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-10p.dts
index a2ebdad11be0..e2f5e7a4c0e1 100644
--- a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-10p.dts
+++ b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210-10p.dts
@@ -77,7 +77,6 @@
partition@c {
label = "u-boot-env2";
reg = <0x000c 0x4>;
-   read-only;
};
partition@28 {
label = "firmware";
diff --git a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210.dtsi 
b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210.dtsi
index e41c6f9f22e1..a14738c8a962 100644
--- a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210.dtsi
+++ b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210.dtsi
@@ -61,7 +61,6 @@
partition@c {
label = "u-boot-env2";
reg = <0x000c 0x4>;
-   read-only;
};
partition@28 {
label = "firmware";
-- 
2.20.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3 2/3] uboot-envtools: add wrapper scripts for alternate config

2021-04-06 Thread Bjørn Mork
Now that we can create an alternate configuration file, add two
wrapper scripts for simple access to it using the alternate
alternate application names `fw_printsys' and `fw_setsys'.

Signed-off-by: Bjørn Mork 
---
 package/boot/uboot-envtools/Makefile  | 2 ++
 package/boot/uboot-envtools/files/fw_printsys | 2 ++
 package/boot/uboot-envtools/files/fw_setsys   | 2 ++
 3 files changed, 6 insertions(+)
 create mode 100644 package/boot/uboot-envtools/files/fw_printsys
 create mode 100644 package/boot/uboot-envtools/files/fw_setsys

diff --git a/package/boot/uboot-envtools/Makefile 
b/package/boot/uboot-envtools/Makefile
index 03dc6c678d74..02bca9cea3f6 100644
--- a/package/boot/uboot-envtools/Makefile
+++ b/package/boot/uboot-envtools/Makefile
@@ -68,6 +68,8 @@ define Package/uboot-envtools/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/env/fw_printenv $(1)/usr/sbin
$(LN) fw_printenv $(1)/usr/sbin/fw_setenv
+   $(INSTALL_BIN) ./files/fw_printsys $(1)/usr/sbin
+   $(INSTALL_BIN) ./files/fw_setsys $(1)/usr/sbin
$(INSTALL_DIR) $(1)/lib
$(INSTALL_DATA) ./files/uboot-envtools.sh $(1)/lib
$(INSTALL_DIR) $(1)/etc/uci-defaults
diff --git a/package/boot/uboot-envtools/files/fw_printsys 
b/package/boot/uboot-envtools/files/fw_printsys
new file mode 100644
index ..0c4c4ab25702
--- /dev/null
+++ b/package/boot/uboot-envtools/files/fw_printsys
@@ -0,0 +1,2 @@
+#!/bin/sh
+[ -e /etc/fw_sys.config ] && exec /usr/sbin/fw_printenv -c /etc/fw_sys.config 
"$@"
diff --git a/package/boot/uboot-envtools/files/fw_setsys 
b/package/boot/uboot-envtools/files/fw_setsys
new file mode 100644
index ..1cdb1a70f7f4
--- /dev/null
+++ b/package/boot/uboot-envtools/files/fw_setsys
@@ -0,0 +1,2 @@
+#!/bin/sh
+[ -e /etc/fw_sys.config ] && exec /usr/sbin/fw_setenv -c /etc/fw_sys.config 
"$@"
-- 
2.20.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3 1/3] uboot-envtools: add support for multiple config partitions

2021-04-06 Thread Bjørn Mork
Most (all?) of the realtek devices have two u-boot config partitions
with a different set of variables in each. The U-Boot shell provides
two sets of apps to manipulate these:

 printenv- print environment variables
 printsys- printsys - print system information variables
 saveenv - save environment variables to persistent storage
 savesys - savesys - save system information variables to persistent storage
 setenv  - set environment variables
 setsys  - setsys  - set system information variables

Add support for multiple ubootenv configuration types, allowing
more than one configuration file.

Section names are not suitable for naming the different
configurations since each file can be the result of multiple sections
in case of backup partitions.

Signed-off-by: Bjørn Mork 
---
 package/boot/uboot-envtools/Makefile  |  1 +
 package/boot/uboot-envtools/files/realtek |  8 +++-
 .../uboot-envtools/files/uboot-envtools.sh| 38 ---
 3 files changed, 32 insertions(+), 15 deletions(-)

diff --git a/package/boot/uboot-envtools/Makefile 
b/package/boot/uboot-envtools/Makefile
index a9eccec0cec9..03dc6c678d74 100644
--- a/package/boot/uboot-envtools/Makefile
+++ b/package/boot/uboot-envtools/Makefile
@@ -61,6 +61,7 @@ MAKE_FLAGS += \
 define Package/uboot-envtools/conffiles
 /etc/config/ubootenv
 /etc/fw_env.config
+/etc/fw_sys.config
 endef
 
 define Package/uboot-envtools/install
diff --git a/package/boot/uboot-envtools/files/realtek 
b/package/boot/uboot-envtools/files/realtek
index a91ca826044e..75a399208e67 100644
--- a/package/boot/uboot-envtools/files/realtek
+++ b/package/boot/uboot-envtools/files/realtek
@@ -18,15 +18,21 @@ zyxel,gs1900-10hp)
idx="$(find_mtd_index u-boot-env)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x400" "0x1"
+   idx2="$(find_mtd_index u-boot-env2)"
+   [ -n "$idx2" ] && \
+   ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x1000" 
"0x1"
;;
 *)
idx="$(find_mtd_index u-boot-env)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1" "0x1"
+   idx2="$(find_mtd_index u-boot-env2)"
+   [ -n "$idx2" ] && \
+   ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x1000" 
"0x1"
;;
 esac
 
 config_load ubootenv
-config_foreach ubootenv_add_app_config ubootenv
+config_foreach ubootenv_add_app_config
 
 exit 0
diff --git a/package/boot/uboot-envtools/files/uboot-envtools.sh 
b/package/boot/uboot-envtools/files/uboot-envtools.sh
index 9218bc4e3912..980c9962b17c 100644
--- a/package/boot/uboot-envtools/files/uboot-envtools.sh
+++ b/package/boot/uboot-envtools/files/uboot-envtools.sh
@@ -3,34 +3,44 @@
 # Copyright (C) 2011-2012 OpenWrt.org
 #
 
-ubootenv_add_uci_config() {
-   local dev=$1
-   local offset=$2
-   local envsize=$3
-   local secsize=$4
-   local numsec=$5
+_ubootenv_add_uci_config() {
+   local cfgtype=$1
+   local dev=$2
+   local offset=$3
+   local envsize=$4
+   local secsize=$5
+   local numsec=$6
uci batch <>/etc/fw_env.config
+   grep -q "^[[:space:]]*${dev}[[:space:]]*${offset}" 
"/etc/fw_${cfgtype#uboot}.config" || echo "$dev $offset $envsize $secsize 
$numsec" >>"/etc/fw_${cfgtype#uboot}.config"
 }
-
-- 
2.20.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3 0/3] uboot-envtools: multiple config partitions

2021-04-06 Thread Bjørn Mork
Most devices supported by the realtek target use a modified U-Boot
based on Realtek's SDK.  This version splits the U-Boot environment in
two separate config partitions.  Some of the devices use the second
partition for variables of interest to OpenWrt, like for example dual
boot control and mac address ranges.

This series adds support for using more than one uboot-envtools
configuration file, with helper scripts for simple access to the
alternate configuration.

The helper scripts are named after the U-Boot shell commands
implemented by the vendor U-Boot:

  printsys => fw_printsys
  setsys   => fw_setsys

similar to the U-Boot commands

 printenv => fw_printenv
 setenv   => fw_setenv


Changes:

v3:
 - using a dedicated variable name for the second partition
 - new patch removing "read-only" from the second partition
   of supported devices

v2:
 - incremented PKG_RELEASE
 - using wrapper scripts instead of patching the tool


Bjørn Mork (3):
  uboot-envtools: add support for multiple config partitions
  uboot-envtools: add wrapper scripts for alternate config
  realtek: allow writing to "u-boot-env2"

 package/boot/uboot-envtools/Makefile  |  3 ++
 package/boot/uboot-envtools/files/fw_printsys |  2 +
 package/boot/uboot-envtools/files/fw_setsys   |  2 +
 package/boot/uboot-envtools/files/realtek |  8 +++-
 .../uboot-envtools/files/uboot-envtools.sh| 38 ---
 .../realtek/dts/rtl8380_netgear_gigabit.dtsi  |  1 -
 .../realtek/dts/rtl8380_zyxel_gs1900.dtsi |  1 -
 .../dts/rtl8382_allnet_all-sg8208m.dts|  1 -
 .../dts/rtl8382_d-link_dgs-1210-10p.dts   |  1 -
 .../realtek/dts/rtl8382_d-link_dgs-1210.dtsi  |  1 -
 10 files changed, 38 insertions(+), 20 deletions(-)
 create mode 100644 package/boot/uboot-envtools/files/fw_printsys
 create mode 100644 package/boot/uboot-envtools/files/fw_setsys

-- 
2.20.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH v2 1/2] uboot-envtools: add support for multiple config partitions

2021-04-06 Thread Bjørn Mork
"Adrian Schmutzler"  writes:

>> --- a/package/boot/uboot-envtools/files/realtek
>> +++ b/package/boot/uboot-envtools/files/realtek
>> @@ -15,15 +15,21 @@ zyxel,gs1900-10hp)
>>  idx="$(find_mtd_index u-boot-env)"
>>  [ -n "$idx" ] && \
>>  ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x400"
>> "0x1"
>> +idx="$(find_mtd_index u-boot-env2)"
>> +[ -n "$idx" ] && \
>> +ubootenv_add_uci_sys_config "/dev/mtd$idx" "0x0"
>
> I'd personally use a different variable name here, e.g. idx2, so it's clearly 
> separated.

fixing up for v3

> BTW, if you only need the variable once, you can directly use logic on the 
> assignment:
>
> + idx2="$(find_mtd_index u-boot-env2)" &&
> + ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0"


Hmm, this doesn't work for me...  And it doesn't match existing patterns
in the package.  This is not the same:

 $ idx2="";[ -n "$idx2" ] && echo "idx2=$idx2"
 $ idx2="" && echo "idx2=$idx2"
 idx2=

Am I misunderstanding your comment?



Bjørn

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: Official OpenWrt project endorsement [Was: Re: crowdfunding to create Right to Repair laws in the USA]

2021-04-06 Thread John Crispin

context ?

    John

On 06.04.21 10:18, Petr Štetiar wrote:

Alberto Bursi  [2021-04-06 02:22:07]:

Hi,

[adding openwrt-adm to Cc:]


This is at least partially relevant for OpenWrt and I think it's interesting
for many in our community.

I agree.

What about little bit improved promotion of both EU/US efforts, for example
official front page endorsement on openwrt.org, openwrt-announce mail and
pinned forum topic (14-30 days)?

Alberto would you be willing to help preparing text for this official project
endorsement? I assume, that if nobody rejects this idea, then it probably
should be OK to proceed next Monday, April 12th.

Cheers,

Petr

___
openwrt-adm mailing list
openwrt-...@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-adm


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Official OpenWrt project endorsement [Was: Re: crowdfunding to create Right to Repair laws in the USA]

2021-04-06 Thread Petr Štetiar
Alberto Bursi  [2021-04-06 02:22:07]:

Hi,

[adding openwrt-adm to Cc:]

> This is at least partially relevant for OpenWrt and I think it's interesting
> for many in our community. 

I agree.

What about little bit improved promotion of both EU/US efforts, for example
official front page endorsement on openwrt.org, openwrt-announce mail and
pinned forum topic (14-30 days)?

Alberto would you be willing to help preparing text for this official project
endorsement? I assume, that if nobody rejects this idea, then it probably
should be OK to proceed next Monday, April 12th.

Cheers,

Petr

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] ramips: gpio-ralink: use ngpios, not ralink,num-gpios

2021-04-06 Thread Ilya Lipnitskiy
DTS properties that match *-gpios are treated specially.

Use ngpios instead, as most GPIO drivers upstream do.

Fixes 5.10 DTS errors such as:
  OF: /palmbus@30/gpio@600: could not find phandle

Fixes DTC warnings such as:
  Warning (gpios_property): /palmbus@30/gpio@600:ralink,num-gpios:
  Could not get phandle node for (cell 0)

Signed-off-by: Ilya Lipnitskiy 
Cc: Daniel Golle 
---
 target/linux/ramips/dts/mt7620a.dtsi  |  8 
 target/linux/ramips/dts/mt7620n.dtsi  |  8 
 target/linux/ramips/dts/rt2880.dtsi   |  6 +++---
 target/linux/ramips/dts/rt3050.dtsi   |  6 +++---
 target/linux/ramips/dts/rt3352.dtsi   |  6 +++---
 target/linux/ramips/dts/rt3883.dtsi   |  8 
 target/linux/ramips/dts/rt5350.dtsi   |  4 ++--
 .../801-DT-Add-documentation-for-gpio-ralink.patch|  4 ++--
 ...O-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch |  2 +-
 ...ging-mt7621-pinctrl-use-ngpios-not-num-gpios.patch | 11 +++
 .../0026-DT-Add-documentation-for-gpio-ralink.patch   |  4 ++--
 ...O-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch |  2 +-
 ...ging-mt7621-pinctrl-use-ngpios-not-num-gpios.patch | 11 +++
 13 files changed, 51 insertions(+), 29 deletions(-)
 create mode 100644 
target/linux/ramips/patches-5.10/804-staging-mt7621-pinctrl-use-ngpios-not-num-gpios.patch
 create mode 100644 
target/linux/ramips/patches-5.4/804-staging-mt7621-pinctrl-use-ngpios-not-num-gpios.patch

diff --git a/target/linux/ramips/dts/mt7620a.dtsi 
b/target/linux/ramips/dts/mt7620a.dtsi
index afd638a38622..c33dd135fef1 100644
--- a/target/linux/ramips/dts/mt7620a.dtsi
+++ b/target/linux/ramips/dts/mt7620a.dtsi
@@ -117,8 +117,8 @@
gpio-controller;
#gpio-cells = <2>;
 
+   ngpios = <24>;
ralink,gpio-base = <0>;
-   ralink,num-gpios = <24>;
ralink,register-map = [ 00 04 08 0c
20 24 28 2c
30 34 ];
@@ -134,8 +134,8 @@
gpio-controller;
#gpio-cells = <2>;
 
+   ngpios = <16>;
ralink,gpio-base = <24>;
-   ralink,num-gpios = <16>;
ralink,register-map = [ 00 04 08 0c
10 14 18 1c
20 24 ];
@@ -153,8 +153,8 @@
gpio-controller;
#gpio-cells = <2>;
 
+   ngpios = <32>;
ralink,gpio-base = <40>;
-   ralink,num-gpios = <32>;
ralink,register-map = [ 00 04 08 0c
10 14 18 1c
20 24 ];
@@ -172,8 +172,8 @@
gpio-controller;
#gpio-cells = <2>;
 
+   ngpios = <1>;
ralink,gpio-base = <72>;
-   ralink,num-gpios = <1>;
ralink,register-map = [ 00 04 08 0c
10 14 18 1c
20 24 ];
diff --git a/target/linux/ramips/dts/mt7620n.dtsi 
b/target/linux/ramips/dts/mt7620n.dtsi
index 309608adb139..2fac091898d9 100644
--- a/target/linux/ramips/dts/mt7620n.dtsi
+++ b/target/linux/ramips/dts/mt7620n.dtsi
@@ -102,8 +102,8 @@
gpio-controller;
#gpio-cells = <2>;
 
+   ngpios = <24>;
ralink,gpio-base = <0>;
-   ralink,num-gpios = <24>;
ralink,register-map = [ 00 04 08 0c
20 24 28 2c
30 34 ];
@@ -119,8 +119,8 @@
gpio-controller;
#gpio-cells = <2>;
 
+   ngpios = <16>;
ralink,gpio-base = <24>;
-   ralink,num-gpios = <16>;
ralink,register-map = [ 00 04 08 0c
10 14 18 1c
20 24 ];
@@ -138,8 +138,8 @@
gpio-controller;
#gpio-cells = <2>;
 
+   ngpios = <32>;
ralink,gpio-base = <40>;
-   ralink,num-gpios = <32>;
ralink,register-map = [ 00 04 08 0c
10 14 18 1c
20 24 ];
@@ -157,8 +157,8 @@
gpio-controller;