install_linux_fw_sd: erase NAND partitions before update

NAND partitions may have pre-existing UBI volume information
and that will tell U-Boot to use 'ubiwrite' to keep UBI wear
leveling information instead of erasing the NAND partition
beforehand. Given that the UBI support in U-Boot is not
particularly complete and stable, and specially if the NAND
partition table has been changed, this could result into
problems during the UBI volume initialization or during the
update process. To prevent such problems it is better that
the NAND partitions are erased.

This loses the UBI wear leveling information but provides
a more reliable deployment install script.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DUB-718
This commit is contained in:
Hector Palacios 2017-01-25 10:31:06 +01:00
parent e0890e8866
commit 9ea7568d8d
2 changed files with 6 additions and 0 deletions

View File

@ -74,6 +74,7 @@ setenv bootcmd "
echo \">> Installing Linux kernel and device tree files\";
echo \"\";
echo \"\";
nand erase.part linux
update linux mmc ${INSTALL_MMCDEV} fat ${INSTALL_LINUX_FILENAME};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update linux partition!\";
@ -86,6 +87,7 @@ setenv bootcmd "
echo \">> Installing recovery\";
echo \"\";
echo \"\";
nand erase.part recovery
update recovery mmc ${INSTALL_MMCDEV} fat ${INSTALL_RECOVERY_FILENAME};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update recovery partition!\";
@ -98,6 +100,7 @@ setenv bootcmd "
echo \">> Installing Linux root file system\";
echo \"\";
echo \"\";
nand erase.part rootfs
update rootfs mmc ${INSTALL_MMCDEV} fat ${INSTALL_ROOTFS_FILENAME};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update rootfs partition!\";

View File

@ -74,6 +74,7 @@ setenv bootcmd "
echo \">> Installing Linux kernel and device tree files\";
echo \"\";
echo \"\";
nand erase.part linux
update linux mmc ${INSTALL_MMCDEV} fat ${INSTALL_LINUX_FILENAME};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update linux partition!\";
@ -86,6 +87,7 @@ setenv bootcmd "
echo \">> Installing recovery\";
echo \"\";
echo \"\";
nand erase.part recovery
update recovery mmc ${INSTALL_MMCDEV} fat ${INSTALL_RECOVERY_FILENAME};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update recovery partition!\";
@ -98,6 +100,7 @@ setenv bootcmd "
echo \">> Installing Linux root file system\";
echo \"\";
echo \"\";
nand erase.part rootfs
update rootfs mmc ${INSTALL_MMCDEV} fat ${INSTALL_ROOTFS_FILENAME};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update rootfs partition!\";