summaryrefslogtreecommitdiff
path: root/recipes-bsp/u-boot/u-boot-toradex-initial-env.inc
blob: 2287242f3adce74e7f9fbfb48f1a81b865162e68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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
}