From 9ea7568d8da3d00947551e414a0c22a6a811c598 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Wed, 25 Jan 2017 10:31:06 +0100 Subject: [PATCH] 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 https://jira.digi.com/browse/DUB-718 --- .../u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt | 3 +++ .../u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt index 6e3bb1555..dd58604c7 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/install_linux_fw_sd.txt @@ -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!\"; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt index c3e652e8e..e6865bd11 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/install_linux_fw_sd.txt @@ -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!\";