From 11e8648ac9f8c508d6bbcb6cdb43aa9fbf490298 Mon Sep 17 00:00:00 2001 From: Samuel Dolt Date: Mon, 17 Oct 2022 11:36:42 +0200 Subject: [PATCH 1/2] meta-belden-coreos-bsp: add layer --- layers/meta-belden-coreos-bsp/COPYING.MIT | 17 ++++++++ layers/meta-belden-coreos-bsp/README | 41 +++++++++++++++++++ layers/meta-belden-coreos-bsp/conf/layer.conf | 13 ++++++ templates/bblayers.conf.sample | 1 + 4 files changed, 72 insertions(+) create mode 100644 layers/meta-belden-coreos-bsp/COPYING.MIT create mode 100644 layers/meta-belden-coreos-bsp/README create mode 100644 layers/meta-belden-coreos-bsp/conf/layer.conf diff --git a/layers/meta-belden-coreos-bsp/COPYING.MIT b/layers/meta-belden-coreos-bsp/COPYING.MIT new file mode 100644 index 0000000..fb950dc --- /dev/null +++ b/layers/meta-belden-coreos-bsp/COPYING.MIT @@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/layers/meta-belden-coreos-bsp/README b/layers/meta-belden-coreos-bsp/README new file mode 100644 index 0000000..ec7e53c --- /dev/null +++ b/layers/meta-belden-coreos-bsp/README @@ -0,0 +1,41 @@ +This README file contains information on the contents of the meta-belden-bsp layer. + +Please see the corresponding sections below for details. + +Dependencies +============ + + URI: + branch: + + URI: + branch: + + . + . + . + +Patches +======= + +Please submit any patches against the meta-belden-bsp layer to the xxxx mailing list (xxxx@zzzz.org) +and cc: the maintainer: + +Maintainer: XXX YYYYYY + +Table of Contents +================= + + I. Adding the meta-belden-bsp layer to your build + II. Misc + + +I. Adding the meta-belden-bsp layer to your build +================================================= + +Run 'bitbake-layers add-layer meta-belden-bsp' + +II. Misc +======== + +--- replace with specific information about the meta-belden-bsp layer --- diff --git a/layers/meta-belden-coreos-bsp/conf/layer.conf b/layers/meta-belden-coreos-bsp/conf/layer.conf new file mode 100644 index 0000000..9d7fe1a --- /dev/null +++ b/layers/meta-belden-coreos-bsp/conf/layer.conf @@ -0,0 +1,13 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "meta-belden-coreos-bsp" +BBFILE_PATTERN_meta-belden-bsp = "^${LAYERDIR}/" +BBFILE_PRIORITY_meta-belden-bsp = "6" + +LAYERDEPENDS_meta-belden-bsp = "core meta-belden-coreos" +LAYERSERIES_COMPAT_meta-belden-bsp = "kirkstone" diff --git a/templates/bblayers.conf.sample b/templates/bblayers.conf.sample index ab16e37..9699cdc 100644 --- a/templates/bblayers.conf.sample +++ b/templates/bblayers.conf.sample @@ -8,5 +8,6 @@ BBFILES ?= "" BBLAYERS ?= " \ ##OEROOT##/meta \ ##COREOS_LAYERSDIR##/meta-belden-coreos \ + ##COREOS_LAYERSDIR##/meta-belden-coreos-bsp \ ##COREOS_LAYERSDIR##/meta-belden-marvell-bsp \ " From a7438b518d50b259ff5abc3138ac1735ebdcd4f2 Mon Sep 17 00:00:00 2001 From: Samuel Dolt Date: Fri, 14 Oct 2022 15:04:40 +0200 Subject: [PATCH 2/2] meta-belden-coreos-bsp: add the pc-x64 machine --- layers/meta-belden-coreos-bsp/COPYING.MIT | 17 ----------------- layers/meta-belden-coreos-bsp/conf/layer.conf | 8 ++++---- .../conf/machine/include/pc-common.inc | 16 ++++++++++++++++ .../conf/machine/pc-x64.conf | 11 +++++++++++ .../linux/linux-yocto_5.15.bbappend | 5 +++++ .../wic/generic-uefi.wks.in | 7 +++++++ .../classes/coreos-image.bbclass | 5 +++++ 7 files changed, 48 insertions(+), 21 deletions(-) delete mode 100644 layers/meta-belden-coreos-bsp/COPYING.MIT create mode 100644 layers/meta-belden-coreos-bsp/conf/machine/include/pc-common.inc create mode 100644 layers/meta-belden-coreos-bsp/conf/machine/pc-x64.conf create mode 100644 layers/meta-belden-coreos-bsp/recipes-kernel/linux/linux-yocto_5.15.bbappend create mode 100644 layers/meta-belden-coreos-bsp/wic/generic-uefi.wks.in diff --git a/layers/meta-belden-coreos-bsp/COPYING.MIT b/layers/meta-belden-coreos-bsp/COPYING.MIT deleted file mode 100644 index fb950dc..0000000 --- a/layers/meta-belden-coreos-bsp/COPYING.MIT +++ /dev/null @@ -1,17 +0,0 @@ -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/layers/meta-belden-coreos-bsp/conf/layer.conf b/layers/meta-belden-coreos-bsp/conf/layer.conf index 9d7fe1a..2577c7a 100644 --- a/layers/meta-belden-coreos-bsp/conf/layer.conf +++ b/layers/meta-belden-coreos-bsp/conf/layer.conf @@ -6,8 +6,8 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ ${LAYERDIR}/recipes-*/*/*.bbappend" BBFILE_COLLECTIONS += "meta-belden-coreos-bsp" -BBFILE_PATTERN_meta-belden-bsp = "^${LAYERDIR}/" -BBFILE_PRIORITY_meta-belden-bsp = "6" +BBFILE_PATTERN_meta-belden-coreos-bsp = "^${LAYERDIR}/" +BBFILE_PRIORITY_meta-belden-coreos-bsp = "6" -LAYERDEPENDS_meta-belden-bsp = "core meta-belden-coreos" -LAYERSERIES_COMPAT_meta-belden-bsp = "kirkstone" +LAYERDEPENDS_meta-belden-coreos-bsp = "core meta-belden-coreos" +LAYERSERIES_COMPAT_meta-belden-coreos-bsp = "kirkstone" diff --git a/layers/meta-belden-coreos-bsp/conf/machine/include/pc-common.inc b/layers/meta-belden-coreos-bsp/conf/machine/include/pc-common.inc new file mode 100644 index 0000000..54840a6 --- /dev/null +++ b/layers/meta-belden-coreos-bsp/conf/machine/include/pc-common.inc @@ -0,0 +1,16 @@ +include conf/machine/include/x86/x86-base.inc +require conf/machine/include/x86/qemuboot-x86.inc + +MACHINE_FEATURES += "wifi efi" + +PREFERRED_VERSION_linux-yocto ?= "5.15%" +PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto" + +MACHINE_EXTRA_RRECOMMENDS += "kernel-modules linux-firmware" + +IMAGE_FSTYPES += "ext4 wic wic.bmap wic.vmdk iso" + +WKS_FILE ?= "generic-uefi.wks.in" +EFI_PROVIDER ?= "systemd-boot" +do_image_wic[depends] += "gptfdisk-native:do_populate_sysroot" +do_image_wic[recrdeptask] += "do_bootimg" diff --git a/layers/meta-belden-coreos-bsp/conf/machine/pc-x64.conf b/layers/meta-belden-coreos-bsp/conf/machine/pc-x64.conf new file mode 100644 index 0000000..606b68f --- /dev/null +++ b/layers/meta-belden-coreos-bsp/conf/machine/pc-x64.conf @@ -0,0 +1,11 @@ +#@TYPE: Machine +#@NAME: Generic x86_64 +#@DESCRIPTION: Machine configuration for generic x86_64 (64-bit) PCs and servers. Supports a moderately wide range of drivers that should boot and be usable on "typical" hardware. + +DEFAULTTUNE ?= "core2-64" +require conf/machine/include/x86/tune-core2.inc +require conf/machine/include/pc-common.inc + +SERIAL_CONSOLES_CHECK = "ttyS0" +#For runqemu +QB_SYSTEM_NAME = "qemu-system-x86_64" diff --git a/layers/meta-belden-coreos-bsp/recipes-kernel/linux/linux-yocto_5.15.bbappend b/layers/meta-belden-coreos-bsp/recipes-kernel/linux/linux-yocto_5.15.bbappend new file mode 100644 index 0000000..ac23e17 --- /dev/null +++ b/layers/meta-belden-coreos-bsp/recipes-kernel/linux/linux-yocto_5.15.bbappend @@ -0,0 +1,5 @@ +KMACHINE:pc-x64 ?= "common-pc-64" +COMPATIBLE_MACHINE:pc-x64 = "pc-x64" + +# Enable some kernel features related to virtualiuzation +KERNEL_FEATURES:append:pc-x64=" cfg/virtio.scc cfg/paravirt_kvm.scc" diff --git a/layers/meta-belden-coreos-bsp/wic/generic-uefi.wks.in b/layers/meta-belden-coreos-bsp/wic/generic-uefi.wks.in new file mode 100644 index 0000000..069ec09 --- /dev/null +++ b/layers/meta-belden-coreos-bsp/wic/generic-uefi.wks.in @@ -0,0 +1,7 @@ +# short-description: Create an EFI disk image for genericx86* +# long-description: Creates a partitioned EFI disk image for genericx86* machines +part /boot --source bootimg-efi --sourceparams="loader=${EFI_PROVIDER}" --ondisk sda --label msdos --active --align 1024 +part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid +part swap --ondisk sda --size 44 --label swap1 --fstype=swap + +bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=ttyS0,115200 console=tty0" \ No newline at end of file diff --git a/layers/meta-belden-coreos/classes/coreos-image.bbclass b/layers/meta-belden-coreos/classes/coreos-image.bbclass index 6ae0dfb..9e1b4c0 100644 --- a/layers/meta-belden-coreos/classes/coreos-image.bbclass +++ b/layers/meta-belden-coreos/classes/coreos-image.bbclass @@ -15,6 +15,11 @@ MACHINE_HWCODECS ??= "" # available. For CoreOS, we only support dropbear FEATURE_PACKAGES_ssh-server = "packagegroup-core-ssh-dropbear" +# The ptest distro feature want to install openssh-ptest by default, that conflict with dropbear +# Do not install openssh complementary packages if either packagegroup-core-ssh-dropbear or dropbear +# is installed # to avoid openssh-dropbear conflict +# see [Yocto #14858] for more information +PACKAGE_EXCLUDE_COMPLEMENTARY:append = "${@bb.utils.contains_any('PACKAGE_INSTALL', 'packagegroup-core-ssh-dropbear dropbear', 'openssh', '' , d)}" # We can handle feature that conflicts with either: