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
Showing
with 257 additions and 94 deletions
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: MIT
# Add a new user named oniro with default password oniro
inherit extrausers
# This is a sha512 hash of the word "oniro"
# To generate a new password run the following command:
# $ mkpasswd -m sha512crypt
# WARNING: this is a temporary solution until we have a provisioning solution to set up the initial password
ONIRO_USER_PASSWORD ?= "\$6\$cI/pmFRW1S8seZ24\$e/7XAuVsOBgoAEmlKQnk54.jQEpRuQmmzik6.1Osaji7ca.04N70Ji.PN86sFXBvqwDGhhSr.jqZsDDA8OVuy."
ONIRO_USER_USERNAME = "oniro"
EXTRA_USERS_PARAMS = "\
useradd -p '${ONIRO_USER_PASSWORD}' ${ONIRO_USER_USERNAME}; \
"
IMAGE_INSTALL:append = " sudo"
# Add to secure_path:
# - /bin
# - /usr/bin
# - /usr/local/bin
# - /sbin
# - /usr/sbin
# - /usr/local/sbin
# Add oniro to the sudo users
init_user_oniro () {
echo "${ONIRO_USER_USERNAME} ALL=(ALL:ALL) ALL" > ${IMAGE_ROOTFS}/etc/sudoers.d/${ONIRO_USER_USERNAME}
echo "Defaults secure_path=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin" >> ${IMAGE_ROOTFS}/etc/sudoers.d/${ONIRO_USER_USERNAME}
}
ROOTFS_POSTPROCESS_COMMAND:append = " init_user_oniro;"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
# This class provides support for defining, at the level of the recipe, the
# required writable paths. It provides support for maintaining persistent or
......
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
inherit autotools
......
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
# Define the configuration set as per our distro policy
PACKAGECONFIG:pn-networkmanager = "nss systemd bluez5 wifi nmcli"
......@@ -11,3 +11,6 @@ PACKAGECONFIG:remove:pn-mosquitto = "dlt"
# We use NetworkManager as the default network manager (included in our
# reference images).
PACKAGECONFIG:remove:pn-systemd = "networkd wheel-group"
# Enable podman rootless support
PACKAGECONFIG:append:pn-podman = " rootless"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
# WIC configuration definitions that are meant to be common across the
# supported devices. This configuration is taking into consideration OTA design
......
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
ONIRO_FLAVOUR = "${@'${ONIRO_FLAVOUR_PRETTY}'.lower()}"
DISTRO = "oniro-${ONIRO_FLAVOUR}"
DISTRO_NAME = "Oniro Project Base ${ONIRO_FLAVOUR_PRETTY} Distro"
require conf/distro/include/security_flags.inc
INHERIT += "oniro-sanity"
BB_DANGLINGAPPENDS_WARNONLY:forcevariable = "0"
# Bump this each time bblayers.conf.sample changes incompatibly. For example,
# when integrating new layers.
ONIRO_REQUIRED_LAYERS_CONF_VERSION = "2"
# oe-core's sanity check sanity_check_conffiles function only runs the
# functions in BBLAYERS_CONF_UPDATE_FUNCS when the associated variable is not
# None. Making sure this variable has a default value, we force running the
# check even when ONIRO_LAYERS_CONF_VERSION is not defined - providing the
# relevant error message.
ONIRO_LAYERS_CONF_VERSION ??= "-1"
# Avoid including NVIDIA linux firmware packages due to license concerns. For
# more info checkout:
# https://gitlab.eclipse.org/eclipse/oniro-core/oniro/-/issues/834.
BAD_RECOMMENDATIONS:append = "\
linux-firmware-nvidia-license \
linux-firmware-nvidia-tegra-k1 \
linux-firmware-nvidia-tegra \
linux-firmware-gpu \
"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
require conf/distro/include/oniro.inc
require conf/distro/freertos.conf
require conf/distro/include/oniro.inc
DISTRO = "oniro-freertos"
DISTRO_NAME = "Oniro Project Base FreeRTOS Distro"
DISTRO_VERSION = "2.0.0-alpha"
ONIRO_FLAVOUR_PRETTY = "FreeRTOS"
DISTRO_VERSION = "2.0.99"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
DISTRO = "oniro-linux"
DISTRO_NAME = "Oniro Project Base Linux Distro"
DISTRO_VERSION = "2.0.0-alpha"
DISTRO_CODENAME = "dev"
ONIRO_FLAVOUR_PRETTY = "Linux"
DISTRO_VERSION = "2.0.99"
DISTRO_CODENAME = "2.0.99"
SDK_VENDOR = "-onirosdk"
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${DATE}', 'snapshot')}"
......@@ -19,13 +18,13 @@ DISTRO_VERSION[vardepsexclude] = "DATE"
SDK_VERSION[vardepsexclude] = "DATE"
# Override these in oniro based distros
ONIRO_DEFAULT_DISTRO_FEATURES = "largefile opengl ptest multiarch pam rauc security wayland vulkan"
ONIRO_DEFAULT_DISTRO_FEATURES = "largefile opengl ptest multiarch pam rauc security tpm tpm2 wayland vulkan virtualization"
ONIRO_DEFAULT_EXTRA_RDEPENDS = "packagegroup-core-boot"
ONIRO_DEFAULT_EXTRA_RRECOMMENDS = "kernel-module-af-packet"
# Remove some of the default Poky DISTRO_FEATURES_DEFAULT we inherited, but do not use.
# Removing this here allows us to readd them, if the end user requires them.
DISTRO_FEATURES_DEFAULT:remove = " nfs nfc 3g pcmcia x11"
DISTRO_FEATURES_DEFAULT:remove = " nfs nfc 3g pcmcia x11 debuginfod"
DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT} ${ONIRO_DEFAULT_DISTRO_FEATURES}"
......@@ -63,20 +62,15 @@ require conf/distro/include/oniro.inc
require conf/distro/include/oniro-wic.inc
require conf/distro/include/oniro-packageconfig.inc
TCLIBC = "musl"
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 +86,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,12 +98,44 @@ 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"
GPU_MEM:raspberrypi4-64 = "128"
GPU_MEM:raspberrypi-armv7 = "128"
SPLASH = "psplash-oniro"
# We run a read-only rootfs but we want shadow because it includes subid
# configuration used by podman in rootless mode.
ROOTFS_RO_UNNEEDED:remove = "shadow"
# Set default hostname to reflect the DISTRO
hostname:pn-base-files = "${DISTRO}-${MACHINE}"
#
# Add support for Raspberry Pi 4 (64) in the Raspberry Pi 4 (64) builds.
#
MACHINE_EXTRA_RRECOMMENDS:append:raspberrypi4-64 = "\
linux-firmware-rpidistro-bcm43430 \
linux-firmware-rpidistro-bcm43455 \
linux-firmware-rpidistro-bcm43456 \
linux-firmware-rpidistro-bcm43436 \
linux-firmware-rpidistro-bcm43436s \
bluez-firmware-rpidistro-bcm43430a1-hcd \
bluez-firmware-rpidistro-bcm43430b0-hcd \
bluez-firmware-rpidistro-bcm4345c0-hcd \
bluez-firmware-rpidistro-bcm4345c5-hcd \
"
RPI_KERNEL_DEVICETREE:raspberrypi4-64 = " \
broadcom/bcm2710-rpi-3-b.dtb \
broadcom/bcm2710-rpi-3-b-plus.dtb \
broadcom/bcm2837-rpi-3-b.dtb \
broadcom/bcm2710-rpi-cm3.dtb \
broadcom/bcm2710-rpi-zero-2.dtb \
broadcom/bcm2711-rpi-4-b.dtb \
broadcom/bcm2711-rpi-400.dtb \
broadcom/bcm2711-rpi-cm4.dtb \
"
# Don't advertise Raspberry Pi 4 as the machine in hostname to avoid confusion.
hostname:pn-base-files:raspberrypi4-64 = "${DISTRO}-raspberrypi"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
require conf/distro/include/oniro.inc
require conf/distro/zephyr.conf
DISTRO = "oniro-zephyr"
DISTRO_NAME = "Oniro Project Base Zephyr Distro"
DISTRO_VERSION = "2.0.0-alpha"
ONIRO_FLAVOUR_PRETTY = "Zephyr"
DISTRO_VERSION = "2.0.99"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
......@@ -20,6 +20,9 @@ LAYERDEPENDS_oniro-core = " \
networking-layer \
raspberrypi \
rauc \
security \
tpm-layer \
tpm2 \
"
LAYERSERIES_COMPAT_oniro-core = "kirkstone"
......
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: MIT
require conf/machine/include/qemu.inc
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
KCONFIG_MODE = "--alldefconfig"
MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
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: MIT
#@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"
# Use the qemuarma15 kernel config as the base config of this machine
KMACHINE = "qemuarma15"
# 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: MIT
#@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"
# Use the qemuarm64 kernel config as the base config of this machine
KMACHINE = "qemuarm64"
# For runqemu
QB_SYSTEM_NAME = "qemu-system-aarch64"
QB_MACHINE_VIRT_HIGHMEM = "on"
QB_CPU = "-cpu cortex-a57"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
# Make rootfstype defined based on ROOT_FSTYPE (selected by wic configuration)
CMDLINE_ROOT_FSTYPE = "rootfstype=${ROOT_FSTYPE} ro"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
# NOTE: This file is referenced from x-gpt-efi-disk.wks.in
# Please be careful when moving it around the tree.
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
set CMDLINE="console=ttyS0,115200 panic=60 rootwait quiet"
set CMDLINE="console=@SERIAL_CONSOLES@ panic=60 rootwait quiet"
# Find the boot partition. We need to know where to load from and save the
# environment to. The boot partition is saved into the ONIRO_GRUB_BOOT
......@@ -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
......@@ -72,6 +72,9 @@ else
set SLOT="$SYSOTA_BOOT_ACTIVE"
fi
timeout=@WIC_BOOTLOADER_TIMEOUT@
default=boot
# Load the kernel from a fixed location of the slot selected for booting.
# The partition identifiers below refer to the fixed sys-a and sys-b
# partitions.
......@@ -81,9 +84,13 @@ 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
menuentry 'boot' {
linux "(hd0,gpt2)/boot/@KERNEL_IMAGETYPE@" root=@RAUC_SLOT_A@ rauc.slot=A $CMDLINE
}
elif [ "$SLOT" == "B" ]; then
linux "(hd0,gpt3)/boot/bzImage" root=/dev/sda3 rauc.slot=B $CMDLINE
menuentry 'boot' {
linux "(hd0,gpt3)/boot/@KERNEL_IMAGETYPE@" root=@RAUC_SLOT_B@ rauc.slot=B $CMDLINE
}
else
echo "error: cannot select slot to boot from, halting"
halt
......
SPDX-FileCopyrightText: Huawei Inc.
SPDX-License-Identifier: MIT
\ No newline at end of file
# SPDX-FileCopyrightText: Huawei Inc.
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
# grub's MD-RAID1 implementation uses zero-length array tricks causing
# array-bounds warnings.
......@@ -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.*)'
# SPDX-FileCopyrightText: Huawei Inc.
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
# grub's MD-RAID1 implementation uses zero-length array tricks causing
# array-bounds warnings.
......@@ -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.*)'
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
SUMMARY = "GRUB configuration file specialized for Oniro reference images"
DESCRIPTION = "This GRUB configuration file has the following features: \
......@@ -15,11 +15,13 @@ SRC_URI = " \
file://grub.cfg \
file://grubenv \
"
inherit allarch deploy
require recipes-core/rauc/rauc-conf.inc
inherit deploy
RPROVIDES:${PN} += "virtual-grub-bootconf"
WIC_BOOTLOADER_TIMEOUT ?= "0"
# Get definitions of the EFI_ variables.
require conf/image-uefi.conf
......@@ -32,17 +34,24 @@ 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
baudrate=`echo "${SERIAL_CONSOLES}" | sed 's/\;.*//'`
ttydev=`echo "${SERIAL_CONSOLES}" | sed -e 's/^[0-9]*\;//' -e 's/ .*//'`
sed -i "s/@SERIAL_CONSOLES@/${ttydev},${baudrate}/g" ${D}${EFI_FILES_PATH}/grub.cfg
sed -i "s,@RAUC_SLOT_A@,${RAUC_SLOT_A},g" ${D}${EFI_FILES_PATH}/grub.cfg
sed -i "s,@RAUC_SLOT_B@,${RAUC_SLOT_B},g" ${D}${EFI_FILES_PATH}/grub.cfg
sed -i "s,@WIC_BOOTLOADER_TIMEOUT@,${WIC_BOOTLOADER_TIMEOUT},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 +61,5 @@ FILES:${PN} = "\
${EFI_FILES_PATH}/grub.cfg \
${EFI_FILES_PATH}/grubenv \
"
PACKAGE_ARCH = "${MACHINE_ARCH}"
# BIG FAT WARNING
# This recipe is plain old WRONG
# It's just there as a workaround to get things
# building with a properly built toolchain.
# THIS NEEDS TO GO AWAY
SRC_URI += " \
git://gitee.com/openharmony/device_hisilicon_hispark_pegasus.git;protocol=http \
file://pegasus-make-wifiiot.patch \
"
SRCREV = "0af23969365dad92c0b080f28caada4102a9a7da"
LICENSE = "MulanPSL-2.0"
LIC_FILES_CHKSUM = "file://NOTICE;md5=d8d6d3af7fa6ad0de5ba69a3520963f8"
S="${WORKDIR}/git"
DEPENDS = "libgcc"
# No clang support until the build system is fixed
TOOLCHAIN = "gcc"
inherit siteinfo
inherit siteconfig
do_compile () {
# Use the correct toolchain
TRIPLET=$(echo ${TARGET_PREFIX} |sed -e 's,-$,,')
if [ "$TRIPLET" != "riscv32-unknown-elf" ]; then
sed -i -e "s,riscv32-unknown-elf,$TRIPLET,g" sdk_liteos/build/make_scripts/usr.mk sdk_liteos/build/scripts/scons_env_cfg.py sdk_liteos/build/scripts/scons_utils.py sdk_liteos/config.gni sdk_liteos/factory.mk sdk_liteos/non_factory.mk
fi
# Passing -nostartfiles to ld is broken (and no longer accepted by current
# toolchains). -nostartfiles goes to cc, not ld.
sed -i -e 's, -nostartfiles,,' sdk_liteos/boot/loaderboot/module_config.mk sdk_liteos/boot/flashboot/module_config.mk sdk_liteos/build/make_scripts/config.mk
sed -i -e 's|, "-nostartfiles"||' sdk_liteos/boot/loaderboot/SConscript sdk_liteos/boot/flashboot/SConscript
sed -i -e 's|'-nostartfiles', ||' sdk_liteos/build/scripts/common_env.py
# Locate libgcc correctly
GCCVER="$(${TARGET_PREFIX}gcc --version |head -n1 |cut -d' ' -f3)"
sed -i -e "s,7\.3\.0,${GCCVER}," sdk_liteos/build/make_scripts/usr.mk sdk_liteos/build/scripts/scons_env_cfg.py
LIBGCC_PATH="${RECIPE_SYSROOT}/usr/lib/${TRIPLET}/${GCCVER}"
sed -i -e "s|-lgcc|-L${LIBGCC_PATH} -lgcc|" sdk_liteos/build/make_scripts/config.mk
cd sdk_liteos
make all
}