uboot: cc6ul: force erase of partitions before update on install scripts
Install scripts may rework the partition table basing on the value of env variables. Information of UBI volumes may remain on the NAND that could later not correspond to the new partition table. Make sure the MTD partitions are erased prior to updating: - For Multi-MTD, append '-e' option to the update command. - For Single-MTD, erase the system partition. Signed-off-by: Hector Palacios <hector.palacios@digi.com>
This commit is contained in:
parent
f647e6d442
commit
f3ae964d10
|
|
@ -146,6 +146,8 @@ setenv bootcmd "
|
||||||
saveenv;
|
saveenv;
|
||||||
if test \"\$\{ubisysvols\}\" = yes; then
|
if test \"\$\{ubisysvols\}\" = yes; then
|
||||||
run ubivolscript;
|
run ubivolscript;
|
||||||
|
else
|
||||||
|
force_erase="-e"
|
||||||
fi;
|
fi;
|
||||||
if test \"\$\{dualboot\}\" = yes; then
|
if test \"\$\{dualboot\}\" = yes; then
|
||||||
echo \"\";
|
echo \"\";
|
||||||
|
|
@ -153,10 +155,7 @@ setenv bootcmd "
|
||||||
echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_a\";
|
echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_a\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then
|
update linux_a mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME} ${force_erase};
|
||||||
nand erase.part linux_a;
|
|
||||||
fi;
|
|
||||||
update linux_a mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME};
|
|
||||||
if test \$? -eq 1; then
|
if test \$? -eq 1; then
|
||||||
echo \"[ERROR] Failed to update linux_a!\";
|
echo \"[ERROR] Failed to update linux_a!\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
|
|
@ -168,10 +167,7 @@ setenv bootcmd "
|
||||||
echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\";
|
echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then
|
update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME} ${force_erase};
|
||||||
nand erase.part linux_b;
|
|
||||||
fi;
|
|
||||||
update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME};
|
|
||||||
if test \$? -eq 1; then
|
if test \$? -eq 1; then
|
||||||
echo \"[ERROR] Failed to update linux_b!\";
|
echo \"[ERROR] Failed to update linux_b!\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
|
|
@ -183,10 +179,7 @@ setenv bootcmd "
|
||||||
echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_a\";
|
echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_a\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then
|
update rootfs_a mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME} ${force_erase};
|
||||||
nand erase.part rootfs_a;
|
|
||||||
fi;
|
|
||||||
update rootfs_a mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME};
|
|
||||||
if test \$? -eq 1; then
|
if test \$? -eq 1; then
|
||||||
echo \"[ERROR] Failed to update rootfs_a partition!\";
|
echo \"[ERROR] Failed to update rootfs_a partition!\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
|
|
@ -198,10 +191,7 @@ setenv bootcmd "
|
||||||
echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\";
|
echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then
|
update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME} ${force_erase};
|
||||||
nand erase.part rootfs_b;
|
|
||||||
fi;
|
|
||||||
update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME};
|
|
||||||
if test \$? -eq 1; then
|
if test \$? -eq 1; then
|
||||||
echo \"[ERROR] Failed to update rootfs_b partition!\";
|
echo \"[ERROR] Failed to update rootfs_b partition!\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
|
|
@ -214,10 +204,7 @@ setenv bootcmd "
|
||||||
echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux\";
|
echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then
|
update linux mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME} ${force_erase};
|
||||||
nand erase.part linux;
|
|
||||||
fi;
|
|
||||||
update linux mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME};
|
|
||||||
if test \$? -eq 1; then
|
if test \$? -eq 1; then
|
||||||
echo \"[ERROR] Failed to update linux!\";
|
echo \"[ERROR] Failed to update linux!\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
|
|
@ -229,10 +216,7 @@ setenv bootcmd "
|
||||||
echo \">> Installing file ${INSTALL_RECOVERY_FILENAME} on recovery\";
|
echo \">> Installing file ${INSTALL_RECOVERY_FILENAME} on recovery\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then
|
update recovery mmc ${INSTALL_MMCDEV} ${INSTALL_RECOVERY_FILENAME} ${force_erase};
|
||||||
nand erase.part recovery;
|
|
||||||
fi;
|
|
||||||
update recovery mmc ${INSTALL_MMCDEV} ${INSTALL_RECOVERY_FILENAME};
|
|
||||||
if test \$? -eq 1; then
|
if test \$? -eq 1; then
|
||||||
echo \"[ERROR] Failed to update recovery partition!\";
|
echo \"[ERROR] Failed to update recovery partition!\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
|
|
@ -244,10 +228,7 @@ setenv bootcmd "
|
||||||
echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs\";
|
echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then
|
update rootfs mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME} ${force_erase};
|
||||||
nand erase.part rootfs;
|
|
||||||
fi;
|
|
||||||
update rootfs mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME};
|
|
||||||
if test \$? -eq 1; then
|
if test \$? -eq 1; then
|
||||||
echo \"[ERROR] Failed to update rootfs partition!\";
|
echo \"[ERROR] Failed to update rootfs partition!\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
|
|
|
||||||
|
|
@ -146,6 +146,8 @@ setenv bootcmd "
|
||||||
saveenv;
|
saveenv;
|
||||||
if test \"\$\{ubisysvols\}\" = yes; then
|
if test \"\$\{ubisysvols\}\" = yes; then
|
||||||
run ubivolscript;
|
run ubivolscript;
|
||||||
|
else
|
||||||
|
force_erase="-e"
|
||||||
fi;
|
fi;
|
||||||
usb start;
|
usb start;
|
||||||
if test \"\$\{dualboot\}\" = yes; then
|
if test \"\$\{dualboot\}\" = yes; then
|
||||||
|
|
@ -154,10 +156,7 @@ setenv bootcmd "
|
||||||
echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_a\";
|
echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_a\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then
|
update linux_a usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME} ${force_erase};
|
||||||
nand erase.part linux_a;
|
|
||||||
fi;
|
|
||||||
update linux_a usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME};
|
|
||||||
if test \$? -eq 1; then
|
if test \$? -eq 1; then
|
||||||
echo \"[ERROR] Failed to update linux_a!\";
|
echo \"[ERROR] Failed to update linux_a!\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
|
|
@ -169,10 +168,7 @@ setenv bootcmd "
|
||||||
echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\";
|
echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then
|
update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME} ${force_erase};
|
||||||
nand erase.part linux_b;
|
|
||||||
fi;
|
|
||||||
update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME};
|
|
||||||
if test \$? -eq 1; then
|
if test \$? -eq 1; then
|
||||||
echo \"[ERROR] Failed to update linux_b!\";
|
echo \"[ERROR] Failed to update linux_b!\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
|
|
@ -184,10 +180,7 @@ setenv bootcmd "
|
||||||
echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_a\";
|
echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_a\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then
|
update rootfs_a usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME} ${force_erase};
|
||||||
nand erase.part rootfs_a;
|
|
||||||
fi;
|
|
||||||
update rootfs_a usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME};
|
|
||||||
if test \$? -eq 1; then
|
if test \$? -eq 1; then
|
||||||
echo \"[ERROR] Failed to update rootfs_a partition!\";
|
echo \"[ERROR] Failed to update rootfs_a partition!\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
|
|
@ -199,10 +192,7 @@ setenv bootcmd "
|
||||||
echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\";
|
echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then
|
update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME} ${force_erase};
|
||||||
nand erase.part rootfs_b;
|
|
||||||
fi;
|
|
||||||
update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME};
|
|
||||||
if test \$? -eq 1; then
|
if test \$? -eq 1; then
|
||||||
echo \"[ERROR] Failed to update rootfs_b partition!\";
|
echo \"[ERROR] Failed to update rootfs_b partition!\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
|
|
@ -215,10 +205,7 @@ setenv bootcmd "
|
||||||
echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux\";
|
echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then
|
update linux usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME} ${force_erase};
|
||||||
nand erase.part linux;
|
|
||||||
fi;
|
|
||||||
update linux usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME};
|
|
||||||
if test \$? -eq 1; then
|
if test \$? -eq 1; then
|
||||||
echo \"[ERROR] Failed to update linux!\";
|
echo \"[ERROR] Failed to update linux!\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
|
|
@ -230,10 +217,7 @@ setenv bootcmd "
|
||||||
echo \">> Installing file ${INSTALL_RECOVERY_FILENAME} on recovery\";
|
echo \">> Installing file ${INSTALL_RECOVERY_FILENAME} on recovery\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then
|
update recovery usb ${INSTALL_USBDEV} ${INSTALL_RECOVERY_FILENAME} ${force_erase};
|
||||||
nand erase.part recovery;
|
|
||||||
fi;
|
|
||||||
update recovery usb ${INSTALL_USBDEV} ${INSTALL_RECOVERY_FILENAME};
|
|
||||||
if test \$? -eq 1; then
|
if test \$? -eq 1; then
|
||||||
echo \"[ERROR] Failed to update recovery partition!\";
|
echo \"[ERROR] Failed to update recovery partition!\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
|
|
@ -245,10 +229,7 @@ setenv bootcmd "
|
||||||
echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs\";
|
echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
if test ! -n \$\{ubisysvols\} || test \"\$\{ubisysvols\}\" = no; then
|
update rootfs usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME} ${force_erase};
|
||||||
nand erase.part rootfs;
|
|
||||||
fi;
|
|
||||||
update rootfs usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME};
|
|
||||||
if test \$? -eq 1; then
|
if test \$? -eq 1; then
|
||||||
echo \"[ERROR] Failed to update rootfs partition!\";
|
echo \"[ERROR] Failed to update rootfs partition!\";
|
||||||
echo \"\";
|
echo \"\";
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,16 @@ part_update()
|
||||||
echo "====================================================================================="
|
echo "====================================================================================="
|
||||||
echo "\033[0m"
|
echo "\033[0m"
|
||||||
|
|
||||||
|
# When in Multi-MTD mode, pass -e to update command to force the erase
|
||||||
|
# of the MTD partition before programming. This is usually done by
|
||||||
|
# 'update' command except when a UBI volume is already found.
|
||||||
|
# On the install script, the MTD partition table may have changed, so
|
||||||
|
# we'd better clean the partition.
|
||||||
|
if [ "${UBISYSVOLS}" != true ]; then
|
||||||
|
ERASE="-e"
|
||||||
|
fi
|
||||||
uuu fb: download -f "${2}"
|
uuu fb: download -f "${2}"
|
||||||
uuu "fb[-t ${3}]:" ucmd update "${1}" ram \${fastboot_buffer} \${fastboot_bytes}
|
uuu "fb[-t ${3}]:" ucmd update "${1}" ram \${fastboot_buffer} \${fastboot_bytes} ${ERASE}
|
||||||
}
|
}
|
||||||
|
|
||||||
clear
|
clear
|
||||||
|
|
@ -259,6 +267,7 @@ uuu "fb[-t 10000]:" ucmd run partition_nand_linux
|
||||||
|
|
||||||
if [ "${UBISYSVOLS}" = true ]; then
|
if [ "${UBISYSVOLS}" = true ]; then
|
||||||
uuu "fb[-t 10000]:" ucmd run ubivolscript
|
uuu "fb[-t 10000]:" ucmd run ubivolscript
|
||||||
|
nand erase.part system
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${DUALBOOT}" = true ]; then
|
if [ "${DUALBOOT}" = true ]; then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue