summaryrefslogtreecommitdiffstats
path: root/meta/classes/baremetal-image.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/baremetal-image.bbclass')
-rw-r--r--meta/classes/baremetal-image.bbclass38
1 files changed, 30 insertions, 8 deletions
diff --git a/meta/classes/baremetal-image.bbclass b/meta/classes/baremetal-image.bbclass
index 90d58f2615..81f5e5e93d 100644
--- a/meta/classes/baremetal-image.bbclass
+++ b/meta/classes/baremetal-image.bbclass
@@ -12,8 +12,8 @@
# Toolchain should be baremetal or newlib based.
# TCLIBC="baremetal" or TCLIBC="newlib"
-COMPATIBLE_HOST_libc-musl_class-target = "null"
-COMPATIBLE_HOST_libc-glibc_class-target = "null"
+COMPATIBLE_HOST:libc-musl:class-target = "null"
+COMPATIBLE_HOST:libc-glibc:class-target = "null"
inherit rootfs-postcommands
@@ -50,15 +50,18 @@ python do_rootfs(){
if os.path.lexists(manifest_link):
os.remove(manifest_link)
os.symlink(os.path.basename(manifest_name), manifest_link)
+ # A lot of postprocess commands assume the existence of rootfs/etc
+ sysconfdir = d.getVar("IMAGE_ROOTFS") + d.getVar('sysconfdir')
+ bb.utils.mkdirhier(sysconfdir)
+
execute_pre_post_process(d, d.getVar('ROOTFS_POSTPROCESS_COMMAND'))
}
# Assure binaries, manifest and qemubootconf are populated on DEPLOY_DIR_IMAGE
do_image_complete[dirs] = "${TOPDIR}"
-do_image_complete[umask] = "022"
SSTATETASKS += "do_image_complete"
-SSTATE_SKIP_CREATION_task-image-complete = '1'
+SSTATE_SKIP_CREATION:task-image-complete = '1'
do_image_complete[sstate-inputdirs] = "${IMGDEPLOYDIR}"
do_image_complete[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
do_image_complete[stamp-extra-info] = "${MACHINE_ARCH}"
@@ -74,7 +77,22 @@ QB_DEFAULT_KERNEL ?= "${IMAGE_LINK_NAME}.bin"
QB_MEM ?= "-m 256"
QB_DEFAULT_FSTYPE ?= "bin"
QB_DTB ?= ""
-QB_OPT_APPEND = "-nographic"
+QB_OPT_APPEND:append = " -nographic"
+
+# RISC-V tunes set the BIOS, unset, and instruct QEMU to
+# ignore the BIOS and boot from -kernel
+QB_DEFAULT_BIOS:qemuriscv64 = ""
+QB_DEFAULT_BIOS:qemuriscv32 = ""
+QB_OPT_APPEND:append:qemuriscv64 = " -bios none"
+QB_OPT_APPEND:append:qemuriscv32 = " -bios none"
+
+
+# Use the medium-any code model for the RISC-V 64 bit implementation,
+# since medlow can only access addresses below 0x80000000 and RAM
+# starts at 0x80000000 on RISC-V 64
+# Keep RISC-V 32 using -mcmodel=medlow (symbols lie between -2GB:2GB)
+CFLAGS:append:qemuriscv64 = " -mcmodel=medany"
+
# This next part is necessary to trick the build system into thinking
# its building an image recipe so it generates the qemuboot.conf
@@ -87,13 +105,17 @@ inherit qemuboot
python(){
# do_addto_recipe_sysroot doesnt exist for all recipes, but we need it to have
# /usr/bin on recipe-sysroot (qemu) populated
+ # The do_addto_recipe_sysroot dependency is coming from EXTRA_IMAGDEPENDS now,
+ # we just need to add the logic to add its dependency to do_image.
def extraimage_getdepends(task):
deps = ""
for dep in (d.getVar('EXTRA_IMAGEDEPENDS') or "").split():
# Make sure we only add it for qemu
if 'qemu' in dep:
- deps += " %s:%s" % (dep, task)
+ if ":" in dep:
+ deps += " %s " % (dep)
+ else:
+ deps += " %s:%s" % (dep, task)
return deps
- d.appendVarFlag('do_image', 'depends', extraimage_getdepends('do_addto_recipe_sysroot'))
- d.appendVarFlag('do_image', 'depends', extraimage_getdepends('do_populate_sysroot'))
+ d.appendVarFlag('do_image', 'depends', extraimage_getdepends('do_populate_sysroot'))
}