generic-poky/meta/recipes-bsp/u-boot/u-boot.inc

51 lines
1.3 KiB
PHP
Raw Normal View History

DESCRIPTION = "U-Boot - the Universal Boot Loader"
HOMEPAGE = "http://www.denx.de/wiki/U-Boot/WebHome"
SECTION = "bootloaders"
PROVIDES = "virtual/bootloader"
inherit deploy
PARALLEL_MAKE=""
# GCC 4.5.1 builds unusable binaries using -Os, remove it from OPTFLAGS
EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} OPTFLAGS='-O2'"
u-boot: remove UBOOT_MACHINE and COMPATIBLE_MACHINES oe-core does not define any machines, so it does not make sense to add machine specific information in the oe-core u-boot recipe and infrastructure. Also note that COMPATIBLE_MACHINES is not easily extended due to its regex syntax: "(machine_a|machine_b)", making it difficult to extend the u-boot recipe in bbappend files without resorting to machine specific overrides. Remove COMPATIBLE_MACHINES and the default UBOOT_MACHINE from the recipe and insert some anonymous python into u-boot.inc to raise SkipPackage if UBOOT_MACHINE is not set (this ensures 'world' still works for machines that can't build u-boot). UBOOT_MACHINE must now be specified in each machine config that requires u-boot. This is an improvement over requiring machine specific overrides in every BSP layer's u-boot_git.bbappend file. For example, a beagleboard machine config currently contains: UBOOT_ENTRYPOINT = "0x80008000" UBOOT_LOADADDRESS = "0x80008000" With this change, it must now contain: UBOOT_MACHINE = "omap3_beagle_config" UBOOT_ENTRYPOINT = "0x80008000" UBOOT_LOADADDRESS = "0x80008000" So long as the SRC_URI in the base recipe can build a working u-boot for a given machine, there is no need to create a u-boot_git.bbappend file. If additional patches are deemed necessary, a BSP layer creates a u-boot_git.bbappend file and extends the SRC_URI to include general or machine specific backports. Note: I used bb.note() instead of bb.debug() to ensure the message at least makes it to the console. From what I could gather, bb.debug() doesn't go anywhere during recipe parsing. (From OE-Core rev: c7a198d7472b4767047dbbfeecb4d941055262b3) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Cc: Richard Purdie <richard.purdie@linuxfoundation.org> Cc: Koen Kooi <koen@dominion.thruhere.net> Cc: Jason Kridner <jkridner@beagleboard.org> Cc: Chris Larson <clarson@kergoth.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-17 21:44:45 +00:00
python () {
if not d.getVar("UBOOT_MACHINE", True):
PN = d.getVar("PN", True)
FILE = os.path.basename(d.getVar("FILE", True))
bb.debug(1, "To build %s, see %s for instructions on \
setting up your machine config" % (PN, FILE))
raise bb.parse.SkipPackage("because UBOOT_MACHINE is not set")
}
UBOOT_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.bin"
UBOOT_BINARY ?= "u-boot.bin"
UBOOT_SYMLINK ?= "u-boot-${MACHINE}.bin"
UBOOT_MAKE_TARGET ?= "all"
do_compile () {
unset LDFLAGS
unset CFLAGS
unset CPPFLAGS
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}
}
FILES_${PN} = "/boot"
do_deploy () {
install ${S}/u-boot.bin ${DEPLOYDIR}/${UBOOT_IMAGE}
cd ${DEPLOYDIR}
rm -f ${UBOOT_SYMLINK}
ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
}
addtask deploy before do_build after do_compile