summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core/recipes-bsp/cdo/extract-cdo_1.0.bb
blob: b2b69c38aa31bce1613b5b2492525c80a8e7f62e (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
DESCRIPTION = "Recipe to extract boot_files for qemu usage"

LICENSE = "CLOSED"

inherit deploy

PROVIDES = "virtual/cdo"

DEPENDS += "bootgen-native"

do_compile[depends] += "virtual/boot-bin:do_deploy"

COMPATIBLE_MACHINE = "^$"
COMPATIBLE_MACHINE:versal = "versal"
COMPATIBLE_MACHINE:versal-net = "versal-net"

PACKAGE_ARCH ?= "${MACHINE_ARCH}"

B = "${WORKDIR}/build"

BOOTGEN_CMD ?= "bootgen"
BOOTGEN_ARCH_DEFAULT = "undefined"
BOOTGEN_ARCH_DEFAULT:versal = "versal"
BOOTGEN_ARCH_DEFAULT:versal-net = "versalnet"
BOOTGEN_ARCH ?= "${BOOTGEN_ARCH_DEFAULT}"
BOOTGEN_OUTFILE ?= "${DEPLOY_DIR_IMAGE}/boot.bin"

# bootgen extracts the boot_files from the boot.bin. By default this happens in
# the same directory as the boot.bin. We need to move it to $B directory, as
# do_compile should never write into a deploy directory.
do_compile() {
    ${BOOTGEN_CMD} -arch ${BOOTGEN_ARCH} -dump_dir ${B} -dump ${BOOTGEN_OUTFILE} boot_files
}

do_install[noexec] = '1'

do_deploy() {
    install -d ${DEPLOYDIR}/CDO
    install -m 0644 ${B}/pmc_cdo.bin ${DEPLOYDIR}/CDO/pmc_cdo.bin
    ln -sf CDO/pmc_cdo.bin ${DEPLOYDIR}/pmc_cdo.bin
}

addtask deploy before do_build after do_install