Compare commits

...

7 Commits

Author SHA1 Message Date
Samuel Dolt ae6c9d6a9f feat(cn9130-cf-pro): add u-boot update functionality to swupdate 2023-05-15 17:55:32 +02:00
Samuel Dolt 917f491c5f feat(coreos-image-swupdate.bbclass): add a way to dynamically extends the
sw-description files

The COREOS_SWUPDATE_EXTENDS_FOR and COREOS_IMAGE_SWUPDATE_EXTRACLASSES
variable can now be used to configure the coreos-image-swupdate to
dynamically extends some part of the sw-description by calling some
python function
2023-05-15 17:51:50 +02:00
Samuel Dolt d77f448f5c feat(beaglebone): use a GPT formatted disk image
BREAKING CHANGE: Support for MBR formatted disk is remove, as
it was only used for Beaglebone
2023-05-11 13:55:31 +02:00
Samuel Dolt 4eaf9a6f92 feat(swupdate): coreos-swupdate-helper integration
swupdate is now relying on coreos-swupdate-helper to get convert
a device abstracted path in the .swu file to the right partition
device file under /dev

Now, the efibooguard binary is updated as well

BREAKING CHANGE: .swu image generated can not be used on old
device, thus the device has to be reflashed.
2023-05-11 11:39:19 +02:00
Samuel Dolt 9678adeee6 feat(coreos-swupdate-helper): add recipe
coreos-swupdate-helper is a Rust utilities used to implement
an unified CoreOS update experience
2023-05-11 11:39:19 +02:00
Samuel Dolt f71746ead4 feat(coreos-all-features-dev): add new image for developement on target
The coreos-all-features-dev provide an image with most common
developer tools, like GCC, git, curl, wget, ...

This image can be used to install a prebuilt version of the Rust
compiler using binary from rust-lang.org, as at this time neither
meta-rust or oe-core can build a Rust compiler running on the
target.

This also include a small feature that allow an image to configure
the size of the RootFS partition on image created by WIC
2023-05-11 11:39:19 +02:00
Samuel Dolt 3bbee4c361 feat(layers): add meta-rust and meta-clang
meta-rust provide a more up to date version of rust that
the version included in oe-core

meta-clang provide the clang c/c++ compiler and libclang.
libclang is often used by Rust library to generate bindings to C
libraries via the bindgen tools.
2023-05-11 11:39:19 +02:00
22 changed files with 289 additions and 40 deletions

8
.gitmodules vendored
View File

@ -22,3 +22,11 @@
path = layers/meta-swupdate
url = ssh://git@bitbucket.gad.local:7999/ico/meta-swupdate.git
branch = kirkstone
[submodule "meta-clang"]
path = layers/meta-clang
url = ssh://git@bitbucket.gad.local:7999/ico/meta-clang.git
branch = kirkstone
[submodule "layers/meta-rust"]
path = layers/meta-rust
url = ssh://git@bitbucket.gad.local:7999/ico/meta-rust.git
branch = master

View File

@ -63,6 +63,11 @@ machine.
Firmware requirements
---------------------
.. warning::
CoreOS support at the moment only hardware that contains a block storage
device (SD Card, eMMC, ...) formatted with GPT. MBR disk or MTD device are
not supported.
ARM32 / AArch32 based machine
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -70,10 +75,7 @@ ARM32 / AArch32 based machine
The firmware for ARM32 should implement a subset of the UEFI specification, as
defined by the EBBR Specification. As this architecure is used on old hardware,
it's ok to use the part of the specification that are marked as deprecated or
legacy like:
- MBR partitionning instead of GPT
- Fixed offsets to firmware data
legacy.
We require the firmware to provide a DeviceTree based system description and not
an ACPI based table (as allowed by the specification).

View File

