summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/u-boot/u-boot.inc
diff options
context:
space:
mode:
authorMing Liu <ming.liu@toradex.com>2020-06-03 13:48:38 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-06-04 13:27:32 +0100
commite52d60d9d472460f2506bedb0ce109905dc590cf (patch)
treefa22429e8d4453955036af2103d926619c47adff /meta/recipes-bsp/u-boot/u-boot.inc
parent43dbbb87120d48c378e3b836d7d0788a91489655 (diff)
downloadpoky-e52d60d9d472460f2506bedb0ce109905dc590cf.tar.gz
u-boot: introduce UBOOT_INITIAL_ENV
It defaults to ${PN}-initial-env, no functional changes with current implementation, but this allows it to be changed in individual u-boot recipes. If UBOOT_INITIAL_ENV is empty, then no initial env would be compiled/ installed/deployed, set ALLOW_EMPTY_${PN}-env = "1". The major purpose for introducing this, is that the users might have some scripts on targets like: ``` /sbin/fw_setenv -f /etc/u-boot-initial-env ``` and it should be able to run against a identical path generated by different u-boot recipes. (From OE-Core rev: fb7e8b6b88855f3f523b2176ea2c85a330bfe00b) Signed-off-by: Ming Liu <ming.liu@toradex.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp/u-boot/u-boot.inc')
-rw-r--r--meta/recipes-bsp/u-boot/u-boot.inc55
1 files changed, 36 insertions, 19 deletions
diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index 718435f13f..6fa2d0820c 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -60,6 +60,10 @@ UBOOT_ENV_BINARY ?= "${UBOOT_ENV}.${UBOOT_ENV_SUFFIX}"
60UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}" 60UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}"
61UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}" 61UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}"
62 62
63# Default name of u-boot initial env, but enable individual recipes to change
64# this value.
65UBOOT_INITIAL_ENV ?= "${PN}-initial-env"
66
63# U-Boot EXTLINUX variables. U-Boot searches for /boot/extlinux/extlinux.conf 67# U-Boot EXTLINUX variables. U-Boot searches for /boot/extlinux/extlinux.conf
64# to find EXTLINUX conf file. 68# to find EXTLINUX conf file.
65UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot/extlinux" 69UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot/extlinux"
@@ -124,8 +128,10 @@ do_compile () {
124 done 128 done
125 129
126 # Generate the uboot-initial-env 130 # Generate the uboot-initial-env
127 oe_runmake -C ${S} O=${B}/${config} u-boot-initial-env 131 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
128 cp ${B}/${config}/u-boot-initial-env ${B}/${config}/u-boot-initial-env-${type} 132 oe_runmake -C ${S} O=${B}/${config} u-boot-initial-env
133 cp ${B}/${config}/u-boot-initial-env ${B}/${config}/u-boot-initial-env-${type}
134 fi
129 135
130 unset k 136 unset k
131 fi 137 fi
@@ -137,7 +143,9 @@ do_compile () {
137 oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET} 143 oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET}
138 144
139 # Generate the uboot-initial-env 145 # Generate the uboot-initial-env
140 oe_runmake -C ${S} O=${B} u-boot-initial-env 146 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
147 oe_runmake -C ${S} O=${B} u-boot-initial-env
148 fi
141 fi 149 fi
142} 150}
143 151
@@ -155,10 +163,12 @@ do_install () {
155 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY} 163 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}
156 164
157 # Install the uboot-initial-env 165 # Install the uboot-initial-env
158 install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} 166 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
159 ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env-${MACHINE}-${type} 167 install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR}
160 ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env-${type} 168 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}
161 ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env 169 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${type}
170 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}
171 fi
162 fi 172 fi
163 done 173 done
164 unset j 174 unset j
@@ -169,9 +179,11 @@ do_install () {
169 ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY} 179 ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
170 180
171 # Install the uboot-initial-env 181 # Install the uboot-initial-env
172 install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/${PN}-initial-env-${MACHINE}-${PV}-${PR} 182 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
173 ln -sf ${PN}-initial-env-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env-${MACHINE} 183 install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR}
174 ln -sf ${PN}-initial-env-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env 184 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}
185 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}
186 fi
175 fi 187 fi
176 188
177 if [ -n "${UBOOT_ELF}" ] 189 if [ -n "${UBOOT_ELF}" ]
@@ -242,8 +254,9 @@ do_install () {
242PACKAGE_BEFORE_PN += "${PN}-env" 254PACKAGE_BEFORE_PN += "${PN}-env"
243 255
244RPROVIDES_${PN}-env += "u-boot-default-env" 256RPROVIDES_${PN}-env += "u-boot-default-env"
257ALLOW_EMPTY_${PN}-env = "1"
245FILES_${PN}-env = " \ 258FILES_${PN}-env = " \
246 ${sysconfdir}/${PN}-initial-env* \ 259 ${@ '${sysconfdir}/${UBOOT_INITIAL_ENV}*' if d.getVar('UBOOT_INITIAL_ENV') else ''} \
247 ${sysconfdir}/fw_env.config \ 260 ${sysconfdir}/fw_env.config \
248" 261"
249 262
@@ -267,10 +280,12 @@ do_deploy () {
267 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY} 280 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}
268 281
269 # Deploy the uboot-initial-env 282 # Deploy the uboot-initial-env
270 install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} 283 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
271 cd ${DEPLOYDIR} 284 install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR}
272 ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${PN}-initial-env-${MACHINE}-${type} 285 cd ${DEPLOYDIR}
273 ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${PN}-initial-env-${type} 286 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}
287 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${type}
288 fi
274 fi 289 fi
275 done 290 done
276 unset j 291 unset j
@@ -285,10 +300,12 @@ do_deploy () {
285 ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY} 300 ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
286 301
287 # Deploy the uboot-initial-env 302 # Deploy the uboot-initial-env
288 install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/${PN}-initial-env-${MACHINE}-${PV}-${PR} 303 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
289 cd ${DEPLOYDIR} 304 install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR}
290 ln -sf ${PN}-initial-env-${MACHINE}-${PV}-${PR} ${PN}-initial-env-${MACHINE} 305 cd ${DEPLOYDIR}
291 ln -sf ${PN}-initial-env-${MACHINE}-${PV}-${PR} ${PN}-initial-env 306 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE}
307 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV}
308 fi
292 fi 309 fi
293 310
294 if [ -e ${WORKDIR}/fw_env.config ] ; then 311 if [ -e ${WORKDIR}/fw_env.config ] ; then