summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2019-05-02 17:56:42 +0200
committerStefan Agner <stefan.agner@toradex.com>2019-05-06 07:09:48 +0000
commit371f39a211885c65bf001115348e674c31547f10 (patch)
tree4a8bd0d9c2504022a3ee88c7f9aaf7ef8981ba70
parent79de061440ae5fc284e81cf248edd0d06f546032 (diff)
u-boot: add inc to generate U-Boot default environment
Including u-boot-toradex-initial-env.inc will generate a uEnv.txt for newer U-Boot versions using U-Boot's u-boot-initial-env Makfile target. It essential does what u-boot-toradex-env.inc did before. Note: Since there is now support for an exported environment in upstream U-Boot, we should upstream the OE logic to the official U-Boot too. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r--recipes-bsp/u-boot/u-boot-toradex-initial-env.inc71
1 files changed, 71 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/u-boot-toradex-initial-env.inc b/recipes-bsp/u-boot/u-boot-toradex-initial-env.inc
new file mode 100644
index 0000000..2287242
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-toradex-initial-env.inc
@@ -0,0 +1,71 @@
+# This provides uEnv.txt files containing default environment using
+# U-Boot build system
+
+do_compile_append() {
+
+ if [ -n "${UBOOT_CONFIG}" ]; then
+ unset i j k
+ for config in ${UBOOT_MACHINE}; do
+ i=$(expr $i + 1);
+ for type in ${UBOOT_CONFIG}; do
+ j=$(expr $j + 1);
+ if [ $j -eq $i ]; then
+ oe_runmake -C ${S} O=${B}/${config} u-boot-initial-env
+ cp ${B}/${config}/u-boot-initial-env ${B}/${config}/uEnv-${type}.txt
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ oe_runmake -C ${S} O=${B} u-boot-initial-env
+ cp ${B}/u-boot-initial-env ${B}/uEnv.txt
+ fi
+}
+
+
+do_install_append() {
+ if [ -n "${UBOOT_CONFIG}" ]; then
+ for config in ${UBOOT_MACHINE}; do
+ i=$(expr $i + 1);
+ for type in ${UBOOT_CONFIG}; do
+ j=$(expr $j + 1);
+ if [ $j -eq $i ]; then
+ install -d ${D}/boot
+ install -m 644 ${B}/${config}/uEnv-${type}.txt ${D}/boot/uEnv-${type}-${PV}-${PR}.txt
+ ln -sf uEnv-${type}-${PV}-${PR}.txt ${D}/boot/uEnv-${type}.txt
+ ln -sf uEnv-${type}-${PV}-${PR}.txt ${D}/boot/uEnv.txt
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ install -d ${D}/boot
+ install -m 644 ${B}/uEnv.txt ${D}/boot/uEnv-${MACHINE}-${PV}-${PR}.txt
+ ln -sf uEnv-${MACHINE}-${PV}-${PR}.txt ${D}/boot/uEnv.txt
+ fi
+}
+
+do_deploy_append() {
+ if [ -n "${UBOOT_CONFIG}" ]; then
+ for config in ${UBOOT_MACHINE}; do
+ i=$(expr $i + 1);
+ for type in ${UBOOT_CONFIG}; do
+ j=$(expr $j + 1);
+ if [ $j -eq $i ]; then
+ install -d ${DEPLOYDIR}
+ install -m 644 ${B}/${config}/uEnv-${type}.txt ${DEPLOYDIR}/uEnv-${type}-${PV}-${PR}.txt
+ ln -sf uEnv-${type}-${PV}-${PR}.txt ${DEPLOYDIR}/uEnv-${type}.txt
+ ln -sf uEnv-${type}-${PV}-${PR}.txt ${DEPLOYDIR}/uEnv.txt
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ install -d ${DEPLOYDIR}
+ install -m 644 ${B}/uEnv.txt ${DEPLOYDIR}/uEnv-${MACHINE}-${PV}-${PR}.txt
+ ln -sf uEnv-${MACHINE}-${PV}-${PR}.txt ${DEPLOYDIR}/uEnv.txt
+ fi
+}