qemuboot, xen-image-minimal: enable runqemu for qemuarm Xen images
PATCH 1/1 qemuboot, xen-image-minimal: enable runqemu for qemuarm Xen images
From: Christopher Clark <[email protected]>
The Xen hypervisor built for Arm 32-bit targets can be launched with runqemu by providing a u-boot script and configuration for Qemu, which enables interactive testing of Xen images.
Add qemuboot-xen-u-boot.bbclass to add a new bitbake task for generating the u-boot script.
Update qemuboot-xen-defaults.bbclass to supply working default parameters for the qemuarm machine needed to boot successfully in testing.
--- classes/qemuboot-xen-defaults.bbclass | 16 +++ classes/qemuboot-xen-u-boot.bbclass | 128 +++++++++++++++++++ conf/distro/include/meta-virt-xen.inc | 1 + recipes-extended/images/xen-image-minimal.bb | 2 +- 4 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 classes/qemuboot-xen-u-boot.bbclass
classes/qemuboot-xen-defaults.bbclass +16 -0
@@ -10,6 +10,17 @@ DOM0_KERNEL ??= "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}" DOM0_KERNEL_LOAD_ADDR ??= "0x45000000" QB_XEN_DOMAIN_MODULES ??= "${DOM0_KERNEL}:${DOM0_KERNEL_LOAD_ADDR}:multiboot,kernel" +# Qemuboot for 32-bit Arm loads Xen via device loader parameter rather than +# kernel and boots using u-boot as bios +XEN_BINARY ??= "${DEPLOY_DIR_IMAGE}/xen-${MACHINE}" +QB_XEN_LOAD_ADDR ??= "0x46000000" +QB_OPT_APPEND:append:arm = " \ + -device loader,file=${XEN_BINARY},addr=${QB_XEN_LOAD_ADDR},force-raw=on \ + -device loader,file=${DOM0_KERNEL},addr=${DOM0_KERNEL_LOAD_ADDR} \ + -bios ${DEPLOY_DIR_IMAGE}/u-boot.bin \ + " +QB_DEFAULT_KERNEL:arm = "none" + # Qemuboot for 64-bit Arm uses the QB_DEFAULT_KERNEL method to load Xen # and the device loader option for the dom0 kernel: QB_OPT_APPEND:append:aarch64 = " \
@@ -17,6 +28,8 @@ QB_OPT_APPEND:append:aarch64 = " \ " QB_DEFAULT_KERNEL:aarch64 = "xen-${MACHINE}" +# 32-bit Arm: gic version 2 +QB_MACHINE:arm = "-machine virt -machine virtualization=true" # 64-bit Arm: gic version 3 QB_MACHINE:aarch64 = "-machine virt,gic-version=3 -machine virtualization=true"
@@ -25,6 +38,9 @@ QB_MACHINE:aarch64 = "-machine virt,gic-version=3 -machine virtualization=true" QB_MEM_VALUE ??= "512" QB_MEM = "-m ${QB_MEM_VALUE}" +# 32-bit Arm: qemuboot with a u-boot script image +QB_XEN_U_BOOT_SCR:arm = "boot.scr.uimg" + # 64-bit Arm: qemuboot with a device tree binary QB_DTB:aarch64 = "${IMAGE_NAME}.qemuboot.dtb" QB_DTB_LINK:aarch64 = "${IMAGE_LINK_NAME}.qemuboot.dtb"
classes/qemuboot-xen-u-boot.bbclass new file +128 -0
128 lines not on this page · raw message
conf/distro/include/meta-virt-xen.inc +1 -0
@@ -13,3 +13,4 @@ include ${@bb.utils.contains('MACHINE', 'raspberrypi4-64', \ # Set serial for working qemuboot console SERIAL_CONSOLES:qemuarm64 ?= "115200;ttyAMA0" +SERIAL_CONSOLES:qemuarm ?= "115200;ttyAMA0"
recipes-extended/images/xen-image-minimal.bb +1 -1
@@ -34,7 +34,7 @@ XEN_ACPI_PROCESSOR_MODULE:x86-64 = "kernel-module-xen-acpi-processor" LICENSE = "MIT" -inherit core-image qemuboot-xen-defaults qemuboot-xen-dtb qemuboot-testimage-network +inherit core-image qemuboot-xen-defaults qemuboot-xen-dtb qemuboot-testimage-network qemuboot-xen-u-boot do_check_xen_state() { if [ "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' yes', 'no', d)}" = "no" ]; then
Signature · 1 line
2.20.1
Hi Christopher,
Quoted 8 lines · Christopher Clark via lists.yoctoproject.org
From: Christopher Clark <[email protected]>
The Xen hypervisor built for Arm 32-bit targets can be launched with runqemu by providing a u-boot script and configuration for Qemu, which enables interactive testing of Xen images.
Quoted 5 lines
Add qemuboot-xen-u-boot.bbclass to add a new bitbake task for generating the u-boot script.
Update qemuboot-xen-defaults.bbclass to supply working default parameters for the qemuarm machine needed to boot successfully in testing.
The changes are very nice but I see 2 problems here:
- all variables are using the architecture (arm or aarch64) instead of using the platform (qemuarm, etc) which would prevent an other platform to be added (for example Xilinx board emulated by qemu).
- xen-image-minimal is now inheriting a lot of classes doing stuff for qemu even when you are building xen-image-minimal for an other board.
Could we switch to platform name in the classes instead of using the architecture ? Could we find a way to only include the qemu classes when building for qemu ?
We are working on making a generic class to be build a Xen device tree and this adding more and more things conflicting with our attempt.
Cheers
Bertrand
Quoted 211 lines
Signed-off-by Christopher Clark <[email protected]>---
classes/qemuboot-xen-defaults.bbclass | 16 +++ classes/qemuboot-xen-u-boot.bbclass | 128 +++++++++++++++++++ conf/distro/include/meta-virt-xen.inc | 1 + recipes-extended/images/xen-image-minimal.bb | 2 +- 4 files changed, 146 insertions(+), 1 deletion(-)create mode 100644 classes/qemuboot-xen-u-boot.bbclass
classes/qemuboot-xen-defaults.bbclass +0
-0@@ -10,6 +10,17 @@ DOM0_KERNEL ??= "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}"
DOM0_KERNEL_LOAD_ADDR??= "0x45000000"QB_XEN_DOMAIN_MODULES??= "${DOM0_KERNEL}:${DOM0_KERNEL_LOAD_ADDR}:multiboot,kernel"classes/qemuboot-xen-defaults.bbclass +11
-0+# Qemuboot for 32-bit Arm loads Xen via device loader parameter rather than +# kernel and boots using u-boot as bios +XEN_BINARY ??= "${DEPLOY_DIR_IMAGE}/xen-${MACHINE}" +QB_XEN_LOAD_ADDR ??= "0x46000000" +QB_OPT_APPEND:append:arm = " \ + -device loader,file=${XEN_BINARY},addr=${QB_XEN_LOAD_ADDR},force-raw=on \ + -device loader,file=${DOM0_KERNEL},addr=${DOM0_KERNEL_LOAD_ADDR} \ + -bios ${DEPLOY_DIR_IMAGE}/u-boot.bin \ + " +QB_DEFAULT_KERNEL:arm = "none" +# Qemuboot for 64-bit Arm uses the
QB_DEFAULT_KERNELmethod to load Xen# and the device loader option for the dom0 kernel: QB_OPT_APPEND:append:aarch64 = " \classes/qemuboot-xen-defaults.bbclass +0
-0@@ -17,6 +28,8 @@ QB_OPT_APPEND:append:aarch64 = " \ "QB_DEFAULT_KERNEL:aarch64 = "xen-${MACHINE}"
classes/qemuboot-xen-defaults.bbclass +2
-0+# 32-bit Arm: gic version 2 +QB_MACHINE:arm = "-machine virt -machine virtualization=true"# 64-bit Arm: gic version 3
QB_MACHINE:aarch64 = "-machine virt,gic-version=3 -machine virtualization=true"classes/qemuboot-xen-defaults.bbclass +0
-0@@ -25,6 +38,9 @@ QB_MACHINE:aarch64 = "-machine virt,gic-version=3 -machine virtualization=true"
QB_MEM_VALUE??= "512"QB_MEM= "-m ${QB_MEM_VALUE}"classes/qemuboot-xen-defaults.bbclass +3
-0+# 32-bit Arm: qemuboot with a u-boot script image +QB_XEN_U_BOOT_SCR:arm = "boot.scr.uimg" +# 64-bit Arm: qemuboot with a device tree binary QB_DTB:aarch64 = "${IMAGE_NAME}.qemuboot.dtb" QB_DTB_LINK:aarch64 = "${IMAGE_LINK_NAME}.qemuboot.dtb"
classes/qemuboot-xen-u-boot.bbclass new file +128
-0@@ -0,0 +1,128 @@ +# Enable booting Xen with qemuboot / runqemu: u-boot configuration +# +# Copyright (c) 2021-2022 Star Lab Corp. All rights reserved. +# +# Author: Christopher Clark <[email protected]> + +# Interface variables: +# +# QB_XEN_U_BOOT_SCR : +# If this variable is set, this class will generate the u-boot script image file. +# It must be set to the name of the compiled command file that u-boot will tftp +# from the image deploy directory during boot, currently: "boot.scr.uimg" +# +# QB_XEN_CMDLINE_EXTRA : +# A string to be appended to the default Xen hypervisor boot command line, +# for supplying Xen boot options. +# The device tree that this bbclass generates will contain Xen command +# line options to connect the Xen console to the Qemu serial port. +# +# QB_XEN_LOAD_ADDR : +# The hypervisor load address +# +# QB_XEN_DOM0_BOOTARGS : +# A string for specifying Dom0 boot options for the Xen section of the device +# tree. +# +# QB_XEN_UBOOT_SCR_TASK_DEPENDS: +# The task dependencies for the u-boot script generation. A default is provided. +# +# QB_XEN_DOMAIN_MODULES: +# A space-separated list of colon-separated entries: +# "<file for the module>:<load memory address>:<module compatibility string>" + +# Set the default value for this variable to empty: no file generated. +QB_XEN_U_BOOT_SCR ??= "" + +write_add_chosen_module() { + CMD_FILE="$1" + ADDR="$2" + SIZE="$3" + MODULE_TYPE="$4" + cat <<EOF >>"${CMD_FILE}" +fdt mknod /chosen module@${ADDR} +fdt set /chosen/module@${ADDR} compatible "multiboot,module" "${MODULE_TYPE}" +fdt set /chosen/module@${ADDR} reg <${ADDR} ${SIZE}> +EOF +} + +generate_xen_u_boot_conf() { + CMD_FILE="${B}/qemuboot-xen.cmd" + cat <<EOF >"${CMD_FILE}" +echo "Running u-boot launch script" +fdt addr 0x40000000 +fdt resize +echo "Device tree resized" + +fdt set /chosen \#address-cells <1> +fdt set /chosen \#size-cells <1> + +fdt set /chosen xen,xen-bootargs "console=dtuart dtuart=/pl011@9000000 ${QB_XEN_CMDLINE_EXTRA}" +fdt set /chosen xen,dom0-bootargs "${QB_XEN_DOM0_BOOTARGS}" +EOF + + if [ -z "${QB_XEN_DOMAIN_MODULES}" ]; then + bbwarn "No domain modules: please set QB_XEN_DOMAIN_MODULES" + fi + + for DOMAIN_MODULE in ${QB_XEN_DOMAIN_MODULES} + do + MODULE_FILE="$(echo ${DOMAIN_MODULE} | cut -f1 -d:)" + ADDR="$(echo ${DOMAIN_MODULE} | cut -f2 -d:)" + MODULE_TYPE="$(echo ${DOMAIN_MODULE} | cut -f3 -d:)" + RESOLVED_FILE="$(readlink -f ${MODULE_FILE})" + SIZE=$(printf '0x%x\n' $(stat -c '%s' "${RESOLVED_FILE}")) + [ "x${SIZE}" != "x0x0" ] || bbfatal No module: "${MODULE_FILE}" + write_add_chosen_module "${CMD_FILE}" "${ADDR}" "${SIZE}" "${MODULE_TYPE}" + done + + cat <<EOF >>"${CMD_FILE}" +fdt print /chosen + +echo Boot Xen +bootz ${QB_XEN_LOAD_ADDR} - 0x40000000 +EOF + + uboot-mkimage -A "${UBOOT_ARCH}" -T script -C none \ + -a 0x20000 -e 0x20000 \ + -d "${CMD_FILE}" "${CMD_FILE}.uimg" + + # u-boot tftps this filename from DEPLOY_DIR_IMAGE: + install -m 0644 "${CMD_FILE}.uimg" "${DEPLOY_DIR_IMAGE}/${QB_XEN_U_BOOT_SCR}" +} + +do_write_qemuboot_xen_u_boot_conf() { + # Not all architectures qemuboot with u-boot, so check to see if this + # is needed. This allows this bbclass file to be used in the same image + # recipe for multiple architectures. + + if [ -n "${QB_XEN_U_BOOT_SCR}" ] && [ -n "${QB_SYSTEM_NAME}" ] ; then + generate_xen_u_boot_conf + fi +} + +addtask do_write_qemuboot_xen_u_boot_conf after do_write_qemuboot_conf before do_image +# Task dependency: +# An expected common case is that the kernel for at least one of the initial +# domains (eg. dom0) is deployed from the virtual/kernel recipe, so +# add that as a task dependency here since the kernel size needs to be known +# for generating the device tree. +# Dependencies are only introduced if a device tree will be generated. +QB_XEN_UBOOT_SCR_TASK_DEPENDS ?= " \ + ${@[ ' \ + u-boot-tools-native:do_populate_sysroot \ + u-boot:do_deploy \ + virtual/kernel:do_deploy \ + ', ''][d.getVar('QB_XEN_U_BOOT_SCR') == '']} \ + " +do_write_qemuboot_xen_u_boot_conf[depends] = "${QB_XEN_UBOOT_SCR_TASK_DEPENDS}" + +def qemuboot_xen_u_boot_vars(d): + build_vars = ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE', + 'KERNEL_IMAGETYPE', 'IMAGE_NAME', 'IMAGE_LINK_NAME', + 'STAGING_DIR_NATIVE', 'STAGING_BINDIR_NATIVE', + 'STAGING_DIR_HOST', 'SERIAL_CONSOLES'] + return build_vars + [k for k in d.keys() if k.startswith('QB_')] + +do_write_qemuboot_xen_u_boot[vardeps] += "${@' '.join(qemuboot_xen_u_boot_vars(d))}" +do_write_qemuboot_xen_u_boot[vardepsexclude] += "TOPDIR"conf/distro/include/meta-virt-xen.inc +0
-0@@ -13,3 +13,4 @@ include ${@bb.utils.contains('MACHINE', 'raspberrypi4-64', \ # Set serial for working qemuboot consoleSERIAL_CONSOLES:qemuarm64 ?= "115200;ttyAMA0"
conf/distro/include/meta-virt-xen.inc +1
-0+SERIAL_CONSOLES:qemuarm ?= "115200;ttyAMA0"recipes-extended/images/xen-image-minimal.bb +0
-0@@ -34,7 +34,7 @@ XEN_ACPI_PROCESSOR_MODULE:x86-64 = "kernel-module-xen-acpi-processor"LICENSE = "MIT"
recipes-extended/images/xen-image-minimal.bb +1
-1-inherit core-image qemuboot-xen-defaults qemuboot-xen-dtb qemuboot-testimage-network +inherit core-image qemuboot-xen-defaults qemuboot-xen-dtb qemuboot-testimage-network qemuboot-xen-u-bootdo_check_xen_state() { if [ "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' yes', 'no', d)}" = "no" ]; then--
2.20.1
Quoted 8 lines
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7213): https://lists.yoctoproject.org/g/meta-virtualization/message/7213
Mute This Topic: https://lists.yoctoproject.org/mt/90633655/3619089
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Quoted 17 lines · Bertrand Marquis
Hi Christopher,
Quoted 8 lines · Christopher Clark via lists.yoctoproject.org
From: Christopher Clark <[email protected]>
The Xen hypervisor built for Arm 32-bit targets can be launched with runqemu by providing a u-boot script and configuration for Qemu, which enables interactive testing of Xen images.
Quoted 5 lines
Add qemuboot-xen-u-boot.bbclass to add a new bitbake task for generating the u-boot script.
Update qemuboot-xen-defaults.bbclass to supply working default parameters for the qemuarm machine needed to boot successfully in testing.
Quoted 6 lines
The changes are very nice but I see 2 problems here:
- all variables are using the architecture (arm or aarch64) instead of using the platform (qemuarm, etc) which would prevent an other platform to be added (for example Xilinx board emulated by qemu).
- xen-image-minimal is now inheriting a lot of classes doing stuff for qemu even when you are building xen-image-minimal for an other board.Could we switch to platform name in the classes instead of using the architecture ? Could we find a way to only include the qemu classes when building for qemu ?
Thanks for the review - this is helpful and I think that these can be addressed in a v2.
Quoted 1 line
We are working on making a generic class to be build a Xen device tree and this adding more and more things conflicting with our attempt.
OK - that sounds promising and I certainly do not want to be making it more difficult.
best,
Christopher
Quoted 225 lines
Cheers
BertrandQuoted 211 lines
Signed-off-by Christopher Clark <[email protected]>---
classes/qemuboot-xen-defaults.bbclass | 16 +++ classes/qemuboot-xen-u-boot.bbclass | 128 +++++++++++++++++++ conf/distro/include/meta-virt-xen.inc | 1 + recipes-extended/images/xen-image-minimal.bb | 2 +- 4 files changed, 146 insertions(+), 1 deletion(-)create mode 100644 classes/qemuboot-xen-u-boot.bbclass
classes/qemuboot-xen-defaults.bbclass +0
-0@@ -10,6 +10,17 @@ DOM0_KERNEL ??= "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}"
DOM0_KERNEL_LOAD_ADDR??= "0x45000000"QB_XEN_DOMAIN_MODULES??= "${DOM0_KERNEL}:${DOM0_KERNEL_LOAD_ADDR}:multiboot,kernel"classes/qemuboot-xen-defaults.bbclass +11
-0+# Qemuboot for 32-bit Arm loads Xen via device loader parameter rather than +# kernel and boots using u-boot as bios +XEN_BINARY ??= "${DEPLOY_DIR_IMAGE}/xen-${MACHINE}" +QB_XEN_LOAD_ADDR ??= "0x46000000" +QB_OPT_APPEND:append:arm = " \ + -device loader,file=${XEN_BINARY},addr=${QB_XEN_LOAD_ADDR},force-raw=on \ + -device loader,file=${DOM0_KERNEL},addr=${DOM0_KERNEL_LOAD_ADDR} \ + -bios ${DEPLOY_DIR_IMAGE}/u-boot.bin \ + " +QB_DEFAULT_KERNEL:arm = "none" +# Qemuboot for 64-bit Arm uses the
QB_DEFAULT_KERNELmethod to load Xen# and the device loader option for the dom0 kernel: QB_OPT_APPEND:append:aarch64 = " \classes/qemuboot-xen-defaults.bbclass +0
-0@@ -17,6 +28,8 @@ QB_OPT_APPEND:append:aarch64 = " \ "QB_DEFAULT_KERNEL:aarch64 = "xen-${MACHINE}"
classes/qemuboot-xen-defaults.bbclass +2
-0+# 32-bit Arm: gic version 2 +QB_MACHINE:arm = "-machine virt -machine virtualization=true"# 64-bit Arm: gic version 3
QB_MACHINE:aarch64 = "-machine virt,gic-version=3 -machine virtualization=true"classes/qemuboot-xen-defaults.bbclass +0
-0@@ -25,6 +38,9 @@ QB_MACHINE:aarch64 = "-machine virt,gic-version=3 -machine virtualization=true"
QB_MEM_VALUE??= "512"QB_MEM= "-m ${QB_MEM_VALUE}"classes/qemuboot-xen-defaults.bbclass +3
-0+# 32-bit Arm: qemuboot with a u-boot script image +QB_XEN_U_BOOT_SCR:arm = "boot.scr.uimg" +# 64-bit Arm: qemuboot with a device tree binary QB_DTB:aarch64 = "${IMAGE_NAME}.qemuboot.dtb" QB_DTB_LINK:aarch64 = "${IMAGE_LINK_NAME}.qemuboot.dtb"
classes/qemuboot-xen-u-boot.bbclass new file +128
-0@@ -0,0 +1,128 @@ +# Enable booting Xen with qemuboot / runqemu: u-boot configuration +# +# Copyright (c) 2021-2022 Star Lab Corp. All rights reserved. +# +# Author: Christopher Clark <[email protected]> + +# Interface variables: +# +# QB_XEN_U_BOOT_SCR : +# If this variable is set, this class will generate the u-boot script image file. +# It must be set to the name of the compiled command file that u-boot will tftp +# from the image deploy directory during boot, currently: "boot.scr.uimg" +# +# QB_XEN_CMDLINE_EXTRA : +# A string to be appended to the default Xen hypervisor boot command line, +# for supplying Xen boot options. +# The device tree that this bbclass generates will contain Xen command +# line options to connect the Xen console to the Qemu serial port. +# +# QB_XEN_LOAD_ADDR : +# The hypervisor load address +# +# QB_XEN_DOM0_BOOTARGS : +# A string for specifying Dom0 boot options for the Xen section of the device +# tree. +# +# QB_XEN_UBOOT_SCR_TASK_DEPENDS: +# The task dependencies for the u-boot script generation. A default is provided. +# +# QB_XEN_DOMAIN_MODULES: +# A space-separated list of colon-separated entries: +# "<file for the module>:<load memory address>:<module compatibility string>" + +# Set the default value for this variable to empty: no file generated. +QB_XEN_U_BOOT_SCR ??= "" + +write_add_chosen_module() { + CMD_FILE="$1" + ADDR="$2" + SIZE="$3" + MODULE_TYPE="$4" + cat <<EOF >>"${CMD_FILE}" +fdt mknod /chosen module@${ADDR} +fdt set /chosen/module@${ADDR} compatible "multiboot,module" "${MODULE_TYPE}" +fdt set /chosen/module@${ADDR} reg <${ADDR} ${SIZE}> +EOF +} + +generate_xen_u_boot_conf() { + CMD_FILE="${B}/qemuboot-xen.cmd" + cat <<EOF >"${CMD_FILE}" +echo "Running u-boot launch script" +fdt addr 0x40000000 +fdt resize +echo "Device tree resized" + +fdt set /chosen \#address-cells <1> +fdt set /chosen \#size-cells <1> + +fdt set /chosen xen,xen-bootargs "console=dtuart dtuart=/pl011@9000000 ${QB_XEN_CMDLINE_EXTRA}" +fdt set /chosen xen,dom0-bootargs "${QB_XEN_DOM0_BOOTARGS}" +EOF + + if [ -z "${QB_XEN_DOMAIN_MODULES}" ]; then + bbwarn "No domain modules: please set QB_XEN_DOMAIN_MODULES" + fi + + for DOMAIN_MODULE in ${QB_XEN_DOMAIN_MODULES} + do + MODULE_FILE="$(echo ${DOMAIN_MODULE} | cut -f1 -d:)" + ADDR="$(echo ${DOMAIN_MODULE} | cut -f2 -d:)" + MODULE_TYPE="$(echo ${DOMAIN_MODULE} | cut -f3 -d:)" + RESOLVED_FILE="$(readlink -f ${MODULE_FILE})" + SIZE=$(printf '0x%x\n' $(stat -c '%s' "${RESOLVED_FILE}")) + [ "x${SIZE}" != "x0x0" ] || bbfatal No module: "${MODULE_FILE}" + write_add_chosen_module "${CMD_FILE}" "${ADDR}" "${SIZE}" "${MODULE_TYPE}" + done + + cat <<EOF >>"${CMD_FILE}" +fdt print /chosen + +echo Boot Xen +bootz ${QB_XEN_LOAD_ADDR} - 0x40000000 +EOF + + uboot-mkimage -A "${UBOOT_ARCH}" -T script -C none \ + -a 0x20000 -e 0x20000 \ + -d "${CMD_FILE}" "${CMD_FILE}.uimg" + + # u-boot tftps this filename from DEPLOY_DIR_IMAGE: + install -m 0644 "${CMD_FILE}.uimg" "${DEPLOY_DIR_IMAGE}/${QB_XEN_U_BOOT_SCR}" +} + +do_write_qemuboot_xen_u_boot_conf() { + # Not all architectures qemuboot with u-boot, so check to see if this + # is needed. This allows this bbclass file to be used in the same image + # recipe for multiple architectures. + + if [ -n "${QB_XEN_U_BOOT_SCR}" ] && [ -n "${QB_SYSTEM_NAME}" ] ; then + generate_xen_u_boot_conf + fi +} + +addtask do_write_qemuboot_xen_u_boot_conf after do_write_qemuboot_conf before do_image +# Task dependency: +# An expected common case is that the kernel for at least one of the initial +# domains (eg. dom0) is deployed from the virtual/kernel recipe, so +# add that as a task dependency here since the kernel size needs to be known +# for generating the device tree. +# Dependencies are only introduced if a device tree will be generated. +QB_XEN_UBOOT_SCR_TASK_DEPENDS ?= " \ + ${@[ ' \ + u-boot-tools-native:do_populate_sysroot \ + u-boot:do_deploy \ + virtual/kernel:do_deploy \ + ', ''][d.getVar('QB_XEN_U_BOOT_SCR') == '']} \ + " +do_write_qemuboot_xen_u_boot_conf[depends] = "${QB_XEN_UBOOT_SCR_TASK_DEPENDS}" + +def qemuboot_xen_u_boot_vars(d): + build_vars = ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE', + 'KERNEL_IMAGETYPE', 'IMAGE_NAME', 'IMAGE_LINK_NAME', + 'STAGING_DIR_NATIVE', 'STAGING_BINDIR_NATIVE', + 'STAGING_DIR_HOST', 'SERIAL_CONSOLES'] + return build_vars + [k for k in d.keys() if k.startswith('QB_')] + +do_write_qemuboot_xen_u_boot[vardeps] += "${@' '.join(qemuboot_xen_u_boot_vars(d))}" +do_write_qemuboot_xen_u_boot[vardepsexclude] += "TOPDIR"conf/distro/include/meta-virt-xen.inc +0
-0@@ -13,3 +13,4 @@ include ${@bb.utils.contains('MACHINE', 'raspberrypi4-64', \ # Set serial for working qemuboot consoleSERIAL_CONSOLES:qemuarm64 ?= "115200;ttyAMA0"
conf/distro/include/meta-virt-xen.inc +1
-0+SERIAL_CONSOLES:qemuarm ?= "115200;ttyAMA0"recipes-extended/images/xen-image-minimal.bb +0
-0@@ -34,7 +34,7 @@ XEN_ACPI_PROCESSOR_MODULE:x86-64 = "kernel-module-xen-acpi-processor"LICENSE = "MIT"
recipes-extended/images/xen-image-minimal.bb +1
-1-inherit core-image qemuboot-xen-defaults qemuboot-xen-dtb qemuboot-testimage-network +inherit core-image qemuboot-xen-defaults qemuboot-xen-dtb qemuboot-testimage-network qemuboot-xen-u-bootdo_check_xen_state() { if [ "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' yes', 'no', d)}" = "no" ]; then--
2.20.1Quoted 8 lines
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7213): https://lists.yoctoproject.org/g/meta-virtualization/message/7213
Mute This Topic: https://lists.yoctoproject.org/mt/90633655/3619089
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.