Compare commits
7 Commits
HEAD
...
feat/coreo
| Author | SHA1 | Date |
|---|---|---|
|
|
ae6c9d6a9f | |
|
|
917f491c5f | |
|
|
d77f448f5c | |
|
|
4eaf9a6f92 | |
|
|
9678adeee6 | |
|
|
f71746ead4 | |
|
|
3bbee4c361 |
|
|
@ -22,3 +22,11 @@
|
||||||
path = layers/meta-swupdate
|
path = layers/meta-swupdate
|
||||||
url = ssh://git@bitbucket.gad.local:7999/ico/meta-swupdate.git
|
url = ssh://git@bitbucket.gad.local:7999/ico/meta-swupdate.git
|
||||||
branch = kirkstone
|
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
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,11 @@ machine.
|
||||||
Firmware requirements
|
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
|
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
|
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,
|
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
|
it's ok to use the part of the specification that are marked as deprecated or
|
||||||
legacy like:
|
legacy.
|
||||||
|
|
||||||
- MBR partitionning instead of GPT
|
|
||||||
- Fixed offsets to firmware data
|
|
||||||
|
|
||||||
We require the firmware to provide a DeviceTree based system description and not
|
We require the firmware to provide a DeviceTree based system description and not
|
||||||
an ACPI based table (as allowed by the specification).
|
an ACPI based table (as allowed by the specification).
|
||||||
|
|
|
||||||
|
|
@ -59,12 +59,5 @@ QB_TCPSERIAL_OPT = "-device virtio-serial-device -chardev socket,id=virtcon,port
|
||||||
# No watchdog available yet
|
# No watchdog available yet
|
||||||
EFIBOOTGUARD_TIMEOUT ?= "0"
|
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/efi.inc
|
||||||
require conf/machine/include/coreos-generic-features/legacy-mbr-disk.inc
|
|
||||||
require conf/machine/include/coreos-generic-features/emmc.inc
|
require conf/machine/include/coreos-generic-features/emmc.inc
|
||||||
|
|
|
||||||
|
|
@ -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_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_A ??= 'part / --source rootfs --fstype=ext4 --label platform0 --align 1024'
|
||||||
WKS_PART_ROOT_B ??= 'part --fstype=ext4 --label platform1 --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_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"'
|
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"'
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,6 @@
|
||||||
# MBR disk are still supported by CoreOS, but only for legacy product
|
# MBR disk are still supported by CoreOS, but only for legacy product
|
||||||
# This ensure that efibootguard / swupdate work with MBR disk
|
# 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
|
# 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
|
# 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
|
# have to be set to the right disk device inside the machine configuration
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,20 @@
|
||||||
# short-description: Create SD card image for Beaglebone
|
# short-description: Create SD card image for Beaglebone
|
||||||
# long-description: Creates a partitioned 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
|
# offset 1S => 1 sector (1x512 byte)
|
||||||
${WKS_PART_EFI} --ondisk mmcblk0 --align 1024 --size 32M --extra-space 0 --overhead-factor 1
|
# The bootloader can be at 4 different position in raw mode: 0S, 256S, 512S, 768S
|
||||||
${WKS_PART_ROOT_A} --ondisk mmcblk0 --size 2G --extra-space 0 --overhead-factor 1
|
# MBR disk use only the sector 0, so 1S is free
|
||||||
${WKS_PART_ROOT_B} --ondisk mmcblk0 --size 2G --extra-space 0 --overhead-factor 1
|
# 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_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
|
${WKS_PART_EFIBOOTGUARD_B} --ondisk mmcblk0 --align 1024 --size 128M --extra-space 0 --overhead-factor 1
|
||||||
bootloader --ptable msdos
|
bootloader --ptable gpt
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,6 @@
|
||||||
# Swupdate image generation
|
# 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"
|
IMAGE_FSTYPES:append = " ext4.zst"
|
||||||
python () {
|
python () {
|
||||||
image = d.getVar('IMAGE_BASENAME')
|
image = d.getVar('IMAGE_BASENAME')
|
||||||
|
|
@ -19,9 +16,14 @@ python () {
|
||||||
inherit swupdate-image
|
inherit swupdate-image
|
||||||
|
|
||||||
# Ensure than variable used in the sw-description files are watched for change
|
# 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"
|
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 () {
|
python () {
|
||||||
kernel0 = d.getVar('COREOS_KERNEL0_NAME')
|
kernel0 = d.getVar('COREOS_KERNEL0_NAME')
|
||||||
|
|
@ -29,6 +31,45 @@ python () {
|
||||||
kernelext = d.getVar('COREOS_KERNEL_EXT')
|
kernelext = d.getVar('COREOS_KERNEL_EXT')
|
||||||
d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", kernel0, kernelext)
|
d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", kernel0, kernelext)
|
||||||
d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", kernel1, 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"
|
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}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,11 @@ FEATURE_PACKAGES_cockpit = "packagegroup-coreos-cockpit ${@get_feature_packages_
|
||||||
# *-dev-tools FEATURES_PACKAGES for any image features
|
# *-dev-tools FEATURES_PACKAGES for any image features
|
||||||
FEATURE_PACKAGES_dev-tools = "${@get_feature_packages_with_suffix('dev-tools', d)}"
|
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):
|
def get_feature_packages_with_suffix(suffix, d):
|
||||||
"""
|
"""
|
||||||
For each feature inside IMAGE_FEATURES, look if a FEATURE_PACKAGE variable
|
For each feature inside IMAGE_FEATURES, look if a FEATURE_PACKAGE variable
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,9 @@ SDK_VERSION[vardepvalue] = "${SDK_VERSION}"
|
||||||
SDK_NAME = "${DISTRO}-${TCLIBC}-${SDKMACHINE}-${IMAGE_BASENAME}-${TUNE_PKGARCH}-${MACHINE}"
|
SDK_NAME = "${DISTRO}-${TCLIBC}-${SDKMACHINE}-${IMAGE_BASENAME}-${TUNE_PKGARCH}-${MACHINE}"
|
||||||
SDKPATHINSTALL = "/opt/${DISTRO}/${SDK_VERSION}"
|
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
|
# EFI and Secure boot
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
|
|
||||||
|
|
@ -78,3 +81,9 @@ INHERIT += "coreos-efi-secureboot"
|
||||||
#PREFERRED_PROVIDER_virtual/runc = "crun"
|
#PREFERRED_PROVIDER_virtual/runc = "crun"
|
||||||
PACKAGECONFIG:append:pn-podman = " rootless"
|
PACKAGECONFIG:append:pn-podman = " rootless"
|
||||||
DISTRO_FEATURES_DEFAULT += "virtualization seccomp ipv6"
|
DISTRO_FEATURES_DEFAULT += "virtualization seccomp ipv6"
|
||||||
|
|
||||||
|
# meta-rust configuration
|
||||||
|
# ==============================================================================
|
||||||
|
|
||||||
|
RUST_VERSION ?= "1.66.1"
|
||||||
|
require conf/distro/include/rust_versions.inc
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@ LAYERDEPENDS_meta-belden-coreos = "\
|
||||||
networking-layer \
|
networking-layer \
|
||||||
virtualization-layer \
|
virtualization-layer \
|
||||||
webserver \
|
webserver \
|
||||||
|
clang-layer \
|
||||||
|
rust-layer \
|
||||||
"
|
"
|
||||||
|
|
||||||
LAYERSERIES_COMPAT_meta-belden-coreos = "kirkstone"
|
LAYERSERIES_COMPAT_meta-belden-coreos = "kirkstone"
|
||||||
|
|
|
||||||
|
|
@ -12,26 +12,39 @@ software =
|
||||||
installed-directly = true;
|
installed-directly = true;
|
||||||
# partlabel are stored inside the GPT partition table.
|
# partlabel are stored inside the GPT partition table.
|
||||||
# The partition table is flashed only once and never updated
|
# 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";
|
type = "raw";
|
||||||
sha256 = "$swupdate_get_sha256(@@PN@@-@@MACHINE@@.ext4.zst)";
|
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: (
|
files: (
|
||||||
{
|
{
|
||||||
filename = "@@COREOS_KERNEL0_FILENAME@@";
|
filename = "@@COREOS_KERNEL0_FILENAME@@";
|
||||||
path = "/KERNEL.EFI";
|
path = "/KERNEL.EFI";
|
||||||
device = "@@COREOS_DISK_PARTLABEL_LOOKUP_DIRECTORY@@/boot0";
|
device = "/var/run/coreos/rootdisk/partitions/ebg/updatable";
|
||||||
filesystem = "vfat";
|
filesystem = "vfat";
|
||||||
sha256 = "$swupdate_get_sha256(@@COREOS_KERNEL0_FILENAME@@)";
|
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: (
|
bootenv: (
|
||||||
{
|
{
|
||||||
name = "kernelparams";
|
name = "kernelparams";
|
||||||
value = "root=PARTLABEL=platform0 @@APPEND@@";
|
value = "";
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "watchdog_timeout_sec";
|
name = "watchdog_timeout_sec";
|
||||||
|
|
@ -42,6 +55,9 @@ software =
|
||||||
value = "C:BOOT0:KERNEL.EFI";
|
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;
|
installed-directly = true;
|
||||||
# partlabel are stored inside the GPT partition table.
|
# partlabel are stored inside the GPT partition table.
|
||||||
# The partition table is flashed only once and never updated
|
# 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";
|
type = "raw";
|
||||||
sha256 = "$swupdate_get_sha256(@@PN@@-@@MACHINE@@.ext4.zst)";
|
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: (
|
files: (
|
||||||
{
|
{
|
||||||
filename = "@@COREOS_KERNEL1_FILENAME@@";
|
filename = "@@COREOS_KERNEL1_FILENAME@@";
|
||||||
path = "/KERNEL.EFI";
|
path = "/KERNEL.EFI";
|
||||||
device = "@@COREOS_DISK_PARTLABEL_LOOKUP_DIRECTORY@@/boot1";
|
device = "/var/run/coreos/rootdisk/partitions/ebg/updatable";
|
||||||
filesystem = "vfat";
|
filesystem = "vfat";
|
||||||
sha256 = "$swupdate_get_sha256(@@COREOS_KERNEL1_FILENAME@@)";
|
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: (
|
bootenv: (
|
||||||
{
|
{
|
||||||
name = "kernelparams";
|
name = "kernelparams";
|
||||||
value = "root=PARTLABEL=platform1 @@APPEND@@";
|
value = "";
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "watchdog_timeout_sec";
|
name = "watchdog_timeout_sec";
|
||||||
|
|
@ -82,6 +111,9 @@ software =
|
||||||
value = "C:BOOT1:KERNEL.EFI";
|
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)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
@ -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
|
||||||
|
}
|
||||||
|
|
@ -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
|
||||||
|
|
@ -17,8 +17,8 @@ echo "Root partition is on device ${DISK_DEVICE_NAME} - type ${DISK_PARTITION_TY
|
||||||
if [ "${DISK_PARTITION_TYPE}" == "gpt" ]; then
|
if [ "${DISK_PARTITION_TYPE}" == "gpt" ]; then
|
||||||
ROOT_PARTLABEL=$(lsblk -dno PARTLABEL "${ROOT_PART}")
|
ROOT_PARTLABEL=$(lsblk -dno PARTLABEL "${ROOT_PART}")
|
||||||
else
|
else
|
||||||
echo "Using MBR disk is less reliable than GPT disk!"
|
echo "Using MBR is not supported"
|
||||||
ROOT_PARTLABEL=$(lsblk -dno LABEL "${ROOT_PART}")
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Root partition label is ${ROOT_PARTLABEL}"
|
echo "Root partition label is ${ROOT_PARTLABEL}"
|
||||||
|
|
@ -37,3 +37,6 @@ case $ROOT_PARTLABEL in
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# Create needed symlinks in /var/run/coreos
|
||||||
|
coreos-swupdate-helper --config /etc/coreos-swupdate-helper/default.toml
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# File in the swupdate subdirectory of this recipe should overwrite the
|
# File in the swupdate subdirectory of this recipe should overwrite the
|
||||||
# same file in meta-swupdate
|
# same file in meta-swupdate
|
||||||
FILESEXTRAPATHS:prepend := "${THISDIR}/swupdate:"
|
FILESEXTRAPATHS:prepend := "${THISDIR}/swupdate:"
|
||||||
RDEPENDS:${PN}:append = " efibootguard"
|
RDEPENDS:${PN}:append = " efibootguard coreos-swupdate-helper"
|
||||||
|
|
||||||
SRC_URI += "file://webserver-config.sh \
|
SRC_URI += "file://webserver-config.sh \
|
||||||
file://sw-collections-config.sh \
|
file://sw-collections-config.sh \
|
||||||
|
|
|
||||||
|
|
@ -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]
|
||||||
|
|
@ -54,6 +54,7 @@ WKS_FILE = "cn913x-sdcard.wks.in"
|
||||||
IMAGE_FSTYPES += "wic.xz wic.bmap"
|
IMAGE_FSTYPES += "wic.xz wic.bmap"
|
||||||
|
|
||||||
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += " kernel-modules kernel-devicetree"
|
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += " kernel-modules kernel-devicetree"
|
||||||
|
COREOS_IMAGE_SWUPDATE_EXTRACLASSES += " coreos-image-swupdate-cn913x"
|
||||||
|
|
||||||
# No watchdog available yet
|
# No watchdog available yet
|
||||||
EFIBOOTGUARD_TIMEOUT ?= "0"
|
EFIBOOTGUARD_TIMEOUT ?= "0"
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,12 @@
|
||||||
|
|
||||||
# Current bootloader is about 1.8MB, so if we put it at 4096S and 12288S we
|
# 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
|
# 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 --size 4M --extra-space 0 --overhead-factor 1 --part-name fw0
|
||||||
part --offset 4096S --source rawcopy --sourceparams="file=flash-image.bin" --ondisk mmcblk1
|
part --offset 12288S --source rawcopy --sourceparams="file=flash-image.bin" --ondisk mmcblk1 --size 4M --extra-space 0 --overhead-factor 1 --part-name fw1
|
||||||
part --offset 12288S --source rawcopy --sourceparams="file=flash-image.bin" --ondisk mmcblk1
|
|
||||||
|
|
||||||
${WKS_PART_EFI} --ondisk mmcblk1 --offset 20480S --size 64M --extra-space 0 --overhead-factor 1
|
${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_A} --ondisk mmcblk1 --size ${WKS_PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
|
||||||
${WKS_PART_ROOT_B} --ondisk mmcblk1 --size 2G --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_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
|
${WKS_PART_EFIBOOTGUARD_B} --ondisk mmcblk1 --align 1024 --size 128M --extra-space 0 --overhead-factor 1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 68ec449f97ffa58d835163581fc72afcb08f027b
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit e3082dc0728023b121d648da4c5c856943b5e425
|
||||||
|
|
@ -19,4 +19,6 @@ BBLAYERS ?= " \
|
||||||
##COREOS_LAYERSDIR##/meta-virtualization \
|
##COREOS_LAYERSDIR##/meta-virtualization \
|
||||||
##COREOS_LAYERSDIR##/meta-efibootguard \
|
##COREOS_LAYERSDIR##/meta-efibootguard \
|
||||||
##COREOS_LAYERSDIR##/meta-swupdate \
|
##COREOS_LAYERSDIR##/meta-swupdate \
|
||||||
|
##COREOS_LAYERSDIR##/meta-clang \
|
||||||
|
##COREOS_LAYERSDIR##/meta-rust \
|
||||||
"
|
"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue