From a32cea139b744c6d1d8cef3c4daa55cfbb4ccb82 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Wed, 6 Jul 2016 13:32:37 +0200 Subject: [PATCH] install_linux_fw_sd: expand variables when setting bootcmd to avoid redefining them The setting of 'bootcmd' in the script was done using single quotes, which doesn't expand variables. As a consequence the following variables must be defined again (during the execution of the second part of the script): - mmcdev - INSTALL_LINUX_FILENAME - INSTALL_ROOTFS_FILENAME This patch changes the single quotes with double quotes, so that these variables are expanded during the setting of 'bootcmd' with the values assigned at the begining of the installation script (notice these are not dynamically generated so there is no risk to expand them). At the same time we need to escape with a backslash: - double quotes containing strings - variables that we don't want to expand (like the return value $?) Signed-off-by: Hector Palacios --- .../ccimx6/install_linux_fw_sd.txt | 73 +++++++++---------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/install_linux_fw_sd.txt index a6f4e7506..4006c9927 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/install_linux_fw_sd.txt @@ -106,58 +106,55 @@ fi # - Update the 'linux' partition # - Update the 'rootfs' partition # - Reset the system and let it boot -setenv bootcmd ' +setenv bootcmd " env default -a; saveenv; - setenv mmcdev 0; - setenv INSTALL_LINUX_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6sbc.boot.vfat; - setenv INSTALL_ROOTFS_FILENAME dey-image-qt-##GRAPHICAL_BACKEND##-ccimx6sbc.ext4; - echo ""; - echo ""; - echo ">> Creating Linux partition table on the eMMC"; - echo ""; - echo ""; + echo \"\"; + echo \"\"; + echo \">> Creating Linux partition table on the eMMC\"; + echo \"\"; + echo \"\"; run partition_mmc_linux; - if test $? -eq 1; then - echo "[ERROR] Failed to create Linux partition table!"; - echo ""; - echo "Aborted."; + if test \$? -eq 1; then + echo \"[ERROR] Failed to create Linux partition table!\"; + echo \"\"; + echo \"Aborted.\"; exit; fi; - echo ""; - echo ""; - echo ">> Installing Linux kernel and device tree files"; - echo ""; - echo ""; + echo \"\"; + echo \"\"; + echo \">> Installing Linux kernel and device tree files\"; + echo \"\"; + echo \"\"; update linux mmc 1 fat ${INSTALL_LINUX_FILENAME}; - if test $? -eq 1; then - echo "[ERROR] Failed to update linux partition!"; - echo ""; - echo "Aborted."; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update linux partition!\"; + echo \"\"; + echo \"Aborted.\"; exit; fi; - echo ""; - echo ""; - echo ">> Installing Linux root file system"; - echo ""; - echo ""; + echo \"\"; + echo \"\"; + echo \">> Installing Linux root file system\"; + echo \"\"; + echo \"\"; update rootfs mmc 1 fat ${INSTALL_ROOTFS_FILENAME}; - if test $? -eq 1; then - echo "[ERROR] Failed to update rootfs partition!"; - echo ""; - echo "Aborted."; + if test \$? -eq 1; then + echo \"[ERROR] Failed to update rootfs partition!\"; + echo \"\"; + echo \"Aborted.\"; exit; fi; - echo ""; - echo "#######################"; - echo "# Install complete! #"; - echo "#######################"; - echo ""; + echo \"\"; + echo \"#######################\"; + echo \"# Install complete! #\"; + echo \"#######################\"; + echo \"\"; sleep 1; - echo ">> Restarting the system"; + echo \">> Restarting the system\"; sleep 1; reset; -' +" saveenv reset