diff options
Diffstat (limited to 'meta/recipes-bsp/u-boot/u-boot.inc')
-rw-r--r-- | meta/recipes-bsp/u-boot/u-boot.inc | 50 |
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 @@ | |||
1 | DESCRIPTION = "U-boot bootloader" | ||
2 | HOMEPAGE = "http://u-boot.sf.net" | ||
3 | SECTION = "bootloaders" | ||
4 | PROVIDES = "virtual/bootloader" | ||
5 | |||
6 | inherit deploy | ||
7 | |||
8 | PARALLEL_MAKE="" | ||
9 | |||
10 | # GCC 4.5.1 builds unusable binaries using -Os, remove it from OPTFLAGS | ||
11 | EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} OPTFLAGS='-O2'" | ||
12 | |||
13 | python () { | ||
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 | |||
22 | UBOOT_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.bin" | ||
23 | UBOOT_BINARY ?= "u-boot.bin" | ||
24 | UBOOT_SYMLINK ?= "u-boot-${MACHINE}.bin" | ||
25 | UBOOT_MAKE_TARGET ?= "all" | ||
26 | |||
27 | do_compile () { | ||
28 | unset LDFLAGS | ||
29 | unset CFLAGS | ||
30 | unset CPPFLAGS | ||
31 | oe_runmake ${UBOOT_MACHINE} | ||
32 | oe_runmake ${UBOOT_MAKE_TARGET} | ||
33 | } | ||
34 | |||
35 | do_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 | |||
41 | FILES_${PN} = "/boot" | ||
42 | |||
43 | do_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 | } | ||
50 | addtask deploy before do_build after do_compile | ||