summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunrong Guo <B40290@freescale.com>2015-01-22 14:27:50 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-07 13:30:56 +0000
commitab126dcca85d6a335212b07a1ca37d5e045a59cf (patch)
treea151b92c1014f0b6e97a7c273132c5c748c964e1
parentbe997c70e4dec101786978b3ab5e49a1be87a85d (diff)
downloadopenembedded-core-ab126dcca85d6a335212b07a1ca37d5e045a59cf.tar.gz
openembedded-core-ab126dcca85d6a335212b07a1ca37d5e045a59cf.tar.bz2
openembedded-core-ab126dcca85d6a335212b07a1ca37d5e045a59cf.zip
u-boot.inc : add compile multiple u-boot feature
Signed-off-by: Chunrong Guo <B40290@freescale.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/recipes-bsp/u-boot/u-boot.inc150
1 files changed, 129 insertions, 21 deletions
diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index c695b73b48..58725fa7aa 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -62,15 +62,56 @@ do_compile () {
echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion
echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
fi
+
+ if [ "x${UBOOT_CONFIG}" != "x" ]
+ then
+ for config in ${UBOOT_MACHINE}; do
+ for type in in ${UBOOT_CONFIG}; do
+ if [ "${type}"x = "in"x ]
+ then
+ continue
+ fi
+ if [ -d "${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX}"]
+ 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}
+ fi
+ done
+ done
+ else
+ oe_runmake ${UBOOT_MACHINE}
+ oe_runmake ${UBOOT_MAKE_TARGET}
+ fi
- oe_runmake ${UBOOT_MACHINE}
- oe_runmake ${UBOOT_MAKE_TARGET}
}
do_install () {
- install -d ${D}/boot
- install ${S}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
- ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
+ if [ "x${UBOOT_CONFIG}" != "x" ]
+ then
+ for config in ${UBOOT_MACHINE}; do
+ for type in in ${UBOOT_CONFIG}; do
+ if [ "${type}"x = "in"x ]
+ then
+ continue
+ fi
+ if [ -d "${D}/boot/u-boot-${type}.${UBOOT_SUFFIX}"]
+ 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}
+ fi
+ done
+ done
+ else
+ install -d ${D}/boot
+ install ${S}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
+ ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
+ fi
if [ -e ${WORKDIR}/fw_env.config ] ; then
install -d ${D}${sysconfdir}
@@ -79,8 +120,28 @@ do_install () {
if [ "x${SPL_BINARY}" != "x" ]
then
- install ${S}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}
- ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARY}
+ if [ "x${UBOOT_CONFIG}" != "x" ]
+ then
+ for config in ${UBOOT_MACHINE}; do
+ for type in in ${UBOOT_CONFIG}; do
+ if [ "${type}"x = "in"x ]
+ then
+ continue
+ fi
+ if [ -d "${D}/boot/${SPL_IMAGE}-${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}
+ fi
+ done
+ done
+ else
+ install ${S}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}
+ ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARY}
+ fi
fi
if [ "x${UBOOT_ENV}" != "x" ]
@@ -93,21 +154,68 @@ do_install () {
FILES_${PN} = "/boot ${sysconfdir}"
do_deploy () {
- install -d ${DEPLOYDIR}
- install ${S}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE}
-
- cd ${DEPLOYDIR}
- rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK}
- ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
- ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
-
- if [ "x${SPL_BINARY}" != "x" ]
+ if [ "x${UBOOT_CONFIG}" != "x" ]
then
- install ${S}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}
- rm -f ${DEPLOYDIR}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_SYMLINK}
- ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARY}
- ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK}
- fi
+ for config in ${UBOOT_MACHINE}; do
+ for type in in ${UBOOT_CONFIG}; do
+ if [ "${type}"x = "in"x ]
+ then
+ continue
+ fi
+ if [ -d "${DEPLOYDIR}/u-boot-${type}.${UBOOT_SUFFIX}"]
+ then
+ break
+ else
+ install -d ${DEPLOYDIR}
+ install ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/u-boot-${type}.${UBOOT_SUFFIX}
+ cd ${DEPLOYDIR}
+ ln -sf u-boot-${type}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}
+ ln -sf u-boot-${type}.${UBOOT_SUFFIX} ${UBOOT_BINARY}
+ fi
+ done
+ done
+ else
+ install -d ${DEPLOYDIR}
+ install ${S}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE}
+ cd ${DEPLOYDIR}
+ rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK}
+ ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
+ ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
+ fi
+
+
+
+ if [ "x${SPL_BINARY}" != "x" ]
+ then
+ if [ "x${UBOOT_CONFIG}" != "x" ]
+ then
+ for config in ${UBOOT_MACHINE}; do
+ for type in in ${UBOOT_CONFIG}; do
+ if [ "${type}"x = "in"x ]
+ then
+ continue
+ fi
+ if [ -d "${DEPLOYDIR}/${SPL_IMAGE}-${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}
+ ln -sf ${SPL_IMAGE}-${type} ${DEPLOYDIR}/${SPL_BINARY}
+ ln -sf ${SPL_IMAGE}-${type} ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
+ ln -sf ${SPL_IMAGE}-${type} ${DEPLOYDIR}/${SPL_SYMLINK}
+ fi
+ done
+ done
+ else
+ install ${S}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}
+ rm -f ${DEPLOYDIR}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_SYMLINK}
+ ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARY}
+ ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK}
+ fi
+ fi
+
if [ "x${UBOOT_ENV}" != "x" ]
then