From f46851e2450af4d7657d65bd993317c4bf7beb49 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Tue, 24 Aug 2021 10:04:02 +0200 Subject: [PATCH] uboot: ccimx6ul: add ubisysvols support to uuu install script With U-Boot supporting the creation of mtdparts and UBI volumes depending on the value of variable 'ubisysvols', adapt the install script to make use of those to generate a partition table and UBI volumes accordingly. This can be triggered with new option '-b'. Signed-off-by: Hector Palacios --- .../ccimx6ul/install_linux_fw_uuu.sh | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh index d093a4792..3c0ddcfa6 100755 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh @@ -29,6 +29,9 @@ show_usage() echo "Usage: $0 [options]" echo "" echo " Options:" + echo " -b Use one MTD 'system' partition to hold system UBI volumes (linux," + echo " recovery, rootfs, update)." + echo " Default is the opposite: one UBI volume per MTD partition." echo " -h Show this help." echo " -i Image name that prefixes the image filenames, such as 'dey-image-qt', " echo " 'dey-image-webkit', 'core-image-base'..." @@ -67,9 +70,10 @@ echo "############################################################" # Command line admits the following parameters: # -u # -i -while getopts 'hi:nu:' c +while getopts 'bhi:nu:' c do case $c in + b) UBISYSVOLS=true ;; h) show_usage ;; i) IMAGE_NAME=${OPTARG} ;; n) NOWAIT=true ;; @@ -218,6 +222,18 @@ sleep 3 # Set fastboot buffer address to $loadaddr uuu fb: ucmd setenv fastboot_buffer \${loadaddr} +# Set up ubisysvols if so requested +if [ "${UBISYSVOLS}" = true ]; then + uuu fb: ucmd setenv ubisysvols yes +fi + +# Create partition table +uuu "fb[-t 10000]:" ucmd run partition_nand_linux + +if [ "${UBISYSVOLS}" = true ]; then + uuu "fb[-t 10000]:" ucmd run ubivolscript +fi + # Update Linux part_update "linux" "${INSTALL_LINUX_FILENAME}" 15000 @@ -227,8 +243,10 @@ part_update "recovery" "${INSTALL_RECOVERY_FILENAME}" 15000 # Update Rootfs part_update "rootfs" "${INSTALL_ROOTFS_FILENAME}" 90000 -# Erase the 'Update' partition -uuu fb: ucmd nand erase.part update +if [ ! "${UBISYSVOLS}" = true ]; then + # Erase the 'Update' partition + uuu fb: ucmd nand erase.part update +fi # Configure u-boot to boot into recovery mode uuu fb: ucmd setenv boot_recovery yes