9669ade748d81e59fde49807a33d8d0e3ed5596b
[glsdk/meta-ti-glsdk.git] / recipes-bsp / u-boot / u-boot.inc
1 DESCRIPTION = "U-Boot - the Universal Boot Loader"
2 HOMEPAGE = "http://www.denx.de/wiki/U-Boot/WebHome"
3 SECTION = "bootloaders"
4 LICENSE = "GPLv2+"
5 LIC_FILES_CHKSUM = "file://COPYING;md5=4c6cde5df68eff615d36789dc18edd3b"
7 PROVIDES = "virtual/bootloader"
9 DEPENDS = "mtd-utils"
11 PACKAGE_ARCH = "${MACHINE_ARCH}"
12 PARALLEL_MAKE=""
14 EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX}"
16 UBOOT_MACHINE ?= "${MACHINE}_config"
17 UBOOT_BINARY ?= "u-boot.bin"
18 UBOOT_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.bin"
19 UBOOT_SYMLINK ?= "u-boot-${MACHINE}.bin"
20 UBOOT_MAKE_TARGET ?= "all"
22 do_configure () {
23         oe_runmake ${UBOOT_MACHINE}
24 }
26 do_compile () {
27         unset LDFLAGS
28         unset CFLAGS
29         unset CPPFLAGS
30         oe_runmake ${UBOOT_MAKE_TARGET}
31         oe_runmake tools env
32 }
34 do_install () {
35         install -d ${D}/boot
36         install ${S}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
37         ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
39         if [ -e ${WORKDIR}/fw_env.config ] ; then
40             install -d ${D}${base_sbindir}
41                 install -d ${D}${sysconfdir}
42                 install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
43 #               install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
44 #               install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
45         fi
47 }
49 FILES_${PN} = "/boot"
50 # no gnu_hash in uboot.bin, by design, so skip QA
51 INSANE_SKIP_${PN} = True
53 PACKAGES += "${PN}-fw-utils"
54 FILES_${PN}-fw-utils = "${sysconfdir} ${base_sbindir}"
56 inherit deploy
58 addtask deploy before do_package after do_compile
60 do_deploy () {
61         install -d ${DEPLOY_DIR_IMAGE}
62         install ${S}/${UBOOT_BINARY} ${DEPLOY_DIR_IMAGE}/${UBOOT_IMAGE}
64         cd ${DEPLOY_DIR_IMAGE}
65         rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK}
66         ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
67         ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
69         if [ -e ${S}/MLO ] ; then
70                 install ${S}/MLO ${DEPLOY_DIR_IMAGE}/MLO-${MACHINE}-${PV}
71                 rm -f ${DEPLOY_DIR_IMAGE}/MLO-${MACHINE} ${DEPLOY_DIR_IMAGE}/MLO
72                 ln -sf MLO-${MACHINE}-${PV} ${DEPLOY_DIR_IMAGE}/MLO-${MACHINE}
73                 ln -sf MLO-${MACHINE}-${PV} ${DEPLOY_DIR_IMAGE}/MLO
74         fi
75 }