[PATCH] base-files: add support for heartbeat led trigger

2022-01-03 Thread Alexey Smirnov
This patch adds support for creation heartbeat led trigger with,
for example, this command:

ucidef_set_led_heartbeat "..." "..." "..."

from /etc/board.d/01_leds.

Signed-off-by: Alexey Smirnov 
---
 package/base-files/files/lib/functions/uci-defaults.sh | 9 +
 1 file changed, 9 insertions(+)

diff --git a/package/base-files/files/lib/functions/uci-defaults.sh 
b/package/base-files/files/lib/functions/uci-defaults.sh
index 02882f43ca..f96e645e73 100644
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -418,6 +418,15 @@ ucidef_set_led_default() {
json_select ..
 }
 
+ucidef_set_led_heartbeat() {
+   _ucidef_set_led_common "$1" "$2" "$3"
+
+   json_add_string trigger heartbeat
+   json_select ..
+
+   json_select ..
+}
+
 ucidef_set_led_gpio() {
local gpio="$4"
local inverted="$5"
-- 
2.25.1


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


[PATCH] kernel/5.10: allocate last level PTEs in high memory

2022-01-03 Thread Rui Salvaterra
Enable support for allocating user space page table entries in high memory [1],
for the targets which support this feature. This saves precious low memory
(permanently mapped, the only type of memory directly accessible by the kernel).

[1] https://www.kernel.org/doc/html/latest/vm/highmem.html

Signed-off-by: Rui Salvaterra 
---

5.4 deemed unworthy, since it's going the way of the dodo. :)

 target/linux/bcm53xx/config-5.10 | 2 +-
 target/linux/ipq40xx/config-5.10 | 2 +-
 target/linux/ipq806x/config-5.10 | 2 +-
 target/linux/mediatek/mt7623/config-5.10 | 2 +-
 target/linux/mvebu/config-5.10   | 2 +-
 target/linux/x86/config-5.10 | 2 +-
 target/linux/zynq/config-5.10| 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/target/linux/bcm53xx/config-5.10 b/target/linux/bcm53xx/config-5.10
index 3dd0359113..6049641898 100644
--- a/target/linux/bcm53xx/config-5.10
+++ b/target/linux/bcm53xx/config-5.10
@@ -159,7 +159,7 @@ CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT_MAP=y
 CONFIG_HAVE_SMP=y
 CONFIG_HIGHMEM=y
-# CONFIG_HIGHPTE is not set
+CONFIG_HIGHPTE=y
 CONFIG_HW_RANDOM=y
 CONFIG_HW_RANDOM_BCM2835=y
 CONFIG_HZ_FIXED=0
diff --git a/target/linux/ipq40xx/config-5.10 b/target/linux/ipq40xx/config-5.10
index 64f0e54d41..65dd21bf7f 100644
--- a/target/linux/ipq40xx/config-5.10
+++ b/target/linux/ipq40xx/config-5.10
@@ -189,7 +189,7 @@ CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT_MAP=y
 CONFIG_HAVE_SMP=y
 CONFIG_HIGHMEM=y
-# CONFIG_HIGHPTE is not set
+CONFIG_HIGHPTE=y
 CONFIG_HWSPINLOCK=y
 CONFIG_HWSPINLOCK_QCOM=y
 CONFIG_HW_RANDOM=y
diff --git a/target/linux/ipq806x/config-5.10 b/target/linux/ipq806x/config-5.10
index 35da3dd3c2..b7b062f3ec 100644
--- a/target/linux/ipq806x/config-5.10
+++ b/target/linux/ipq806x/config-5.10
@@ -177,7 +177,7 @@ CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT_MAP=y
 CONFIG_HAVE_SMP=y
 CONFIG_HIGHMEM=y
-# CONFIG_HIGHPTE is not set
+CONFIG_HIGHPTE=y
 CONFIG_HWMON=y
 CONFIG_HWSPINLOCK=y
 CONFIG_HWSPINLOCK_QCOM=y
diff --git a/target/linux/mediatek/mt7623/config-5.10 
b/target/linux/mediatek/mt7623/config-5.10
index aabc3b775e..8129584ffc 100644
--- a/target/linux/mediatek/mt7623/config-5.10
+++ b/target/linux/mediatek/mt7623/config-5.10
@@ -264,7 +264,7 @@ CONFIG_HAVE_SMP=y
 CONFIG_HDMI=y
 CONFIG_HID=y
 CONFIG_HIGHMEM=y
-# CONFIG_HIGHPTE is not set
+CONFIG_HIGHPTE=y
 CONFIG_HOTPLUG_CPU=y
 CONFIG_HW_CONSOLE=y
 CONFIG_HWMON=y
diff --git a/target/linux/mvebu/config-5.10 b/target/linux/mvebu/config-5.10
index 1017ee5eed..32978a7d3c 100644
--- a/target/linux/mvebu/config-5.10
+++ b/target/linux/mvebu/config-5.10
@@ -197,7 +197,7 @@ CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT_MAP=y
 CONFIG_HAVE_SMP=y
 CONFIG_HIGHMEM=y
-# CONFIG_HIGHPTE is not set
+CONFIG_HIGHPTE=y
 CONFIG_HOTPLUG_CPU=y
 CONFIG_HWBM=y
 CONFIG_HWMON=y
diff --git a/target/linux/x86/config-5.10 b/target/linux/x86/config-5.10
index 2d07f5a905..ec27bb7945 100644
--- a/target/linux/x86/config-5.10
+++ b/target/linux/x86/config-5.10
@@ -146,7 +146,7 @@ CONFIG_HID=y
 CONFIG_HIGHMEM=y
 CONFIG_HIGHMEM4G=y
 # CONFIG_HIGHMEM64G is not set
-# CONFIG_HIGHPTE is not set
+CONFIG_HIGHPTE=y
 CONFIG_HPET_EMULATE_RTC=y
 CONFIG_HPET_TIMER=y
 # CONFIG_HP_WATCHDOG is not set
diff --git a/target/linux/zynq/config-5.10 b/target/linux/zynq/config-5.10
index 35b7f03a9b..7e960d4ad0 100644
--- a/target/linux/zynq/config-5.10
+++ b/target/linux/zynq/config-5.10
@@ -225,7 +225,7 @@ CONFIG_HID=y
 CONFIG_HID_GENERIC=y
 CONFIG_HID_MICROSOFT=y
 CONFIG_HIGHMEM=y
-# CONFIG_HIGHPTE is not set
+CONFIG_HIGHPTE=y
 CONFIG_HOTPLUG_CPU=y
 CONFIG_HWMON=y
 CONFIG_HW_CONSOLE=y
-- 
2.34.1


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


[PATCH 21.02] openssl: bump to 1.1.1m

2022-01-03 Thread Eneas U de Queiroz
This is a bugfix release.  Changelog:

  *) Avoid loading of a dynamic engine twice.
  *) Fixed building on Debian with kfreebsd kernels
  *) Prioritise DANE TLSA issuer certs over peer certs
  *) Fixed random API for MacOS prior to 10.12

