Re: [19.07.7] failed to sysupgrade the newifi router

2021-06-24 Thread Michael Richardson

zhengfish  wrote:
> Hello, Guys Today I build one image for newifi router using 19.07.7
> release.  However while I try to reflash the router, it fails.

>Seems it cannot read one key, I don't know what's this key?  And how
> to correct it?

It means that the image is signed by a key that your device does not recognize.
The possibilities are:

  1) your current image was self-built, and did not include the release keys
  2) your new image was self-built, and did not include the release keys.
  3) some other failure.

If you are self-building, then you should ahve the public key you can copy
over.  I think that sysupgrade also an option to skip the check, but I can't
double check that from my laptop at the moment.

--
]   Never tell me the odds! | ipv6 mesh networks [
]   Michael Richardson, Sandelman Software Works|IoT architect   [
] m...@sandelman.ca  http://www.sandelman.ca/|   ruby on rails[



signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH v2] zram-swap: robustify mkswap/swapon/swapoff invocation

2021-06-24 Thread Paul Spooren

Hi,

On 6/21/21 9:54 PM, Rui Salvaterra wrote:

Instead of assuming /sbin contains the correct BusyBox symlinks, directly invoke
the busybox executable. The required utilities are guaranteed to be present,
since the zram-swap package selects them. Additionally, don't assume busybox
resides in /bin, rely on PATH to find it.

While at it, update the copyright year, use SPDX and switch to AUTORELEASE.

Signed-off-by: Rui Salvaterra 
---
v2: update the copyright year, use SPDX and switch to AUTORELEASE.

  package/system/zram-swap/Makefile|  9 ++
  package/system/zram-swap/files/zram.init | 39 ++--
  2 files changed, 13 insertions(+), 35 deletions(-)

diff --git a/package/system/zram-swap/Makefile 
b/package/system/zram-swap/Makefile
index 80f87fcdff..d0d1baddd1 100644
--- a/package/system/zram-swap/Makefile
+++ b/package/system/zram-swap/Makefile
@@ -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)
  
diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init

index d97e85efa5..4c645d6013 100755
--- a/package/system/zram-swap/files/zram.init
+++ b/package/system/zram-swap/files/zram.init
@@ -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"
@@ -160,8 +135,14 @@ start()
return 1
fi
  
-	local zram_size="$( zram_getsize )"

local zram_dev="$( zram_getdev )"
+
+   [ -e "$zram_dev" ] || {
+   logger -s -t zram_applicable -p daemon.crit "[ERROR] device 
'$zram_dev' not found"
+   return 1
+   }
+
+   local zram_size="$( zram_getsize )"
zram_applicable "$zram_dev" || return 1

This line should be removed, too.

local zram_priority="$( uci -q get system.@system[0].zram_priority )"
zram_priority=${zram_priority:+-p $zram_priority}
@@ -171,8 +152,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()

@@ -181,7 +162,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"


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


[PATCH 2/3] zram-swap: set the zram swap priority to 100 by default

2021-06-24 Thread Rui Salvaterra
New swap devices are added in decreasing priority order, starting at -1. Make
sure the zram swap device has the highest priority, by default.

Signed-off-by: Rui Salvaterra 
---
 package/system/zram-swap/files/zram.init | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/package/system/zram-swap/files/zram.init 
b/package/system/zram-swap/files/zram.init
index 9fce5e4797..ea9b55680e 100755
--- a/package/system/zram-swap/files/zram.init
+++ b/package/system/zram-swap/files/zram.init
@@ -144,7 +144,10 @@ start()
 
local zram_size="$( zram_getsize )"
local zram_priority="$( uci -q get system.@system[0].zram_priority )"
-   zram_priority=${zram_priority:+-p $zram_priority}
+
+   if [ -z "$zram_priority" ]; then
+   zram_priority="100"
+   fi
 
logger -s -t zram_start -p daemon.debug "activating '$zram_dev' for 
swapping ($zram_size MegaBytes)"
 
@@ -152,7 +155,7 @@ start()
zram_comp_algo "$zram_dev"
echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename 
"$zram_dev" )/disksize"
busybox mkswap "$zram_dev"
-   busybox swapon -d $zram_priority "$zram_dev"
+   busybox swapon -d -p $zram_priority "$zram_dev"
 }
 
 stop()
-- 
2.32.0


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


