diff options
author | Ming Liu <ming.liu@toradex.com> | 2020-06-03 13:48:38 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-07-02 16:12:36 +0100 |
commit | d7b8ae3faa9344f2ada22e0402066c2fff5958c6 (patch) | |
tree | e63292854d572b3c6eb3bc86ee1a4cf496265736 /meta/recipes-bsp | |
parent | abde5f4cab763c308ef3144055afebc6c87877d1 (diff) | |
download | poky-d7b8ae3faa9344f2ada22e0402066c2fff5958c6.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: e4d5c99abab58aa813fe2da7c576ae69b9413304)
Signed-off-by: Ming Liu <ming.liu@toradex.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit fb7e8b6b88855f3f523b2176ea2c85a330bfe00b)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
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.inc | 55 |
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 80f828df52..cbe15cb3c8 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}" | |||
60 | UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}" | 60 | UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}" |
61 | UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}" | 61 | UBOOT_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. | ||
65 | UBOOT_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. |
65 | UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot/extlinux" | 69 | UBOOT_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 | } |
@@ -156,10 +164,12 @@ do_install () { | |||
156 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY} | 164 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY} |
157 | 165 | ||
158 | # Install the uboot-initial-env | 166 | # Install the uboot-initial-env |
159 | install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} | 167 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then |
160 | ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env-${MACHINE}-${type} | 168 | install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} |
161 | ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env-${type} | 169 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type} |
162 | ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env | 170 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${type} |
171 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV} | ||
172 | fi | ||
163 | fi | 173 | fi |
164 | done | 174 | done |
165 | unset j | 175 | unset j |
@@ -170,9 +180,11 @@ do_install () { | |||
170 | ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY} | 180 | ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY} |
171 | 181 | ||
172 | # Install the uboot-initial-env | 182 | # Install the uboot-initial-env |
173 | install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/${PN}-initial-env-${MACHINE}-${PV}-${PR} | 183 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then |
174 | ln -sf ${PN}-initial-env-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env-${MACHINE} | 184 | install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} |
175 | ln -sf ${PN}-initial-env-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${PN}-initial-env | 185 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE} |
186 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV} | ||
187 | fi | ||
176 | fi | 188 | fi |
177 | 189 | ||
178 | if [ -n "${UBOOT_ELF}" ] | 190 | if [ -n "${UBOOT_ELF}" ] |
@@ -244,8 +256,9 @@ do_install () { | |||
244 | PACKAGE_BEFORE_PN += "${PN}-env" | 256 | PACKAGE_BEFORE_PN += "${PN}-env" |
245 | 257 | ||
246 | RPROVIDES_${PN}-env += "u-boot-default-env" | 258 | RPROVIDES_${PN}-env += "u-boot-default-env" |
259 | ALLOW_EMPTY_${PN}-env = "1" | ||
247 | FILES_${PN}-env = " \ | 260 | FILES_${PN}-env = " \ |
248 | ${sysconfdir}/${PN}-initial-env* \ | 261 | ${@ '${sysconfdir}/${UBOOT_INITIAL_ENV}*' if d.getVar('UBOOT_INITIAL_ENV') else ''} \ |
249 | ${sysconfdir}/fw_env.config \ | 262 | ${sysconfdir}/fw_env.config \ |
250 | " | 263 | " |
251 | 264 | ||
@@ -269,10 +282,12 @@ do_deploy () { | |||
269 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY} | 282 | ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY} |
270 | 283 | ||
271 | # Deploy the uboot-initial-env | 284 | # Deploy the uboot-initial-env |
272 | install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} | 285 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then |
273 | cd ${DEPLOYDIR} | 286 | install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} |
274 | ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${PN}-initial-env-${MACHINE}-${type} | 287 | cd ${DEPLOYDIR} |
275 | ln -sf ${PN}-initial-env-${MACHINE}-${type}-${PV}-${PR} ${PN}-initial-env-${type} | 288 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE}-${type} |
289 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${type} | ||
290 | fi | ||
276 | fi | 291 | fi |
277 | done | 292 | done |
278 | unset j | 293 | unset j |
@@ -287,10 +302,12 @@ do_deploy () { | |||
287 | ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY} | 302 | ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY} |
288 | 303 | ||
289 | # Deploy the uboot-initial-env | 304 | # Deploy the uboot-initial-env |
290 | install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/${PN}-initial-env-${MACHINE}-${PV}-${PR} | 305 | if [ -n "${UBOOT_INITIAL_ENV}" ]; then |
291 | cd ${DEPLOYDIR} | 306 | install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} |
292 | ln -sf ${PN}-initial-env-${MACHINE}-${PV}-${PR} ${PN}-initial-env-${MACHINE} | 307 | cd ${DEPLOYDIR} |
293 | ln -sf ${PN}-initial-env-${MACHINE}-${PV}-${PR} ${PN}-initial-env | 308 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE} |
309 | ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV} | ||
310 | fi | ||
294 | fi | 311 | fi |
295 | 312 | ||
296 | if [ -e ${WORKDIR}/fw_env.config ] ; then | 313 | if [ -e ${WORKDIR}/fw_env.config ] ; then |