blob: 6da28f36fc12914ac6bbe2cc0a4aac242da19dcf [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
Brad Bishop754b8fa2019-08-20 09:16:20 -040016 if [ -z "${type##*simpleImage*}" ] && [ ${ARCH} = "microblaze" ]; then
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080017 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
Brad Bishop754b8fa2019-08-20 09:16:20 -040026 if [ -z "${type##*simpleImage*}" ] && [ ${ARCH} = "microblaze" ]; then
Brad Bishop26bdd442019-08-16 17:08:17 -040027 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}