From ee29d0ffcddd0b59d78b2dcc46ef46ac58e6e075 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Tue, 19 Jan 2021 13:18:22 +0100 Subject: [PATCH] install_fw: cc6ul: erase 'update' partition unconditionally When manually changing the partition table, it could happen that a UBI volume already exists in the 'update' partition. If not erased, the system may find the old UBI volume (with wrong geometry information) and try to mount it which will result in failure. Signed-off-by: Hector Palacios --- .../u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_sd.txt | 2 ++ .../u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_usb.txt | 2 ++ .../u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_uuu.sh | 4 ++++ .../u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_sd.txt | 2 ++ .../u-boot-dey/ccimx6ulstarter/install_linux_fw_usb.txt | 2 ++ .../u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_uuu.sh | 4 ++++ 6 files changed, 16 insertions(+) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_sd.txt index dae64bf27..3ef1c09ea 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_sd.txt @@ -100,6 +100,7 @@ fi # - Update the 'linux' partition # - Update the 'recovery' partition # - Update the 'rootfs' partition +# - Erase the 'update' partition # - Configure recovery to wipe 'update' partition # - Run 'recovery' and let the system boot after setenv bootcmd " @@ -145,6 +146,7 @@ setenv bootcmd " exit; fi; echo \"\"; + nand erase.part update; setenv boot_recovery yes; setenv recovery_command wipe_update; saveenv; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_usb.txt index 9ed3f9107..f1e1b405a 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_usb.txt @@ -100,6 +100,7 @@ fi # - Update the 'linux' partition # - Update the 'recovery' partition # - Update the 'rootfs' partition +# - Erase the 'update' partition # - Configure recovery to wipe 'update' partition # - Run 'recovery' and let the system boot after setenv bootcmd " @@ -146,6 +147,7 @@ setenv bootcmd " exit; fi; echo \"\"; + nand erase.part update; setenv boot_recovery yes; setenv recovery_command wipe_update; saveenv; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_uuu.sh index 36f1f37d8..78408f70a 100755 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulsbc/install_linux_fw_uuu.sh @@ -119,6 +119,7 @@ nand_update "uboot" "${INSTALL_UBOOT_FILENAME}" 5000 # - Update the 'linux' partition # - Update the 'recovery' partition # - Update the 'rootfs' partition +# - Erase the 'update' partition uuu fb: ucmd setenv bootcmd " env default -a; saveenv; @@ -152,6 +153,9 @@ nand_update "recovery" "${INSTALL_RECOVERY_FILENAME}" 15000 # Update Rootfs nand_update "rootfs" "${INSTALL_ROOTFS_FILENAME}" 90000 +# Erase the 'Update' partition +uuu fb: ucmd nand erase.part update + # Configure u-boot to boot into recovery mode uuu fb: ucmd setenv boot_recovery yes uuu fb: ucmd setenv recovery_command wipe_update diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_sd.txt index eea78e59b..74482a704 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_sd.txt @@ -100,6 +100,7 @@ fi # - Update the 'linux' partition # - Update the 'recovery' partition # - Update the 'rootfs' partition +# - Erase the 'update' partition # - Configure recovery to wipe 'update' partition # - Run 'recovery' and let the system boot after setenv bootcmd " @@ -145,6 +146,7 @@ setenv bootcmd " exit; fi; echo \"\"; + nand erase.part update; setenv boot_recovery yes; setenv recovery_command wipe_update; saveenv; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_usb.txt index 86b2a1a2b..885440ee1 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_usb.txt @@ -100,6 +100,7 @@ fi # - Update the 'linux' partition # - Update the 'recovery' partition # - Update the 'rootfs' partition +# - Erase the 'update' partition # - Configure recovery to wipe 'update' partition # - Run 'recovery' and let the system boot after setenv bootcmd " @@ -146,6 +147,7 @@ setenv bootcmd " exit; fi; echo \"\"; + nand erase.part update; setenv boot_recovery yes; setenv recovery_command wipe_update; saveenv; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_uuu.sh index afa42cf22..89346f19c 100755 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ulstarter/install_linux_fw_uuu.sh @@ -119,6 +119,7 @@ nand_update "uboot" "${INSTALL_UBOOT_FILENAME}" 5000 # - Update the 'linux' partition # - Update the 'recovery' partition # - Update the 'rootfs' partition +# - Erase the 'update' partition uuu fb: ucmd setenv bootcmd " env default -a; saveenv; @@ -152,6 +153,9 @@ nand_update "recovery" "${INSTALL_RECOVERY_FILENAME}" 15000 # Update Rootfs nand_update "rootfs" "${INSTALL_ROOTFS_FILENAME}" 90000 +# Erase the 'Update' partition +uuu fb: ucmd nand erase.part update + # Configure u-boot to boot into recovery mode uuu fb: ucmd setenv boot_recovery yes uuu fb: ucmd setenv recovery_command wipe_update