at91bootstrap: afeb9260 support, cleanup
[vuplus_openembedded] / packages / at91bootstrap / at91bootstrap_2.4.bb
1 DESCRIPTION = "at91bootstrap"
2 SRC_URI = "ftp://www.at91.com/pub/buildroot/${PN}-${PV}.tar.bz2 \
3            "
4 SRC_URI_append_afeb9260 = " file://0001-Generic-code-changes.patch;patch=1 \
5            file://0002-Making-image-directly-flashable.patch;patch=1 \
6            file://0003-AFEB9260-board-support.patch;patch=1 \
7            file://0004-AFEB9260-133-board-support.patch;patch=1"
8
9 PR = "r4"
10 SECTION = "bootloaders"
11
12 AT91BOOTSTRAP_MACHINE ?= "${MACHINE}"
13 AT91BOOTSTRAP_FLAGS ?= ""
14 AT91BOOTSTRAP_MEMORY ?= "dataflash"
15
16 AT91BOOTSTRAP_IMAGE = "at91bootstrap-${MACHINE}-${AT91BOOTSTRAP_MEMORY}-${PV}-${PR}.bin"
17 AT91BOOTSTRAP_SYMLINK = "at91bootstrap.bin"
18
19 S = "${WORKDIR}/${PN}-${PV}"
20
21 PACKAGE_ARCH = "${MACHINE_ARCH}"
22 EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} MEMORY=${AT91BOOTSTRAP_MEMORY}"
23
24 do_compile () {
25         unset LDFLAGS
26         unset CFLAGS
27         unset CPPFLAGS
28
29         rm -Rf ${S}/binaries
30         oe_runmake ${AT91BOOTSTRAP_MACHINE}_defconfig
31         oe_runmake AT91_CUSTOM_FLAGS="${AT91BOOTSTRAP_FLAGS}"
32         chmod +x ${S}/fixboot.py
33         ${S}/fixboot.py ${S}/binaries/${AT91BOOTSTRAP_MACHINE}-${AT91BOOTSTRAP_MEMORY}boot-${PV}.bin
34 }
35
36 do_deploy () {
37         install -d ${DEPLOY_DIR_IMAGE}
38         install ${S}/binaries/${AT91BOOTSTRAP_MACHINE}-${AT91BOOTSTRAP_MEMORY}boot-${PV}.bin.fixboot \
39                 ${DEPLOY_DIR_IMAGE}/${AT91BOOTSTRAP_IMAGE}
40         package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${AT91BOOTSTRAP_IMAGE}
41         cd ${DEPLOY_DIR_IMAGE}
42         rm -f ${AT91BOOTSTRAP_SYMLINK}
43         ln -sf ${AT91BOOTSTRAP_IMAGE} ${AT91BOOTSTRAP_SYMLINK}
44         package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${AT91BOOTSTRAP_SYMLINK}
45 }
46
47 do_deploy[dirs] = "${S}"
48 addtask deploy before do_build after do_compile