[PATCH 0/3] zram-swap cleanups and fixes.

2021-06-24 Thread Rui Salvaterra
The first and third patches are cleanups. The second fixes a priority problem
with multiple swap devices, when added with no priorities specified.

Rui Salvaterra (3):
  zram-swap: robustify mkswap/swapon/swapoff invocation
  zram-swap: set the zram swap priority to 100 by default
  zram-swap: clean up the log messages

 package/system/zram-swap/Makefile|  9 ++--
 package/system/zram-swap/files/zram.init | 61 +---
 2 files changed, 25 insertions(+), 45 deletions(-)

-- 
2.32.0


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


[PATCH 1/3] zram-swap: robustify mkswap/swapon/swapoff invocation

2021-06-24 Thread Rui Salvaterra
Instead of assuming /sbin contains the correct BusyBox symlinks, directly invoke
the busybox executable. The required utilities are guaranteed to be present,
since the zram-swap package selects them. Additionally, don't assume busybox
resides in /bin, rely on PATH to find it.

While at it, update the copyright year, use SPDX and switch to AUTORELEASE.

Signed-off-by: Rui Salvaterra 
---
 package/system/zram-swap/Makefile|  9 ++
 package/system/zram-swap/files/zram.init | 40 ++--
 2 files changed, 13 insertions(+), 36 deletions(-)

diff --git a/package/system/zram-swap/Makefile 
b/package/system/zram-swap/Makefile
index 80f87fcdff..d0d1baddd1 100644
--- a/package/system/zram-swap/Makefile
+++ b/package/system/zram-swap/Makefile
@@ -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)
 
diff --git a/package/system/zram-swap/files/zram.init 
b/package/system/zram-swap/files/zram.init
index d97e85efa5..9fce5e4797 100755
--- a/package/system/zram-swap/files/zram.init
+++ b/package/system/zram-swap/files/zram.init
@@ -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"
@@ -160,9 +135,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}
 
@@ -171,8 +151,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()
@@ -181,7 +161,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"
-- 
2.32.0


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


[PATCH 3/3] zram-swap: clean up the log messages

2021-06-24 Thread Rui Salvaterra
Remove redundant tags and name things more consistently.

Signed-off-by: Rui Salvaterra 
---
 package/system/zram-swap/files/zram.init | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/package/system/zram-swap/files/zram.init 
b/package/system/zram-swap/files/zram.init
index ea9b55680e..e894025b38 100755
--- a/package/system/zram-swap/files/zram.init
+++ b/package/system/zram-swap/files/zram.init
@@ -2,8 +2,8 @@
 
 START=15
 
-extra_command "compact" "Trigger compaction for all Z-RAM swap dev's"
-extra_command "status" "Print out information & statistics about Z-RAM swap 
devices"
+extra_command "compact" "Trigger compaction for all zram swap devices"
+extra_command "status" "Print out information & statistics about zram swap 
devices"
 
 ram_getsize()
 {
@@ -60,15 +60,15 @@ zram_comp_algo()
local zram_comp_algo="$( uci -q get system.@system[0].zram_comp_algo )"
 
if [ -z "$zram_comp_algo" ]; then
-   # lzo-rle fails on small RAM devices, default to lzo, which is 
always available
+   # default to lzo, which is always available
zram_comp_algo="lzo"
fi
 
if [ $(grep -c "$zram_comp_algo" /sys/block/$( basename $dev 
)/comp_algorithm) -ne 0 ]; then
-   logger -s -t zram_comp_algo -p daemon.debug "Set compression 
algorithm '$zram_comp_algo' for zram '$dev'"
+   logger -s -t zram_comp_algo -p daemon.debug "set compression 
algorithm '$zram_comp_algo' for zram '$dev'"
echo $zram_comp_algo > "/sys/block/$( basename $dev 
)/comp_algorithm"
else
-   logger -s -t zram_comp_algo -p daemon.debug "Compression 
algorithm '$zram_comp_algo' is not supported for '$dev'"
+   logger -s -t zram_comp_algo -p daemon.debug "compression 
algorithm '$zram_comp_algo' is not supported for '$dev'"
fi
 }
 
@@ -79,7 +79,7 @@ zram_stats()
 
printf "\nGathering stats info for zram device \"$( basename "$1" 
)\"\n\n"
 