Patches were refreshed.

Signed-off-by: Eneas U de Queiroz 
(cherry picked from commit def9565be632b316c82ffc5a7b28c789e9df75b4)
---
 package/libs/openssl/Makefile | 4 ++--
 .../libs/openssl/patches/100-Configure-afalg-support.patch| 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index 0397ab90c4..e8e10524ca 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssl
 PKG_BASE:=1.1.1
-PKG_BUGFIX:=l
+PKG_BUGFIX:=m
 PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX)
 PKG_RELEASE:=1
 PKG_USE_MIPS16:=0
@@ -26,7 +26,7 @@ PKG_SOURCE_URL:= \
ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \
ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/old/$(PKG_BASE)/
 
-PKG_HASH:=0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
+PKG_HASH:=f89199be8b23ca45fc7cb9f1d8d3ee67312318286ad030f5316aca6462db6c96
 
 PKG_LICENSE:=OpenSSL
 PKG_LICENSE_FILES:=LICENSE
diff --git a/package/libs/openssl/patches/100-Configure-afalg-support.patch 
b/package/libs/openssl/patches/100-Configure-afalg-support.patch
index 98944103b5..d8789f4b45 100644
--- a/package/libs/openssl/patches/100-Configure-afalg-support.patch
+++ b/package/libs/openssl/patches/100-Configure-afalg-support.patch
@@ -12,7 +12,7 @@ diff --git a/Configure b/Configure
 index 5a699836f3..74d057c219 100755
 --- a/Configure
 +++ b/Configure
