diff --git a/install_linux_fw_uuu.sh b/install_linux_fw_uuu.sh index 41234a8d..87edb46e 100644 --- a/install_linux_fw_uuu.sh +++ b/install_linux_fw_uuu.sh @@ -21,10 +21,16 @@ # Exit on any error set -e +if [ $(uname -s) != "Linux" ]; then + UUU="./uuu.exe" +else + UUU="./uuu" +fi + # Parse uuu cmd output getenv() { - uuu -v fb: ucmd printenv "${1}" | sed -ne "s,^${1}=,,g;T;p" + $UUU -v fb: ucmd printenv "${1}" | sed -ne "s,^${1}=,,g;T;p" } # Grep for string in command output @@ -33,7 +39,7 @@ getenv() # 2. String to grep grep_string() { - uuu -v fb: ucmd ${1} | grep "${2}" + $UUU -v fb: ucmd ${1} | grep "${2}" } show_usage() @@ -47,7 +53,7 @@ show_usage() 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'..." - echo " Defaults to '##DEFAULT_IMAGE_NAME##' if not provided." + echo " Defaults to 'dey-image-qt' if not provided." echo " -k Update includes dek file." echo " (implies -t)." echo " -n No wait. Skips 10 seconds delay to stop script." @@ -71,25 +77,25 @@ part_update() if [ "${1}" = "bootloader" ]; then if [ "${ENCRYPTED}" = "true" ]; then - uuu fb: download -f "${2}" + $UUU fb: download -f "${2}" if [ -n "${DEK_FILE}" ]; then # Encrypted bootloader + dek - uuu fb: ucmd setenv uboot_size \${filesize} - uuu fb: ucmd setenv fastboot_buffer \${initrd_addr} - uuu fb: download -f "${3}" - uuu fb: ucmd setenv dek_size \${filesize} - uuu fb: ucmd trustfence update ram \${loadaddr} \${uboot_size} \${initrd_addr} \${dek_size} + $UUU fb: ucmd setenv uboot_size \${filesize} + $UUU fb: ucmd setenv fastboot_buffer \${initrd_addr} + $UUU fb: download -f "${3}" + $UUU fb: ucmd setenv dek_size \${filesize} + $UUU fb: ucmd trustfence update ram \${loadaddr} \${uboot_size} \${initrd_addr} \${dek_size} else # Encrypted bootloader (re-use existing dek) - uuu fb: ucmd trustfence update ram \${fastboot_buffer} \${fastboot_bytes} + $UUU fb: ucmd trustfence update ram \${fastboot_buffer} \${fastboot_bytes} fi else # Non-encrypted bootloader (can be signed or not) - uuu fb: flash "${1}" "${2}" + $UUU fb: flash "${1}" "${2}" fi else # Non-bootloader image - uuu fb: flash -raw2sparse "${1}" "${2}" + $UUU fb: flash -raw2sparse "${1}" "${2}" fi } @@ -124,7 +130,7 @@ do done # Enable the redirect support to get u-boot variables values -uuu fb: ucmd setenv stdout serial,fastboot +$UUU fb: ucmd setenv stdout serial,fastboot # Check if dualboot variable is active dualboot=$(getenv "dualboot") @@ -137,7 +143,7 @@ echo "Determining image files to use..." # Determine U-Boot file to program basing on SOM's SOC type (linked to bus width) if [ -z "${INSTALL_UBOOT_FILENAME}" ]; then - INSTALL_UBOOT_FILENAME="imx-boot-##SIGNED##-##MACHINE##.bin" + INSTALL_UBOOT_FILENAME="imx-boot-ccimx8mm-dvk.bin" fi # Determine if bootloader is signed and/or encrypted @@ -170,24 +176,24 @@ if [ "${ENCRYPTED}" = "true" ]; then fi # remove redirect -uuu fb: ucmd setenv stdout serial +$UUU fb: ucmd setenv stdout serial # Determine linux, recovery, and rootfs image filenames to update if [ -z "${IMAGE_NAME}" ]; then - IMAGE_NAME="##DEFAULT_IMAGE_NAME##" + IMAGE_NAME="dey-image-qt" fi -GRAPHICAL_IMAGES="##GRAPHICAL_IMAGES##" +GRAPHICAL_IMAGES="dey-image-qt dey-image-webkit dey-image-lvgl dey-image-chromium" for g in ${GRAPHICAL_IMAGES}; do if [ "${IMAGE_NAME}" = "${g}" ]; then - BASEFILENAME="${IMAGE_NAME}-##GRAPHICAL_BACKEND##" + BASEFILENAME="${IMAGE_NAME}-fb" fi done if [ -z "${BASEFILENAME}" ]; then BASEFILENAME="${IMAGE_NAME}" fi -INSTALL_LINUX_FILENAME="${BASEFILENAME}-##MACHINE##.boot.vfat" -INSTALL_RECOVERY_FILENAME="${BASEFILENAME}-##MACHINE##.recovery.vfat" -INSTALL_ROOTFS_FILENAME="${BASEFILENAME}-##MACHINE##.ext4" +INSTALL_LINUX_FILENAME="${BASEFILENAME}-ccimx8mm-dvk.boot.vfat" +INSTALL_RECOVERY_FILENAME="${BASEFILENAME}-ccimx8mm-dvk.recovery.vfat" +INSTALL_ROOTFS_FILENAME="${BASEFILENAME}-ccimx8mm-dvk.ext4" COMPRESSED_ROOTFS_IMAGE="${INSTALL_ROOTFS_FILENAME}.gz" @@ -216,7 +222,7 @@ done; # Verify what kind of rootfs is going to be programmed if [ ! -f ${INSTALL_ROOTFS_FILENAME} ]; then echo "\033[31m[ERROR] Could not find file '${INSTALL_ROOTFS_FILENAME}'\033[0m" - INSTALL_ROOTFS_FILENAME="${BASEFILENAME}-##MACHINE##.squashfs" + INSTALL_ROOTFS_FILENAME="${BASEFILENAME}-ccimx8mm-dvk.squashfs" echo "\033[32m[INFO] Trying with file '${INSTALL_ROOTFS_FILENAME}'\033[0m" if [ ! -f "${INSTALL_ROOTFS_FILENAME}" ]; then echo "\033[31m[ERROR] Could not find file '${INSTALL_ROOTFS_FILENAME}'\033[0m" @@ -275,16 +281,16 @@ if [ "${NOWAIT}" != true ]; then fi # Set fastboot buffer address to $loadaddr, just in case -uuu fb: ucmd setenv fastboot_buffer \${loadaddr} +$UUU fb: ucmd setenv fastboot_buffer \${loadaddr} # Skip user confirmation for U-Boot update -uuu fb: ucmd setenv forced_update 1 +$UUU fb: ucmd setenv forced_update 1 # Update U-Boot part_update "bootloader" "${INSTALL_UBOOT_FILENAME}" "${DEK_FILE}" # Set MMC to boot from BOOT1 partition -uuu fb: ucmd mmc partconf 0 1 1 1 +$UUU fb: ucmd mmc partconf 0 1 1 1 # Set 'bootcmd' for the second part of the script that will # - Reset environment to defaults @@ -295,7 +301,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 # - Update the 'linux' partition # - Update the 'recovery' partition # - Update the 'rootfs' partition -uuu fb: ucmd setenv bootcmd " +$UUU fb: ucmd setenv bootcmd " env default -a; setenv dualboot \${dualboot}; bootcount reset; @@ -322,18 +328,18 @@ uuu fb: ucmd setenv bootcmd " fastboot 0; " -uuu fb: ucmd saveenv -uuu fb: acmd reset +$UUU fb: ucmd saveenv +$UUU fb: acmd reset # Wait for the target to reset sleep 3 # Restart fastboot with the latest MMC partition configuration -uuu fb: ucmd setenv fastboot_dev sata -uuu fb: ucmd setenv fastboot_dev mmc +$UUU fb: ucmd setenv fastboot_dev sata +$UUU fb: ucmd setenv fastboot_dev mmc # Set fastboot buffer address to $loadaddr, just in case -uuu fb: ucmd setenv fastboot_buffer \${loadaddr} +$UUU fb: ucmd setenv fastboot_buffer \${loadaddr} if [ "${DUALBOOT}" = true ]; then # Update Linux A @@ -364,15 +370,21 @@ fi if [ "${DUALBOOT}" != true ]; then # Configure u-boot to boot into recovery mode - uuu fb: ucmd setenv boot_recovery yes - uuu fb: ucmd setenv recovery_command wipe_update + $UUU fb: ucmd setenv boot_recovery yes + $UUU fb: ucmd setenv recovery_command wipe_update fi -uuu fb: ucmd saveenv + +# Enable the touchscreen support +$UUU fb: ucmd setenv fdt_file ccimx8mm-leahi.dtb +$UUU fb: ucmd setenv overlays + +# Save the U-Boot environment variables +$UUU fb: ucmd saveenv # Reset the bootcount -uuu fb: ucmd bootcount reset +$UUU fb: ucmd bootcount reset # Reset the target -uuu fb: acmd reset +$UUU fb: acmd reset echo "\033[32m" echo "============================================================="