2
0
forked from Ivasoft/openwrt

layerscape: add dtb to sysupgrade

At this moment sysupgrade replaces only kernel and rootfs.

This patch add dtb part to sysupgrade images to avoid situation
when old dtb make system broken.

Is possible to sysupgrade older images for NOR devices:
1. Firmware partition in bootargs need to be updated to:
   "49m@0xf00000(firmware)". Env should be saved after changes.
2. After step one, "sysupgrade -F" will work.

Run tested: LS1046A-RDB

Reviewed-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[bump PKG_RELEASE for uboot-layerscape]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Pawel Dembicki
2020-08-19 12:13:26 +02:00
committed by Adrian Schmutzler
parent 6180005deb
commit 3605eff881
12 changed files with 66 additions and 18 deletions

View File

@@ -61,7 +61,7 @@ platform_do_upgrade_sdboot() {
if [ -n "$diff" ]; then
dd if="$1" of="/dev/$diskdev" bs=1024 count=4 > /dev/null 2>&1
echo "Writing image to /dev/$diskdev..."
dd if="$1" of="/dev/$diskdev" bs=1024 skip=16384 seek=16384 > /dev/null 2>&1
dd if="$1" of="/dev/$diskdev" bs=1024 skip=15360 seek=15360 > /dev/null 2>&1
sync
# Separate removal and addtion is necessary; otherwise, partition 1
@@ -72,6 +72,9 @@ platform_do_upgrade_sdboot() {
return 0
fi
# write dtb
echo "Writing dtb to /dev/$diskdev..."
dd if="$1" of="/dev/$diskdev" bs=1024 skip=15360 seek=15360 count=1024 > /dev/null 2>&1
# write kernel image
echo "Writing kernel to /dev/$diskdev..."
dd if="$1" of="/dev/$diskdev" bs=1024 skip=16384 seek=16384 count=16384 > /dev/null 2>&1