-   printf "Z-RAM\n-\n"
+   printf "ZRAM\n-\n"
printf "%-25s - %s\n" "Block device" $zdev
awk '{ printf "%-25s - %d MiB\n", "Device size", $1/1024/1024 }' 
<$zdev/disksize
printf "%-25s - %s\n" "Compression algo" "$(cat $zdev/comp_algorithm)"
@@ -131,7 +131,7 @@ start()
}
 
if [ $( grep -cs zram /proc/swaps ) -ne 0 ]; then
-   logger -s -t zram_start -p daemon.notice "[OK] zram swap is 
already mounted"
+   logger -s -t zram_start -p daemon.notice "zram swap is already 
mounted"
return 1
fi
 
@@ -149,7 +149,7 @@ start()
zram_priority="100"
fi
 
-   logger -s -t zram_start -p daemon.debug "activating '$zram_dev' for 
swapping ($zram_size MegaBytes)"
+   logger -s -t zram_start -p daemon.debug "activating '$zram_dev' for 
swapping ($zram_size MiB)"
 
zram_reset "$zram_dev" "enforcing defaults"
zram_comp_algo "$zram_dev"
-- 
2.32.0


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


[PATCH] realtek: fix ZyXEL initramfs image generation

2021-06-24 Thread Bjørn Mork
The current rule produces empty trailers, causing the OEM firmware
update application to reject our images.

The double expansion of a makefile variable does not work inside
shell code.  The second round is interpreted as a shell expansion,
attempting to run the command ZYXEL_VERS instead of expanding the
$(ZYXEL_VERS) makefile variable.

Fix by removing one level of variable indirection.

Fixes: c6c8d597e183 ("realtek: Add generic zyxel_gs1900 image definition")
Signed-off-by: Bjørn Mork 
---
I got myself another brand new GS1900-10HP and used the opportunity to
verify the console-less installation procedure.  And of course, it didn't
work

The reason is that we currently build images with a bogus trailer,
lacking the crucial hardware version info the OEM firmware looks
for.

This needs to be backported yto 21.02 as well.  I dowloaded the
initramfs images from downloads.openwrt.org and verified that they have
the same issue:

 $ hexdump -C 
openwrt-21.02.0-rc3-realtek-generic-zyxel_gs1900-10hp-initramfs-kernel.bin 
|tail -4
 005b7240  ca 0f 86 61 cc 1b 7d 0a  0b 09 45 88 fc 06 fd ac  |...a..}...E.|
 005b7250  f6 82 7e 5d 7d 13 5a 56  8c 14 fe 7f 55 bf 19 d4  |..~]}.ZVU...|
 005b7260  ea 2d d7 00 56 45 52 53  0a   |.-..VERS.|
 005b7269


A proper image should have a trailer similar to this:

 $ hexdump -C openwrt-initramfs.bin |tail -4
 005746d0  10 e1 d2 0c 73 0a ff 07  eb 12 c6 f1 0a eb ca 00  |s...|
 005746e0  56 45 52 53 0a 56 39 2e  39 39 28 41 41 5a 49 2e  |VERS.V9.99(AAZI.|
 005746f0  30 29 20 7c 20 30 36 2f  32 34 2f 32 30 32 31 0a  |0) | 06/24/2021.|
 00574700

The last one is the actual image I used to my initial install from OEM.
It worked.


Bjørn

 target/linux/realtek/image/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/realtek/image/Makefile 
b/target/linux/realtek/image/Makefile
index ebc0c0a78480..38b4d5e441cc 100644
--- a/target/linux/realtek/image/Makefile
+++ b/target/linux/realtek/image/Makefile
@@ -10,7 +10,7 @@ DEVICE_VARS += ZYXEL_VERS
 
 define Build/zyxel-vers
( echo VERS;\
-   for hw in $(1); do\
+   for hw in $(ZYXEL_VERS); do\
echo -n "V9.99($$hw.0) | ";\
date -d @$(SOURCE_DATE_EPOCH) +%m/%d/%Y;\
done ) >> $@
@@ -117,7 +117,7 @@ define Device/zyxel_gs1900
   IMAGE_SIZE := 6976k
   DEVICE_VENDOR := ZyXEL
   UIMAGE_MAGIC := 0x8380
