diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/recovery.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/recovery.txt new file mode 100644 index 000000000..7df232111 --- /dev/null +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6/recovery.txt @@ -0,0 +1,49 @@ +# +# U-Boot bootscript for EMMC/SD images created by Yocto. +# + +# +# Set device tree filename depending on the board ID (if defined) +# +if test -n "${board_id}"; then + setenv fdt_file uImage-${soc_family}-ccimx6sbc-id${board_id}.dtb +else + # + # Set device tree filename depending on the hardware variant + # + if test "${module_variant}" = "0x02"; then + setenv fdt_file uImage-imx6q-ccimx6sbc-wb.dtb + elif test "${module_variant}" = "0x03"; then + setenv fdt_file uImage-imx6q-ccimx6sbc-wb.dtb + elif test "${module_variant}" = "0x04"; then + setenv fdt_file uImage-imx6q-ccimx6sbc-wb.dtb + elif test "${module_variant}" = "0x05"; then + setenv fdt_file uImage-imx6q-ccimx6sbc-w.dtb + elif test "${module_variant}" = "0x06"; then + setenv fdt_file uImage-imx6q-ccimx6sbc-wb.dtb + elif test "${module_variant}" = "0x08"; then + setenv fdt_file uImage-imx6q-ccimx6sbc.dtb + elif test "${module_variant}" = "0x0a"; then + setenv fdt_file uImage-imx6dl-ccimx6sbc-w.dtb + elif test "${module_variant}" = "0x0b"; then + setenv fdt_file uImage-imx6dl-ccimx6sbc-wb.dtb + elif test "${module_variant}" = "0x0c"; then + setenv fdt_file uImage-imx6dl-ccimx6sbc.dtb + elif test "${module_variant}" = "0x0e"; then + setenv fdt_file uImage-imx6q-ccimx6sbc.dtb + elif test "${module_variant}" = "0x0f"; then + setenv fdt_file uImage-imx6q-ccimx6sbc.dtb + elif test "${module_variant}" = "0x11"; then + setenv fdt_file uImage-imx6q-ccimx6sbc-wb.dtb + elif test "${module_variant}" = "0x12"; then + setenv fdt_file uImage-imx6q-ccimx6sbc-wb.dtb + elif test "${module_variant}" = "0x13"; then + setenv fdt_file uImage-imx6dl-ccimx6sbc-wb.dtb + else + echo "------ Using default fdt_file" + fi +fi + +setenv boot_initrd true +setenv initrd_file uramdisk-recovery.img +dboot linux mmc ${mmcbootdev}:${mmcpart} diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/recovery.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/recovery.txt new file mode 100644 index 000000000..877abe457 --- /dev/null +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulsbc/recovery.txt @@ -0,0 +1,25 @@ +# +# U-Boot bootscript for NAND images created by Yocto. +# + +# +# Set device tree filename depending on the board ID (if defined) +# +if test -n "${board_id}"; then + setenv fdt_file zImage-imx6ul-ccimx6ulsbc-id${board_id}.dtb +else + # + # Set device tree filename depending on the hardware variant + # + if test "${module_variant}" = "0x02"; then + setenv fdt_file zImage-imx6ul-ccimx6ulsbc-wb.dtb + elif test "${module_variant}" = "0x03"; then + setenv fdt_file zImage-imx6ul-ccimx6ulsbc.dtb + else + echo "------ Using default fdt_file: $fdt_file" + fi +fi + +setenv boot_initrd true +setenv initrd_file uramdisk-recovery.img +dboot linux nand ${mtdbootpart} diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/recovery.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/recovery.txt new file mode 100644 index 000000000..2c75edf7a --- /dev/null +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-2015.04/ccimx6ulstarter/recovery.txt @@ -0,0 +1,25 @@ +# +# U-Boot bootscript for NAND images created by Yocto. +# + +# +# Set device tree filename depending on the board ID (if defined) +# +if test -n "${board_id}"; then + setenv fdt_file zImage-imx6ul-ccimx6ulstarter-id${board_id}.dtb +else + # + # Set device tree filename depending on the hardware variant + # + if test "${module_variant}" = "0x02"; then + setenv fdt_file zImage-imx6ul-ccimx6ulstarter-wb.dtb + elif test "${module_variant}" = "0x03"; then + setenv fdt_file zImage-imx6ul-ccimx6ulstarter.dtb + else + echo "------ Using default fdt_file: $fdt_file" + fi +fi + +setenv boot_initrd true +setenv initrd_file uramdisk-recovery.img +dboot linux nand ${mtdbootpart} diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2015.04.bb b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2015.04.bb index 59596c3c1..e54eac91c 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2015.04.bb +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2015.04.bb @@ -24,6 +24,7 @@ SRC_URI = " \ SRC_URI_append = " \ file://boot.txt \ file://install_linux_fw_sd.txt \ + file://recovery.txt \ " LOCALVERSION ?= "" @@ -150,12 +151,24 @@ do_deploy_append() { TMP_BOOTSCR="$(mktemp ${WORKDIR}/bootscr.XXXXXX)" sed -e "${TF_BOOTSCRIPT_SEDFILTER}" ${WORKDIR}/boot.txt > ${TMP_BOOTSCR} mkimage -T script -n bootscript -C none -d ${TMP_BOOTSCR} ${DEPLOYDIR}/boot.scr + + # Recovery boot script for DEY images + mkimage -T script -n bootscript -C none -d ${WORKDIR}/recovery.txt ${DEPLOYDIR}/recovery.scr + + # Sign the scripts if [ "${TRUSTFENCE_SIGN}" = "1" ]; then export CONFIG_SIGN_KEYS_PATH="${TRUSTFENCE_SIGN_KEYS_PATH}" [ -n "${TRUSTFENCE_KEY_INDEX}" ] && export CONFIG_KEY_INDEX="${TRUSTFENCE_KEY_INDEX}" [ -n "${TRUSTFENCE_DEK_PATH}" ] && [ "${TRUSTFENCE_DEK_PATH}" != "0" ] && export CONFIG_DEK_PATH="${TRUSTFENCE_DEK_PATH}" - "${STAGING_BINDIR_NATIVE}/trustfence-sign-kernel.sh" -p "${DIGI_FAMILY}" -b "${DEPLOYDIR}/boot.scr" "${DEPLOYDIR}/boot-signed.scr" - mv ${DEPLOYDIR}/boot-signed.scr ${DEPLOYDIR}/boot.scr + + # Sign boot script + TMP_SIGNED_BOOTSCR="$(mktemp ${WORKDIR}/bootscr-signed.XXXXXX)" + trustfence-sign-kernel.sh -p "${DIGI_FAMILY}" -b "${DEPLOYDIR}/boot.scr" "${TMP_SIGNED_BOOTSCR}" + mv "${TMP_SIGNED_BOOTSCR}" "${DEPLOYDIR}/boot.scr" + + # Sign recovery script + trustfence-sign-kernel.sh -p "${DIGI_FAMILY}" -b "${DEPLOYDIR}/recovery.scr" "${TMP_SIGNED_BOOTSCR}" + mv "${TMP_SIGNED_BOOTSCR}" "${DEPLOYDIR}/recovery.scr" fi rm -f ${TMP_BOOTSCR} }