Compare commits

..

2 Commits

Author SHA1 Message Date
Sam Dolt 81c834a892 feat(cn9130-cf-pro): use same BSP recipes as Nitroc 2024-03-18 16:00:26 +01:00
Sam Dolt 2be0c69de4 feat(nitroc): add BSP recipes for Nitroc
This was ported from NWL to CoreOS. https://bitbucket.gad.local/projects/NM-NSP/repos/netmodule-wireless-linux/pull-requests/49/overview

Co-authored-by: Stefen Eichenberger <stefan.eichenberger@netmodule.com>
2024-03-18 14:44:32 +01:00
77 changed files with 422 additions and 842 deletions

View File

@ -3,35 +3,33 @@
CoreOS Installer
****************
The CoreOS installer is a set of scripts running on the target and a
The CoreOS installer is a set of script running on the target and a
corresponding bitbake image that is used into the bootstrap process of CoreOS.
coreos-image-installer
======================
The CoreOS image installer results in an image contairing only a single binary
EFI file. This EFI file includes a kernel, a device tree and an initramfs with
all (and only) the tools needed to install CoreOS.
The CoreOS installer image is a single binary EFI file that include a kernel,
device tree and an initramfs with all the tools needed to install CoreOS.
The installer image is not automatically built in parallel of a normal image.
This can be changed by setting `COREOS_IMAGE_GENERATE_INSTALLER` to 1 in the
image file (as it is done for example in coreos-image-all-features.bb).
An installer image is automatically built in parallel of a normal image.
This can be deactivated by setting `COREOS_IMAGE_GENERATE_INSTALLER` to 0.
The installer image build by default only a single EFI binary named
coreos-installer-MACHINE.efi. An SDCard or USB image can be generated if
coreos-installer-MACHINE.efi. An SDCard image can be generate if
`COREOS_INSTALLER_WKS_FILE` is set to a wks file.
coreos-installer
================
The coreos-installer recipe installs scripts that are used at startup to
automatically format the internal emmc of the device. The recipe also contains
The coreos-installer recipe installs some script that is used at startup
to automatically format the internal emmc of the device. It also contains
a swupdate configuration file to setup swupdate correctly for that use case.
coreos-installer-config
=======================
The coreos-installer-config recipe installs device specific configuration file
used by the coreos-installer. This includes the partitioner config file. Distros
and projects based on CoreOS can change the partioning scheme or partition size
used by the coreos-installer. This includes the partitionner config file. Distro
and project based on CoreOS can change the partionning scheme or partition size
by installing their own version of this package using a `bbappend file`.

@ -1 +1 @@
Subproject commit d7b7b6fb6c7c5545e718e44f38853d1718ce5446
Subproject commit b187fb9232ca0a6b5f8f90b4715958546fc41d73

@ -1 +1 @@
Subproject commit 09d2f9391813674627ec53cb222da6c7a51221e6
Subproject commit 228b24895f951bab648a21d084f42dc66599927c

@ -1 +1 @@
Subproject commit 8bb16533532b6abc2eded7d9961ab2a108fd7a5b
Subproject commit fda737ec0cc1d2a5217548a560074a8e4d5ec580

@ -1 +1 @@
Subproject commit 3d12b2788a45d86efcb1ad3e01f209558c54795c
Subproject commit eaa4dcbac224c9f5e7da784dcda78b67f117cf63

@ -1 +1 @@
Subproject commit cb2bc17e96552cdfc141d27bd9f4dbd95a872846
Subproject commit 7902664f89678164b7fc90d421cee74cbec51cdf

@ -1 +1 @@
Subproject commit 1b5405955c7c2579ed1f52522e2e177d0281fa33
Subproject commit d63af11e92094487d6e358f27283e5385937e7a8

View File

@ -12,7 +12,7 @@ include conf/machine/include/arm/armv7a/tune-cortexa8.inc
IMAGE_FSTYPES += "wic wic.xz wic.bmap"
WKS_FILE ?= "beaglebone-sdcard.wks.in"
COREOS_INSTALLER_WKS_FILE ?= "beaglebone-sdcard-installer.wks"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-image"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-image kernel-devicetree"
do_image_wic[depends] += "mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot gptfdisk-native:do_populate_sysroot virtual/bootloader:do_deploy"
do_image_wic[recrdeptask] += "do_bootimg"
@ -21,10 +21,10 @@ SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
APPEND:append = " console=ttyS0,115200"
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
PREFERRED_VERSION_linux-yocto ?= "6.6%"
PREFERRED_VERSION_linux-yocto ?= "5.15%"
KERNEL_IMAGETYPE = "zImage"
DTB_FILES = "ti/omap/am335x-bone.dtb ti/omap/am335x-boneblack.dtb ti/omap/am335x-bonegreen.dtb"
KERNEL_DEVICETREE = "am335x-bone.dtb am335x-boneblack.dtb am335x-bonegreen.dtb"
KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"

View File

@ -5,7 +5,7 @@
require include/coreos-generic-arch/x64.inc
MACHINE_FEATURES += "pci usbhost x86 serial efi"
MACHINE_FEATURES += "pci usbhost x86 acpi serial efi tpm2 "
# Kernel configuration
# ******************************************************************************
@ -28,10 +28,11 @@ APPEND += "console=ttyS0,115200"
# Ensure that both flash-image.bin and boot.scr are generated as they are needed
# for a wic image
WKS_FILE = "generic-uefi.wks.in"
COREOS_INSTALLER_WKS_FILE ?= "generic-uefi-usb-installer.wks"
# COREOS_INSTALLER_WKS_FILE ?= "" --> TBD
IMAGE_FSTYPES += "wic.xz wic.bmap"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += " kernel-modules"
# COREOS_IMAGE_SWUPDATE_EXTRACLASSES += "" --> TBD
# No watchdog available yet
EFIBOOTGUARD_TIMEOUT ?= "0"

View File

@ -1,20 +1,17 @@
# Variables used in WKS file
# Variable used in WKS file
WKS_PART_EFI ??= 'part --source efibootguard-efi --label efi --part-type=EF00'
WKS_PART_EFIBOOTGUARD_A ??= 'part --source efibootguard-boot --label ebg0 --part-type=0700 --sourceparams "args=coreos.root=rootfs0,watchdog=${EFIBOOTGUARD_TIMEOUT},revision=2,kernel=${COREOS_KERNEL_FILENAME};KERNEL.EFI"'
WKS_PART_EFIBOOTGUARD_B ??= 'part --source efibootguard-boot --label ebg1 --part-type=0700 --sourceparams "args=coreos.root=rootfs1,watchdog=${EFIBOOTGUARD_TIMEOUT},revision=1,kernel=${COREOS_KERNEL_FILENAME};KERNEL.EFI"'
WKS_PART_ROOT_A ??= 'part / --source rootfs --fstype=ext4 --label rootfs0'
WKS_PART_ROOT_B ??= 'part --fstype=ext4 --label rootfs1'
WKS_PART_ROOT_SIZE ??= '1G'
WKS_PART_USERDATA_SIZE ??= '1G'
WKS_PART_USERDATA ??= 'part /usr/local/data --fstype=btrfs --label userdata'
PART_EFI_SIZE ??= '64M'
PART_ROOT_SIZE ??= '1G'
PART_EFIBG_SIZE ??= '128M'
PART_USERDATA_SIZE ??= '1G'
# Variables used in SFDISK file
SFDISK_PART_EFI ??= 'type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, name="efi"'
SFDISK_PART_EFIBOOTGUARD_A ??= 'type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, name="ebg0"'
SFDISK_PART_EFIBOOTGUARD_B ??= 'type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, name="ebg1"'
SFDISK_PART_ROOT_A ??= 'type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, name="rootfs0"'
SFDISK_PART_ROOT_B ??= 'type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, name="rootfs1"'
SFDISK_PART_USERDATA ??= 'type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, name="userdata"'
SFDISK_PART_ROOT_B ??= 'type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, name="rootfs0"'

View File

@ -6,7 +6,7 @@ MACHINE_FEATURES += "wifi efi"
# Add an override that work for all pc image
MACHINEOVERRIDES =. "vm:"
PREFERRED_VERSION_linux-yocto ?= "6.6%"
PREFERRED_VERSION_linux-yocto ?= "5.15%"
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
MACHINE_EXTRA_RRECOMMENDS += "kernel-modules linux-firmware"

View File

@ -1,23 +1,12 @@
# Ensure that file are found event when this file is included in another layer
# ==============================================================================
FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot:"
# U-Boot CoreOS Distro Settings
# ==============================================================================
# Enable more debug option when debug-tweaks is enabled
SRC_URI += " \
${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", "file://debug-tweaks.cfg", "", d)} \
"
inherit coreos-efi-secureboot
# Make sure UEFI and secure boot is enabled for every u-boot build
SRC_URI += " \
file://uefi.cfg \
file://uefi-secureboot.cfg \
"
DEPENDS:append = " ${PYTHON_PN}-pyopenssl-native u-boot-tools-native cos-certificates-and-keys-native"
# Generate a ubootefi.var file inside the build directory
#
# This file can be directly linked inside the u-boot binary to provide
@ -26,7 +15,6 @@ SRC_URI += " \
#
# The efivar.py is taken from u-boot-tools recipes, so that we are sure that he
# is found and don't depend on the u-boot version being used
DEPENDS:append = " ${PYTHON_PN}-pyopenssl-native u-boot-tools-native cos-certificates-and-keys-native"
addtask uboot_generate_efivar after do_configure before do_compile
do_uboot_generate_efivar() {
# Settings OPENSSL_MODULES is needed, otherwise efivar.py fail with

View File

@ -0,0 +1,12 @@
# Ensure that file are found event when this file is included in another layer
# ==============================================================================
FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot:"
# Main include file for u-boot to ensure CoreOS compatibility
# ==============================================================================
SRC_URI += " \
${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", "file://debug-tweaks.cfg", "", d)} \
"
require ${@bb.utils.contains("COMBINED_FEATURES", "efi", "u-boot-coreos-efi.inc", "", d)}

View File

@ -0,0 +1,2 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
require u-boot-coreos.inc

View File

@ -4,3 +4,5 @@ require recipes-bsp/u-boot/u-boot.inc
SRCREV = "4debc57a3da6c3f4d3f89a637e99206f4cea0a96"
DEPENDS += "bc-native dtc-native python3-setuptools-native"
LIC_FILES_CHKSUM = "file://Licenses/README;md5=2ca5f2c35c8cc335f0a19756634782f1"
require u-boot-coreos.inc

View File

@ -12,8 +12,8 @@ sector-size: 512
/dev/mmcblk1p1 : start= 256, size= 512, type=4DA6E9DA-C803-4BE4-BAC4-8192717C5EB0, name="mlo", attrs="RequiredPartition"
/dev/mmcblk1p2 : start= 768, size= 8192, type=5B97345D-B7A1-47D3-A491-ED40F4841639, name="uboot", attrs="RequiredPartition"
/dev/mmcblk1p3 : size= ${PART_EFI_SIZE}, ${SFDISK_PART_EFI}
/dev/mmcblk1p4 : size= ${PART_EFIBG_SIZE}, ${SFDISK_PART_EFIBOOTGUARD_A}
/dev/mmcblk1p5 : size= ${PART_EFIBG_SIZE}, ${SFDISK_PART_EFIBOOTGUARD_B}
/dev/mmcblk1p6 : size= ${PART_ROOT_SIZE}, ${SFDISK_PART_ROOT_A}
/dev/mmcblk1p7 : size= ${PART_ROOT_SIZE}, ${SFDISK_PART_ROOT_B}
/dev/mmcblk1p3 : start= 8960, size= 131072, ${SFDISK_PART_EFI}
/dev/mmcblk1p4 : start= 140032, size= 262144, ${SFDISK_PART_EFIBOOTGUARD_A}
/dev/mmcblk1p5 : start= 402176, size= 262144, ${SFDISK_PART_EFIBOOTGUARD_B}
/dev/mmcblk1p6 : start= 664320, size= 3403375, ${SFDISK_PART_ROOT_A}
/dev/mmcblk1p7 : start= 4067695, size= 3403375, ${SFDISK_PART_ROOT_B}

View File

@ -1,13 +0,0 @@
label: gpt
device: /dev/mmcblk2
unit: sectors
first-lba: 34
last-lba: 7471070
sector-size: 512
/dev/mmcblk2p1 : start= 256, size= ${PART_EFI_SIZE}, ${SFDISK_PART_EFI}
/dev/mmcblk2p2 : size= ${PART_ROOT_SIZE}, ${SFDISK_PART_ROOT_A}
/dev/mmcblk2p3 : size= ${PART_ROOT_SIZE}, ${SFDISK_PART_ROOT_B}
/dev/mmcblk2p4 : size= ${PART_EFIBG_SIZE}, ${SFDISK_PART_EFIBOOTGUARD_A}
/dev/mmcblk2p5 : size= ${PART_EFIBG_SIZE}, ${SFDISK_PART_EFIBOOTGUARD_B}
/dev/mmcblk2p6 : size= ${PART_USERDATA_SIZE}, ${SFDISK_PART_USERDATA}

View File

@ -1,4 +1,3 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/coreos-installer-config:"
SRC_URI:append:beaglebone = " file://beaglebone_1.0.sfdisk"
SRC_URI:append:eagle40-03 = " file://eagle40-03_1.0.sfdisk"

View File

@ -1,2 +0,0 @@
CONFIG_F71808E_WDT=y
CONFIG_WATCHDOG_SYSFS=y

View File

@ -0,0 +1,23 @@
inherit coreos-efi-sbsign
require conf/image-uefi.conf
# Ensure EFI STUB is enabled
KERNEL_FEATURES:append = " cfg/efi.scc cfg/efi-ext.scc"
# By default we use a Unified Kernel Image that contain the kernel, the
# kernel command line and some device tree, so we don't need to sign the output
# of the kernel recipes
COREOS_KERNEL_EFI_SIGNED ??= "0"
# Extend the kernel_do_deploy function from kernel.bbclass to sign the kernel
kernel_do_deploy:append() {
if [ "${COREOS_KERNEL_EFI_SIGNED}" == "1" ]; then
deployDir="${DEPLOYDIR}"
for imageType in ${KERNEL_IMAGETYPES} ; do
baseName="$imageType-${KERNEL_IMAGE_NAME}"
coreos_efi_secureboot_sign_app "$deployDir/$baseName${KERNEL_IMAGE_BIN_EXT}"
done
fi
}

View File

@ -0,0 +1,2 @@
# Set kernel config needed by secure-storage
SRC_URI += "file://secure-storage.cfg"

View File

@ -4,7 +4,7 @@ COMPATIBLE_MACHINE:vm-x64 = "vm-x64"
# Enable some kernel features related to virtualiuzation
KERNEL_FEATURES:append:vm-x64=" cfg/virtio.scc cfg/paravirt_kvm.scc"
SRC_URI:append:vm-x64 = " file://hyperv.cfg"
KMACHINE:eagle40-03 ?= "common-pc-64"
KBRANCH:eagle40-03 = "v5.15/standard/base"
@ -18,3 +18,8 @@ KMACHINE:beaglebone ?= "beaglebone"
SRCREV_machine:beaglebone ?= "9aabbaa89fcb21af7028e814c1f5b61171314d5a"
COMPATIBLE_MACHINE:beaglebone = "beaglebone"
LINUX_VERSION:beaglebone = "5.15.54"
require ${@bb.utils.contains("COMBINED_FEATURES", "efi", "linux-yocto-coreos-efi.inc", "", d)}
SRC_URI += " file://k3s_kernel_adaptions.cfg"
SRC_URI:append:vm-x64 = " file://hyperv.cfg"

View File

@ -3,12 +3,4 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
KMACHINE:eagle40-03 ?= "common-pc-64"
COMPATIBLE_MACHINE:eagle40-03 = "eagle40-03"
KMACHINE:beaglebone ?= "beaglebone"
COMPATIBLE_MACHINE:beaglebone = "beaglebone"
KMACHINE:vm-x64 ?= "common-pc-64"
COMPATIBLE_MACHINE:vm-x64 = "vm-x64"
KERNEL_FEATURES:append:vm-x64=" cfg/virtio.scc cfg/paravirt_kvm.scc"
SRC_URI:append:vm-x64 = " file://hyperv.cfg"
SRC_URI += " file://eagle40-03.cfg"
require ${@bb.utils.contains("COMBINED_FEATURES", "efi", "linux-yocto-coreos-efi.inc", "", d)}

View File

@ -13,8 +13,8 @@ part --offset 768S --source rawcopy --sourceparams="file=u-boot.img" --ondisk mm
# 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 --fixed-size 32M
${WKS_PART_EFIBOOTGUARD_A} --ondisk mmcblk0 --fixed-size ${PART_EFIBG_SIZE}
${WKS_PART_EFIBOOTGUARD_B} --ondisk mmcblk0 --fixed-size ${PART_EFIBG_SIZE}
${WKS_PART_ROOT_A} --ondisk mmcblk0 --fixed-size ${PART_ROOT_SIZE}
${WKS_PART_ROOT_B} --ondisk mmcblk0 --fixed-size ${PART_ROOT_SIZE}
${WKS_PART_EFIBOOTGUARD_A} --ondisk mmcblk0 --fixed-size 128M
${WKS_PART_EFIBOOTGUARD_B} --ondisk mmcblk0 --fixed-size 128M
${WKS_PART_ROOT_A} --ondisk mmcblk0 --fixed-size ${WKS_PART_ROOT_SIZE}
${WKS_PART_ROOT_B} --ondisk mmcblk0 --fixed-size ${WKS_PART_ROOT_SIZE}
bootloader --ptable gpt

View File

@ -1,16 +0,0 @@
# short-description: Create USB image for Eagle 40-03
# long-description: Creates a partitioned USB image for Eagle 40-03.
# 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
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# Don't name partition in the installer disk image, otherwise the installer may not work as it rely on partition label!
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
part --offset 256S --source bootimg-partition --part-type=EF00 --ondisk mmcblk0
part --fixed-size 3G --fstype=vfat --label=image
bootloader --ptable gpt

