summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/u-boot/u-boot.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-bsp/u-boot/u-boot.inc')
-rw-r--r--meta/recipes-bsp/u-boot/u-boot.inc50
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
new file mode 100644
index 0000000000..544acd23b2
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -0,0 +1,50 @@
1DESCRIPTION = "U-boot bootloader"
2HOMEPAGE = "http://u-boot.sf.net"
3SECTION = "bootloaders"
4PROVIDES = "virtual/bootloader"
5
6inherit deploy
7
8PARALLEL_MAKE=""
9
10# GCC 4.5.1 builds unusable binaries using -Os, remove it from OPTFLAGS
11EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} OPTFLAGS='-O2'"
12
13python () {
14 if not d.getVar("UBOOT_MACHINE", True):
15 PN = d.getVar("PN", True)
16 FILE = os.path.basename(d.getVar("FILE", True))
17 bb.debug(1, "To build %s, see %s for instructions on \
18 setting up your machine config" % (PN, FILE))
19 raise bb.parse.SkipPackage("because UBOOT_MACHINE is not set")
20}
21
22UBOOT_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.bin"
23UBOOT_BINARY ?= "u-boot.bin"
24UBOOT_SYMLINK ?= "u-boot-${MACHINE}.bin"
25UBOOT_MAKE_TARGET ?= "all"
26
27do_compile () {
28 unset LDFLAGS
29 unset CFLAGS
30 unset CPPFLAGS
31 oe_runmake ${UBOOT_MACHINE}
32 oe_runmake ${UBOOT_MAKE_TARGET}
33}
34
35do_install () {
36 install -d ${D}/boot
37 install ${S}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
38 ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
39}
40
41FILES_${PN} = "/boot"
42
43do_deploy () {
44 install ${S}/u-boot.bin ${DEPLOYDIR}/${UBOOT_IMAGE}
45
46 cd ${DEPLOYDIR}
47 rm -f ${UBOOT_SYMLINK}
48 ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
49}
50addtask deploy before do_build after do_compile