summaryrefslogtreecommitdiff
path: root/packages/u-boot/u-boot-openmoko_1.3.1+git+svn.bb
blob: d8a51ea8245053a5c24c50fedf9629e248b807ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
DESCRIPTION = "U-boot bootloader w/ Neo1973 (GTA01) and Neo FreeRunner (GTA02) support"
AUTHOR = "Harald Welte <laforge@openmoko.org>, OpenMoko <openmoko-kernel@lists.openmoko.org>"
LICENSE = "GPL"
SECTION = "bootloader"
PRIORITY = "optional"

UBOOT_UPSTREAM_REV = "b29661fc1151077776454288051bc9a488351ce8"
UBOOT_MACHINES = "gta01bv2 gta01bv3 gta01bv4 gta02v2 gta02v3 gta02v4 gta02v5"
SRCREV_FORMAT = "+gitupstream+svnpatchset"

PV = "1.3.1${SRCREV}"
PR = "r3"

PROVIDES = "virtual/bootloader"
S = "${WORKDIR}/git"

SRC_URI = "\
  git://www.denx.de/git/u-boot.git;protocol=git;tag=${UBOOT_UPSTREAM_REV};name=upstream \
  svn://svn.openmoko.org/trunk/src/target/u-boot;module=patches;proto=http;name=patchset \
  file://uboot-20070311-tools_makefile_ln_sf.patch;patch=1 \
#  file://makefile-no-dirafter.patch;patch=1 \
#  file://fix-data-abort-from-sd-ombug799.patch;patch=1 \
"

EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX}"
TARGET_LDFLAGS = ""

do_quilt() {
        mv ${WORKDIR}/patches ${S}/patches && cd ${S} && quilt push -av
        rm -Rf patches .pc
}

do_svnrev() {
	mv -f tools/setlocalversion tools/setlocalversion.old
	echo "echo ${LOCALVERSION}" >>tools/setlocalversion
}

do_compile () {
        chmod +x board/neo1973/gta*/split_by_variant.sh
        for mach in ${UBOOT_MACHINES}
        do
                oe_runmake ${mach}_config
                oe_runmake clean
                find board -name lowlevel_foo.bin -exec rm '{}' \;
                oe_runmake all
                oe_runmake u-boot.udfu
                if [ -f u-boot.udfu ]; then
                        mv u-boot.udfu u-boot_${mach}.bin
                else
                        mv u-boot.bin u-boot_${mach}.bin
                fi
                if [ -f board/${mach}/lowlevel_foo.bin ]; then
                        mv board/${mach}/lowlevel_foo.bin \
                            lowlevel_foo_${mach}.bin
                else
                        find board -name lowlevel_foo.bin \
                            -exec mv '{}' lowlevel_foo_${mach}.bin \;
                fi
        done
}

do_deploy () {
	install -d ${DEPLOY_DIR_IMAGE}
	for mach in ${UBOOT_MACHINES}
	do
		install -m 0644 ${S}/u-boot_${mach}.bin ${DEPLOY_DIR_IMAGE}/u-boot-${mach}-${PV}-${PR}.bin
		ln -sf ${DEPLOY_DIR_IMAGE}/u-boot-${mach}-${PV}-${PR}.bin ${DEPLOY_DIR_IMAGE}/uboot-${mach}-latest.bin
		if [ -f ${S}/lowlevel_foo_${mach}.bin ]; then
			install -m 0644 ${S}/lowlevel_foo_${mach}.bin ${DEPLOY_DIR_IMAGE}/lowlevel_foo-${mach}-${PV}-${PR}.bin
			ln -sf ${DEPLOY_DIR_IMAGE}/lowlevel_foo-${mach}-${PV}-${PR}.bin ${DEPLOY_DIR_IMAGE}/lowlevel-foo-${mach}-latest.bin
		fi
	done
	install -m 0755 tools/mkimage ${STAGING_BINDIR_NATIVE}/uboot-mkimage
}

do_deploy[dirs] = "${S}"
addtask deploy before do_package after do_install
addtask quilt before do_patch after do_unpack
addtask svnrev before do_patch after do_quilt