-@@ -1545,7 +1545,9 @@ unless ($disabled{"crypto-mdebug-backtrace"})
+@@ -1548,7 +1548,9 @@ unless ($disabled{"crypto-mdebug-backtrace"})
  
  unless ($disabled{afalgeng}) {
  $config{afalgeng}="";

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


Re: [RFT] Kernels for next release

2022-01-03 Thread Paul Spooren
Hi,

> I would be fine to remove the arc770 and the ipq807x targets.

I removed ipq807x for now, arc770 should receive a patch within the next days.

> There is no hardware available on the consumer market supported by arc770 and 
> I think archs38 is the successor anyway. If someone wants to add support for 
> real hardware using ARC CPUs later it can be added again.

Alexey could you please comment on this? Do you think it makes more sense to 
focus on archs38?

> What about uml, it is still on kernel 5.4?

I forgot about it! I’ll give it another test with 5.10 and update it later 
today.

Best,
Paul


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


New OpenWrt rootfs format: ubifs volume with squashfs & overlay dir

2022-01-03 Thread Rafał Miłecki
On some UBI-aware devices, firmware file can contain only kernel & 1
UBI volume. It means we can't use:
1. rootfs UBI volume with squashfs
2. rootfs_data UBI volume with ubifs (for overlay)

Note: creating rootfs_data dynamically is not an option as that
wouldn't be wiped out properly while flashing new firmware with
bootloader.


The only solution idea we have is to build ubifs volume with:
1. /root.squashfs
2. /overlay/
and include such ubifs volume in firmware image file for selected devices.

That of course will require initramfs with user-space handling mounting above.

I'm planning to start working on that now. If anyone is willing to
help that's highly appreciated as I'm not well familiar with that
topic. If you can think of any better / simpler solution, please let
me know *now*.


Above solution suggested by Olivier in the e-mail thread:
Identifying UBI volume instance / storing UBI volume metadata
http://lists.openwrt.org/pipermail/openwrt-devel/2021-December/037308.html

My previous request for help in e-mail:
rootfs_data on UBI-aware devices
http://lists.openwrt.org/pipermail/openwrt-devel/2021-December/037304.html
didn't result in any ideas.

--
Rafał

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


Re: [PATCH v2] ruckus_fw_header: Add Ruckus Firmware builder for Ruckus R500 and others

2022-01-03 Thread Rafał Miłecki

On 3.12.2021 01:18, tus...@tusker.org wrote:

From: Damien Mascord 

This image builder builds a tftp updatable binary for Ruckus hardware


Hey, I missed this patch, my suggestion would be to use something like
[PATCH firmware-utils V2]

Let me look at it now.

First git complains about some whitespaces:

Applying: ruckus_fw_header: Add Ruckus Firmware builder for Ruckus R500 and 
others
.git/rebase-apply/patch:97: trailing whitespace.
char load_address[4] = {
.git/rebase-apply/patch:98: trailing whitespace.
0x80, 0x06, 0x00, 0x00 };
.git/rebase-apply/patch:110: trailing whitespace.
0x4f, 0x50, 0x45, 0x4e, 0x57, 0x52, 0x54, 0x31, 0x32, 0x33, 
0x34, 0x35,
.git/rebase-apply/patch:118: trailing whitespace.
char header4[4] = {
.git/rebase-apply/patch:120: trailing whitespace.
char entry_point[4] = {
warning: squelched 13 whitespace errors
warning: 18 lines add whitespace errors.



@@ -0,0 +1,258 @@
+/*
+ * rucks_fw_header.c - partially based on OpenWrt's xorimage.c
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */


Please use SPDX header



+int write_header(FILE *out, char* md5sum){
+   // lzma kernel offset is ruckus header + uimage header = 160 + 64 = 224 
= 0xE0
+   char header1[12] = {
+   0x52, 0x43, 0x4b, 0x53, 0x00, 0x13, 0x00, 0x00, 0x00, 0xe0, 
0x6c, 0x37 };
+   char load_address[4] = {
+   0x80, 0x06, 0x00, 0x00 };   
+   char fakesize[4] = {
+   0x01, 0x76, 0xd7, 0x5c };
+   char header_postsize[4] = {
+   0x60, 0x9a, 0x43, 0xd2 };
+   char fakemd5[16] = {
+   0x39, 0x17, 0x73, 0x56, 0xed, 0x87, 0x33, 0x9a, 0xe3, 0xe4, 
0xff, 0xc9,
+   0xee, 0xcd, 0xd2, 0x9c };
+   char header2[4] = {
+   0x00, 0x04, 0x66, 0x69 };
+   //200.7.10.202.9 - OPENWRT12345678
+   char fake_version[16] = {
+   0x4f, 0x50, 0x45, 0x4e, 0x57, 0x52, 0x54, 0x31, 0x32, 0x33, 
0x34, 0x35,
+   0x36, 0x37, 0x38, 0x39 };
+   char header3[48] = {
+   0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00,
+   0x7a, 0x66, 0x37, 0x37, 0x35, 0x32, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00 };
+   //200.7.10.202.9 - OPENWRT12345678
+   char header4[4] = { 
+   0x00, 0x00, 0x00, 0x03 };
+   char entry_point[4] = { 
+   0x80, 0x06, 0x00, 0x00 };
+   char header_postentry[28] = {
+   0x00, 0x00, 0x00, 0x01, 0x01, 0x76, 0xcf, 0x60, 0x00, 0x00, 0x00, 
0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00,
+   0x00, 0x00, 0x00, 0x00 };


It's full of magic values, hard to maintain & hacky. Please use a packed
struct with proper width (u8 / u16 / u32) named fields. Fill them using
real values and helpers like cpu_to_le32 / cpu_to_be32.

Then fwrite whole struct at once.

Make function static.



+void usage(void) __attribute__ (( __noreturn__ ));


Do we need that?



+void usage(void)
+{
+   fprintf(stderr, "Usage: ruckus_fw_header [-i infile] [-o outfile] 
[-d]\n");
+   exit(EXIT_FAILURE);
+}


Static function



+int main(int argc, char **argv)
+{
+   char buf[1];/* keep this at 1k or adjust garbage calc below */
+   FILE *in = stdin;
+   FILE *out = stdout;
+   char *ifn = NULL;
+   char *ofn = NULL;
+   int c;
+   int v0, v1, v2;
+   size_t n;
+   int p_len, p_off = 0;
+uint8_t  md5sum[0x10];


Use tab for indent.



+
+   while ((c = getopt(argc, argv, "i:o:h")) != -1) {
+   switch (c) {
+   case 'i':
+   ifn = optarg;
+   break;
+   case 'o':
+   ofn = optarg;
+   break;
+   case 'h':
+   default:
+   usage();
+   }
+   }
+   
+   data_size = get_file_size(ifn);


Check returned value.
Maybe make that a local variable to keep code a bit cleaner.

Archer AX73

2022-01-03 Thread eggmudhip--- via openwrt-devel
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 ---
Hello!

Could you please add firmware for Archer AX73?--- End Message ---
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel