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>
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
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