@ -59,12 +59,5 @@ QB_TCPSERIAL_OPT = "-device virtio-serial-device -chardev socket,id=virtcon,port
# No watchdog available yet
EFIBOOTGUARD_TIMEOUT ?= "0"
# MBR disk can't select the root device by partition label as MBR doesn't have
# a partition label. Using filesystem label only work with an initramfs and we
# don't support it yet.
COREOS_PLATFORM0_ROOT ?= "/dev/mmcblk0p3"
COREOS_PLATFORM1_ROOT ?= "/dev/mmcblk0p4"
require conf/machine/include/coreos-generic-features/efi.inc
require conf/machine/include/coreos-generic-features/legacy-mbr-disk.inc
require conf/machine/include/coreos-generic-features/emmc.inc

View File

@ -10,5 +10,6 @@ do_image_wic[depends] += "efibootguard-native:do_populate_sysroot efibootguard:d
WKS_PART_EFI ??= 'part --source efibootguard-efi --label efi --align 1024 --part-type=EF00'
WKS_PART_ROOT_A ??= 'part / --source rootfs --fstype=ext4 --label platform0 --align 1024'
WKS_PART_ROOT_B ??= 'part --fstype=ext4 --label platform1 --align 1024'
WKS_PART_ROOT_SIZE ??= '2G'
WKS_PART_EFIBOOTGUARD_A ??= 'part --source efibootguard-boot --label boot0 --align 1024 --part-type=0700 --sourceparams "watchdog=${EFIBOOTGUARD_TIMEOUT},revision=2,kernel=kernel0-${MACHINE}.efi;KERNEL0.EFI"'
WKS_PART_EFIBOOTGUARD_B ??= 'part --source efibootguard-boot --label boot1 --align 1024 --part-type=0700 --sourceparams "watchdog=${EFIBOOTGUARD_TIMEOUT},revision=1,kernel=kernel1-${MACHINE}.efi;KERNEL1.EFI"'

View File

@ -2,10 +2,6 @@
# MBR disk are still supported by CoreOS, but only for legacy product
# This ensure that efibootguard / swupdate work with MBR disk
# Do not include this file in a machine configuration if the machine support
# a GPT disk instead
COREOS_DISK_PARTLABEL_LOOKUP_DIRECTORY ?= "/dev/disk/by-label"
# MBR can't disk can't use partition label, but may use filesystem label
# This will only work with an initramfs. If no initramfs is used, this will
# have to be set to the right disk device inside the machine configuration

View File

@ -1,11 +1,20 @@
# short-description: Create SD card image for Beaglebone
# long-description: Creates a partitioned SD card image for Beaglebone.
# Boot files are located in the first vfat partition.
part --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4 --size 32M --extra-space 0 --overhead-factor 1
${WKS_PART_EFI} --ondisk mmcblk0 --align 1024 --size 32M --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_A} --ondisk mmcblk0 --size 2G --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_B} --ondisk mmcblk0 --size 2G --extra-space 0 --overhead-factor 1
# offset 1S => 1 sector (1x512 byte)
# The bootloader can be at 4 different position in raw mode: 0S, 256S, 512S, 768S
# MBR disk use only the sector 0, so 1S is free
# GPT disk use sector 0-33S, so first free slot is 256S
# Offset are from the BBB default settings
part --offset 256S --source rawcopy --sourceparams="file=MLO" --ondisk mmcblk0
part --offset 768S --source rawcopy --sourceparams="file=u-boot.img" --ondisk mmcblk0
# Let's define a 4MiB maximum size for the bootloader
# 4MiB => 4*1024*1024/512=8192S | 768S + 8192S => 8960S
${WKS_PART_EFI} --ondisk mmcblk0 --offset 8960S --align 1024 --size 32M --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_A} --ondisk mmcblk0 --size ${WKS_PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_B} --ondisk mmcblk0 --size ${WKS_PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_EFIBOOTGUARD_A} --ondisk mmcblk0 --align 1024 --size 128M --extra-space 0 --overhead-factor 1
${WKS_PART_EFIBOOTGUARD_B} --ondisk mmcblk0 --align 1024 --size 128M --extra-space 0 --overhead-factor 1
bootloader --ptable msdos
bootloader --ptable gpt

View File

