aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape
diff options
context:
space:
mode:
authorPawel Dembicki <paweldembicki@gmail.com>2020-08-24 12:21:19 +0200
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-10-26 00:40:12 +0100
commitc51f8030b623e03567a73fbcedc4ee69a8896688 (patch)
treeff2fc8cba2da5857963a8f5f83b7f456f7024779 /target/linux/layerscape
parent3605eff88190af9cc2905ba750252c1643a1bc7d (diff)
downloadupstream-c51f8030b623e03567a73fbcedc4ee69a8896688.tar.gz
upstream-c51f8030b623e03567a73fbcedc4ee69a8896688.tar.bz2
upstream-c51f8030b623e03567a73fbcedc4ee69a8896688.zip
layerscape: fix platform_copy_config function
At this moment platform_copy_config function is used for every device and function "export_partdevice" without "export_bootdevice" causes multiple errors like that: "sh: 1: unknown operand" This patch fix usage of export_partdevice and split platform_copy_config for sd-card images. 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>
Diffstat (limited to 'target/linux/layerscape')
-rw-r--r--target/linux/layerscape/base-files/lib/upgrade/platform.sh24
1 files changed, 21 insertions, 3 deletions
diff --git a/target/linux/layerscape/base-files/lib/upgrade/platform.sh b/target/linux/layerscape/base-files/lib/upgrade/platform.sh
index 633cbaf953..de01ac46de 100644
--- a/target/linux/layerscape/base-files/lib/upgrade/platform.sh
+++ b/target/linux/layerscape/base-files/lib/upgrade/platform.sh
@@ -109,15 +109,33 @@ platform_do_upgrade_traverse_nandubi() {
nand_do_upgrade "$1" || (echo "Upgrade failed, setting bootsys ${bootsys}" && fw_setenv bootsys $bootsys)
}
-platform_copy_config() {
- local partdev parttype=ext4
+platform_copy_config_sdboot() {
+ local diskdev partdev parttype=ext4
+
+ export_bootdevice && export_partdevice diskdev 0 || {
+ echo "Unable to determine upgrade device"
+ return 1
+ }
if export_partdevice partdev 1; then
- mount -t $parttype -o rw,noatime "/dev/$partdev" /mnt
+ mount -t $parttype -o rw,noatime "/dev/$partdev" /mnt 2>&1
cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE"
umount /mnt
fi
}
+platform_copy_config() {
+ local board=$(board_name)
+
+ case "$board" in
+ fsl,ls1012a-frwy-sdboot | \
+ fsl,ls1021a-twr-sdboot | \
+ fsl,ls1043a-rdb-sdboot | \
+ fsl,ls1046a-rdb-sdboot | \
+ fsl,ls1088a-rdb-sdboot)
+ platform_copy_config_sdboot
+ ;;
+ esac
+}
platform_check_image() {
local board=$(board_name)