aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape
diff options
context:
space:
mode:
authorPawel Dembicki <paweldembicki@gmail.com>2020-08-20 09:28:01 +0200
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-10-26 00:40:12 +0100
commit6180005debe3f2502e5c2e1839f05682338990b4 (patch)
tree7ae8333c5b7b5b4b88b9fdeef32ea1ddce941ca5 /target/linux/layerscape
parent2a0d08d8270f0a299c3ea341019272faa157d427 (diff)
downloadupstream-6180005debe3f2502e5c2e1839f05682338990b4.tar.gz
upstream-6180005debe3f2502e5c2e1839f05682338990b4.tar.bz2
upstream-6180005debe3f2502e5c2e1839f05682338990b4.zip
layerscape: fix sd-card sysupgrade
So far, kernel has not been written correctly to SD card during sysupgrade, as both target path and offset were wrong. This patch fixes it, and adds some descriptive output on the way. Fixes: 0841b68c91d3 ("layerscape: support sysupgrade for SD card ext4 rootfs") Reviewed-by: Yangbo Lu <yangbo.lu@nxp.com> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> [alter/extend commit message] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/layerscape')
-rw-r--r--target/linux/layerscape/base-files/lib/upgrade/platform.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/target/linux/layerscape/base-files/lib/upgrade/platform.sh b/target/linux/layerscape/base-files/lib/upgrade/platform.sh
index 8a136d9439..fa0f21a6c5 100644
--- a/target/linux/layerscape/base-files/lib/upgrade/platform.sh
+++ b/target/linux/layerscape/base-files/lib/upgrade/platform.sh
@@ -60,7 +60,8 @@ platform_do_upgrade_sdboot() {
if [ -n "$diff" ]; then
dd if="$1" of="/dev/$diskdev" bs=1024 count=4 > /dev/null 2>&1
- dd if="$1" of="$diskdev" bs=1024 skip=4 seek=16384 > /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
sync
# Separate removal and addtion is necessary; otherwise, partition 1
@@ -72,7 +73,8 @@ platform_do_upgrade_sdboot() {
fi
# write kernel image
- dd if="$1" of="$diskdev" bs=1024 skip=4 seek=16384 count=16384 > /dev/null 2>&1
+ echo "Writing kernel to /dev/$diskdev..."
+ dd if="$1" of="/dev/$diskdev" bs=1024 skip=16384 seek=16384 count=16384 > /dev/null 2>&1
sync
# iterate over each partition from the image and write it to the boot disk