summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/imx-bootlets/imx-bootlets_10.12.01.bb
blob: d2f51fd3aab27b1476249463651bbed3004a96be (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
DESCRIPTION = "i.MXS boot streams"
LICENSE = "GPL-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"

PR = "r1"

SRC_URI = "http://download.ossystems.com.br/bsp/freescale/source/imx-bootlets-src-${PV}.tar.gz \
           file://linux-fix-paths.patch \
           file://linux_prep-fix-cmdlines.patch"

SRC_URI[md5sum] = "cf0ab3822dca694b930a051501c1d0e4"
SRC_URI[sha256sum] = "63f6068ae36884adef4259bbb1fe2591755718f22c46d0a59d854883dfab1ffc"

S = "${WORKDIR}/imx-bootlets-src-${PV}"

# Disable parallel building or it may fail to build.
PARALLEL_MAKE = ""

EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX}"

# Ensure machine defines the IMXBOOTLETS_MACHINE
python () {
	if not d.getVar("IMXBOOTLETS_MACHINE", True):
		PN = d.getVar("PN", True)
		FILE = os.path.basename(d.getVar("FILE", True))
		bb.debug(1, "To build %s, see %s for instructions on \
			     setting up your machine config" % (PN, FILE))
		raise bb.parse.SkipPackage("because IMXBOOTLETS_MACHINE is not set")
}

do_configure () {
    # Use machine specific binaries
    sed -i 's,@MACHINE@,${MACHINE},g' linux.bd
}

do_compile () {
    oe_runmake BOARD=${IMXBOOTLETS_MACHINE} linux_prep \
                                            boot_prep \
                                            power_prep
}

do_install () {
    install -d ${D}/boot/
    install -m 644 boot_prep/boot_prep power_prep/power_prep \
                   linux_prep/output-target/linux_prep linux.bd \
                   ${D}/boot
}

FILES_${PN} = "/boot"

do_deploy () {
    install -d ${DEPLOY_DIR_IMAGE}

	for f in boot_prep/boot_prep \
             power_prep/power_prep \
             linux_prep/output-target/linux_prep \
             linux.bd; do
        full_name="imx-bootlets-`basename $f`-${MACHINE}-${PV}-${PR}"
        symlink_name="imx-bootlets-`basename $f`-${MACHINE}"

        install -m 644 ${S}/$f ${DEPLOY_DIR_IMAGE}/$full_name
        (cd ${DEPLOY_DIR_IMAGE} ; rm -f $symlink_nake ; ln -sf $full_name $symlink_name)
    done
}

addtask deploy before do_build after do_compile

PACKAGE_ARCH = "${MACHINE_ARCH}"
COMPATIBLE_MACHINE = "(mxs)"