aboutsummaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core/classes/kernel-simpleimage.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta-xilinx-core/classes/kernel-simpleimage.bbclass')
-rw-r--r--meta-xilinx-core/classes/kernel-simpleimage.bbclass35
1 files changed, 35 insertions, 0 deletions
diff --git a/meta-xilinx-core/classes/kernel-simpleimage.bbclass b/meta-xilinx-core/classes/kernel-simpleimage.bbclass
new file mode 100644
index 00000000..110ee254
--- /dev/null
+++ b/meta-xilinx-core/classes/kernel-simpleimage.bbclass
@@ -0,0 +1,35 @@
+python __anonymous () {
+ kerneltypes = set((d.getVar("KERNEL_IMAGETYPE") or "").split())
+ kerneltypes |= set((d.getVar("KERNEL_IMAGETYPES") or "").split())
+ if any(t.startswith("simpleImage.") for t in kerneltypes):
+ # Enable building of simpleImage
+ bb.build.addtask('do_prep_simpleimage', 'do_compile', 'do_configure', d)
+ uarch = d.getVar("UBOOT_ARCH")
+ if uarch == "microblaze":
+ d.appendVarFlag('do_prep_simpleimage', 'depends', ' virtual/dtb:do_populate_sysroot')
+}
+
+do_prep_simpleimage[dirs] += "${B}"
+do_prep_simpleimage () {
+ install -d ${B}/arch/${ARCH}/boot/dts
+ for type in ${KERNEL_IMAGETYPES} ; do
+ if [ -z "${type##*simpleImage*}" ] && [ ${ARCH} = "microblaze" ]; then
+ ext="${type##*.}"
+ # Microblaze simpleImage only works with dts file
+ cp ${RECIPE_SYSROOT}/boot/devicetree/${ext}.dts ${B}/arch/${ARCH}/boot/dts/
+ fi
+ done
+}
+
+do_deploy:append () {
+ for type in ${KERNEL_IMAGETYPES} ; do
+ if [ -z "${type##*simpleImage*}" ] && [ ${ARCH} = "microblaze" ]; then
+ base_name=${type}-${KERNEL_IMAGE_NAME}
+ install -m 0644 ${KERNEL_OUTPUT_DIR}/${type}.strip $deployDir/${base_name}.strip
+ install -m 0644 ${KERNEL_OUTPUT_DIR}/${type}.unstrip $deployDir/${base_name}.unstrip
+ symlink_name=${type}-${KERNEL_IMAGE_LINK_NAME}
+ ln -sf ${base_name}.strip $deployDir/${symlink_name}.strip
+ ln -sf ${base_name}.unstrip $deployDir/${symlink_name}.unstrip
+ fi
+ done
+}