View File

@ -1,11 +1,10 @@
# short-description: Create an EFI disk image for genericx86*
# long-description: Creates a partitioned EFI disk image for genericx86* machines
${WKS_PART_EFI} --align 1024 --size ${PART_EFI_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_A} --size ${PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_B} --size ${PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_EFIBOOTGUARD_A} --align 1024 --size ${PART_EFIBG_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_EFIBOOTGUARD_B} --align 1024 --size ${PART_EFIBG_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_USERDATA} --size ${PART_USERDATA_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_EFI} --align 1024 --size 64M --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_A} --size ${WKS_PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_B} --size ${WKS_PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_EFIBOOTGUARD_A} --align 1024 --size 128M --extra-space 0 --overhead-factor 1
${WKS_PART_EFIBOOTGUARD_B} --align 1024 --size 128M --extra-space 0 --overhead-factor 1
${WKS_PART_USERDATA} --size ${WKS_PART_USERDATA_SIZE} --extra-space 0 --overhead-factor 1
bootloader --ptable gpt

View File

@ -2,11 +2,11 @@
# long-description: Creates a partitioned EFI disk image that the user
# can directly dd to boot media.
part --source efibootguard-efi --label efi --part-type=EF00 --use-uuid --offset 20480S --size ${PART_EFI_SIZE} --extra-space 0 --overhead-factor 1
part / --source rootfs --fstype=ext4 --label rootfs0 --use-uuid --size ${PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
part --fstype=ext4 --label rootfs1 --use-uuid --size ${PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
part --source efibootguard-boot --label ebg0 --part-type=0700 --sourceparams "args=coreos.root=rootfs0,watchdog=${EFIBOOTGUARD_TIMEOUT},revision=2,kernel=${COREOS_KERNEL_FILENAME};KERNEL.EFI" --use-uuid --align 1024 --size ${PART_EFIBG_SIZE} --extra-space 0 --overhead-factor 1
part --source efibootguard-boot --label ebg1 --part-type=0700 --sourceparams "args=coreos.root=rootfs1,watchdog=${EFIBOOTGUARD_TIMEOUT},revision=1,kernel=${COREOS_KERNEL_FILENAME};KERNEL.EFI" --use-uuid --align 1024 --size ${PART_EFIBG_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_USERDATA} --use-uuid --size ${PART_USERDATA_SIZE} --extra-space 0 --overhead-factor 1
part --source efibootguard-efi --label efi --part-type=EF00 --use-uuid --offset 20480S --size 64M --extra-space 0 --overhead-factor 1
part / --source rootfs --fstype=ext4 --label rootfs0 --use-uuid --size ${WKS_PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
part --fstype=ext4 --label rootfs1 --use-uuid --size ${WKS_PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
part --source efibootguard-boot --label ebg0 --part-type=0700 --sourceparams "args=coreos.root=rootfs0,watchdog=${EFIBOOTGUARD_TIMEOUT},revision=2,kernel=${COREOS_KERNEL_FILENAME};KERNEL.EFI" --use-uuid --align 1024 --size 128M --extra-space 0 --overhead-factor 1
part --source efibootguard-boot --label ebg1 --part-type=0700 --sourceparams "args=coreos.root=rootfs1,watchdog=${EFIBOOTGUARD_TIMEOUT},revision=1,kernel=${COREOS_KERNEL_FILENAME};KERNEL.EFI" --use-uuid --align 1024 --size 128M --extra-space 0 --overhead-factor 1
${WKS_PART_USERDATA} --use-uuid --size ${WKS_PART_USERDATA_SIZE} --extra-space 0 --overhead-factor 1
bootloader --ptable gpt

View File

@ -4,5 +4,3 @@ require recipes-core/images/coreos-image-all-features.bb
IMAGE_INSTALL += "k3s-agent"
# To use this image, please add k3s to DISTRO_FEATURE inside your
# local.conf config file.

View File

@ -1 +0,0 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"

View File

@ -1,41 +0,0 @@
# Class used to generate image based on Belden CoreOS
export IMAGE_BASENAME = "${MLPREFIX}${PN}"
IMAGE_NAME_SUFFIX ?= ""
IMAGE_LINGUAS = ""
LICENSE = "MIT"
IMAGE_FSTYPES = "cpio.gz"
# Support for generating a SDCard or USB installer is optional
COREOS_INSTALLER_WKS_FILE ??= ""
WKS_FILE = "${COREOS_INSTALLER_WKS_FILE}"
IMAGE_FSTYPES += "${@'wic.xz wic.bmap' if d.getVar('COREOS_INSTALLER_WKS_FILE') else ''}"
IMAGE_BOOT_FILES = "${COREOS_KERNEL_FILENAME};EFI/BOOT/${EFI_BOOT_IMAGE}"
COREOS_IMAGE_GENERATE_UKI = "1"
# IMGDEPLOYDIR has to be used instead of DEPLOY_DIR_IMAGE here, because it will
# run during image generation
COREOS_UKI_PART_INITRAMFS = "${IMGDEPLOYDIR}/${IMAGE_BASENAME}-${MACHINE}.cpio.gz"
COREOS_IMAGE_GENERATE_SWU = "0"
# Change generated UKI filename and reset the bundled command line to "APPEND"
# to ensure that root is not set in the kernel command line
COREOS_KERNEL_NAME ?= "coreos-installer-${MACHINE}"
COREOS_KERNEL_CMDLINE ?= "${APPEND}"
inherit coreos-image
# Only install a reduced set of package and feature to keep image size small
IMAGE_INSTALL = "packagegroup-coreos-boot coreos-installer coreos-installer-unattended util-linux-sfdisk util-linux-fdisk util-linux-cfdisk efibootguard efibootguard-tools"
IMAGE_FEATURES = "debug-tweaks swupdate"
NO_RECOMMENDATIONS = "1"
IMAGE_ROOTFS_SIZE = "8192"
INITRAMFS_MAXSIZE = "976562"
IMAGE_ROOTFS_EXTRA_SPACE = "0"
# Use the same restriction as initramfs-module-install
COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'

View File

@ -90,10 +90,8 @@ IMAGE_ROOTFS_EXTRA_SPACE:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'sys
# Unified kernel image and swupdate support
# ==============================================================================
# The CoreOS image installer is disabled by default.
COREOS_IMAGE_GENERATE_INSTALLER ?= "0"
# Support for Unified Kernel Image and Swupdate are optional.
# Support for Unified Kernel Image and Swupdate are optional
COREOS_IMAGE_GENERATE_INSTALLER ?= "${@"1" if "efi" in d.getVar('COMBINED_FEATURES') and "swupdate" in d.getVar("DISTRO_FEATURES") else "0"}"
COREOS_IMAGE_GENERATE_UKI ?= "${@bb.utils.contains("COMBINED_FEATURES", "efi", "1", "0", d)}"
COREOS_IMAGE_GENERATE_SWU ?= "${@"1" if "efi" in d.getVar('COMBINED_FEATURES') and "swupdate" in d.getVar("DISTRO_FEATURES") else "0"}"

View File

@ -7,3 +7,8 @@ MAINTAINER = "Belden CoreOS Team"
DISTRO_VERSION = "0.0.1"
DISTRO_CODENAME = "kirkstone"
# This TS represents 01.01.2024 generating it dynamically would cause a lot of
# things to get re-build, we need a good solution for this or change it every
# year
REPRODUCIBLE_TIMESTAMP_ROOTFS = "1704067200"

View File

@ -2,11 +2,6 @@
# it should support the most basic distro without optional coreos
# features
# Using :coreos override should work on all CoreOS based distro
# Note that :belden-coreos does not work on CoreOS based distro but will
# work when build for the belden-coreos distro
DISTROOVERRIDES = "coreos:${DISTRO}"
INHERIT += "coreos_metadata_scm"
# Distro features and policies
@ -111,8 +106,3 @@ PACKAGECONFIG:pn-systemd ?= " \
# Distro based on CoreOS can provide their own configuration files for the
# CoreOS installer by overriding this variable
PREFERRED_PROVIDER_coreos-installer-config ??= "coreos-installer-config"
# This TS represents 01.01.2024 generating it dynamically would cause a lot of
# things to get re-build, we need a good solution for this or change it every
# year
REPRODUCIBLE_TIMESTAMP_ROOTFS = "1704067200"

View File

@ -1,149 +0,0 @@
COREOS_RECIPE_MAINTAINER:pn-acl = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-arptables = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-attr = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-autoconf-archive = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-base-files = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-base-passwd = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-bash-completion = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-bash = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-binutils-cross-x86_64 = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-boost = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-bridge-utils = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-busybox = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-bzip2 = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-ca-certificates = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-conntrack-tools = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-coreutils = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-cppzmq = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-cracklib = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-cryptsetup = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-curl = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-dbus = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-depmodwrapper-cross = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-e2fsprogs = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-ebtables = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-efibootguard = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-elfutils = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-ethtool = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-expat = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-findutils = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-flatbuffers = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-flex = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-fmt = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-gawk = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-gcc-cross-x86_64 = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-gcc-runtime = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-gcc-source-11.4.0 = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-gdbm = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-glib-2.0 = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-glibc = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-glibc-locale = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-gmp = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-gnu-efi = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-gnutls = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-grub-bootconf = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-grub = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-grub-efi = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-icu = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-iproute2 = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-iptables = "Team CoreOS"
#iw should be removed
COREOS_RECIPE_MAINTAINER:pn-json-c = "Team CoreOS"
# kbd check if it can be removed
# kmod check if it can be removed
COREOS_RECIPE_MAINTAINER:pn-libaio = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libarchive = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libcap = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libcap-ng = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libcheck = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libconfig = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libdevmapper = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libestr = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libfastjson = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libffi = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libgcc = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libgcc-initial = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libgcrypt = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libgpg-error = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libidn2 = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-liblogging = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libmnl = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libnet = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libnetfilter-conntrack = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libnetfilter-cthelper = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libnetfilter-cttimeout = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libnetfilter-log = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libnetfilter-queue = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libnfnetlink = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libnl = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libnsl2 = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libpam = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libpcap = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libpcre = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libseccomp = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libsodium = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libsolv = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libssh2 = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libssh = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libtirpc = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libtool-cross = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libunistring = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libusb1 = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libxcrypt = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-libxml2 = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-linux-libc-headers = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-linux-yocto = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-logrotate = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-lrzsz = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-lvm2 = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-lzo = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-m4 = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-mtools = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-ncurses = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-netbase = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-nettle = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-openssh = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-openssl = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-opkg-arch-config = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-opkg = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-opkg-utils = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-os-release = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-packagegroup-base = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-packagegroup-core-boot = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-packagegroup-coreos-base = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-packagegroup-coreos-boot = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-pciutils = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-perl = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-popt = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-python3 = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-qemuwrapper-cross = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-readline = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-rsyslog = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-run-postinsts = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-secure-storage = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-setserial = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-sh = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-shared-mime-info = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-spdlog = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-sqlite3 = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-swupdate = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-sysfsutils = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-syslinux = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-syslog-ng = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-systemd-bootconf = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-systemd-boot = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-systemd-conf = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-systemd = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-systemd-serialgetty = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-tar = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-tcpdump = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-usbutils = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-util-linux = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-util-linux-libuuid = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-volatile-binds = "Team CoreOS"
# wpa-supplicant should be removed
COREOS_RECIPE_MAINTAINER:pn-xz = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-zeromq = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-zip = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-zlib = "Team CoreOS"
COREOS_RECIPE_MAINTAINER:pn-zstd = "Team CoreOS"

View File

@ -1,5 +0,0 @@
# Add CoreOS distro settings to u-boot
UBOOT_COREOS_REQUIRE:coreos ?= "u-boot-coreos.inc"
UBOOT_COREOS_REQUIRE ?= ""
require ${UBOOT_COREOS_REQUIRE}

View File

@ -10,6 +10,3 @@ IMAGE_INSTALL:append = "${@bb.utils.contains("IMAGE_FEATURES", "swupdate", " swu
# development tools
IMAGE_INSTALL:append = " systemd-analyze"
# Enable the optional image installer
COREOS_IMAGE_GENERATE_INSTALLER = "1"

View File

@ -1,4 +1,50 @@
DESCRIPTION = "Initramfs image with the CoreOS emmc installer"
# Don't reboot the device at reboot and don't do A/B switching
BAD_RECOMMENDATIONS = "swupdate-progress swupdate-coreos-config"
export IMAGE_BASENAME = "${MLPREFIX}${PN}"
IMAGE_NAME_SUFFIX ?= ""
IMAGE_LINGUAS = ""
LICENSE = "MIT"
inherit coreos-image-installer
IMAGE_FSTYPES = "cpio.gz"
# Support for generating a SDCard installer is optional
COREOS_INSTALLER_WKS_FILE ??= ""
WKS_FILE = "${COREOS_INSTALLER_WKS_FILE}"
IMAGE_FSTYPES += "${@'wic.xz wic.bmap' if d.getVar('COREOS_INSTALLER_WKS_FILE') else ''}"
IMAGE_BOOT_FILES = "${COREOS_KERNEL_FILENAME};EFI/BOOT/${EFI_BOOT_IMAGE}"
COREOS_IMAGE_GENERATE_UKI = "1"
# Avoid dependancy loop, we are already in an installer image, so we don't need
# to bundle another one
COREOS_IMAGE_GENERATE_INSTALLER = "0"
# IMGDEPLOYDIR has to be used instead of DEPLOY_DIR_IMAGE here, because it will
# run during image generation
COREOS_UKI_PART_INITRAMFS = "${IMGDEPLOYDIR}/${IMAGE_BASENAME}-${MACHINE}.cpio.gz"
COREOS_IMAGE_GENERATE_SWU = "0"
# Change generated UKI filename and reset the bundled command line to "APPEND"
# to ensure that root is not set in the kernel command line
COREOS_KERNEL_NAME ?= "coreos-installer-${MACHINE}"
COREOS_KERNEL_CMDLINE ?= "${APPEND}"
inherit coreos-image
# Only install a reduced set of package and feature to keep image size small
IMAGE_INSTALL = "packagegroup-coreos-boot coreos-installer swupdate-www util-linux-sfdisk util-linux-fdisk util-linux-cfdisk efibootguard efibootguard-tools"
IMAGE_FEATURES = "debug-tweaks swupdate networkmanager"
NO_RECOMMENDATIONS = "1"
IMAGE_ROOTFS_SIZE = "8192"
INITRAMFS_MAXSIZE = "976562"
IMAGE_ROOTFS_EXTRA_SPACE = "0"
# Use the same restriction as initramfs-module-install
COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'

View File

@ -15,7 +15,7 @@ COREOS_IMAGE_EFI_PROVIDER_EXTRA = " \
"
RDEPENDS:${PN} = "\
packagegroup-base \
packagegroup-base-extended \
os-release \
${@bb.utils.contains("MACHINE_FEATURES", "efi", "${COREOS_IMAGE_EFI_PROVIDER_EXTRA}", "", d)} \
"

View File

@ -1,2 +0,0 @@
[Manager]
RuntimeWatchdogSec=5

View File

@ -1,15 +1,10 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/systemd-conf:"
SRC_URI += " file://system.conf-watchdog"
do_install:append(){
# the creation date/time of this file will be used as initial boot time.
# Creation time will be set to REPRODUCIBLE_TIMESTAMP_ROOTFS
# More info about the date/time handling here:
# https://www.freedesktop.org/software/systemd/man/latest/systemd-timesyncd.service.html
touch ${D}/${base_libdir}/clock-epoch
install -D -m0644 ${WORKDIR}/system.conf-watchdog ${D}${systemd_unitdir}/system.conf.d/01-${PN}-watchdog.conf
}
FILES:${PN} += "${base_libdir}/clock-epoch"

View File

@ -1,23 +0,0 @@
#!/usr/bin/env sh
# catch errors from previous source files
if [ "$SWUPDATE_EXIT" != "" ]; then
# Notify the installation status indicator about the failed installation.
# This can result in the red LED lighting up.
dbus-send --system /org/belden/CoreOSInstallationStatusIndicator org.belden.CoreOSInstallationStatusIndicator.InstallationStatusFailure
exit 1
fi
# Notify the installation status indicator about the success with partitioning
# the blockdevice. This can result in the first green LED lighting up.
dbus-send --system /org/belden/CoreOSInstallationStatusIndicator org.belden.CoreOSInstallationStatusIndicator.InstallationStatusPartitioningSuccess
mount /dev/disk/by-label/image /mnt
if [ ! -f "/mnt/image.swu" ]; then
echo "Could not find image.swu on the vfat partition!"
dbus-send --system /org/belden/CoreOSInstallationStatusIndicator org.belden.CoreOSInstallationStatusIndicator.InstallationStatusFailure
exit 1
fi
SWUPDATE_ARGS="${SWUPDATE_ARGS} -p /usr/lib/swupdate/post-install.sh"
SWUPDATE_ARGS="${SWUPDATE_ARGS} -i /mnt/image.swu"

View File

@ -1,5 +0,0 @@
#!/usr/bin/env sh
# Notify the installation status indicator about the success with flashing the image.
# This can result in the second green LED lighting up.
dbus-send --system /org/belden/CoreOSInstallationStatusIndicator org.belden.CoreOSInstallationStatusIndicator.InstallationStatusImageFlashingSuccess

View File

@ -1,23 +0,0 @@
DESCRIPTION = "CoreOS scripts for unattended installation"
SECTION = "coreos"
LICENSE = "CLOSED"
SRC_URI += "\
file://99-overwrite.sh \
file://post-install.sh \
"
FILES:${PN} = "\
${libdir}/swupdate/conf.d/99-overwrite.sh \
${libdir}/swupdate/post-install.sh \
"
RDEPENDS:${PN} = "coreos-installer"
RCONFLICTS:${PN} = "swupdate-www"
do_install() {
install -d ${D}${libdir}/swupdate/conf.d
install -m 755 ${WORKDIR}/post-install.sh ${D}${libdir}/swupdate/
install -m 755 ${WORKDIR}/99-overwrite.sh ${D}${libdir}/swupdate/conf.d/
}

View File

@ -1,8 +1,5 @@
#!/usr/bin/env sh
set -o errtrace
trap 'echo "An error occured in line $LINENO: $BASH_COMMAND, exiting..."; SWUPDATE_EXIT=1; exit;' ERR
# Read /etc/hwrevision and turn it into a stripped string
# with the format ${MACHINE}_${VERSION}
HWREVISION=$(tr ' ' '_' < /etc/hwrevision | tr -d '[:space:]')
@ -18,13 +15,6 @@ fi
DISK=$(grep "^device:\s" < "${SFDISK_DUMP_FILE}" | cut -d ' ' -f 2)
# Remove the partition table signature, if there is already one.
# This ensures that sfdisk always finds a 'clean' disk to install / recover
wipefs -a -f ${DISK}
# Give the kernel some time to reload the partition
sleep 3
echo "Flashing ${SFDISK_DUMP_FILE} to ${DISK}"
cat "${SFDISK_DUMP_FILE}"
sfdisk "${DISK}" < "${SFDISK_DUMP_FILE}"

View File

@ -1,18 +1,22 @@
DESCRIPTION = "CoreOS Installer scripts"
SECTION = "coreos"
LICENSE = "CLOSED"
SECTION = "coreos"
SRC_URI += "file://25-installer-config.sh"
SRC_URI+= " \
file://25-installer-config.sh \
"
FILES:${PN} = "${libdir}/swupdate/conf.d/25-installer-config.sh"
# This package ship an alternate configuration for SWUpade to disable A/B
# switching and always flash A
RCONFLICTS:${PN}= "swupdate-coreos-config"
FILES:${PN} = " \
${libdir}/swupdate/conf.d/25-installer-config.sh \
"
# glibc-utils provide iconv
# glibc-gconv-utf-16 provide utf-16 support to iconv
RDEPENDS:${PN} = "coreos-installer-config dosfstools glibc-gconv-utf-16 glibc-utils util-linux-lsblk util-linux-sfdisk util-linux-wipefs"
# This package ships an alternate configuration for SWUpdate to disable A/B
# switching and always flash A
RCONFLICTS:${PN} = "swupdate-coreos-config"
RDEPENDS:${PN} = "coreos-installer-config dosfstools util-linux-lsblk util-linux-sfdisk glibc-utils glibc-gconv-utf-16"
do_install() {
install -d ${D}${libdir}/swupdate/conf.d

View File

@ -1,8 +0,0 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
# Secure Storage
# ==============================================================================
SRC_URI += "file://secure-storage.cfg"
# Ensure the Kernel EFI STUB is enabled
KERNEL_FEATURES += "cfg/efi.scc cfg/efi-ext.scc"

View File

@ -1,6 +0,0 @@
# Add CoreOS distro settings to the linux-yocto recipes
LINUX_YOCTO_COREOS_REQUIRE ?= ""
LINUX_YOCTO_COREOS_REQUIRE:coreos = "linux-yocto-coreos.inc"
require ${LINUX_YOCTO_COREOS_REQUIRE}

View File

@ -31,4 +31,4 @@ do_install() {
SYSTEMD_SERVICE:${PN} = "secure-storage.service"
SYSTEMD_AUTO_ENABLE = "enable"
RDEPENDS:${PN} += "cryptsetup util-linux-losetup e2fsprogs-mke2fs"
RDEPENDS:${PN} += "cryptsetup"

View File

@ -24,7 +24,6 @@ CONFIG_DISKPART=y
CONFIG_DISKPART_FORMAT=y
CONFIG_FAT_FILESYSTEM=y
CONFIG_EXT_FILESYSTEM=y
CONFIG_SIGNED=y
CONFIG_SIGNED_IMAGES=y
CONFIG_SIGALG_RAWRSA=n
CONFIG_SIGALG_CMS=y

View File

@ -48,6 +48,3 @@ do_install:append() {
install -m 755 ${COREOS_EFI_SECUREBOOT_KEYDIR}/swupdate.crt ${D}${libdir}/swupdate/
echo "${MACHINE} 1.0" > ${D}${sysconfdir}/hwrevision
}
# Fix: libgcc_s.so.1 must be installed for pthread_exit to work
RDEPENDS:${PN} += "libgcc"

View File

@ -4,3 +4,18 @@
#
require conf/machine/include/cn913x.inc
# Bootloader configuration
# *****************************************************************************
# Set the configuration and device tree for the board
UBOOT_MACHINE = "cn9130-clearfog-pro_defconfig"
UBOOT_BUILDENV_DEVICE_TREE ??= "cn9130-cf-pro"
# Kernel configuration
# ******************************************************************************
KERNEL_DEFCONFIG ?= "nitroc_defconfig"
KERNEL_DEVICETREE ?= "\
marvell/cn9130-cf-pro.dtb \
"

View File

@ -3,6 +3,36 @@
#@DESCRIPTION: CN9131 SOM based on Bldn MBV-A/B
#
# Use source code provided by Solidrun for Falcon support
# Bootloader configuration
# *****************************************************************************
PREFERRED_VERSION_u-boot ?= "2019.10-solidrun"
# Solidrun made cn913x use the same defconfig for u-boot, but another devicetree
# by settings UBOOT_BUILDENV_DEVICE_TREE in the machine configuration file
UBOOT_MACHINE = "sr_cn913x_cex7_defconfig"
UBOOT_BUILDENV_DEVICE_TREE ??= "${MACHINE}"
UBOOT_ENTRYPOINT = "0x7000000"
UBOOT_LOADADDRESS = "0x7000000"
# Kernel configuration
# ******************************************************************************
PREFERRED_PROVIDER_virtual/kernel ?= "linux-netmodule"
PREFERRED_VERSION_linux-netmodule ?= "git-5.15-solidrun"
PREFERRED_VERSION_trusted_firmware_a ?= "2.6"
KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
KERNEL_DEFCONFIG ?= "cn9130-netmodule_defconfig"
KERNEL_DEVICETREE ?= "\
marvell/${MACHINE}.dtb \
"
require conf/machine/include/cn913x.inc
### Device specific settings

View File

@ -0,0 +1,26 @@
#@TYPE: Machine
#@NAME: cn9131-nitroc
#@DESCRIPTION: Machine support for Belden Nitroc Platform
#
require conf/machine/include/cn913x.inc
# Bootloader configuration
# *****************************************************************************
# Set the configuration and device tree for Nitroc
UBOOT_MACHINE = "nitroc_defconfig"
UBOOT_BUILDENV_DEVICE_TREE ??= "cn9131-nitroc-v1"
# Kernel configuration
# ******************************************************************************
KERNEL_DEFCONFIG ?= "nitroc_defconfig"
KERNEL_DEVICETREE ?= "\
marvell/cn9131-nitroc-v1.dtb \
marvell/cn9131-nitroc-m12.dtb \
marvell/cn9131-nitroc-rj45.dtb \
"
# Needed for phy firmware
MACHINE_EXTRA_RDEPENDS += "linux-firmware-ath10k linux-firmware-ath11k"

View File

@ -11,31 +11,16 @@ require conf/machine/include/soc-family.inc
# *****************************************************************************
PREFERRED_PROVIDER_virtual/bootloader = "u-boot"
PREFERRED_VERSION_u-boot ?= "2019.10-solidrun"
# All cn913x use the same defconfig for u-boot, but another devicetree by
# settings UBOOT_BUILDENV_DEVICE_TREE in the machine configuration file
UBOOT_MACHINE = "sr_cn913x_cex7_defconfig"
UBOOT_BUILDENV_DEVICE_TREE ??= "${MACHINE}"
UBOOT_ENTRYPOINT = "0x7000000"
UBOOT_LOADADDRESS = "0x7000000"
PREFERRED_VERSION_u-boot ?= "2020.10-marvell"
# Kernel configuration
# ******************************************************************************
PREFERRED_PROVIDER_virtual/kernel ?= "linux-netmodule"
PREFERRED_VERSION_linux-netmodule ?= "git-5.15-solidrun"
PREFERRED_VERSION_trusted_firmware_a = "2.6"
PREFERRED_PROVIDER_virtual/kernel ?= "linux-nitroc"
PREFERRED_VERSION_linux-netmodule ?= "v6.6.y%"
PREFERRED_VERSION_trusted-firmware-a ?= "2.9-nitroc"
KERNEL_IMAGETYPE = "Image"
KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
KERNEL_DEFCONFIG ?= "cn9130-netmodule_defconfig"
KERNEL_DEVICETREE ?= "\
marvell/${MACHINE}.dtb \
"
# getty configuration
# ******************************************************************************
@ -54,7 +39,7 @@ WKS_FILE = "cn913x-sdcard.wks.in"
COREOS_INSTALLER_WKS_FILE ?= "cn913x-sdcard-installer.wks"
IMAGE_FSTYPES += "wic.xz wic.bmap"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += " kernel-modules kernel-devicetree"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += " kernel-modules"
COREOS_IMAGE_SWUPDATE_EXTRACLASSES += " coreos-image-swupdate-cn913x"
# No watchdog available yet

View File

@ -0,0 +1,29 @@
DESCRIPTION = "Marvell binaries like the system controller firmware"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://README.md;md5=bbdf038ac62317d3a12a067c50dadc61"
SRC_URI = "git://git@bitbucket.gad.local:7999/nm-nsp/binaries-marvell.git;protocol=ssh;user=git;branch=nitroc"
# Modify these as desired
PV = "11.23.08+git${SRCPV}"
SRCREV = "6765e4fa3eae4000a307bdb891fe8c03f3422f91"
S = "${WORKDIR}/git"
do_configure () {
:
}
do_compile () {
:
}
do_install () {
# The sources are needed by arm-trusted-firmware
install -d "${D}/usr/src/${PN}"
cp -r "${S}/mrvl_scp_bl2.img" "${D}/usr/src/${PN}/"
}
FILES:${PN}-dev = "/usr/src/${PN}"
INSANE_SKIP:${PN}-dev += "file-rdeps"
SYSROOT_DIRS += " /usr/src/${PN} "

View File

@ -1,23 +0,0 @@
From 85df3fa1ce20e577b2a1c83af01a88b7abc373ac Mon Sep 17 00:00:00 2001
From: Alon Rotman <alon.rotman@solid-run.com>
Date: Wed, 24 Mar 2021 15:47:08 +0200
Subject: [PATCH] COMPILE: fix stack overflow warning
Signed-off-by: Alon Rotman <alon.rotman@solid-run.com>
---
drivers/snps/snps_fw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/snps/snps_fw.c b/drivers/snps/snps_fw.c
index e2bbe57..811d70c 100644
--- a/drivers/snps/snps_fw.c
+++ b/drivers/snps/snps_fw.c
@@ -451,7 +451,7 @@ static void snps_mail_box_print_stream_msg(int msg_id, int msg_log_index)
/* 1D and 2D have different mail box dictionary database */
mb_stream_database = (snps_get_state() == TRAINING_2D ? two_d_messages : one_d_messages);
- stream_msg_count = sizeof(mb_stream_database) / sizeof(mb_stream_database[0]);
+ stream_msg_count = sizeof(mb_stream_database) / sizeof(struct mail_box_stream_message);
/* Most of the dictionary msg_id's are continuous, so first check database if
* msg_id cell holds this msg_id */

View File

@ -1,62 +0,0 @@
From 18c20824d9cb05c461c30f86484c0f2b0132bb85 Mon Sep 17 00:00:00 2001
From: Konstantin Porotchkin <kostap@marvell.com>
Date: Tue, 19 Jan 2021 14:06:36 +0200
Subject: [PATCH] fix compilation errors popped up by GCC-10
1. Multiple structure definitions due to define usage
in a header file.
2. Computing static array size from a derived pointer
Change-Id: Ic016813c3f06e2ec8ff9b7ad33c182c85faaa7d5
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/boot/mv_ddr/+/43918
Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com>
Reviewed-by: Ofer Heifetz <oferh@marvell.com>
Reviewed-by: Nadav Haklai <nadavh@marvell.com>
---
drivers/snps/snps.h | 2 +-
drivers/snps/snps_fw.c | 11 +++++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/snps/snps.h b/drivers/snps/snps.h
index 2ed1fec..6964c1c 100644
--- a/drivers/snps/snps.h
+++ b/drivers/snps/snps.h
@@ -322,7 +322,7 @@ struct snps_global_data {
int current_run_num;
};
-struct snps_global_data gd;
+extern struct snps_global_data gd;
extern int static_section_completed;
diff --git a/drivers/snps/snps_fw.c b/drivers/snps/snps_fw.c
index 811d70c..7417e06 100644
--- a/drivers/snps/snps_fw.c
+++ b/drivers/snps/snps_fw.c
@@ -101,6 +101,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ddr_topology_def.h"
#include "ddr3_training_ip_db.h"
+struct snps_global_data gd;
+
struct mail_box_major_message mb_major_messages[] = {
/* ID, Message string */
{MB_MAJOR_ID_END_INIT, "End of initialization"},
@@ -450,8 +452,13 @@ static void snps_mail_box_print_stream_msg(int msg_id, int msg_log_index)
debug_enter();
/* 1D and 2D have different mail box dictionary database */
- mb_stream_database = (snps_get_state() == TRAINING_2D ? two_d_messages : one_d_messages);
- stream_msg_count = sizeof(mb_stream_database) / sizeof(struct mail_box_stream_message);
+ if (snps_get_state() == TRAINING_2D) {
+ mb_stream_database = two_d_messages;
+ stream_msg_count = ARRAY_SIZE(two_d_messages);
+ } else {
+ mb_stream_database = one_d_messages;
+ stream_msg_count = ARRAY_SIZE(one_d_messages);
+ }
/* Most of the dictionary msg_id's are continuous, so first check database if
* msg_id cell holds this msg_id */

View File

@ -1,24 +1,12 @@
# Recipe created by recipetool
# This is the basis of a recipe and may need further editing in order to be fully functional.
# (Feel free to remove these comments when editing.)
DESCRIPTION = "Marvell DDR training library"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://Makefile;md5=9993156c815673120e02a7c8e00a8cc3"
# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is
# your responsibility to verify that the values are complete and correct.
#
# The following license files were not able to be identified and are
# represented as "Unknown" below, you will need to check them yourself:
# drivers/snps/fw/snps_license.txt
LICENSE = "Unknown"
LIC_FILES_CHKSUM = "file://drivers/snps/fw/snps_license.txt;md5=eec6820d302b600f6c1dc29d86f75ccb"
SRC_URI = "git://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git;branch=mv-ddr-devel;protocol=https \
file://0001-COMPILE-fix-stack-overflow-warning.patch \
file://0001-fix-compilation-errors-popped-up-by-GCC-10.patch \
"
SRC_URI = "git://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git;protocol=https;branch=master"
# Modify these as desired
PV = "1.0+git${SRCPV}"
SRCREV = "305d923e6bc4236cd3b902f6679b0aef9e5fa52d"
PV = "devel+git${SRCPV}"
SRCREV = "bfcf62051be835f725005bb5137928f7c27b792e"
S = "${WORKDIR}/git"

View File

@ -0,0 +1,21 @@
require recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
DEPENDS += "mv-ddr-marvell binaries-marvell coreutils-native"
COMPATIBLE_MACHINE = "cn9131-nitroc|cn9130-cf-pro"
LIC_FILES_CHKSUM += "file://docs/license.rst;md5=b2c740efedc159745b9b31f88ff03dde"
SRC_URI = "git://git@bitbucket.gad.local:7999/nm-nsp/trusted-firmware-a.git;protocol=ssh;user=git;branch=nitroc-v2.9.0"
SRCREV = "41911b0db0a07878a384e8358950b79e6df7d1be"
EXTRA_OEMAKE += "MV_DDR_PATH=${PKG_CONFIG_SYSROOT_DIR}/usr/src/mv-ddr-marvell DDR_TOPOLOGY=2 SCP_BL2=${PKG_CONFIG_SYSROOT_DIR}/usr/src/binaries-marvell/mrvl_scp_bl2.img"
TFA_PLATFORM:cn9131-nitroc = "t9130_nitroc"
TFA_PLATFORM:cn9130-cf-pro = "t9130_clearfog_pro"
TFA_BUILD_TARGET = "all mrvl_flash"
TFA_INSTALL_TARGET = "flash-image"
TFA_DEBUG = "1"
TFA_MBEDTLS = "0"
TFA_UBOOT = "1"
TFA_UEFI = "0"

View File

@ -51,6 +51,7 @@ SRC_URI = "git://git.denx.de/u-boot.git;branch=master \
S = "${WORKDIR}/git"
require recipes-bsp/u-boot/u-boot.inc
require recipes-bsp/u-boot/u-boot-coreos.inc
# Solidrun patches require to build out-of-the-tree
B = "${WORKDIR}/build"

View File

@ -0,0 +1,32 @@
HOMEPAGE = "http://www.denx.de/wiki/U-Boot/WebHome"
DESCRIPTION = "U-Boot, a boot loader for Embedded boards based on PowerPC, \
ARM, MIPS and several other processors, which can be installed in a boot \
ROM and used to initialize and test the hardware or to download and run \
application code."
SECTION = "bootloaders"
DEPENDS += "flex-native bison-native"
COMPATIBLE_MACHINE = "cn913x"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://Licenses/README;md5=5a7450c57ffe5ae63fd732446b988025"
PE = "1"
SRCREV = "3534f6601c53362407bc6b3bf0af85908c38b81c"
SRC_URI = "git://git@bitbucket.gad.local:7999/nm-nsp/netmodule-u-boot.git;protocol=ssh;user=git;branch=sdk11.23.08-v2020.10-nitroc"
S = "${WORKDIR}/git"
require recipes-bsp/u-boot/u-boot.inc
require recipes-bsp/u-boot/u-boot-coreos.inc
# Solidrun patches require to build out-of-the-tree
B = "${WORKDIR}/build"
DEPENDS += "bc-native dtc-native u-boot-mkimage-native"
do_compile:prepend() {
export DEVICE_TREE="${UBOOT_BUILDENV_DEVICE_TREE}"
}
SYSROOT_DIRS += " /boot "

View File

@ -1,43 +0,0 @@
HOMEPAGE = "http://www.denx.de/wiki/U-Boot/WebHome"
DESCRIPTION = "U-Boot, a boot loader for Embedded boards based on PowerPC, \
ARM, MIPS and several other processors, which can be installed in a boot \
ROM and used to initialize and test the hardware or to download and run \
application code."
SECTION = "bootloaders"
DEPENDS += "flex-native bison-native"
COMPATIBLE_MACHINE = "cn913x"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://Licenses/README;md5=2ca5f2c35c8cc335f0a19756634782f1"
PE = "1"
FILESEXTRAPATHS:prepend := "${THISDIR}/files_2023.04-marvell:"
# We use the revision in order to avoid having to fetch it from the
# repo during parse
SRCREV = "6add83991b2887619d0b25e4068b4c0082a4596a"
# Patch from https://github.com/SolidRun/cn913x_build
# Git SHA: f33e2aeb01c7ee061be7b053035ae87ce30fce4a
SRC_URI = "git://source.denx.de/u-boot/custodians/u-boot-marvell.git;branch=master;protocol=https \
${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", "file://debug-tweaks.cfg", "", d)} \
file://uefi.cfg \
file://uefi-secureboot.cfg \
file://0001-add-support-for-cn9130-cf-pro-and-cn9130-bldn-mbv.patch \
"
S = "${WORKDIR}/git"
require recipes-bsp/u-boot/u-boot.inc
# Solidrun patches require to build out-of-the-tree
B = "${WORKDIR}/build"
DEPENDS += "bc-native dtc-native u-boot-mkimage-native"
do_compile:prepend() {
export DEVICE_TREE="${UBOOT_BUILDENV_DEVICE_TREE}"
}
SYSROOT_DIRS += " /boot "

View File

@ -18,8 +18,8 @@ sector-size: 512
/dev/mmcblk0p1 : start= 4096, size= 8192, type=71B02716-C000-4F0D-AE03-2F5DC0A114CD, name="fw0", attrs="RequiredPartition"
/dev/mmcblk0p2 : start= 12288, size= 8192, type=71B02716-C000-4F0D-AE03-2F5DC0A114CD, name="fw1", attrs="RequiredPartition"
/dev/mmcblk0p3 : size= ${PART_EFI_SIZE}, ${SFDISK_PART_EFI}
/dev/mmcblk0p4 : size= ${PART_EFIBG_SIZE}, ${SFDISK_PART_EFIBOOTGUARD_A}
/dev/mmcblk0p5 : size= ${PART_EFIBG_SIZE}, ${SFDISK_PART_EFIBOOTGUARD_B}
/dev/mmcblk0p6 : size= ${PART_ROOT_SIZE}, ${SFDISK_PART_ROOT_A}
/dev/mmcblk0p7 : size= ${PART_ROOT_SIZE}, ${SFDISK_PART_ROOT_B}
/dev/mmcblk0p3 : start= 20480, size= 131072, ${SFDISK_PART_EFI}
/dev/mmcblk0p4 : start= 151552, size= 262144, ${SFDISK_PART_EFIBOOTGUARD_A}
/dev/mmcblk0p5 : start= 413696, size= 262144, ${SFDISK_PART_EFIBOOTGUARD_B}
/dev/mmcblk0p6 : start= 675840, size= 7294976, ${SFDISK_PART_ROOT_A}
/dev/mmcblk0p7 : start= 7970816, size= 7294976, ${SFDISK_PART_ROOT_B}

View File

@ -166,7 +166,7 @@ CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT=y
# CONFIG_RING_BUFFER_STARTUP_TEST is not set
# CONFIG_RING_BUFFER_VALIDATE_TIME_DELTAS is not set
# CONFIG_PREEMPTIRQ_DELAY_TEST is not set
CONFIG_CMA_SIZE_MBYTES=256
CONFIG_CMA_SIZE_MBYTES=128
CONFIG_FUNCTION_TRACER
CONFIG_FUNCTION_GRAPH_TRACER
CONFIG_STACK_TRACER

View File

@ -32,7 +32,4 @@ do_configure:append(){
fi
}
# linux-yocto-coreos.inc provide some kernel config fragment that we can apply
# Note that KERNEL_FEATURES are not applied as this recipes doesn't ihnerit
# the linux-yocto class.
require recipes-kernel/linux/linux-yocto-coreos.inc
require recipes-kernel/linux/linux-yocto-coreos-efi.inc

View File

@ -0,0 +1,71 @@
DESCRIPTION = "Linux kernel for the Nitroc hardware"
COMPATIBLE_MACHINE = "cn9131-nitroc|cn9130-cf-pro"
inherit kernel
SRC_URI = "git://git@bitbucket.gad.local:7999/nm-nsp/netmodule-linux.git;protocol=ssh;user=git;branch=nitroc-v6.6.y"
SRCREV ?= "0b8f8f81ab0ec015002357820f50bfc2924390fe"
PV = "v6.6.y+git${SRCPV}"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
S = "${WORKDIR}/git"
#If a KERNEL_DEFCONFIG is specified, the defconfig specified in SRC_URI will be overwritten!
do_configure:append(){
if [ "${KERNEL_DEFCONFIG}" != "" ]; then
oe_runmake ${KERNEL_DEFCONFIG}
fi
configs="${@" ".join(find_cfgs(d))}"
if [ ! -z "${configs}" ]; then
${S}/scripts/kconfig/merge_config.sh -m -O ${WORKDIR}/build ${WORKDIR}/build/.config ${WORKDIR}/*.cfg
fi
}
# The default kenrel.bbclass expects it can remove the source symlink,
# newer kernels don't have this symlink so we need to override kernel_do_install
kernel_do_install() {
#
# First install the modules
#
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
oe_runmake DEPMOD=echo MODLIB=${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION} INSTALL_FW_PATH=${D}${nonarch_base_libdir}/firmware modules_install
rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
# Remove empty module directories to prevent QA issues
find "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel" -type d -empty -delete
else
bbnote "no modules to install"
fi
#
# Install various kernel output (zImage, map file, config, module support files)
#
install -d ${D}/${KERNEL_IMAGEDEST}
#
# When including an initramfs bundle inside a FIT image, the fitImage is created after the install task
# by do_assemble_fitimage_initramfs.
# This happens after the generation of the initramfs bundle (done by do_bundle_initramfs).
# So, at the level of the install task we should not try to install the fitImage. fitImage is still not
# generated yet.
# After the generation of the fitImage, the deploy task copies the fitImage from the build directory to
# the deploy folder.
#
for imageType in ${KERNEL_IMAGETYPES} ; do
if [ $imageType != "fitImage" ] || [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ] ; then
install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType ${D}/${KERNEL_IMAGEDEST}/$imageType-${KERNEL_VERSION}
fi
done
install -m 0644 System.map ${D}/${KERNEL_IMAGEDEST}/System.map-${KERNEL_VERSION}
install -m 0644 .config ${D}/${KERNEL_IMAGEDEST}/config-${KERNEL_VERSION}
install -m 0644 vmlinux ${D}/${KERNEL_IMAGEDEST}/vmlinux-${KERNEL_VERSION}
[ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/${KERNEL_IMAGEDEST}/Module.symvers-${KERNEL_VERSION}
install -d ${D}${sysconfdir}/modules-load.d
install -d ${D}${sysconfdir}/modprobe.d
}
require recipes-kernel/linux/linux-yocto-coreos-efi.inc

View File

@ -11,11 +11,11 @@
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 ${PART_EFI_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_A} --ondisk mmcblk1 --size ${PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_ROOT_B} --ondisk mmcblk1 --size ${PART_ROOT_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_EFIBOOTGUARD_A} --ondisk mmcblk1 --align 1024 --size ${PART_EFIBG_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_EFIBOOTGUARD_B} --ondisk mmcblk1 --align 1024 --size ${PART_EFIBG_SIZE} --extra-space 0 --overhead-factor 1
${WKS_PART_USERDATA} --ondisk mmcblk1 --size ${PART_USERDATA_SIZE} --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 ${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
${WKS_PART_USERDATA} --ondisk mmcblk1 --size ${WKS_PART_USERDATA_SIZE} --extra-space 0 --overhead-factor 1
bootloader --ptable gpt

View File

@ -13,11 +13,8 @@ SRCREV = "34cf1e583eb263dd6644d0ebf3468b3846fc0925"
PACKAGECONFIG[atf] = "BL31=${STAGING_DIR_HOST}/firmware/bl31.bin,,trusted-firmware-a"
# CoreOS enable EFI by default for all u-boot build, but this machine as a dual architecture u-boot
# and EFI is not needed on the co-processor. So we enable it only for the main
# machine
UBOOT_COREOS_REQUIRE:coreos:netmodule-hw34 ?= "recipes-bsp/u-boot/u-boot-coreos.inc"
UBOOT_COREOS_REQUIRE ?= ""
require ${UBOOT_COREOS_REQUIRE}
# Only require coreos include file for the aarch64 build of u-boot
UBOOT_REQUIRE ?= ""
UBOOT_REQUIRE:netmodule-hw34 = "recipes-bsp/u-boot/u-boot-coreos.inc"
require ${UBOOT_REQUIRE}

View File

@ -23,7 +23,4 @@ do_configure:append(){
fi
}
# linux-yocto-coreos.inc provide some kernel config fragment that we can apply
# Note that KERNEL_FEATURES are not applied as this recipes doesn't ihnerit
# the linux-yocto class.
require recipes-kernel/linux/linux-yocto-coreos.inc
require recipes-kernel/linux/linux-yocto-coreos-efi.inc

View File

@ -1,62 +0,0 @@
#!/usr/bin/env bash
#title :coreos-resign-swu-file.sh
#description :This script signs/resigns an already existent swu file with a
# provided private key and a certificate
#author :Patrick Vogelaar
#date :20240325
#version :0.1
#usage :coreos-resign-swu-file.sh -i <in>.swu -k <key> -c <cert>
# -o <output_file>
#notes :openssl and cpio are required
#==============================================================================
SW_DESC_FILE_NAME="sw-description"
SW_DESC_SIG_FILE_NAME="sw-description.sig"
FIRMWARE_TMP_DIR="firmware_tmp"
CPIO_ORDER_FILE="cpio_order"
while getopts i:k:c:o flag
do
case "${flag}" in
i) swupdate_in_file=${OPTARG};;
k) key_file=${OPTARG};;
c) certificate=${OPTARG};;
o) output_file=${OPTARG};;
*);; # TODO: error handling -> unknown flag
esac
done
### Some basic checks
if [[ -d $FIRMWARE_TMP_DIR ]]; then
echo "ERROR: $FIRMWARE_TMP_DIR directory alread exists in this directory"
exit 1
fi
if ! command -v openssl &> /dev/null
then
echo "openssl could not be found"
exit 1
fi
if ! command -v cpio &> /dev/null
then
echo "cpio could not be found"
exit 1
fi
mkdir -p $FIRMWARE_TMP_DIR
cd $FIRMWARE_TMP_DIR || exit 1
# store the exact order in a file
cpio --quiet --list < "../$swupdate_in_file" > $CPIO_ORDER_FILE
cpio --quiet -id < "../$swupdate_in_file"
# resign
openssl cms -sign -in $SW_DESC_FILE_NAME -out $SW_DESC_SIG_FILE_NAME -signer\
"$certificate" -inkey "$key_file" -outform DER -nosmimecap -binary
# recreate the swu file
echo "cat < $CPIO_ORDER_FILE | cpio --quiet -ov > $output_file"
cat < $CPIO_ORDER_FILE | cpio --quiet -ov > "$output_file"

View File

@ -1,164 +0,0 @@
#!/usr/bin/env python3
# Copyright (C) 2023 Hirschmann Automation and Control GmbH
#
# - list all recipes that are supported by the CoreOS team
import sys
import optparse
import os
import re
scripts_path = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0])))
# Add the path if we have own libs
lib_path = os.path.abspath(scripts_path + '/../lib')
sys.path = sys.path + [lib_path]
# Add the OE lib path
lib_path = os.path.abspath(scripts_path + '/../external-layers/openembedded-core/scripts/lib')
sys.path = sys.path + [lib_path]
import scriptpath
# For importing the following modules
bitbakepath = scriptpath.add_bitbake_lib_path()
if not bitbakepath:
sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n")
sys.exit(1)
import bb.cooker
import bb.providers
import bb.tinfoil
from pprint import pprint
def get_fnlist(bbhandler, pkg_pn):
''' Get all recipe file names '''
(latest_versions, preferred_versions, required_versions) = bb.providers.findProviders(bbhandler.config_data, bbhandler.cooker.recipecaches[''], pkg_pn)
fn_list = []
for pn in sorted(pkg_pn):
# use the preferred version
fn_list.append(preferred_versions[pn][1])
return fn_list
def get_recipesdata(bbhandler):
''' Get data of all available recipes '''
pkg_pn = bbhandler.cooker.recipecaches[''].pkg_pn
pkg_dict = {}
supported_pkg_dict = {}
fn_list = get_fnlist(bbhandler, pkg_pn)
size = str(len(fn_list))
i = 0
for fn in fn_list:
print(size + "/" + str(i))
i += 1
data = bbhandler.parse_recipe_file(fn)
maintainer = data.getVar("COREOS_RECIPE_MAINTAINER")
pn = data.getVar("PN")
packages = data.getVar("PACKAGES")
packages += data.getVar("PROVIDES")
pkg_dict[pn] = data
if maintainer:
supported_pkg_dict[pn] = data
for pkg in packages.split():
pkg_dict[pkg] = data
if maintainer:
supported_pkg_dict[pkg] = data
return pkg_dict, supported_pkg_dict
def resolve_dependencies(pkg_dict, supported_pkg_dict):
''' Resolve dependencies and add them to supported packages '''
sup_with_dep_dict = {}
for pkg in supported_pkg_dict:
depends = supported_pkg_dict[pkg].getVar("DEPENDS") or ''
rdepends = supported_pkg_dict[pkg].getVar("RDEPENDS") or ''
sup_with_dep_dict[pkg] = pkg_dict[pkg]
for d_pkg in depends.split():
if ("virtual/" in d_pkg) or ("native" in d_pkg):
continue
sup_with_dep_dict[d_pkg] = pkg_dict[d_pkg]
for r_pkg in rdepends.split():
if ("virtual/" in r_pkg) or ("native" in r_pkg):
continue
sup_with_dep_dict[r_pkg] = pkg_dict[r_pkg]
return sup_with_dep_dict
def display(supported_pkg_dict):
''' Display all pkgs and COREOS_RECIPE_MAINTAINER information '''
print(f'{str("RECIPE NAMES:"):40} {str("META-LAYER:"):40} {str("COS-MAINTAINER:"):50}')
for pn in supported_pkg_dict:
recipe_name = supported_pkg_dict[pn].getVar("P")
recipe_path = supported_pkg_dict[pn].getVar("FILE")
meta_layer = re.search("(?<=/layers/)(.*)(?=/recipe)", recipe_path).group(0)
maintainer = supported_pkg_dict[pn].getVar("COREOS_RECIPE_MAINTAINER") or 'Supported by Dependency'
print(f'{recipe_name:40} {meta_layer:40} {maintainer:50}')
def get_unique_list(supported_pkg_dict):
''' Create a list that only contains one package based on PN '''
unique_dict = {}
for pkg in supported_pkg_dict:
pn = supported_pkg_dict[pkg].getVar("P")
unique_dict[pn] = supported_pkg_dict[pkg]
return unique_dict
def print_to_file(supported_pkg_dict, file):
''' print list to a file '''
with open(file, "w") as file:
file.write(f'{str("RECIPE NAMES:"):40} {str("META-LAYER:"):40} {str("COS-MAINTAINER:"):50}\n')
for pn in supported_pkg_dict:
recipe_name = supported_pkg_dict[pn].getVar("P")
recipe_path = supported_pkg_dict[pn].getVar("FILE")
meta_layer = re.search("(?<=/layers/)(.*)(?=/recipe)", recipe_path).group(0)
maintainer = supported_pkg_dict[pn].getVar("COREOS_RECIPE_MAINTAINER") or 'Supported by Dependency'
file.write(f'{recipe_name:40} {meta_layer:40} {maintainer:50}\n')
def main():
parser = optparse.OptionParser(
description = "Lists all recipes supported by CoreOS.",
usage = """
%prog [options]""")
parser.add_option("-p", "--print",
help = "print all recipes that are supported",
action="store_const", dest="print", default=True)
parser.add_option("-f", "--file",
help = "store in file",
action="store", dest="file", type="string")
options, args = parser.parse_args(sys.argv)
with bb.tinfoil.Tinfoil() as bbhandler:
bbhandler.prepare()
print("Gathering recipe data...")
pkg_dict, supported_pkg_dict = get_recipesdata(bbhandler)
new_len = len(supported_pkg_dict)
old_len = 0
while old_len != new_len:
supported_pkg_dict = resolve_dependencies(pkg_dict, supported_pkg_dict)
old_len = new_len
new_len = len(supported_pkg_dict)
unique_dict = get_unique_list(supported_pkg_dict)
supported_pkg_dict = unique_dict
if options.print:
display(supported_pkg_dict)
if options.file:
print_to_file(supported_pkg_dict, options.file)
if __name__ == "__main__":
main()