diff options
author | Ryan Eatmon <reatmon@ti.com> | 2024-08-07 09:44:55 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-08-09 22:33:38 +0100 |
commit | 469c371e5509399ae0abd991981935be44ec8f39 (patch) | |
tree | d3d21af1ce6058db6cbac9fdc4c139d5ed44fc99 /meta | |
parent | ea471cf48c80cee728d97c57292c90d2dda4ac6d (diff) | |
download | poky-469c371e5509399ae0abd991981935be44ec8f39.tar.gz |
u-boot.inc: Refactor do_* steps into functions that can be overridden
The looping logic for handling (and not handling) UBOOT_CONFIG has led
to the various do_* functions to be large and unwieldy. In order to
modify one of the functional blocks inside of a loop (or in the else
condition) means you either have to replace the function entirely, or
append the function and undo something it did and then do what you need
for your change.
This refactor breaks out all of the inner loops and else clauses into
new functions that themselves can be overridden without needing to
worry about the bulk of the looping logic.
It should not break any existing recipes doing prepends, appends, or
overrides. None of the functional blocks were changed, just refactored
out into new functions.
(From OE-Core rev: 937bcc229502fcc154cc676b4fcc93c561873def)
Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-bsp/u-boot/u-boot-configure.inc | 36 | ||||
-rw-r--r-- | meta/recipes-bsp/u-boot/u-boot.inc | 281 |
2 files changed, 208 insertions, 109 deletions
diff --git a/meta/recipes-bsp/u-boot/u-boot-configure.inc b/meta/recipes-bsp/u-boot/u-boot-configure.inc index 378d675364..a15511f8b2 100644 --- a/meta/recipes-bsp/u-boot/u-boot-configure.inc +++ b/meta/recipes-bsp/u-boot/u-boot-configure.inc | |||
@@ -18,23 +18,35 @@ do_configure () { | |||
18 | for type in ${UBOOT_CONFIG}; do | 18 | for type in ${UBOOT_CONFIG}; do |
19 | j=$(expr $j + 1); | 19 | j=$(expr $j + 1); |
20 | if [ $j -eq $i ]; then | 20 | if [ $j -eq $i ]; then |
21 | oe_runmake -C ${S} O=${B}/${config} ${config} | 21 | uboot_configure_config $config $type |
22 | if [ -n "${@' '.join(find_cfgs(d))}" ]; then | ||
23 | merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))} | ||
24 | oe_runmake -C ${S} O=${B}/${config} oldconfig | ||
25 | fi | ||
26 | fi | 22 | fi |
27 | done | 23 | done |
28 | unset j | 24 | unset j |
29 | done | 25 | done |
30 | unset i | 26 | unset i |
31 | else | 27 | else |
32 | if [ -n "${UBOOT_MACHINE}" ]; then | 28 | uboot_configure |
33 | oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} | ||
34 | else | ||
35 | oe_runmake -C ${S} O=${B} oldconfig | ||
36 | fi | ||
37 | merge_config.sh -m .config ${@" ".join(find_cfgs(d))} | ||
38 | cml1_do_configure | ||
39 | fi | 29 | fi |
40 | } | 30 | } |
31 | |||
32 | uboot_configure_config () { | ||
33 | config=$1 | ||
34 | type=$2 | ||
35 | |||
36 | oe_runmake -C ${S} O=${B}/${config} ${config} | ||
37 | if [ -n "${@' '.join(find_cfgs(d))}" ]; then | ||
38 | merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))} | ||
39 | oe_runmake -C ${S} O=${B}/${config} oldconfig | ||
40 | fi | ||
41 | } | ||
42 | |||
43 | uboot_configure () { | ||
44 | if [ -n "${UBOOT_MACHINE}" ]; then | ||
45 | oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} | ||
46 | else | ||
47 | oe_runmake -C ${S} O=${B} oldconfig | ||
48 | fi | ||
49 | merge_config.sh -m .config ${@" ".join(find_cfgs(d))} | ||
50 | cml1_do_configure | ||
51 | } | ||
52 | |||
diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc index fc36c21ec2..5a7bd6703f 100644 --- a/meta/recipes-bsp/u-boot/u-boot.inc +++ b/meta/recipes-bsp/u-boot/u-boot.inc | |||
@@ -54,40 +54,21 @@ do_compile () { | |||
54 | 54 | ||
55 | if [ -n "${UBOOT_CONFIG}" -o -n "${UBOOT_DELTA_CONFIG}" ] | 55 | if [ -n "${UBOOT_CONFIG}" -o -n "${UBOOT_DELTA_CONFIG}" ] |
56 | then | 56 | then |
57 | unset i j k | 57 | unset i j |
58 | for config in ${UBOOT_MACHINE}; do | 58 | for config in ${UBOOT_MACHINE}; do |
59 | i=$(expr $i + 1); | 59 | i=$(expr $i + 1); |
60 | for type in ${UBOOT_CONFIG}; do | 60 | for type in ${UBOOT_CONFIG}; do |
61 | j=$(expr $j + 1); | 61 | j=$(expr $j + 1); |
62 | if [ $j -eq $i ] | 62 | if [ $j -eq $i ] |
63 | then | 63 | then |
64 | oe_runmake -C ${S} O=${B}/${config} ${UBOOT_MAKE_TARGET} | 64 | uboot_compile_config $i $config $type |
65 | for binary in ${UBOOT_BINARIES}; do | ||
66 | k=$(expr $k + 1); | ||
67 | if [ $k -eq $i ]; then | ||
68 | cp ${B}/${config}/${binary} ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} | ||
69 | fi | ||
70 | done | ||
71 | |||
72 | # Generate the uboot-initial-env | ||
73 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then | ||
74 | oe_runmake -C ${S} O=${B}/${config} u-boot-initial-env | ||
75 | cp ${B}/${config}/u-boot-initial-env ${B}/${config}/u-boot-initial-env-${type} | ||
76 | fi | ||
77 | |||
78 | unset k | ||
79 | fi | 65 | fi |
80 | done | 66 | done |
81 | unset j | 67 | unset j |
82 | done | 68 | done |
83 | unset i | 69 | unset i |
84 | else | 70 | else |
85 | oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET} | 71 | uboot_compile |
86 | |||
87 | # Generate the uboot-initial-env | ||
88 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then | ||
89 | oe_runmake -C ${S} O=${B} u-boot-initial-env | ||
90 | fi | ||
91 | fi | 72 | fi |
92 | 73 | ||
93 | if [ -n "${UBOOT_ENV}" ] && [ "${UBOOT_ENV_SUFFIX}" = "scr" ] | 74 | if [ -n "${UBOOT_ENV}" ] && [ "${UBOOT_ENV_SUFFIX}" = "scr" ] |
@@ -96,6 +77,46 @@ do_compile () { | |||
96 | fi | 77 | fi |
97 | } | 78 | } |
98 | 79 | ||
80 | uboot_compile_config () { | ||
81 | i=$1 | ||
82 | config=$2 | ||
83 | type=$3 | ||
84 | |||
85 | oe_runmake -C ${S} O=${B}/${config} ${UBOOT_MAKE_TARGET} | ||
86 | |||
87 | unset k | ||
88 | for binary in ${UBOOT_BINARIES}; do | ||
89 | k=$(expr $k + 1); | ||
90 | if [ $k -eq $i ]; then | ||
91 | uboot_compile_config_copy_binary $config $type $binary | ||
92 | fi | ||
93 | done | ||
94 | unset k | ||
95 | |||
96 | # Generate the uboot-initial-env | ||
97 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then | ||
98 | oe_runmake -C ${S} O=${B}/${config} u-boot-initial-env | ||
99 | cp ${B}/${config}/u-boot-initial-env ${B}/${config}/u-boot-initial-env-${type} | ||
100 | fi | ||
101 | } | ||
102 | |||
103 | uboot_compile_config_copy_binary () { | ||
104 | config=$1 | ||
105 | type=$2 | ||
106 | binary=$3 | ||
107 | |||
108 | cp ${B}/${config}/${binary} ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} | ||
109 | } | ||
110 | |||
111 | uboot_compile () { | ||
112 | oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET} | ||
113 | |||
114 | # Generate the uboot-initial-env | ||
115 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then | ||
116 | oe_runmake -C ${S} O=${B} u-boot-initial-env | ||
117 | fi | ||
118 | } | ||
119 | |||
99 | do_install () { | 120 | do_install () { |
100 | if [ -n "${UBOOT_CONFIG}" ] | 121 | if [ -n "${UBOOT_CONFIG}" ] |
101 | then | 122 | then |
@@ -105,32 +126,14 @@ do_install () { | |||
105 | j=$(expr $j + 1); | 126 | j=$(expr $j + 1); |
106 | if [ $j -eq $i ] | 127 | if [ $j -eq $i ] |
107 | then | 128 | then |
108 | install -D -m 644 ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} | 129 | uboot_install_config $config $type |
109 | ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type} | ||
110 | ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY} | ||
111 | |||
112 | # Install the uboot-initial-env | ||
113 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then | ||
114 | install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} | ||
115 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type} | ||
116 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${type} | ||
117 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV} | ||
118 | fi | ||
119 | fi | 130 | fi |
120 | done | 131 | done |
121 | unset j | 132 | unset j |
122 | done | 133 | done |
123 | unset i | 134 | unset i |
124 | else | 135 | else |
125 | install -D -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE} | 136 | uboot_install |
126 | ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY} | ||
127 | |||
128 | # Install the uboot-initial-env | ||
129 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then | ||
130 | install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} | ||
131 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE} | ||
132 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV} | ||
133 | fi | ||
134 | fi | 137 | fi |
135 | 138 | ||
136 | if [ -n "${UBOOT_ELF}" ] | 139 | if [ -n "${UBOOT_ELF}" ] |
@@ -143,17 +146,14 @@ do_install () { | |||
143 | j=$(expr $j + 1); | 146 | j=$(expr $j + 1); |
144 | if [ $j -eq $i ] | 147 | if [ $j -eq $i ] |
145 | then | 148 | then |
146 | install -m 644 ${B}/${config}/${UBOOT_ELF} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} | 149 | uboot_install_elf_config $config $type |
147 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type} | ||
148 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY} | ||
149 | fi | 150 | fi |
150 | done | 151 | done |
151 | unset j | 152 | unset j |
152 | done | 153 | done |
153 | unset i | 154 | unset i |
154 | else | 155 | else |
155 | install -m 644 ${B}/${UBOOT_ELF} ${D}/boot/${UBOOT_ELF_IMAGE} | 156 | uboot_install_elf |
156 | ln -sf ${UBOOT_ELF_IMAGE} ${D}/boot/${UBOOT_ELF_BINARY} | ||
157 | fi | 157 | fi |
158 | fi | 158 | fi |
159 | 159 | ||
@@ -172,17 +172,14 @@ do_install () { | |||
172 | j=$(expr $j + 1); | 172 | j=$(expr $j + 1); |
173 | if [ $j -eq $i ] | 173 | if [ $j -eq $i ] |
174 | then | 174 | then |
175 | install -m 644 ${B}/${config}/${SPL_BINARY} ${D}/boot/${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} | 175 | uboot_install_spl_config $config $type |
176 | ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE}-${type} | ||
177 | ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE} | ||
178 | fi | 176 | fi |
179 | done | 177 | done |
180 | unset j | 178 | unset j |
181 | done | 179 | done |
182 | unset i | 180 | unset i |
183 | else | 181 | else |
184 | install -m 644 ${B}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE} | 182 | uboot_install_spl |
185 | ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARYFILE} | ||
186 | fi | 183 | fi |
187 | fi | 184 | fi |
188 | 185 | ||
@@ -198,6 +195,63 @@ do_install () { | |||
198 | fi | 195 | fi |
199 | } | 196 | } |
200 | 197 | ||
198 | uboot_install_config () { | ||
199 | config=$1 | ||
200 | type=$2 | ||
201 | |||
202 | install -D -m 644 ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} | ||
203 | ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type} | ||
204 | ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY} | ||
205 | |||
206 | # Install the uboot-initial-env | ||
207 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then | ||
208 | install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} | ||
209 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type} | ||
210 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${type} | ||
211 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV} | ||
212 | fi | ||
213 | } | ||
214 | |||
215 | uboot_install () { | ||
216 | install -D -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE} | ||
217 | ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY} | ||
218 | |||
219 | # Install the uboot-initial-env | ||
220 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then | ||
221 | install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} | ||
222 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE} | ||
223 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV} | ||
224 | fi | ||
225 | } | ||
226 | |||
227 | uboot_install_elf_config () { | ||
228 | config=$1 | ||
229 | type=$2 | ||
230 | |||
231 | install -m 644 ${B}/${config}/${UBOOT_ELF} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} | ||
232 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type} | ||
233 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY} | ||
234 | } | ||
235 | |||
236 | uboot_install_elf () { | ||
237 | install -m 644 ${B}/${UBOOT_ELF} ${D}/boot/${UBOOT_ELF_IMAGE} | ||
238 | ln -sf ${UBOOT_ELF_IMAGE} ${D}/boot/${UBOOT_ELF_BINARY} | ||
239 | } | ||
240 | |||
241 | uboot_install_spl_config () { | ||
242 | config=$1 | ||
243 | type=$2 | ||
244 | |||
245 | install -m 644 ${B}/${config}/${SPL_BINARY} ${D}/boot/${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} | ||
246 | ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE}-${type} | ||
247 | ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE} | ||
248 | } | ||
249 | |||
250 | uboot_install_spl () { | ||
251 | install -m 644 ${B}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE} | ||
252 | ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARYFILE} | ||
253 | } | ||
254 | |||
201 | PACKAGE_BEFORE_PN += "${PN}-env ${PN}-extlinux" | 255 | PACKAGE_BEFORE_PN += "${PN}-env ${PN}-extlinux" |
202 | 256 | ||
203 | RPROVIDES:${PN}-env += "u-boot-default-env" | 257 | RPROVIDES:${PN}-env += "u-boot-default-env" |
@@ -224,40 +278,14 @@ do_deploy () { | |||
224 | j=$(expr $j + 1); | 278 | j=$(expr $j + 1); |
225 | if [ $j -eq $i ] | 279 | if [ $j -eq $i ] |
226 | then | 280 | then |
227 | install -D -m 644 ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} | 281 | uboot_deploy_config $config $type |
228 | cd ${DEPLOYDIR} | ||
229 | ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type} | ||
230 | ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK} | ||
231 | ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type} | ||
232 | ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY} | ||
233 | |||
234 | # Deploy the uboot-initial-env | ||
235 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then | ||
236 | install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} | ||
237 | cd ${DEPLOYDIR} | ||
238 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE}-${type} | ||
239 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${type} | ||
240 | fi | ||
241 | fi | 282 | fi |
242 | done | 283 | done |
243 | unset j | 284 | unset j |
244 | done | 285 | done |
245 | unset i | 286 | unset i |
246 | else | 287 | else |
247 | install -D -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE} | 288 | uboot_deploy |
248 | |||
249 | cd ${DEPLOYDIR} | ||
250 | rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK} | ||
251 | ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK} | ||
252 | ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY} | ||
253 | |||
254 | # Deploy the uboot-initial-env | ||
255 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then | ||
256 | install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} | ||
257 | cd ${DEPLOYDIR} | ||
258 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE} | ||
259 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV} | ||
260 | fi | ||
261 | fi | 289 | fi |
262 | 290 | ||
263 | if [ -e ${UNPACKDIR}/fw_env.config ] ; then | 291 | if [ -e ${UNPACKDIR}/fw_env.config ] ; then |
@@ -277,20 +305,14 @@ do_deploy () { | |||
277 | j=$(expr $j + 1); | 305 | j=$(expr $j + 1); |
278 | if [ $j -eq $i ] | 306 | if [ $j -eq $i ] |
279 | then | 307 | then |
280 | install -m 644 ${B}/${config}/${UBOOT_ELF} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} | 308 | uboot_deploy_elf_config $config $type |
281 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}-${type} | ||
282 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY} | ||
283 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}-${type} | ||
284 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK} | ||
285 | fi | 309 | fi |
286 | done | 310 | done |
287 | unset j | 311 | unset j |
288 | done | 312 | done |
289 | unset i | 313 | unset i |
290 | else | 314 | else |
291 | install -m 644 ${B}/${UBOOT_ELF} ${DEPLOYDIR}/${UBOOT_ELF_IMAGE} | 315 | uboot_deploy_elf |
292 | ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_BINARY} | ||
293 | ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK} | ||
294 | fi | 316 | fi |
295 | fi | 317 | fi |
296 | 318 | ||
@@ -305,21 +327,14 @@ do_deploy () { | |||
305 | j=$(expr $j + 1); | 327 | j=$(expr $j + 1); |
306 | if [ $j -eq $i ] | 328 | if [ $j -eq $i ] |
307 | then | 329 | then |
308 | install -m 644 ${B}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} | 330 | uboot_deploy_spl_config $config $type |
309 | rm -f ${DEPLOYDIR}/${SPL_BINARYFILE} ${DEPLOYDIR}/${SPL_SYMLINK} | ||
310 | ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE}-${type} | ||
311 | ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE} | ||
312 | ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_SYMLINK}-${type} | ||
313 | ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_SYMLINK} | ||
314 | fi | 331 | fi |
315 | done | 332 | done |
316 | unset j | 333 | unset j |
317 | done | 334 | done |
318 | unset i | 335 | unset i |
319 | else | 336 | else |
320 | install -m 644 ${B}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE} | 337 | uboot_deploy_spl |
321 | ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARYNAME} | ||
322 | ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK} | ||
323 | fi | 338 | fi |
324 | fi | 339 | fi |
325 | 340 | ||
@@ -343,4 +358,76 @@ do_deploy () { | |||
343 | fi | 358 | fi |
344 | } | 359 | } |
345 | 360 | ||
361 | uboot_deploy_config () { | ||
362 | config=$1 | ||
363 | type=$2 | ||
364 | |||
365 | install -D -m 644 ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} | ||
366 | cd ${DEPLOYDIR} | ||
367 | ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type} | ||
368 | ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK} | ||
369 | ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type} | ||
370 | ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY} | ||
371 | |||
372 | # Deploy the uboot-initial-env | ||
373 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then | ||
374 | install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} | ||
375 | cd ${DEPLOYDIR} | ||
376 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE}-${type} | ||
377 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${type} | ||
378 | fi | ||
379 | } | ||
380 | |||
381 | uboot_deploy () { | ||
382 | install -D -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE} | ||
383 | |||
384 | cd ${DEPLOYDIR} | ||
385 | rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK} | ||
386 | ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK} | ||
387 | ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY} | ||
388 | |||
389 | # Deploy the uboot-initial-env | ||
390 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then | ||
391 | install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} | ||
392 | cd ${DEPLOYDIR} | ||
393 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE} | ||
394 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV} | ||
395 | fi | ||
396 | } | ||
397 | |||
398 | uboot_deploy_elf_config () { | ||
399 | config=$1 | ||
400 | type=$2 | ||
401 | |||
402 | install -m 644 ${B}/${config}/${UBOOT_ELF} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} | ||
403 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}-${type} | ||
404 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY} | ||
405 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}-${type} | ||
406 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK} | ||
407 | } | ||
408 | |||
409 | uboot_deploy_elf () { | ||
410 | install -m 644 ${B}/${UBOOT_ELF} ${DEPLOYDIR}/${UBOOT_ELF_IMAGE} | ||
411 | ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_BINARY} | ||
412 | ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK} | ||
413 | } | ||
414 | |||
415 | uboot_deploy_spl_config () { | ||
416 | config=$1 | ||
417 | type=$2 | ||
418 | |||
419 | install -m 644 ${B}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} | ||
420 | rm -f ${DEPLOYDIR}/${SPL_BINARYFILE} ${DEPLOYDIR}/${SPL_SYMLINK} | ||
421 | ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE}-${type} | ||
422 | ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE} | ||
423 | ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_SYMLINK}-${type} | ||
424 | ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_SYMLINK} | ||
425 | } | ||
426 | |||
427 | uboot_deploy_spl () { | ||
428 | install -m 644 ${B}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE} | ||
429 | ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARYNAME} | ||
430 | ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK} | ||
431 | } | ||
432 | |||
346 | addtask deploy before do_build after do_compile | 433 | addtask deploy before do_build after do_compile |