@ -7,9 +7,6 @@
# Swupdate image generation
# ==============================================================================
# Machine using MBR override this value, see legacy-mbr-disk.inc
COREOS_DISK_PARTLABEL_LOOKUP_DIRECTORY ??= "/dev/disk/by-partlabel"
IMAGE_FSTYPES:append = " ext4.zst"
python () {
image = d.getVar('IMAGE_BASENAME')
@ -19,9 +16,14 @@ python () {
inherit swupdate-image
# Ensure than variable used in the sw-description files are watched for change
do_swuimage[vardeps] += "COREOS_KERNEL0_FILENAME COREOS_KERNEL1_FILENAME EFIBOOTGUARD_TIMEOUT COREOS_DISK_PARTLABEL_LOOKUP_DIRECTORY APPEND"
do_swuimage[vardeps] += "COREOS_KERNEL0_FILENAME COREOS_KERNEL1_FILENAME EFIBOOTGUARD_TIMEOUT EFIDIR EFI_BOOT_IMAGE COREOS_EFIBOOTGUARD_FILENAME"
do_swuimage[deptask] += "do_bundle_uki"
SWUPDATE_IMAGES += "${COREOS_KERNEL0_NAME} ${COREOS_KERNEL1_NAME}"
COREOS_EFIBOOTGUARD_NAME ?= "efibootguard${EFI_ARCH}"
COREOS_EFIBOOTGUARD_EXT ?= ".efi"
COREOS_EFIBOOTGUARD_FILENAME = "${COREOS_EFIBOOTGUARD_NAME}${COREOS_EFIBOOTGUARD_EXT}"
SWUPDATE_IMAGES += "${COREOS_KERNEL0_NAME} ${COREOS_KERNEL1_NAME} ${COREOS_EFIBOOTGUARD_NAME}"
python () {
kernel0 = d.getVar('COREOS_KERNEL0_NAME')
@ -29,6 +31,45 @@ python () {
kernelext = d.getVar('COREOS_KERNEL_EXT')
d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", kernel0, kernelext)
d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", kernel1, kernelext)
efibootguard = d.getVar('COREOS_EFIBOOTGUARD_NAME')
efibootguardext = d.getVar('COREOS_EFIBOOTGUARD_EXT')
d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", efibootguard, efibootguardext)
}
FILESEXTRAPATHS:append := ":${COREOS_ROOT}/layers/meta-belden-coreos/files"
# Space seperated list of extension points
COREOS_SWUPDATE_EXTENDS_FOR ??= ""
def coreos_swupdate_extends(d, s, key):
"""
Extends the swupdate for each extension points defined by COREOS_SWUPDATE_EXTENDS_FOR
"""
extends_for = d.getVar('COREOS_SWUPDATE_EXTENDS_FOR', True).replace("-", "_").split()
def kv_to_sw_description(kv):
swdescr = ",{\n"
for key, value in kv.items():
swdescr += f'{key} = "{value}";\n'
swdescr += "}\n"
return swdescr
text = ""
# BSP and Distro can extends the swupdate by implementing some python
# function that return a list of dictionary.
for extension_point in extends_for:
try:
kv_list = globals()[f"coreos_swupdate_extends_{key}_for_{extension_point}"](d,s)
except KeyError:
# Don't fail if the extension is not implemented
pass
else:
for kv in kv_list:
text += kv_to_sw_description(kv)
return text
COREOS_IMAGE_SWUPDATE_EXTRACLASSES ?= ""
inherit ${COREOS_IMAGE_SWUPDATE_EXTRACLASSES}

View File

@ -24,6 +24,11 @@ FEATURE_PACKAGES_cockpit = "packagegroup-coreos-cockpit ${@get_feature_packages_
# *-dev-tools FEATURES_PACKAGES for any image features
FEATURE_PACKAGES_dev-tools = "${@get_feature_packages_with_suffix('dev-tools', d)}"
FEATURE_PACKAGES_tools-debug = "packagegroup-core-tools-debug"
FEATURE_PACKAGES_tools-profile = "packagegroup-core-tools-profile"
FEATURE_PACKAGES_tools-sdk = "packagegroup-core-sdk packagegroup-core-standalone-sdk-target"
def get_feature_packages_with_suffix(suffix, d):
"""
For each feature inside IMAGE_FEATURES, look if a FEATURE_PACKAGE variable

View File

@ -63,6 +63,9 @@ SDK_VERSION[vardepvalue] = "${SDK_VERSION}"
SDK_NAME = "${DISTRO}-${TCLIBC}-${SDKMACHINE}-${IMAGE_BASENAME}-${TUNE_PKGARCH}-${MACHINE}"
SDKPATHINSTALL = "/opt/${DISTRO}/${SDK_VERSION}"
# When building an SDK, clang should be installed as well as GCC by default
CLANGSDK = "1"
# EFI and Secure boot
# ==============================================================================
@ -78,3 +81,9 @@ INHERIT += "coreos-efi-secureboot"
#PREFERRED_PROVIDER_virtual/runc = "crun"
PACKAGECONFIG:append:pn-podman = " rootless"
DISTRO_FEATURES_DEFAULT += "virtualization seccomp ipv6"
# meta-rust configuration
# ==============================================================================
RUST_VERSION ?= "1.66.1"
require conf/distro/include/rust_versions.inc

View File

@ -15,6 +15,8 @@ LAYERDEPENDS_meta-belden-coreos = "\
networking-layer \
virtualization-layer \
webserver \
clang-layer \
rust-layer \
"
LAYERSERIES_COMPAT_meta-belden-coreos = "kirkstone"

View File

@ -12,26 +12,39 @@ software =
installed-directly = true;
# partlabel are stored inside the GPT partition table.
# The partition table is flashed only once and never updated
device = "@@COREOS_DISK_PARTLABEL_LOOKUP_DIRECTORY@@/platform0";
device = "/var/run/coreos/rootdisk/partitions/root/updatable";
type = "raw";
sha256 = "$swupdate_get_sha256(@@PN@@-@@MACHINE@@.ext4.zst)";
}
# Don't remove the trailing whitspace on the next line otherwise
# it will not work due to a regex bug in meta-swupdate
$coreos_swupdate_extends(images)
);
files: (
{
filename = "@@COREOS_KERNEL0_FILENAME@@";
path = "/KERNEL.EFI";
device = "@@COREOS_DISK_PARTLABEL_LOOKUP_DIRECTORY@@/boot0";
device = "/var/run/coreos/rootdisk/partitions/ebg/updatable";
filesystem = "vfat";
sha256 = "$swupdate_get_sha256(@@COREOS_KERNEL0_FILENAME@@)";
},
{
filename = "@@COREOS_EFIBOOTGUARD_FILENAME@@";
path = "@@EFIDIR@@/@@EFI_BOOT_IMAGE@@";
device = "/var/run/coreos/rootdisk/partitions/efi";
filesystem = "vfat";
sha256 = "$swupdate_get_sha256(@@COREOS_EFIBOOTGUARD_FILENAME@@)";
}
# Don't remove the trailing whitspace on the next line otherwise
# it will not work due to a regex bug in meta-swupdate
$coreos_swupdate_extends(files)
);
bootenv: (
{
name = "kernelparams";
value = "root=PARTLABEL=platform0 @@APPEND@@";
value = "";
},
{
name = "watchdog_timeout_sec";
@ -42,6 +55,9 @@ software =
value = "C:BOOT0:KERNEL.EFI";
}
# Don't remove the trailing whitspace on the next line otherwise
# it will not work due to a regex bug in meta-swupdate
$coreos_swupdate_extends(bootenv)
);
}
@ -53,25 +69,38 @@ software =
installed-directly = true;
# partlabel are stored inside the GPT partition table.
# The partition table is flashed only once and never updated
device = "@@COREOS_DISK_PARTLABEL_LOOKUP_DIRECTORY@@/platform1";
device = "/var/run/coreos/rootdisk/partitions/root/updatable";
type = "raw";
sha256 = "$swupdate_get_sha256(@@PN@@-@@MACHINE@@.ext4.zst)";
}
# Don't remove the trailing whitspace on the next line otherwise
# it will not work due to a regex bug in meta-swupdate
$coreos_swupdate_extends(images)
);
files: (
{
filename = "@@COREOS_KERNEL1_FILENAME@@";
path = "/KERNEL.EFI";
device = "@@COREOS_DISK_PARTLABEL_LOOKUP_DIRECTORY@@/boot1";
device = "/var/run/coreos/rootdisk/partitions/ebg/updatable";
filesystem = "vfat";
sha256 = "$swupdate_get_sha256(@@COREOS_KERNEL1_FILENAME@@)";
},
{
filename = "@@COREOS_EFIBOOTGUARD_FILENAME@@";
path = "@@EFIDIR@@/@@EFI_BOOT_IMAGE@@";
device = "/var/run/coreos/rootdisk/partitions/efi";
filesystem = "vfat";
sha256 = "$swupdate_get_sha256(@@COREOS_EFIBOOTGUARD_FILENAME@@)";
}
# Don't remove the trailing whitspace on the next line otherwise
# it will not work due to a regex bug in meta-swupdate
$coreos_swupdate_extends(files)
);
bootenv: (
{
name = "kernelparams";
value = "root=PARTLABEL=platform1 @@APPEND@@";
value = "";
},
{
name = "watchdog_timeout_sec";
@ -82,6 +111,9 @@ software =
value = "C:BOOT1:KERNEL.EFI";
}
# Don't remove the trailing whitspace on the next line otherwise
# it will not work due to a regex bug in meta-swupdate
$coreos_swupdate_extends(bootenv)
);
}
}

View File

@ -0,0 +1,16 @@
require coreos-image-all-features.bb
# To develop on the target, we need more space
# Ensute that the rootfs image and the sdcard partition are 12G wide
# This means that you will need at least a 32GB SDCard
IMAGE_ROOTFS_SIZE = "12582000"
IMAGE_ROOTFS_EXTRA_SPACE = "0"
WKS_PART_ROOT_SIZE = "12G"
IMAGE_FEATURES:append = " \
dev-pkgs \
doc-pkgs \
tools-sdk \
"
IMAGE_INSTALL:append = " git wget curl vim rsync clang"

View File

@ -0,0 +1,8 @@
# libudev (from systemd) and pkgconfig are needed
DEPENDS += "pkgconfig-native systemd"
# Install all the configuration files to /etc/coreos-swupdate-helper
do_install:append() {
install -d ${D}/${sysconfdir}/coreos-swupdate-helper
install -m 0644 ${S}/config/* ${D}/${sysconfdir}/coreos-swupdate-helper
}

View File

@ -0,0 +1,99 @@
# Auto-Generated by cargo-bitbake 0.3.16
#
inherit cargo
# If this is git based prefer versioned ones if they exist
# DEFAULT_PREFERENCE = "-1"
# how to get coreos-swupdate-helper could be as easy as but default to a git checkout:
# SRC_URI += "crate://crates.io/coreos-swupdate-helper/0.1.0"
SRC_URI += "git://git@bitbucket.gad.local:7999/ico/coreos-swupdate-helper.git;protocol=ssh;branch=main"
SRCREV = "77caf94a18c7cb6b41f0b85acf661c49f27c068b"
S = "${WORKDIR}/git"
CARGO_SRC_DIR = ""
PV:append = ".AUTOINC+77caf94a18"
# please note if you have entries that do not begin with crate://
# you must change them to how that package can be fetched
SRC_URI += " \
crate://crates.io/aho-corasick/1.0.1 \
crate://crates.io/anstream/0.3.2 \
crate://crates.io/anstyle-parse/0.2.0 \
crate://crates.io/anstyle-query/1.0.0 \
crate://crates.io/anstyle-wincon/1.0.1 \
crate://crates.io/anstyle/1.0.0 \
crate://crates.io/anyhow/1.0.71 \
crate://crates.io/async-trait/0.1.68 \
crate://crates.io/bitflags/1.3.2 \
crate://crates.io/cc/1.0.79 \
crate://crates.io/cfg-if/1.0.0 \
crate://crates.io/clap-verbosity-flag/2.0.1 \
crate://crates.io/clap/4.2.7 \
crate://crates.io/clap_builder/4.2.7 \
crate://crates.io/clap_derive/4.2.0 \
crate://crates.io/clap_lex/0.4.1 \
crate://crates.io/colorchoice/1.0.0 \
crate://crates.io/config/0.13.3 \
crate://crates.io/env_logger/0.10.0 \
crate://crates.io/errno-dragonfly/0.1.2 \
crate://crates.io/errno/0.3.1 \
crate://crates.io/heck/0.4.1 \
crate://crates.io/hermit-abi/0.3.1 \
crate://crates.io/humantime/2.1.0 \
crate://crates.io/io-lifetimes/1.0.10 \
crate://crates.io/is-terminal/0.4.7 \
crate://crates.io/lazy_static/1.4.0 \
crate://crates.io/libc/0.2.144 \
crate://crates.io/libudev-sys/0.1.4 \
crate://crates.io/linux-raw-sys/0.3.7 \
crate://crates.io/log/0.4.17 \
crate://crates.io/memchr/2.5.0 \
crate://crates.io/minimal-lexical/0.2.1 \
crate://crates.io/nom/7.1.3 \
crate://crates.io/once_cell/1.17.1 \
crate://crates.io/pathdiff/0.2.1 \
crate://crates.io/pkg-config/0.3.27 \
crate://crates.io/proc-macro2/1.0.56 \
crate://crates.io/quote/1.0.26 \
crate://crates.io/regex-syntax/0.7.1 \
crate://crates.io/regex/1.8.1 \
crate://crates.io/rustix/0.37.19 \
crate://crates.io/serde/1.0.162 \
crate://crates.io/serde_derive/1.0.162 \
crate://crates.io/strsim/0.10.0 \
crate://crates.io/syn/2.0.15 \
crate://crates.io/termcolor/1.2.0 \
crate://crates.io/toml/0.5.11 \
crate://crates.io/udev/0.7.0 \
crate://crates.io/unicode-ident/1.0.8 \
crate://crates.io/utf8parse/0.2.1 \
crate://crates.io/winapi-i686-pc-windows-gnu/0.4.0 \
crate://crates.io/winapi-util/0.1.5 \
crate://crates.io/winapi-x86_64-pc-windows-gnu/0.4.0 \
crate://crates.io/winapi/0.3.9 \
crate://crates.io/windows-sys/0.48.0 \
crate://crates.io/windows-targets/0.48.0 \
crate://crates.io/windows_aarch64_gnullvm/0.48.0 \
crate://crates.io/windows_aarch64_msvc/0.48.0 \
crate://crates.io/windows_i686_gnu/0.48.0 \
crate://crates.io/windows_i686_msvc/0.48.0 \
crate://crates.io/windows_x86_64_gnu/0.48.0 \
crate://crates.io/windows_x86_64_gnullvm/0.48.0 \
crate://crates.io/windows_x86_64_msvc/0.48.0 \
"
# FIXME: update generateme with the real MD5 of the license file
LIC_FILES_CHKSUM = " \
"
SUMMARY = "Helper script for SWUpdate on CoreOS"
HOMEPAGE = "ssh://git@bitbucket.gad.local:7999/ico/coreos-swupdate-helper.git"
LICENSE = "CLOSED"
# includes this file if it exists but does not fail
# this is useful for anything you may want to override from
# what cargo-bitbake generates.
include coreos-swupdate-helper-${PV}.inc
include coreos-swupdate-helper.inc

View File

@ -17,8 +17,8 @@ echo "Root partition is on device ${DISK_DEVICE_NAME} - type ${DISK_PARTITION_TY
if [ "${DISK_PARTITION_TYPE}" == "gpt" ]; then
ROOT_PARTLABEL=$(lsblk -dno PARTLABEL "${ROOT_PART}")
else
echo "Using MBR disk is less reliable than GPT disk!"
ROOT_PARTLABEL=$(lsblk -dno LABEL "${ROOT_PART}")
echo "Using MBR is not supported"
exit 1
fi
echo "Root partition label is ${ROOT_PARTLABEL}"
@ -37,3 +37,6 @@ case $ROOT_PARTLABEL in
exit 1
;;
esac
# Create needed symlinks in /var/run/coreos
coreos-swupdate-helper --config /etc/coreos-swupdate-helper/default.toml

View File

@ -1,7 +1,7 @@
# File in the swupdate subdirectory of this recipe should overwrite the
# same file in meta-swupdate
FILESEXTRAPATHS:prepend := "${THISDIR}/swupdate:"
RDEPENDS:${PN}:append = " efibootguard"
RDEPENDS:${PN}:append = " efibootguard coreos-swupdate-helper"
SRC_URI += "file://webserver-config.sh \
file://sw-collections-config.sh \

View File

@ -0,0 +1,21 @@
SWUPDATE_IMAGES += "flash-image"
SWUPDATE_IMAGES_FSTYPES[flash-image] = ".bin"
COREOS_SWUPDATE_EXTENDS_FOR:append = "cn913x"
def coreos_swupdate_extends_images_for_cn913x(d,s):
boot0 = {
"filename" : "flash-image.bin",
"installed-directly" : "true",
"device" : "/dev/mmcblk1",
"type" : "raw",
"sha256" : swupdate_get_sha256(d, s, "flash-image.bin"),
"offset" : "2M"
}
boot1 = boot0.copy()
boot1["offset"] = "6M"
return [boot0, boot1]

View File

@ -54,6 +54,7 @@ WKS_FILE = "cn913x-sdcard.wks.in"
IMAGE_FSTYPES += "wic.xz wic.bmap"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += " kernel-modules kernel-devicetree"
COREOS_IMAGE_SWUPDATE_EXTRACLASSES += " coreos-image-swupdate-cn913x"
# No watchdog available yet
EFIBOOTGUARD_TIMEOUT ?= "0"

View File

@ -8,13 +8,12 @@
# Current bootloader is about 1.8MB, so if we put it at 4096S and 12288S we
# have 4MiB between the first bootloader and the second copy of it
# tfa = TrustedFirmware-A
part --offset 4096S --source rawcopy --sourceparams="file=flash-image.bin" --ondisk mmcblk1
part --offset 12288S --source rawcopy --sourceparams="file=flash-image.bin" --ondisk mmcblk1
part --offset 4096S --source rawcopy --sourceparams="file=flash-image.bin" --ondisk mmcblk1 --size 4M --extra-space 0 --overhead-factor 1 --part-name fw0
part --offset 12288S --source rawcopy --sourceparams="file=flash-image.bin" --ondisk mmcblk1 --size 4M --extra-space 0 --overhead-factor 1 --part-name fw1
${WKS_PART_EFI} --ondisk mmcblk1 --offset 20480S --size 64M --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_A} --ondisk mmcblk1 --size 2G --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_B} --ondisk mmcblk1 --size 2G --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_A} --ondisk mmcblk1 --size ${WKS_PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_B} --ondisk mmcblk1 --size ${WKS_PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_EFIBOOTGUARD_A} --ondisk mmcblk1 --align 1024 --size 128M --extra-space 0 --overhead-factor 1
${WKS_PART_EFIBOOTGUARD_B} --ondisk mmcblk1 --align 1024 --size 128M --extra-space 0 --overhead-factor 1

1
layers/meta-clang Submodule

@ -0,0 +1 @@
Subproject commit 68ec449f97ffa58d835163581fc72afcb08f027b

1
layers/meta-rust Submodule

@ -0,0 +1 @@
Subproject commit e3082dc0728023b121d648da4c5c856943b5e425

View File

@ -19,4 +19,6 @@ BBLAYERS ?= " \
##COREOS_LAYERSDIR##/meta-virtualization \
##COREOS_LAYERSDIR##/meta-efibootguard \
##COREOS_LAYERSDIR##/meta-swupdate \
##COREOS_LAYERSDIR##/meta-clang \
##COREOS_LAYERSDIR##/meta-rust \
"