Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | python __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 | |
| 12 | do_prep_simpleimage[dirs] += "${B}" |
| 13 | do_prep_simpleimage () { |
| 14 | install -d ${B}/arch/${ARCH}/boot/dts |
| 15 | for type in ${KERNEL_IMAGETYPES} ; do |
Brad Bishop | 754b8fa | 2019-08-20 09:16:20 -0400 | [diff] [blame] | 16 | if [ -z "${type##*simpleImage*}" ] && [ ${ARCH} = "microblaze" ]; then |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 17 | ext="${type##*.}" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 18 | # Microblaze simpleImage only works with dts file |
| 19 | cp ${RECIPE_SYSROOT}/boot/devicetree/${ext}.dts ${B}/arch/${ARCH}/boot/dts/ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 20 | fi |
| 21 | done |
| 22 | } |
| 23 | |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 24 | do_deploy_append () { |
| 25 | for type in ${KERNEL_IMAGETYPES} ; do |
Brad Bishop | 754b8fa | 2019-08-20 09:16:20 -0400 | [diff] [blame] | 26 | if [ -z "${type##*simpleImage*}" ] && [ ${ARCH} = "microblaze" ]; then |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 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 | } |