* [PATCH] u-boot.inc: fix rename image error
@ 2015-03-05 9:38 Chunrong Guo
2015-03-05 11:47 ` Burton, Ross
0 siblings, 1 reply; 2+ messages in thread
From: Chunrong Guo @ 2015-03-05 9:38 UTC (permalink / raw)
To: openembedded-core
Resolve mismatch between U-Boot configs and uboot image name.
The ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX} may alway be false
and repeat compile or install so we need to check if ${type} match ${config} .
Signed-off-by: Chunrong Guo <B40290@freescale.com>
---
meta/recipes-bsp/u-boot/u-boot.inc | 32 +++++++++++---------------------
1 file changed, 11 insertions(+), 21 deletions(-)
diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index 6bdc86a..aa7c20f 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -66,15 +66,13 @@ do_compile () {
if [ "x${UBOOT_CONFIG}" != "x" ]
then
for config in ${UBOOT_MACHINE}; do
- for type in in ${UBOOT_CONFIG}; do
+ for type in ${UBOOT_CONFIG}; do
if [ "${type}"x = "in"x ]
then
continue
fi
- if [ -d "${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX}" ]
+ if [ "`echo ${config} | cut -d'_' -f2`" = "${type}" ]
then
- break
- else
oe_runmake O=${config} ${config}
oe_runmake O=${config} ${UBOOT_MAKE_TARGET}
cp ${S}/${config}/${UBOOT_BINARY} ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
@@ -92,15 +90,13 @@ do_install () {
if [ "x${UBOOT_CONFIG}" != "x" ]
then
for config in ${UBOOT_MACHINE}; do
- for type in in ${UBOOT_CONFIG}; do
+ for type in ${UBOOT_CONFIG}; do
if [ "${type}"x = "in"x ]
then
continue
fi
- if [ -d "${D}/boot/u-boot-${type}.${UBOOT_SUFFIX}" ]
+ if [ "`echo ${config} | cut -d'_' -f2`" = "${type}" ]
then
- break
- else
install -d ${D}/boot
install ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/u-boot-${type}.${UBOOT_SUFFIX}
ln -sf u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}
@@ -123,15 +119,13 @@ do_install () {
if [ "x${UBOOT_CONFIG}" != "x" ]
then
for config in ${UBOOT_MACHINE}; do
- for type in in ${UBOOT_CONFIG}; do
+ for type in ${UBOOT_CONFIG}; do
if [ "${type}"x = "in"x ]
then
continue
fi
- if [ -d "${D}/boot/${SPL_IMAGE}-${type}" ]
+ if [ "`echo ${config} | cut -d'_' -f2`" = "${type}" ]
then
- break
- else
install ${S}/${config}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}-${type}
ln -sf ${SPL_IMAGE}-${type} ${D}/boot/${SPL_BINARY}-${type}
ln -sf ${SPL_IMAGE}-${type} ${D}/boot/${SPL_BINARY}
@@ -157,15 +151,13 @@ do_deploy () {
if [ "x${UBOOT_CONFIG}" != "x" ]
then
for config in ${UBOOT_MACHINE}; do
- for type in in ${UBOOT_CONFIG}; do
+ for type in ${UBOOT_CONFIG}; do
if [ "${type}"x = "in"x ]
then
continue
fi
- if [ -d "${DEPLOYDIR}/u-boot-${type}.${UBOOT_SUFFIX}" ]
- then
- break
- else
+ if [ "`echo ${config} | cut -d'_' -f2`" = "${type}" ]
+ then
install -d ${DEPLOYDIR}
install ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/u-boot-${type}.${UBOOT_SUFFIX}
cd ${DEPLOYDIR}
@@ -190,15 +182,13 @@ do_deploy () {
if [ "x${UBOOT_CONFIG}" != "x" ]
then
for config in ${UBOOT_MACHINE}; do
- for type in in ${UBOOT_CONFIG}; do
+ for type in ${UBOOT_CONFIG}; do
if [ "${type}"x = "in"x ]
then
continue
fi
- if [ -d "${DEPLOYDIR}/${SPL_IMAGE}-${type}" ]
+ if [ "`echo ${config} | cut -d'_' -f2`" = "${type}" ]
then
- break
- else
install ${S}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}-${type}
rm -f ${DEPLOYDIR}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
ln -sf ${SPL_IMAGE}-${type} ${DEPLOYDIR}/${SPL_BINARY}-${type}
--
1.9.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] u-boot.inc: fix rename image error
2015-03-05 9:38 [PATCH] u-boot.inc: fix rename image error Chunrong Guo
@ 2015-03-05 11:47 ` Burton, Ross
0 siblings, 0 replies; 2+ messages in thread
From: Burton, Ross @ 2015-03-05 11:47 UTC (permalink / raw)
To: Chunrong Guo; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 676 bytes --]
On 5 March 2015 at 09:38, Chunrong Guo <B40290@freescale.com> wrote:
> - for type in in ${UBOOT_CONFIG}; do
> + for type in ${UBOOT_CONFIG}; do
> if [ "${type}"x = "in"x ]
> then
> continue
> fi
>
The if "${type}x" = "inx" check demonstrates that the in was repeated for a
reason, which you've just broken.
Of course all of that isn't required as a simple test demonstrates:
$ UBOOT_CONFIG=""
~
$ for type in ${UBOOT_CONFIG}; do echo x$type; done
~
$
You can remove the "typex = inx" tests as if UBOOT_CONFIG isn't set the
loop won't be entered.
Ross
[-- Attachment #2: Type: text/html, Size: 1604 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-05 11:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-05 9:38 [PATCH] u-boot.inc: fix rename image error Chunrong Guo
2015-03-05 11:47 ` Burton, Ross
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.