-  KERNEL_INITRAMFS := kernel-bin | append-dtb | gzip | zyxel-vers 
(ZYXEL_VERS) | \
+  KERNEL_INITRAMFS := kernel-bin | append-dtb | gzip | zyxel-vers | \
uImage gzip
 endef
 
-- 
2.20.1


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


Re: [PATCH 2/3] base-files: failsafe: Start also CPU interface for DSA

2021-06-24 Thread Sven Roederer
Am Sonntag, 20. Juni 2021, 17:11:08 CEST schrieb Hauke Mehrtens:
> On 6/20/21 4:30 PM, Sven Roederer wrote:
> > 
> > The Rb750 is DSA, so it seems there is still something wrong. I'll retest
> > with current master soon, to rule out issues based on 21.02-rc3.
> > 
> > Sven
> 
> Hi,
> 
> I tried it on a lantiq device with the DSA patches applied and it works
> fine.
> 

Hauke,

I found some tme to test and and confirm the this patch-series also fixes the 
issue on the RB750Gr3 with DSA.
As it takes much longer till the network is up, in comparison to 19.07, it 
seems that I gave up to quickly.

IÄve seen you pushed some updated patch-sets already, so my comment here might 
be only for reference.

Sven



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


[PATCH v2] cn913x: add support for iEi Puzzle-M901/Puzzle-M902

2021-06-24 Thread eveans2002
From: Ian Chang 

 Hardware specification
 --
 * CN9130 SoC, Quad-core ARMv8 Cortex-72 @ 2200 MHz
 * 4 GB DDR
 * 4 GB eMMC
 mmcblk0
 ├─mmcblk0p164M  kernel_1
 ├─mmcblk0p264M  kernel_2
 ├─mmcblk0p3   512M  rootfs_1
 ├─mmcblk0p4   512M  rootfs_2
 ├─mmcblk0p5   512M  Reserved
 ├─mmcblk0p664M  Reserved
 └─mmcblk0p7   1.8G  rootfs_data

 * 4 MB (SPI Flash)
 * 6 x 2.5 Gigabit  ports (Puzzle-M901)
- External PHY with 6 ports (AQR112R)
 * 6 x 2.5 Gigabit ports (Puzzle-M902)
- External PHY with 6 ports (AQR112R)
   3 x 10 Gigabit ports (Puzzle-M902)
- External PHY with 3 ports (AQR113R)

 * 4 x Front panel LED
 * 1 x USB 3.0
 * Reset button on Rear panel
 * UART (115200 8N1,header on PCB)

 Flash instructions:
   The original firmware is based on OpenWrt.
   Flash firmware using LuCI and CLI

Signed-off-by: Ian Chang 
---
 .../base-files/etc/board.d/02_network |   6 +
 .../cortexa72/base-files/lib/upgrade/emmc.sh  |  45 
 .../base-files/lib/upgrade/platform.sh|   8 +
 target/linux/mvebu/cortexa72/config-5.4   |   4 +
 .../dts/marvell/puzzle-armada-common.dtsi |  11 +
 .../boot/dts/marvell/puzzle-armada-cp110.dtsi |  12 +
 .../arm64/boot/dts/marvell/puzzle-cn9130.dtsi |  37 +++
 .../boot/dts/marvell/puzzle-m901-cn9130.dts   | 219 
 .../boot/dts/marvell/puzzle-m901-cn9131.dts   | 182 +
 .../boot/dts/marvell/puzzle-m902-cn9130.dts   | 245 ++
 .../boot/dts/marvell/puzzle-m902-cn9131.dts   | 140 ++
 .../boot/dts/marvell/puzzle-m902-cn9132.dts   | 209 +++
 target/linux/mvebu/image/cortexa72.mk |  20 ++
 13 files changed, 1138 insertions(+)
 create mode 100644 target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc.sh
 create mode 100644 
target/linux/mvebu/files/arch/arm64/boot/dts/marvell/puzzle-armada-common.dtsi
 create mode 100644 
target/linux/mvebu/files/arch/arm64/boot/dts/marvell/puzzle-armada-cp110.dtsi
 create mode 100644 
target/linux/mvebu/files/arch/arm64/boot/dts/marvell/puzzle-cn9130.dtsi
 create mode 100644 
target/linux/mvebu/files/arch/arm64/boot/dts/marvell/puzzle-m901-cn9130.dts
 create mode 100644 
