#@TYPE: Distro #@NAME: PLC-OS #@DESCRIPTION: Open Source Realtime OS for running PLC logic (Full Featured Distribution) # we want to use rsyslog as the default syslog, but it's GPLv3, so need this # check to switch to sysklogd if GLPv3 is blacklisted. VIRTUAL-RUNTIME_syslog ?= "${@bb.utils.contains('INCOMPATIBLE_LICENSE', 'GPL-3.0-only', 'sysklogd', 'rsyslog', d)}" VIRTUAL-RUNTIME_base-utils-syslog ?= "${VIRTUAL-RUNTIME_syslog}" NETWORK_MANAGER = "" # common plcos distro definitions # ############################################################################################################# # We need this to add multilib support to the built-in QEMU BSPs include conf/distro/include/plcos-bsp-${MACHINE}.inc MAINTAINER = "Vaughn Varma " PLCOS_VARIANT ??= "" PLCOS_NAME = "PLC-OS" PLCOS_VERSION ??= "0.1" PLCOS_UPDATE_VERSION = "0" PLCOS_BRANCH ?= "" DISTRO = "plcos" DISTRO_NAME ?= "${PLCOS_NAME}${PLCOS_VARIANT}" DISTRO_VERSION ?= "${PLCOS_VERSION}" SDK_VERSION ?= "${PLCOS_VERSION}" SDK_VERSION[vardepvalue] = "${SDK_VERSION}" DISTRO_PRETTY_VERSION ?= "${PLCOS_VERSION}${@' Update ${PLCOS_UPDATE_VERSION}' if d.getVar('PLCOS_UPDATE_VERSION') != '0' else ''}" #TODO release own distro codename DISTRO_CODENAME ?= "wrynose" #TODO: build own SDK SDK_VENDOR = "-pokysdk" #TARGET_VENDOR = "-wrs" #possible issue of this making full path names too long?? TARGET_VENDOR = "-poky" DISTROOVERRIDES:append = "${@['', ':'][(d.getVar('DISTRO', True) != '')]}poky" LOCALCONF_VERSION = "2" SDK_NAME = "${DISTRO}-${TCLIBC}-${SDKMACHINE}-${IMAGE_BASENAME}-${TUNE_PKGARCH}-${MACHINE}" SDKPATHINSTALL = "/opt/${DISTRO}/${SDK_VERSION}" PLCOS_DEFAULT_DISTRO_FEATURES = "multiarch ptest" #PLCOS_DEFAULT_DISTRO_FEATURES = "largefile multiarch pulseaudio kvm virtualization" PLCOS_DEFAULT_EXTRA_RDEPENDS = "packagegroup-core-boot packagegroup-plcos-core" #PLCOS_DEFAULT_EXTRA_RDEPENDS += " packagegroup-core-boot-wrs" PLCOS_DEFAULT_EXTRA_RRECOMMENDS = "kernel-module-af-packet" #DISTRO_FEATURES:append = "${DISTRO_FEATURES_DEFAULTS} ${PLCOS_DEFAULT_DISTRO_FEATURES}" DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULTS} ${PLCOS_DEFAULT_DISTRO_FEATURES}" DISTRO_EXTRA_RDEPENDS += " ${PLCOS_DEFAULT_EXTRA_RDEPENDS}" DISTRO_EXTRA_RRECOMMENDS += " ${PLCOS_DEFAULT_EXTRA_RRECOMMENDS}" #IMAGE_LINGUAS ?= "" # The CONNECTIVITY_CHECK_URI's are used to test whether we can succesfully # fetch from the network (and warn you if not). To disable the test set # the variable to be empty. #CONNECTIVITY_CHECK_URIS ?= "https://www.example.com/" #TODO evaluate which of these are necessary, modify or replace them to ensure full open source compliance #currently some of these files are from wrlinux #require conf/distro/include/poky-world-exclude.inc #require conf/distro/include/no-static-libs.inc #require conf/distro/include/plcos-uninative.inc #require packagegroup-core-base-utils.inc #require conf/distro/include/plcos_security_flags.inc #require conf/distro/include/plcos-space-optimize.inc # Default hash policy for distro #BB_SIGNATURE_HANDLER ?= 'OEBasicHash' BB_SIGNATURE_HANDLER ?= "OEEquivHash" BB_HASHSERVE ??= "auto" INIT_MANAGER ?= "systemd" # QA check settings - a little stricter than the OE-Core defaults WARN_TO_ERROR_QA ?= "already-stripped compile-host-path install-host-path \ installed-vs-shipped ldflags pn-overrides rpaths staticdev \ unknown-configure-option useless-rpaths" WARN_QA:remove = "${WARN_TO_ERROR_QA}" ERROR_QA:append = " ${WARN_TO_ERROR_QA}" # Change base package dependency in -dbg packages from recommends to suggests #RRECOMMENDS:${PN}-dbg = "" #RSUGGESTS:${PN}-dbg = "${PN} (= ${EXTENDPKGV})" # Make sure that ldconfig is only enabled when the user has added ldconfig # to the DISTRO_FEATURES #This was set to BACKFILL_CONSIDERED in previous yocto versions, it seems the change may be breaking something for intel-x86 # Make sure that X11 is only enabled in a graphics configuration #DISTRO_FEATURES_OPTED_OUT += "ldconfig x11" # Multilib configuration MULTILIBS ?= "" MULTILIB_CONF = "${@'conf/multilib.conf' if d.getVar('MULTILIBS') and d.getVar('PACKAGE_CLASSES').split()[0] != 'package_deb' else ''}" require ${MULTILIB_CONF} # only support realtime kernels. This OS is focused on realtime performance TARGET_SUPPORTED_KTYPES = "preempt-rt" PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-rt" # Blacklisted Packages #SKIP_RECIPE[xyz-abc] ?= "Recipe xyz-abc is blacklisted via SKIP_RECIPE" # SANITY_TESTED_DISTROS used to defined the distribution list which we used to build PLC-OS #cachyos is NOT officially supported by yocto/bitbake, but we have personally tested it without issue SANITY_TESTED_DISTROS ?= " \ ubuntu-24.04 \n \ cachyos-260809 \n " # TODO: This works, but OE documentation recommends either working with the DISTRO_FEATURES variable, or with the DISTRO_FEATURES_OPTED_OUT variable #Same with the MACHINE_FEATURES_OPTED_OUT DISTRO_FEATURES_DEFAULTS:remove:class-target = "x11" DISTRO_FEATURES_DEFAULTS:remove:class-target = "wayland" DISTRO_FEATURES_DEFAULTS:remove:class-target = "vulkan" DISTRO_FEATURES_DEFAULTS:remove:class-target = "3g" DISTRO_FEATURES_DEFAULTS:remove:class-target = "nfc" DISTRO_FEATURES_DEFAULTS:remove:class-target = "nfs" MACHINE_FEATURES:remove:class-target = "3g" MACHINE_FEATURES:remove:class-target = "nfc" #ran into an issue where leaving pcbios on meant that the installed EFI would boot into the installer USB by default, despite BIOS settings MACHINE_FEATURES:remove:class-target = "pcbios" #we are using grub-efi for tuned; this is automatically included in x86 and SystemReady ARM configurations, but must be included for *all* architectures, including non-SystemReady ARM devices such as raspberry pi, which must chain-load u-boot into efi MACHINE_FEATURES:append = " efi" #PLCOS_DEFAULT_DISTRO_FEATURES += "pam" # Native sstate should not depend on multilib provider whitelist #BB_MULTI_PROVIDER_ALLOWED:class-native:forcevariable = "" # Configure the root user's home directory #ROOT_HOME ?= "/root" # initramfs image for plcos distro #TODO investigate having own initramfs image; some other yocto distros have their own (e.g. wrlinux), but for now we use default yocto/poky initramfs INITRD_IMAGE_LIVE ?= "${@d.getVar('INITRAMFS_IMAGE', True) if d.getVar('INITRAMFS_IMAGE', True) else 'core-image-minimal-initramfs'}" # The providers are fftwf, fftwl, fftw PREFERRED_PROVIDER_virtual/fftw = "fftw" ## Syslinux options for boot menus when using isolinux or linux live #SYSLINUX_TIMEOUT = "50" #SYSLINUX_SPLASH = "${@oe.utils.conditional('WRLINUX_BRANCH', 'LTS', '${LAYER_PATH_plcos}/files/syslinux/bootloading-blue-wrl.png', '${LAYER_PATH_plcos}/files/syslinux/bootloading-gray-wrl.png', d)}" #SYSLINUX_SPLASH = "${LAYER_PATH_meta-realtime}/recipes-extended/psplash/files/psplash-plcos-img.png" #AUTO_SYSLINUXMENU = "1" ## "1" = Have graphics and serial in the boot menu when use grub-efi in iso GRUB_GFXSERIAL = "0" #TODO consider handling this some other way, this seems hacky GRUB_TIMEOUT ?= "0" # Possibly eliminate busybox from an image. The variables defined here # are used by oe-core packagegroup-core-boot.bb. VIRTUAL-RUNTIME_login_manager = "shadow" # This runs the busybox-hwclock script during systemv # init. This does NOT supply /sbin/hwclock, only a script! # VIRTUAL-RUNTIME_base-utils-hwclock = "busybox-hwclock" # Supply replacements for busybox functions we really, really need. # #VIRTUAL-RUNTIME_base-utils = "packagegroup-core-base-utils" #IMAGE_INSTALL:append = " ${VIRTUAL-RUNTIME_base-utils}" PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto-rt" INHERIT += "ext_secure_cflags wrlinux-metadata_scm" # Support distro features override INHERIT += "distrooverrides" INHERIT += "poky-sanity" PREFERRED_VERSION_linux-yocto ?= "6.18%" PREFERRED_VERSION_linux-yocto-rt ?= "6.18%" PREFERRED_VERSION_linux-yocto-tiny ?= "6.18%" # Third party download notice #INHERIT += "third-party-dl" # Enable VENDOR REVISION for CVE patches #VENDOR_REVISION_PREFIX ?= ".wr" #INHERIT += "enable-vendor-revision" # Extend CLANG_EXTRA_OE_DISTRO to make clang work well on plcos host. See usage in meta-clang. # TODO: check if needed or helpful. removed for parity with poky #CLANG_EXTRA_OE_DISTRO:append = " plcos-graphics:poky plcos:poky" #INHERIT += "uninative" #INHERIT += "create-spdx" # We need debug symbols so that SPDX license manifests for the kernel work KERNEL_EXTRA_FEATURES:append = " features/debug/debug-kernel.scc" KERNEL_FEATURES:append = " ${KERNEL_EXTRA_FEATURES}" KERNEL_FEATURES:append = " tuning-and-support.scc" EFI_PROVIDER = "grub-efi" #default device hostname hostname:pn-base-files = "plc" WKS_FILE:x86 = "plcos-bootdisk-x86.wks.in" WKS_FILE:x86-64 = "plcos-bootdisk-x86.wks.in" WKS_FILE:intel-x86-common = "plcos-bootdisk-intel.wks.in" WKS_FILE:aarch64 = "plcos-bootdisk-arm.wks.in" DISTRO_FEATURES:append = " pam opengl usbhost largefile " #DISTRO_FEATURES:append = " x11 wayland virtualization " INHERIT += "rtopts" APPEND += "rcu_nocb_poll nmi-watchdog=0 processor.max_cstate=1 noefi irqaffinity=0" ROOTFS_POSTPROCESS_COMMAND += " set_kernel_opts;" TARGET_SUPPORTED_KTYPES:append = " preempt-rt" DISTRO_FEATURES_DEFAULTS:append = " usbhost" # use systemd as the default init manager INIT_MANAGER = "systemd"