DISTRO = "belden-coreos"
DISTRO_NAME = "Belden CoreOS"
MAINTAINER = "Belden CoreOS Team"

INHERIT += "coreos_metadata_scm"

DISTRO_VERSION = "0.0.1"
DISTRO_CODENAME = "kirkstone"

# Distro features and policies
# ==============================================================================

PACKAGE_CLASSES = "package_ipk"
INIT_MANAGER = "systemd"

# CoreOS use journald from the systemd package to handle log
# https://docs.yoctoproject.org/singleindex.html#using-systemd-journald-without-a-traditional-syslog-daemon
# This remove syslog from packagegroup-core-boot
VIRTUAL-RUNTIME_syslog = ""
VIRTUAL-RUNTIME_base-utils-syslog = ""

DISTRO_FEATURES_DEFAULT ?= "bluetooth usbhost pci ipv4 ipv6 wifi multiarch usrmerge ptest efi pam"
DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT}"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "pulseaudio ldconfig"
DISTRO_EXTRA_RDEPENDS += "packagegroup-core-boot"

# Build configuration
# ==============================================================================

TARGET_VENDOR = "-belden"

# We don't support multiple libc, so we don't need to append the libc name to
# the tmp directory: ie use build/tmp instead of build/tmp-glibc
TCLIBCAPPEND = ""

SANITY_TESTED_DISTROS ?= " \
            debian-11 \n \
            ubuntu-22.04 \n \
            "

# This variable is used to ensure that any distribution using the CoreOS layer
# include this file. This is checked by the coreos-sanity class
SANITY_COREOS_COMPATIBLE ?= "1"

require conf/distro/include/no-static-libs.inc
require conf/distro/include/yocto-uninative.inc
require conf/distro/include/security_flags.inc

# uninative is need to share the sstates between multiple host distrubtion
INHERIT += "uninative"

# Bitbake configuration
# ==============================================================================

BB_SIGNATURE_HANDLER ?= "OEBasicHash"

# SDK Configuration
# ==============================================================================

SDK_VENDOR = "-coreossdk"
SDK_VERSION = "${DISTRO_VERSION}"
SDK_VERSION[vardepvalue] = "${SDK_VERSION}"
SDK_NAME = "${DISTRO}-${TCLIBC}-${SDKMACHINE}-${IMAGE_BASENAME}-${TUNE_PKGARCH}-${MACHINE}"
SDKPATHINSTALL = "/opt/${DISTRO}/${SDK_VERSION}"

# EFI and Secure boot
# ==============================================================================

EFI_PROVIDER = "efibootguard"
EFIBOOTGUARD_TIMEOUT ??= "60"
INHERIT += "coreos-efi-secureboot"

# Virtualization configuration
# ==============================================================================

# Use crun insted of runc as a OCI runtime. crun is faster and need less memory
# than runc so it's a better fit for embedded
#PREFERRED_PROVIDER_virtual/runc = "crun"
PACKAGECONFIG:append:pn-podman = " rootless"
DISTRO_FEATURES_DEFAULT += "virtualization seccomp ipv6"