target/linux/mvebu/files/arch/arm64/boot/dts/marvell/puzzle-m901-cn9131.dts
 create mode 100644 
target/linux/mvebu/files/arch/arm64/boot/dts/marvell/puzzle-m902-cn9130.dts
 create mode 100644 
target/linux/mvebu/files/arch/arm64/boot/dts/marvell/puzzle-m902-cn9131.dts
 create mode 100644 
target/linux/mvebu/files/arch/arm64/boot/dts/marvell/puzzle-m902-cn9132.dts

diff --git a/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network 
b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network
index 9ab3c8174d..dc6d5bfd8b 100755
--- a/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network
+++ b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network
@@ -21,6 +21,12 @@ marvell,armada8040-db)
 marvell,armada7040-db)
ucidef_set_interfaces_lan_wan "eth0 eth2" "eth1"
;;
+marvell,puzzle-m901-cn9131)
+   ucidef_set_interfaces_lan_wan "eth1 eth2 eth3 eth4 eth5" "eth0"
+   ;;
+marvell,puzzle-m902-cn9132)
+   ucidef_set_interfaces_lan_wan "eth1 eth2 eth3 eth4 eth5 eth10 eth11 
eth12" "eth0"
+   ;;
 *)
ucidef_set_interface_lan "eth0"
;;
diff --git a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc.sh 
b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc.sh
new file mode 100644
index 00..d959350ff4
--- /dev/null
+++ b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc.sh
@@ -0,0 +1,45 @@
+platform_do_upgrade_emmc() {
+   local board=$(board_name)
+   local diskdev partdev diff
+
+   export_bootdevice && export_partdevice diskdev 0 || {
+   v "Unable to determine upgrade device"
+   return 1
+   }
+
+   sync
+
+   if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then
+   get_partitions "/dev/$diskdev" bootdisk
+
+   v "Extract boot sector from the image"
+   get_image_dd "$1" of=/tmp/image.bs count=1 bs=512b
+
+   get_partitions /tmp/image.bs image
+
+   #compare tables
+   diff="$(grep -F -x -v -f /tmp/partmap.bootdisk 
/tmp/partmap.image)"
+   else
+   diff=1
+   fi
+
+   #iterate over each partition from the image and write it to the boot 
disk
+   while read part start size; do
+   if export_partdevice partdev $part; then
+   if [ "$partdev" = "mmcblk0p2" ]; then
+   v "Writing image mmcblk0p3 for /dev/$partdev  
$start $size"
+   get_image_dd "$1" of="/dev/mmcblk0p3" ibs="512" 
obs=1M skip="$start" count="$size" conv=fsync
+ elif [ "$partdev" = "mmcblk0p1" ]; then
+   v "Writing image mmcblk0p1 for /dev/$partdev 
$start $size"
+   get_image_dd "$1" of="/dev/$partdev" ibs="512" 
obs

Re: [19.07.7] failed to sysupgrade the newifi router

2021-06-24 Thread zhengfish
Hello, Michael
Yes, you are right.
As you figured out, I built my current image several months ago,
and now need to build one new to reflash it.
Just now I managed to fix it: I find one the same name key in
./build_dir/target-mipsel_24kc_musl/root-ramips/etc/opkg/keys/fde039f0d5af3cef
I copy it into my newifi box before I do sysupgrade, then I can reflash it.
Thanks for your information.

Regards.

zhengfish


On Fri, Jun 25, 2021 at 12:04 AM Michael Richardson  wrote:
>
>
> zhengfish  wrote:
> > Hello, Guys Today I build one image for newifi router using 19.07.7
> > release.  However while I try to reflash the router, it fails.
>
> >Seems it cannot read one key, I don't know what's this key?  And how
> > to correct it?
>
> It means that the image is signed by a key that your device does not 
> recognize.
> The possibilities are:
>
>   1) your current image was self-built, and did not include the release keys
>   2) your new image was self-built, and did not include the release keys.
>   3) some other failure.
>
> If you are self-building, then you should ahve the public key you can copy
> over.  I think that sysupgrade also an option to skip the check, but I can't
> double check that from my laptop at the moment.
>
> --
> ]   Never tell me the odds! | ipv6 mesh networks [
> ]   Michael Richardson, Sandelman Software Works|IoT architect   [
> ] m...@sandelman.ca  http://www.sandelman.ca/|   ruby on rails
> [
>

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