summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp
diff options
context:
space:
mode:
authorOtavio Salvador <otavio.salvador@gmail.com>2020-04-01 21:14:31 -0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-04-02 15:24:59 +0100
commit4882a93566f2ef24787777d33950f12a9cc5db4e (patch)
tree046482aa2b17a7a2c8c363b1d365f0cbdb91eee9 /meta/recipes-bsp
parent40f37ab2312ada1f4d6e44d270f71d2e4e0ec637 (diff)
downloadpoky-4882a93566f2ef24787777d33950f12a9cc5db4e.tar.gz
u-boot: Restore valid default environment for running system
One significant change from previous OE-Core releases was the move from u-boot-fw-utils to libubootenv which offers a generic and not machine specific alternative. However, it is not fully functional as currently we don't provide the default environment nor the required configuration file to be used by it. This change address this and include on the default u-boot.inc the needed code to generate, install and deploy the default environment. (From OE-Core rev: 69b3b093079c2ca2744d6c02747c5d1b5d3e7ecf) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp')
-rw-r--r--meta/recipes-bsp/u-boot/u-boot.inc62
1 files changed, 53 insertions, 9 deletions
diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index 648298da0b..188e5295cf 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -122,6 +122,11 @@ do_compile () {
122 cp ${B}/${config}/${binary} ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} 122 cp ${B}/${config}/${binary} ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
123 fi 123 fi
124 done 124 done
125
126 # Generate the uboot-initial-env
127 oe_runmake -C ${S} O=${B}/${config} u-boot-initial-env
128 cp ${B}/${config}/u-boot-initial-env ${B}/${config}/u-boot-initial-env-${type}
129
125 unset k 130 unset k
126 fi 131 fi
127 done 132 done
@@ -130,6 +135,9 @@ do_compile () {
130 unset i 135 unset i
131 else 136 else
132 oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET} 137 oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET}
138
139 # Generate the uboot-initial-env
140 oe_runmake -C ${S} O=${B} u-boot-initial-env
133 fi 141 fi
134 142
135} 143}
@@ -143,19 +151,28 @@ do_install () {
143 j=$(expr $j + 1); 151 j=$(expr $j + 1);
144 if [ $j -eq $i ] 152 if [ $j -eq $i ]
145 then 153 then
146 install -d ${D}/boot 154 install -D -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
147 install -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
148 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type} 155 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
149 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY} 156 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}
157
158 # Install the uboot-initial-env
159 install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/u-boot-initial-env-${MACHINE}-${type}-${PV}-${PR}
160 ln -sf u-boot-initial-env-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/u-boot-initial-env-${MACHINE}-${type}
161 ln -sf u-boot-initial-env-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/u-boot-initial-env-${type}
162 ln -sf u-boot-initial-env-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/u-boot-initial-env
150 fi 163 fi
151 done 164 done
152 unset j 165 unset j
153 done 166 done
154 unset i 167 unset i
155 else 168 else
156 install -d ${D}/boot 169 install -D -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
157 install -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
158 ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY} 170 ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
171
172 # Install the uboot-initial-env
173 install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/u-boot-initial-env-${MACHINE}-${PV}-${PR}
174 ln -sf u-boot-initial-env-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/u-boot-initial-env-${MACHINE}
175 ln -sf u-boot-initial-env-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/u-boot-initial-env
159 fi 176 fi
160 177
161 if [ -n "${UBOOT_ELF}" ] 178 if [ -n "${UBOOT_ELF}" ]
@@ -224,7 +241,16 @@ do_install () {
224 241
225} 242}
226 243
227FILES_${PN} = "/boot ${sysconfdir} ${datadir}" 244PACKAGE_BEFORE_PN += "${PN}-env"
245
246RPROVIDES_${PN}-env += "u-boot-default-env"
247FILES_${PN}-env = " \
248 ${sysconfdir}/u-boot-initial-env* \
249 ${sysconfdir}/fw_env.config \
250"
251
252FILES_${PN} = "/boot ${datadir}"
253RDEPENDS_${PN} += "${PN}-env"
228 254
229do_deploy () { 255do_deploy () {
230 if [ -n "${UBOOT_CONFIG}" ] 256 if [ -n "${UBOOT_CONFIG}" ]
@@ -235,25 +261,43 @@ do_deploy () {
235 j=$(expr $j + 1); 261 j=$(expr $j + 1);
236 if [ $j -eq $i ] 262 if [ $j -eq $i ]
237 then 263 then
238 install -d ${DEPLOYDIR} 264 install -D -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
239 install -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
240 cd ${DEPLOYDIR} 265 cd ${DEPLOYDIR}
241 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type} 266 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type}
242 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK} 267 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}
243 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type} 268 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type}
244 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY} 269 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}
270
271 # Deploy the uboot-initial-env
272 install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/u-boot-initial-env-${MACHINE}-${type}-${PV}-${PR}
273 cd ${DEPLOYDIR}
274 ln -sf u-boot-initial-env-${MACHINE}-${type}-${PV}-${PR} u-boot-initial-env-${MACHINE}-${type}
275 ln -sf u-boot-initial-env-${MACHINE}-${type}-${PV}-${PR} u-boot-initial-env-${type}
245 fi 276 fi
246 done 277 done
247 unset j 278 unset j
248 done 279 done
249 unset i 280 unset i
250 else 281 else
251 install -d ${DEPLOYDIR} 282 install -D -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE}
252 install -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE} 283
253 cd ${DEPLOYDIR} 284 cd ${DEPLOYDIR}
254 rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK} 285 rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK}
255 ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK} 286 ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
256 ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY} 287 ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
288
289 # Deploy the uboot-initial-env
290 install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/u-boot-initial-env-${MACHINE}-${PV}-${PR}
291 cd ${DEPLOYDIR}
292 ln -sf u-boot-initial-env-${MACHINE}-${PV}-${PR} u-boot-initial-env-${MACHINE}
293 ln -sf u-boot-initial-env-${MACHINE}-${PV}-${PR} u-boot-initial-env
294 fi
295
296 if [ -e ${WORKDIR}/fw_env.config ] ; then
297 install -D -m 644 ${WORKDIR}/fw_env.config ${DEPLOYDIR}/fw_env.config-${MACHINE}-${PV}-${PR}
298 cd ${DEPLOYDIR}
299 ln -sf fw_env.config-${MACHINE}-${PV}-${PR} fw_env.config-${MACHINE}
300 ln -sf fw_env.config-${MACHINE}-${PV}-${PR} fw_env.config
257 fi 301 fi
258 302
259 if [ -n "${UBOOT_ELF}" ] 303 if [ -n "${UBOOT_ELF}" ]