blob: 348d0a733e628ba3261ee0763d0564a2fddd5e03 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001python __anonymous () {
2 kerneltypes = set((d.getVar("KERNEL_IMAGETYPE") or "").split())
3 kerneltypes |= set((d.getVar("KERNEL_IMAGETYPES") or "").split())
4 if any(t.startswith("simpleImage.") for t in kerneltypes):
5 # Enable building of simpleImage
6 bb.build.addtask('do_prep_simpleimage', 'do_compile', 'do_configure', d)
7 uarch = d.getVar("UBOOT_ARCH")
8 if uarch == "microblaze":
9 d.appendVarFlag('do_prep_simpleimage', 'depends', ' virtual/dtb:do_populate_sysroot')
10}
11
12do_prep_simpleimage[dirs] += "${B}"
13do_prep_simpleimage () {
14 install -d ${B}/arch/${ARCH}/boot/dts
15 for type in ${KERNEL_IMAGETYPES} ; do
16 if [[ "${type}" =~ "simpleImage" ]] && [ ${ARCH} = "microblaze" ]; then
17 ext="${type##*.}"
Brad Bishop26bdd442019-08-16 17:08:17 -040018 # Microblaze simpleImage only works with dts file
19 cp ${RECIPE_SYSROOT}/boot/devicetree/${ext}.dts ${B}/arch/${ARCH}/boot/dts/
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080020 fi
21 done
22}
23
Brad Bishop26bdd442019-08-16 17:08:17 -040024do_deploy_append () {
25 for type in ${KERNEL_IMAGETYPES} ; do
26 if [[ "${type}" =~ "simpleImage" ]] && [ ${ARCH} = "microblaze" ]; then
27 base_name=${imageType}-${KERNEL_IMAGE_NAME}
28 install -m 0644 ${KERNEL_OUTPUT_DIR}/${type}.strip $deployDir/${base_name}.strip
29 install -m 0644 ${KERNEL_OUTPUT_DIR}/${type}.unstrip $deployDir/${base_name}.unstrip
30 symlink_name=${imageType}-${KERNEL_IMAGE_LINK_NAME}
31 ln -sf ${base_name}.strip $deployDir/${symlink_name}.strip
32 ln -sf ${base_name}.unstrip $deployDir/${symlink_name}.unstrip
33 fi
34 done
35}