summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/baremetal-image.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes-recipe/baremetal-image.bbclass')
-rw-r--r--meta/classes-recipe/baremetal-image.bbclass25
1 files changed, 16 insertions, 9 deletions
diff --git a/meta/classes-recipe/baremetal-image.bbclass b/meta/classes-recipe/baremetal-image.bbclass
index d3377a92fa..b9a584351a 100644
--- a/meta/classes-recipe/baremetal-image.bbclass
+++ b/meta/classes-recipe/baremetal-image.bbclass
@@ -15,15 +15,6 @@
#
# See meta-skeleton for a working example.
-## Emulate image.bbclass
-# Handle inherits of any of the image classes we need
-IMAGE_CLASSES ??= ""
-IMGCLASSES = " ${IMAGE_CLASSES}"
-inherit ${IMGCLASSES}
-# Set defaults to satisfy IMAGE_FEATURES check
-IMAGE_FEATURES ?= ""
-IMAGE_FEATURES[type] = "list"
-IMAGE_FEATURES[validitems] += ""
# Toolchain should be baremetal or newlib based.
# TCLIBC="baremetal" or TCLIBC="newlib"
@@ -95,6 +86,11 @@ QB_DEFAULT_FSTYPE ?= "bin"
QB_DTB ?= ""
QB_OPT_APPEND:append = " -nographic"
+# QEMU x86 requires an .elf kernel to boot rather than a .bin
+QB_DEFAULT_KERNEL:qemux86 ?= "${IMAGE_LINK_NAME}.elf"
+# QEMU x86-64 refuses to boot from -kernel, needs a multiboot compatible image
+QB_DEFAULT_FSTYPE:qemux86-64 ?= "iso"
+
# RISC-V tunes set the BIOS, unset, and instruct QEMU to
# ignore the BIOS and boot from -kernel
QB_DEFAULT_BIOS:qemuriscv64 = ""
@@ -110,6 +106,17 @@ QB_OPT_APPEND:append:qemuriscv32 = " -bios none"
CFLAGS:append:qemuriscv64 = " -mcmodel=medany"
+## Emulate image.bbclass
+# Handle inherits of any of the image classes we need
+IMAGE_CLASSES ??= ""
+IMGCLASSES = " ${IMAGE_CLASSES}"
+inherit_defer ${IMGCLASSES}
+# Set defaults to satisfy IMAGE_FEATURES check
+IMAGE_FEATURES ?= ""
+IMAGE_FEATURES[type] = "list"
+IMAGE_FEATURES[validitems] += ""
+
+
# This next part is necessary to trick the build system into thinking
# its building an image recipe so it generates the qemuboot.conf
addtask do_rootfs before do_image after do_install