Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • eclipse/oniro-core/oniro
  • landgraf/oniro
  • zyga/oniro
  • mrybczyn/oniro
  • agherzan/oniro
  • pcoval/oniro
  • tony3oo3/oniro
  • stefanschmidt/oniro
  • waykovalenko/oniro
  • bero/oniro
  • esben/oniro
  • robertd/oniro
  • pidge/oniro
  • shettygururaj/oniro
  • thierrye/oniro
  • sradakovi/oniro
  • dricci783/oniro
  • ektor5/oniro
  • fldn/oniro
  • lucafavaretto/oniro
  • lucazizolfi/oniro
  • artemkondratiuk/oniro
  • lucaseri/oniro
  • gwozdzcfs/oniro
  • kristis/oniro
  • brgl/oniro
  • heurtemattes/oniro
  • idlethread/oniro
  • lquach/oniro
  • ghassaneben/oniro
  • heurtemattes/oniro-bitbake
  • kzarka/oniro
  • heurtemattes/oniro-migration
  • pastanki/oniro
  • malowe/oniro
  • chaseqi/oniro
  • mrfrank/oniro
37 results
Show changes
Commits on Source (30)
Showing
with 274 additions and 30 deletions
......@@ -31,6 +31,44 @@
- when: manual
allow_failure: true
.linux-qemuarm-efi:
extends: [.build-wic-image, .check-abi]
variables:
MACHINE: qemuarm-efi
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_RECIPE_NAME: oniro-image-base-tests
# Set CI_ONIRO_BUILD_CACHE to "pub", overriding the value defined in the
# .build job. This enables sharing of download and sstate-cache created
# during this job.
#
# This is done assuming that there are no non-redistributable or otherwise
# tainted build intermediate files, downloads or published artifacts.
CI_ONIRO_BB_LOCAL_CONF_BB_GENERATE_MIRROR_TARBALLS: 1
CI_ONIRO_JOB_ARTIFACTS: "*.wic.* *.qemuboot.conf uefi.bin"
linux-qemuarm-efi-gcc:
extends: [.linux-qemuarm-efi, .toolchain-gcc]
linux-qemuarm-efi-clang:
extends: [.linux-qemuarm-efi, .toolchain-clang]
.linux-qemuarm64-efi:
extends: [.build-wic-image, .check-abi]
variables:
MACHINE: qemuarm64-efi
CI_ONIRO_BUILD_FLAVOUR: linux
CI_ONIRO_RECIPE_NAME: oniro-image-base-tests
# Set CI_ONIRO_BUILD_CACHE to "pub", overriding the value defined in the
# .build job. This enables sharing of download and sstate-cache created
# during this job.
#
# This is done assuming that there are no non-redistributable or otherwise
# tainted build intermediate files, downloads or published artifacts.
CI_ONIRO_BB_LOCAL_CONF_BB_GENERATE_MIRROR_TARBALLS: 1
CI_ONIRO_JOB_ARTIFACTS: "*.wic.* *.qemuboot.conf uefi.bin"
linux-qemuarm64-efi-gcc:
extends: [.linux-qemuarm64-efi, .toolchain-gcc]
linux-qemuarm64-efi-clang:
extends: [.linux-qemuarm64-efi, .toolchain-clang]
.linux-qemu-x86:
extends: [.build-wic-image, .check-abi]
variables:
......
......@@ -22,8 +22,8 @@ Supported machines (default in **bold**):
* **qemux86-64**
* qemux86
* qemuarm
* qemuarm64
* qemuarm64-efi
* qemuarm-efi
* seco-intel-b68 (SECO SBC-B68)
* seco-imx8mm-c61-2gb (SECO SBC-C61 2GB DRAM)
* seco-imx8mm-c61-4gb (SECO SBC-C61 4GB DRAM)
......
......@@ -14,3 +14,5 @@ This section details the support for virtual targets in |main_project_name|.
qemux86-64
qemux86
qemuarm64-efi
qemuarm-efi
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
.. include:: ../../definitions.rst
Qemu ARM 32bit
##############
.. contents::
:depth: 4
Overview
********
|main_project_name| supports running the software stack into an virtual
environment using Qemu.
Building an Oniro image
=======================
To clone the source code, perform the procedure in: :ref:`Setting up a repo
workspace <RepoWorkspace>`.
Building a Linux image
======================
Build Steps
-----------
1. Source the environment with proper template settings, flavour being *linux*
and target machine being *qemuarm-efi*. Pay attention to how relative
paths are constructed. The value of *TEMPLATECONF* is relative to the
location of the build directory *./build-oniro-linux*, that is going to be
created after this step:
.. code-block:: console
$ TEMPLATECONF=../oniro/flavours/linux . ./oe-core/oe-init-build-env build-oniro-linux
2. You will find yourself in the newly created build directory. Call *bitbake*
to build the image. For example, if you are using *oniro-image-base*
run the following command:
.. code-block:: console
$ MACHINE=qemuarm-efi bitbake oniro-image-base
Once the image is done, you can run the Qemu using the provided script wrapper:
.. code-block:: console
$ MACHINE=qemuarm-efi runqemu oniro-image-base slirp
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
.. include:: ../../definitions.rst
Qemu ARM 64bit
##############
.. contents::
:depth: 4
Overview
********
|main_project_name| supports running the software stack into an virtual
environment using Qemu.
Building an Oniro image
=======================
To clone the source code, perform the procedure in: :ref:`Setting up a repo
workspace <RepoWorkspace>`.
Building a Linux image
======================
Build Steps
-----------
1. Source the environment with proper template settings, flavour being *linux*
and target machine being *qemuarm64-efi*. Pay attention to how relative
paths are constructed. The value of *TEMPLATECONF* is relative to the
location of the build directory *./build-oniro-linux*, that is going to be
created after this step:
.. code-block:: console
$ TEMPLATECONF=../oniro/flavours/linux . ./oe-core/oe-init-build-env build-oniro-linux
2. You will find yourself in the newly created build directory. Call *bitbake*
to build the image. For example, if you are using *oniro-image-base*
run the following command:
.. code-block:: console
$ MACHINE=qemuarm64-efi bitbake oniro-image-base
Once the image is done, you can run the Qemu using the provided script wrapper:
.. code-block:: console
$ MACHINE=qemuarm64-efi runqemu oniro-image-base slirp
......@@ -14,6 +14,8 @@ Supported targets:
Supported machines (first is the default):
- qemux86-64
- qemux86
- qemuarm-efi
- qemuarm64-efi
- seco-intel-b68 (SECO SBC-B68)
- seco-imx8mm-c61-2gb (SECO SBC-C61 2GB DRAM)
- seco-imx8mm-c61-4gb (SECO SBC-C61 4GB DRAM)
......
......@@ -22,6 +22,8 @@
#
#MACHINE ?= "qemux86"
#MACHINE ?= "qemux86-64"
#MACHINE ?= "qemuarm-efi"
#MACHINE ?= "qemuarm64-efi"
#MACHINE ?= "seco-intel-b68"
#MACHINE ?= "seco-imx8mm-c61-2gb"
#MACHINE ?= "seco-imx8mm-c61-4gb"
......
......@@ -46,9 +46,6 @@ WKS_FILE:qemux86-64 ?= "x-gpt-efi-disk.wks.in"
WKS_FILE_DEPENDS:qemux86-64 += "ovmf"
WKS_FILE_DEPENDS:qemux86 += "ovmf"
WKS_FILE:qemu-generic-arm64 = "x-qemu-efi-disk.wks.in"
IMAGE_FSTYPES:qemu-generic-arm64 += "wic wic.qcow2"
WKS_FILE:seco-imx8mm-c61-2gb ?= "x-imx-uboot-bootpart.wks.in"
IMAGE_FSTYPES:seco-imx8mm-c61-2gb ?= "wic.gz wic.bmap"
......
......@@ -68,15 +68,10 @@ TCLIBC ?= "musl"
INIT_MANAGER = "systemd"
PREFERRED_VERSION_linux-yocto = "5.10%"
PREFERRED_PROVIDER_virtual/kernel:qemuarm = "linux-oniro"
PREFERRED_PROVIDER_virtual/kernel:qemuarm64 = "linux-oniro"
PREFERRED_PROVIDER_virtual/kernel:qemux86 = "linux-oniro"
PREFERRED_PROVIDER_virtual/kernel:qemux86-64 = "linux-oniro"
# qemu-generic-arm64 has issues booting past 5.10. See:
# https://git.yoctoproject.org/meta-arm/tree/meta-arm/conf/machine/generic-arm64.conf?id=c40fb5348b1d0f8c4a1ed779c8df6ba3cf411930
# When kernel version is bumped we will have to revisit here.
PREFERRED_PROVIDER_virtual/kernel_qemu-generic-arm64 = "linux-oniro"
PREFERRED_PROVIDER_virtual/kernel:qemuarm-efi = "linux-oniro"
PREFERRED_PROVIDER_virtual/kernel:qemuarm64-efi = "linux-oniro"
# Prefer GRUB as the EFI provider.
#
......@@ -92,7 +87,8 @@ MACHINE_FEATURES:qemux86-64 += "efi"
MACHINE_FEATURES:qemux86 += "efi"
# Add bootindex to qemu boot device to prevent boot order from being changed in ovmf file
# and not break boot order with EFI. See qemuboot.bbclass for more information
# and not break boot order with EFI. See qemuboot.bbclass for more information.
# We set it here for the machines we don't have control on.
QB_ROOTFS_EXTRA_OPT:qemux86-64 += ",bootindex=0"
QB_ROOTFS_EXTRA_OPT:qemux86 += ",bootindex=0"
......@@ -103,9 +99,6 @@ IMAGE_EFI_BOOT_FILES += "grubenv;EFI/BOOT/grubenv"
# (note r-provider is used below)
PREFERRED_RPROVIDER_virtual-grub-bootconf = "oniro-grub-bootconf"
# qemu-generic-arm64 specific requirements
PREFERRED_VERSION_optee-os:qemu-generic-arm64 = "3.14.0"
# Default to enabling serial debug console on RaspberryPi
ENABLE_UART ?= "1"
......
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
require conf/machine/include/qemu.inc
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
KCONFIG_MODE = "--alldefconfig"
MACHINE_EXTRA_RRECOMMENDS += "kernel-modules linux-firmware"
SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;hvc0"
SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
# This provides the bios for runqemu
EXTRA_IMAGEDEPENDS += "edk2-firmware"
IMAGE_FSTYPES += "wic wic.gz"
WKS_FILE ?= "x-gpt-efi-disk.wks.in"
# For runqemu
QB_MACHINE_VIRT_HIGHMEM ?= "on"
QB_MACHINE = "-machine virt,highmem=${QB_MACHINE_VIRT_HIGHMEM}"
QB_SMP = "-smp 4"
# For graphics to work we need to define the VGA device as well as the necessary USB devices
QB_GRAPHICS = "-device virtio-gpu-pci"
QB_OPT_APPEND = "-device qemu-xhci -device usb-tablet -device usb-kbd"
# Virtio Networking support
QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
QB_NETWORK_DEVICE = "-device virtio-net-pci,netdev=net0,mac=@MAC@"
# Virtio block device
QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw"
# Virtio serial console
QB_SERIAL_OPT = "-device virtio-serial-pci -chardev null,id=virtcon -device virtconsole,chardev=virtcon"
QB_TCPSERIAL_OPT = "-device virtio-serial-pci -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
# Boot the wic image via EFI
QB_DEFAULT_FSTYPE = "wic"
QB_DEFAULT_KERNEL = "none"
QB_DEFAULT_BIOS = "uefi.bin"
QB_ROOTFS_EXTRA_OPT += "bootindex=0"
EFI_PROVIDER = "grub-efi"
MACHINE_FEATURES += "efi"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
#@TYPE: Machine
#@NAME: qemuarm-efi
#@DESCRIPTION: Qemu Arm machine that boots via EFI.
DEFAULTTUNE ?= "cortexa15t-neon"
require conf/machine/include/arm/armv7a/tune-cortexa15.inc
require conf/machine/include/qemu-efi.inc
KERNEL_IMAGETYPE ?= "zImage"
# For runqemu
QB_SYSTEM_NAME = "qemu-system-arm"
QB_MACHINE_VIRT_HIGHMEM = "off"
QB_CPU = "-cpu cortex-a15"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
#@TYPE: Machine
#@NAME: qemuarm64-efi
#@DESCRIPTION: Qemu Arm64 machine that boots via EFI.
require conf/machine/include/arm/armv8a/tune-cortexa57.inc
require conf/machine/include/qemu-efi.inc
KERNEL_IMAGETYPE ?= "Image"
# For runqemu
QB_SYSTEM_NAME = "qemu-system-aarch64"
QB_MACHINE_VIRT_HIGHMEM = "on"
QB_CPU = "-cpu cortex-a57"
......@@ -33,20 +33,20 @@ echo "note: loaded SYSOTA_BOOT_ACTIVE=$SYSOTA_BOOT_ACTIVE SYSOTA_BOOT_TRY=$SYSOT
# Recover active slot if the file is corrupted.
if [ -z "$SYSOTA_BOOT_ACTIVE" ]; then
echo "warning: SYSOTA_BOOT_ACTIVE is unset, attempting recovery"
if [ -e "(hd0,gpt2)/boot/bzImage" -a -e "(hd0,gpt3)/boot/bzImage" ]; then
if [ -e "(hd0,gpt2)/boot/@KERNEL_IMAGETYPE@" -a -e "(hd0,gpt3)/boot/@KERNEL_IMAGETYPE@" ]; then
# Both slots are available, pick the more recent slot.
# TODO: handle rollback prevention flags (how?)
if [ "(hd0,gpt2)/boot/bzImage" -nt "(hd0,gpt3)/boot/bzImage" ]; then
if [ "(hd0,gpt2)/boot/@KERNEL_IMAGETYPE@" -nt "(hd0,gpt3)/boot/@KERNEL_IMAGETYPE@" ]; then
echo "note: recovered SYSOTA_BOOT_ACTIVE=A (slot A kernel is newer than slot B)"
set SYSOTA_BOOT_ACTIVE="A"
else
echo "note: recovered SYSOTA_BOOT_ACTIVE=B (slot B kernel is newer than slot A)"
set SYSOTA_BOOT_ACTIVE="B"
fi
elif [ -e "(hd0,gpt2)/boot/bzImage" ]; then
elif [ -e "(hd0,gpt2)/boot/@KERNEL_IMAGETYPE@" ]; then
echo "note: recovered SYSOTA_BOOT_ACTIVE=A"
set SYSOTA_BOOT_ACTIVE="A"
elif [ -e "(hd0,gpt3)/boot/bzImage" ]; then
elif [ -e "(hd0,gpt3)/boot/@KERNEL_IMAGETYPE@" ]; then
echo "note: recovered SYSOTA_BOOT_ACTIVE=B"
set SYSOTA_BOOT_ACTIVE="B"
else
......@@ -81,9 +81,9 @@ fi
# https://gitlab.eclipse.org/eclipse/oniro-core/sysota/-/wikis/Boot%20Assets%20Specification#efigrub
if [ "$SLOT" == "A" ]; then
# TODO pass root partition by partuuid.
linux "(hd0,gpt2)/boot/bzImage" root=/dev/sda2 rauc.slot=A $CMDLINE
linux "(hd0,gpt2)/boot/@KERNEL_IMAGETYPE@" root=/dev/sda2 rauc.slot=A $CMDLINE
elif [ "$SLOT" == "B" ]; then
linux "(hd0,gpt3)/boot/bzImage" root=/dev/sda3 rauc.slot=B $CMDLINE
linux "(hd0,gpt3)/boot/@KERNEL_IMAGETYPE@" root=/dev/sda3 rauc.slot=B $CMDLINE
else
echo "error: cannot select slot to boot from, halting"
halt
......
......@@ -16,3 +16,8 @@ TARGET_CFLAGS:remove = "-Werror=array-bounds"
# echo and halt modules, so that the GRUB boot script can print diagnostic
# messages or shut down on error.
GRUB_BUILDIN:append = " squash4 halt echo"
# TODO oe-core avoids armv7ve builds. This is more of a blanket fix because
# grub supports this arch. It doesn't support hardfp configuration that can't
# be forced into softfp with a compiler flag. qemuarm-efi defaults to softfp.
COMPATIBLE_HOST:qemuarm-efi = 'arm.*-(linux.*|freebsd.*)'
......@@ -16,3 +16,8 @@ TARGET_CFLAGS:remove = "-Werror=array-bounds"
# echo and halt modules, so that the GRUB boot script can print diagnostic
# messages or shut down on error.
GRUB_BUILDIN:append = " squash4 halt echo"
# TODO oe-core avoids armv7ve builds. This is more of a blanket fix because
# grub supports this arch. It doesn't support hardfp configuration that can't
# be forced into softfp with a compiler flag. qemuarm-efi defaults to softfp.
COMPATIBLE_HOST:qemuarm-efi = 'arm.*-(linux.*|freebsd.*)'
......@@ -16,7 +16,7 @@ SRC_URI = " \
file://grubenv \
"
inherit allarch deploy
inherit deploy
RPROVIDES:${PN} += "virtual-grub-bootconf"
......@@ -32,17 +32,18 @@ do_install() {
# testing.
install -d ${D}${EFI_FILES_PATH}
install -m 644 grub.cfg ${D}${EFI_FILES_PATH}/grub.cfg
sed -i "s/@KERNEL_IMAGETYPE@/${KERNEL_IMAGETYPE}/g" ${D}${EFI_FILES_PATH}/grub.cfg
install -m 644 grubenv ${D}${EFI_FILES_PATH}/grubenv
}
do_deploy() {
# Install the boot assets into DEPLOYDIR. The deploy bbclass
# eventually copies those into the boot partition.
install -m 644 ${WORKDIR}/grub.cfg ${DEPLOYDIR}
install -m 644 ${D}${EFI_FILES_PATH}/grub.cfg ${DEPLOYDIR}
# Unlike grub.cfg, nothing installs this file to the boot partition
# automatically. It is handled by extending IMAGE_EFI_BOOT_FILES from
# conf/distro/oniro-linux.conf.
install -m 644 ${WORKDIR}/grubenv ${DEPLOYDIR}
install -m 644 ${D}${EFI_FILES_PATH}/grubenv ${DEPLOYDIR}
}
# Cargo-cult from a similar recipe.
......@@ -52,3 +53,5 @@ FILES:${PN} = "\
${EFI_FILES_PATH}/grub.cfg \
${EFI_FILES_PATH}/grubenv \
"
PACKAGE_ARCH = "${MACHINE_ARCH}"
COMPATIBLE_MACHINE:qemuarm-efi = "qemuarm-efi"
EDK2_PLATFORM:qemuarm-efi = "ArmVirtQemu"
EDK2_PLATFORM_DSC:qemuarm-efi = "ArmVirtPkg/ArmVirtQemu.dsc"
EDK2_BIN_NAME:qemuarm-efi = "QEMU_EFI.fd"
COMPATIBLE_MACHINE:qemuarm64-efi = "qemuarm64-efi"
EDK2_PLATFORM:qemuarm64-efi = "ArmVirtQemu"
EDK2_PLATFORM_DSC:qemuarm64-efi = "ArmVirtPkg/ArmVirtQemu.dsc"
EDK2_BIN_NAME:qemuarm64-efi = "QEMU_EFI.fd"
......@@ -109,6 +109,12 @@ SYSOTA_BOOTLOADER_TYPE:qemux86 := "GRUB"
SYSOTA_MODEL:qemux86-64 := "QEMU Virtual Machine"
SYSOTA_BOOTLOADER_TYPE:qemux86-64 := "GRUB"
SYSOTA_MODEL:qemuarm-efi := "QEMU Virtual Machine"
SYSOTA_BOOTLOADER_TYPE:qemuarm-efi := "GRUB"
SYSOTA_MODEL:qemuarm64-efi := "QEMU Virtual Machine"
SYSOTA_BOOTLOADER_TYPE:qemuarm64-efi := "GRUB"
SYSOTA_MODEL:seco-intel-b68 := "B68 / Alvin"
SYSOTA_BOOTLOADER_TYPE:seco-intel-b68 := "GRUB"
......
......@@ -21,3 +21,6 @@ SRC_URI += "file://rauc.cfg"
# For the gcc-plugins build of the kernel we need to ensure the right include
# path for headers is picked up to use the natively build dependencies.
export HOSTCXXFLAGS = " -I${RECIPE_SYSROOT_NATIVE}/usr/include"
SRC_URI:append:qemuarm-efi = " file://defconfig"
SRC_URI:append:qemuarm64-efi = " file://defconfig"
......@@ -7,10 +7,6 @@ KMETA = "kernel-meta"
require recipes-kernel/linux/linux-yocto.inc
# board-specific branches
KBRANCH:qemuarm ?= "oniro/v5.10/hw/qemuarm"
SRCREV_machine:qemuarm ?= "b8d9461a3957dba555b1ae82481cf57f3ce9e8b1"
SRCREV_machine ?= "452ea6a15ed2ac74789b7b3513777cc94ea3b751"
SRCREV_meta ?= "3b283fa8d4068ff68457b93e07d321c6c06d37e0"
......@@ -32,7 +28,7 @@ PROVIDES="linux-oniro virtual/kernel"
KCONF_BSP_AUDIT_LEVEL = "1"
COMPATIBLE_MACHINE = "qemuarm|qemuarm64|qemux86|qemux86-64|qemuriscv64|qemuriscv32|qemu-generic-arm64"
COMPATIBLE_MACHINE = "^(qemuarm-efi|qemuarm64-efi|qemux86|qemux86-64|qemuriscv64|qemuriscv32)$"
# Functionality flags
KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
......