summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core/classes-recipe/kernel-simpleimage.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta-xilinx-core/classes-recipe/kernel-simpleimage.bbclass')
-rw-r--r--meta-xilinx-core/classes-recipe/kernel-simpleimage.bbclass35
1 files changed, 35 insertions, 0 deletions
diff --git a/meta-xilinx-core/classes-recipe/kernel-simpleimage.bbclass b/meta-xilinx-core/classes-recipe/kernel-simpleimage.bbclass
new file mode 100644
index 00000000..110ee254
--- /dev/null
+++ b/meta-xilinx-core/classes-recipe/kernel-simpleimage.bbclass
@@ -0,0 +1,35 @@
1python __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 [ -z "${type##*simpleImage*}" ] && [ ${ARCH} = "microblaze" ]; then
17 ext="${type##*.}"
18 # Microblaze simpleImage only works with dts file
19 cp ${RECIPE_SYSROOT}/boot/devicetree/${ext}.dts ${B}/arch/${ARCH}/boot/dts/
20 fi
21 done
22}
23
24do_deploy:append () {
25 for type in ${KERNEL_IMAGETYPES} ; do
26 if [ -z "${type##*simpleImage*}" ] && [ ${ARCH} = "microblaze" ]; then
27 base_name=${type}-${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=${type}-${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}