Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,2 @@
DISTRO_FEATURES += "etcd"
DISTROOVERRIDES .= "df-etcd"
@@ -0,0 +1 @@
DISTRO_FEATURES += "extra-dev-debug-tools"
@@ -0,0 +1,2 @@
DISTRO_FEATURES += "obmc-aspeed-spi-master"
DISTROOVERRIDES .= ":df-aspeed-spi-master"
@@ -0,0 +1,2 @@
DISTRO_FEATURES += "obmc-aspeednic-use-mac2"
DISTROOVERRIDES .= ":df-aspeednic-use-mac2"
@@ -0,0 +1,150 @@
require conf/distro/include/phosphor-defaults.inc
require conf/distro/include/phosphor-pkg-tweaks.inc
# Match the distro codename from upstream poky.
DISTRO_CODENAME ?= "mickledore"
# Override these in poky based distros
POKY_DEFAULT_DISTRO_FEATURES = "opengl ptest multiarch wayland vulkan"
POKY_DEFAULT_EXTRA_RDEPENDS = "packagegroup-core-boot"
POKY_DEFAULT_EXTRA_RRECOMMENDS = "kernel-module-af-packet"
DISTRO_EXTRA_RDEPENDS += " ${POKY_DEFAULT_EXTRA_RDEPENDS}"
DISTRO_EXTRA_RRECOMMENDS += " ${POKY_DEFAULT_EXTRA_RRECOMMENDS}"
DISTROOVERRIDES .= ":openbmc-phosphor"
TCLIBCAPPEND = ""
QEMU_TARGETS ?= "arm aarch64 i386 riscv32 riscv64 ppc64le x86_64"
PREMIRRORS ??= "\
bzr://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
cvs://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
git://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
gitsm://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
hg://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
osc://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
p4://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
svn://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n"
MIRRORS =+ "\
ftp://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
http://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
https://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n"
# The CONNECTIVITY_CHECK_URI's are used to test whether we can successfully
# fetch from the network (and warn you if not). To disable the test set
# the variable to be empty.
# Git example url: git://git.yoctoproject.org/yocto-firewall-test;protocol=https;rev=master
CONNECTIVITY_CHECK_URIS ?= "https://yoctoproject.org/connectivity.html"
SANITY_TESTED_DISTROS ?= " \
poky-2.4 \n \
poky-2.5 \n \
ubuntu-15.04 \n \
ubuntu-16.04 \n \
ubuntu-16.10 \n \
ubuntu-17.04 \n \
fedora-26 \n \
centos-7 \n \
debian-8 \n \
debian-9 \n \
opensuse-42.1 \n \
opensuse-42.2 \n \
"
#
# OELAYOUT_ABI allows us to notify users when the format of TMPDIR changes in
# an incompatible way. Such changes should usually be detailed in the commit
# that breaks the format and have been previously discussed on the mailing list
# with general agreement from the core team.
#
OELAYOUT_ABI = "12"
# 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 \
useless-rpaths"
WARN_QA:remove = "${WARN_TO_ERROR_QA}"
ERROR_QA:append = " ${WARN_TO_ERROR_QA}"
require conf/distro/include/no-static-libs.inc
require conf/distro/include/yocto-uninative.inc
DISTRO_NAME ?= "Phosphor OpenBMC (Phosphor OpenBMC Project Reference Distro)"
TARGET_VENDOR="-openbmc"
VIRTUAL-RUNTIME_keymaps = ""
# Phosphor OpenBMC uses systemd and udev
VIRTUAL-RUNTIME_init_manager = "systemd"
VIRTUAL-RUNTIME_initscripts = ""
DISTRO_FEATURES_BACKFILL_CONSIDERED = " \
bluez5 \
ldconfig \
gobject-introspection-data \
pulseaudio \
sysvinit \
"
DISTRO_FEATURES_OBMC = " \
obmc-host-ctl \
obmc-host-ipmi \
obmc-phosphor-chassis-mgmt \
obmc-phosphor-fan-mgmt \
obmc-phosphor-flash-mgmt \
obmc-phosphor-system-mgmt \
"
DISTRO_FEATURES_DEFAULT = " \
avahi \
ipv4 \
ipv6 \
pam \
security \
slp \
systemd \
seccomp \
usrmerge \
"
DISTRO_FEATURES += " \
${DISTRO_FEATURES_DEFAULT} \
${DISTRO_FEATURES_OBMC} \
"
DISTRO_EXTRA_RDEPENDS:remove:qemuarm = "packagegroup-core-device-devel"
include conf/distro/include/openbmc-phosphor/${MACHINE}.inc
IMAGE_CLASSES:append = " image_types_phosphor phosphor-rootfs-postcommands"
IMAGE_CLASSES:append:npcm7xx = " image_types_phosphor_nuvoton"
IMAGE_CLASSES:append:npcm8xx = " image_types_phosphor_nuvoton_npcm8xx"
IMAGE_INSTALL:append = " dbus-broker libnss-systemd"
# Skip the udev database by default. It adds around 2MB
# compressed to the root filesystem, and probably doesn't
# make sense on a BMC anyway.
BAD_RECOMMENDATIONS += "udev-hwdb"
BAD_RECOMMENDATIONS += "shared-mime-info"
# e2fsprogs isn't needed on a BMC without MMC, where it gets explicitly added
BAD_RECOMMENDATIONS += "e2fsprogs-e2fsck"
LAYER_CONF_VERSION ?= "8"
KERNEL_CLASSES:append = " obmc-phosphor-kernel-version"
# Some packages have directory trees of YAML files arranged based on
# canonical organization names. 'org/freedesktop' and 'xyz/openbmc_project'
# should be used everywhere in phosphor, but some layers may append this with
# their own organization(s).
OBMC_ORG_YAML_SUBDIRS += " org/freedesktop xyz/openbmc_project"
PREFERRED_VERSION_libgpiod = "1.6.4"
# Enable SBOM: https://docs.yoctoproject.org/next/dev-manual/sbom.html
INHERIT += "create-spdx"
@@ -0,0 +1,166 @@
OBMC_BMC_INSTANCES ?= "0"
OBMC_CHASSIS_INSTANCES ?= "0"
OBMC_HOST_INSTANCES ?= "0"
OBMC_POWER_INSTANCES ?= "0"
# obmc-bmc-state-manager
#
# Provides an implementation of the xyz.openbmc_project.State.BMC
# interface.
VIRTUAL-RUNTIME_obmc-bmc-state-manager ?= "phosphor-state-manager-bmc"
# obmc-chassis-state-manager
#
# Provides an implementation of the xyz.openbmc_project.State.Chassis
# interface.
VIRTUAL-RUNTIME_obmc-chassis-state-manager ?= "phosphor-state-manager-chassis"
# obmc-host-state-manager
#
# Provides an implementation of the xyz.openbmc_project.State.Host
# interface.
VIRTUAL-RUNTIME_obmc-host-state-manager ?= "phosphor-state-manager-host"
# obmc-discover-system-state
#
# Provides an implementation of phosphor-discover-system-state, which, if the
# host is powered off, will check the current power policy and, if necessary,
# power the host back on.
VIRTUAL-RUNTIME_obmc-discover-system-state ?= "phosphor-state-manager-discover"
# obmc-fan-presence
#
# Provides implementations of fan presence detection
VIRTUAL-RUNTIME_obmc-fan-presence ?= "phosphor-fan-presence-tach"
# obmc-fan-control
#
# Provides implementations of fan control
VIRTUAL-RUNTIME_obmc-fan-control ?= "phosphor-fan-control"
# obmc-inventory-manager
#
# Provides an implementation of the xyz.openbmc_project.Inventory.Manager
# interface.
VIRTUAL-RUNTIME_obmc-inventory-manager ?= "phosphor-inventory-manager"
# obmc-sensors-hwmon
#
# Provides an implementation of xyz.openbmc_project.Sensor.Value
# for hwmon sensors.
VIRTUAL-RUNTIME_obmc-sensors-hwmon ?= "phosphor-hwmon"
# phosphor-hwmon-config
#
# The phosphor-hwmon package can have its configuration generated
# automatically if the MRW feature is enabled.
VIRTUAL-RUNTIME_phosphor-hwmon-config ?= ""
# Configuration overrides for phosphor-ipmi-fru.
#
# The phosphor-ipmi-fru application is data-driven and requires an input
# mapping of how the host firmware reports inventory via IPMI and the mapping
# of that inventory metadata to DBus objects interfaces and properties.
# The phosphor-ipmi-fru application is data-driven and requires an input
# mapping of how the host firmware reports inventory via IPMI.
# This virtual is a native recipe that provides that mapping by installing
# configuration files in the format and native sysroot location expected by
# the phosphor-ipmi-fru build process.
PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-hostfw-config ?= "phosphor-ipmi-fru-hostfw-config-example-native"
# The phosphor-ipmi-fru application is data-driven and requires an input
# mapping of IPMI inventory metadata to DBus objects interfaces and properties.
# This virtual is a native recipe that provides that mapping by installing
# configuration files in the format and native sysroot location expected by
# the phosphor-ipmi-fru build process in the native sysroot.
PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-inventory ?= "phosphor-ipmi-fru-inventory-example-native"
PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-properties ?= "phosphor-ipmi-fru-properties-native"
PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-read-inventory ?= "phosphor-ipmi-fru-read-inventory-example-native"
# Configuration overrides for phosphor-host-ipmid.
#
# The phosphor-host-ipmid application is data-driven.
# The phosphor-host-ipmid application is data-driven and requires an input
# mapping of IPMI inventory sensor metadata to DBus objects interfaces and properties.
# This virtual is a native recipe that provides that mapping by installing
# configuration files in the format and native sysroot location expected by
# the phosphor-host-ipmid build process in the native sysroot.
PREFERRED_PROVIDER_virtual/phosphor-ipmi-sensor-inventory ?= "phosphor-ipmi-sensor-inventory-native"
# The phosphor-host-ipmid application is data-driven and requires an input
# mapping of inventory object path to the sensor number and sensor metadata.
# This virtual is a native recipe that provides that mapping by installing
# configuration files in the format and native sysroot location expected by
# the phosphor-host-ipmid build process in the native sysroot.
PREFERRED_PROVIDER_virtual/phosphor-ipmi-inventory-sel ?= "phosphor-ipmi-inventory-sel-native"
# Various other overrides.
# The phosphor-led-manager application is data-driven and requires an input
# yaml of LED group and members.
# This virtual is a native recipe that provides that mapping by installing
# configuration files in the format and native sysroot location expected by
# the phosphor-led-manager build process in the native sysroot.
PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native ?= "phosphor-led-manager-config-example-native"
# The phosphor-logging application has a data driven plugin that adds FRU
# callout information to error logs, when applications generating error logs
# add the requisite callout metadata to the systemd journal. The plugin requires
# an input mapping of Linux sysfs devices to OpenBMC DBus objects.
# This virtual is a native recipe that provides that mapping by installing
# configuration files in the format and native sysroot location expected by
# the phosphor-logging build process in the native sysroot.
PREFERRED_PROVIDER_virtual/phosphor-logging-callouts ?= "phosphor-logging-callouts-example-native"
# The phosphor-fan-presence application is data driven and requires an input
# YAML that maps fans to their tach sensors. This virtual is a recipe that
# provides that mapping by installing configuration files in the format and
# sysroot location expected by the phosphor-fan-presence build process in the
# sysroot.
PREFERRED_PROVIDER_virtual/phosphor-fan-presence-config ?= "phosphor-fan-presence-config"
# The phosphor-fan-control application is data driven and requires a YAML file
# to define the fans in the system. This virtual is a recipe that provides
# that definition by installing the YAML file in the format and sysroot
# location expected by the phosphor-fan-control build process in the sysroot.
PREFERRED_PROVIDER_virtual/phosphor-fan-control-fan-config ?= "phosphor-fan-control-fan-config"
OBMC_DBUS_PATH_ROOT ?= "/xyz/openbmc_project"
OBMC_DBUS_IFACE_ROOT ?= "xyz.openbmc_project"
# VIRTUAL-RUNTIME_phosphor-ipmi-providers are the set of shared library
# plugins for the host-ipmid application. By default the IPMI FRU plugin
# is enabled. Additionally the host-ipmid recipe uses
# VIRTUAL-RUNTIME_phosphor-ipmi-providers to compute a list of potential
# IPMI whitelist recipe dependencies. For example:
#
# VIRTUAL-RUNTIME_phosphor-ipmi-providers ?= "phosphor-ipmi-fru"
#
# Will add a build dependency to host-ipmid on the
# phosphor-ipmi-fru-whitelist-native recipe.
VIRTUAL-RUNTIME_phosphor-ipmi-providers ?= "phosphor-ipmi-fru"
# Set security headers on builds
require conf/distro/include/security_flags.inc
# obmc-libobmc-intf doesn't compile with security flags enabled
SECURITY_CFLAGS:pn-obmc-libobmc-intf = ""
# We generally want to enable LTO with meson
EXTRA_OEMESON:append:class-target = " -Db_lto=true"
# Set the root password to '0penBmc'
# Override this in your local.conf
inherit extrausers
# This is the default password for the OpenBMC root user account (0penBmc)
# salted and hashed with SHA512 suitable for /etc/shadow or `usermod -p`.
DEFAULT_OPENBMC_PASSWORD = "'\$6\$UGMqyqdG\$GqTb3tXPFx9AJlzTw/8X5RoW2Z.100dT.acuk8AFJfNQYr.ZRL8itMIgLqsdq46RNHgiv78XayOSl.IbR4DFU.'"
EXTRA_USERS_PARAMS:pn-obmc-phosphor-image = " \
usermod -p ${DEFAULT_OPENBMC_PASSWORD} root; \
"
@@ -0,0 +1,2 @@
DISTRO_FEATURES += "isolate-bmc"
DISTROOVERRIDES .= ":df-isolate-bmc"
@@ -0,0 +1,2 @@
DISTRO_FEATURES += "phosphor-mmc"
DISTROOVERRIDES .= ":df-phosphor-mmc"
@@ -0,0 +1,17 @@
DISTRO_FEATURES += "obmc-mrw"
DISTRO_FEATURES_FILTER_NATIVE += "obmc-mrw"
DISTRO_FEATURES_FILTER_NATIVESDK += "obmc-mrw"
DISTROOVERRIDES .= ":df-mrw"
VIRTUAL-RUNTIME_phosphor-hwmon-config:df-mrw ?= "phosphor-hwmon-config-mrw"
PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-inventory:df-mrw ?= "phosphor-ipmi-fru-inventory-mrw-native"
PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-properties:df-mrw ?= "phosphor-ipmi-fru-properties-mrw-native"
PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-read-inventory:df-mrw ?= "phosphor-ipmi-fru-read-inventory-mrw-native"
PREFERRED_PROVIDER_virtual/phosphor-ipmi-sensor-inventory:df-mrw ?= "phosphor-ipmi-sensor-inventory-mrw-native"
PREFERRED_PROVIDER_virtual/phosphor-ipmi-inventory-sel:df-mrw ?= "phosphor-ipmi-inventory-sel-mrw-native"
PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native:df-mrw ?= "phosphor-led-manager-config-mrw-native"
PREFERRED_PROVIDER_virtual/phosphor-logging-callouts:df-mrw ?= "phosphor-logging-callouts-mrw-native"
PREFERRED_PROVIDER_virtual/phosphor-fan-presence-config:df-mrw ?= "phosphor-fan-presence-mrw"
PREFERRED_PROVIDER_virtual/phosphor-fan-control-fan-config:df-mrw ?= "phosphor-fan-control-fan-config-mrw"
@@ -0,0 +1,7 @@
## Some packages do not allow a simple bbappend to tweak the PACKAGECONFIG
## because they can end up inheriting bbclasses, which cause other
## side-effects before the bbappend is applied. Place tweaks for those
## packages in this file.
# Disable python from btrfs-tools
PACKAGECONFIG:remove:pn-btrfs-tools = "python"
@@ -0,0 +1,2 @@
DISTRO_FEATURES += "obmc-static-norootfs"
DISTROOVERRIDES .= ":df-obmc-static-norootfs"
@@ -0,0 +1,2 @@
DISTRO_FEATURES += "obmc-ubi-fs"
DISTROOVERRIDES .= ":df-obmc-ubi-fs"
@@ -0,0 +1 @@
require conf/distro/include/phosphor-base.inc
+26
View File
@@ -0,0 +1,26 @@
# 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 += "phosphor-layer"
BBFILE_PATTERN_phosphor-layer := "^${LAYERDIR}/"
LAYERVERSION_phosphor-layer = "1"
LAYERDEPENDS_phosphor-layer = "core"
LAYERDEPENDS_phosphor-layer += "openembedded-layer"
LAYERDEPENDS_phosphor-layer += "meta-python"
LAYERDEPENDS_phosphor-layer += "networking-layer"
LAYERSERIES_COMPAT_phosphor-layer = "langdale mickledore"
IMAGE_FEATURES[validitems] += "tools-profile"
BBFILES_DYNAMIC += " \
aspeed-layer:${LAYERDIR}/dynamic-layers/aspeed-layer/recipes-*/*/*.bb \
aspeed-layer:${LAYERDIR}/dynamic-layers/aspeed-layer/recipes-*/*/*.bbappend \
nuvoton-layer:${LAYERDIR}/dynamic-layers/nuvoton-layer/recipes-*/*/*.bb \
nuvoton-layer:${LAYERDIR}/dynamic-layers/nuvoton-layer/recipes-*/*/*.bbappend \
tpm-layer:${LAYERDIR}/dynamic-layers/tpm-layer/recipes-*/*/*.bb \
tpm-layer:${LAYERDIR}/dynamic-layers/tpm-layer/recipes-*/*/*.bbappend \
"
@@ -0,0 +1 @@
MACHINEOVERRIDES =. "ibm-power-cpu:"
@@ -0,0 +1,2 @@
MACHINEOVERRIDES =. "ibm-power10-cpu:"
require conf/machine/include/ibm-power-cpu.inc
@@ -0,0 +1,2 @@
MACHINEOVERRIDES =. "ibm-power8-cpu:"
require conf/machine/include/ibm-power-cpu.inc
@@ -0,0 +1,2 @@
MACHINEOVERRIDES =. "ibm-power9-cpu:"
require conf/machine/include/ibm-power-cpu.inc
@@ -0,0 +1,2 @@
IMAGE_FSTYPES += "wic.xz mmc-ext4-tar"
INITRAMFS_IMAGE = "obmc-phosphor-initramfs"
@@ -0,0 +1,11 @@
INITRAMFS_CTYPE="zst"
INITRAMFS_CTYPE:flash-32768="xz"
IMAGE_FSTYPES += "cpio.${INITRAMFS_CTYPE}.fitImage mtd-static-norootfs"
# We don't want to build an initial kernel-based FIT image because the
# initramfs is going to be the eventual rootfs from this image and not
# a smaller initramfs.
INITRAMFS_IMAGE = ""
KERNEL_IMAGETYPE = "${ARCH_DEFAULT_KERNELIMAGETYPE}"
KERNEL_IMAGETYPES = "${ARCH_DEFAULT_KERNELIMAGETYPE}"
@@ -0,0 +1,2 @@
IMAGE_FSTYPES += "mtd-static mtd-static-tar mtd-static-alltar"
INITRAMFS_IMAGE = "obmc-phosphor-initramfs"
@@ -0,0 +1,2 @@
IMAGE_FSTYPES += "mtd-ubi mtd-ubi-tar"
INITRAMFS_IMAGE = ""
@@ -0,0 +1,18 @@
#@TYPE: Machine
#@NAME: OpenBMC
#@DESCRIPTION: Common machine configuration for OpenBMC chips
KERNEL_CLASSES ?= "kernel-fitimage"
KERNEL_IMAGETYPES ?= "fitImage vmlinux"
FLASH_SIZE ?= "32768"
OBMC_IMAGE_INCLUDE = "static"
OBMC_IMAGE_INCLUDE:df-obmc-static-norootfs = "static-norootfs"
OBMC_IMAGE_INCLUDE:df-obmc-ubi-fs = "ubi-fs"
OBMC_IMAGE_INCLUDE:df-phosphor-mmc = "mmc"
require conf/machine/include/image-type/${OBMC_IMAGE_INCLUDE}.inc
INITRAMFS_CTYPE ?= "xz"
INITRAMFS_FSTYPES = "cpio.${INITRAMFS_CTYPE}"
@@ -0,0 +1,4 @@
# EVB systems have different packages they can support, due to not having a
# managed host. Enable this machine override to allow other recipes to know
# that the machine is a special type.
MACHINEOVERRIDES =. "phosphor-evb:"
@@ -0,0 +1,15 @@
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "8"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
##OEROOT##/meta \
##OEROOT##/meta-poky \
##OEROOT##/meta-openembedded/meta-oe \
##OEROOT##/meta-openembedded/meta-networking \
##OEROOT##/meta-openembedded/meta-python \
##OEROOT##/meta-phosphor \
"
@@ -0,0 +1,5 @@
Common targets are:
obmc-phosphor-image
You can also run generated qemu images with a command like:
runqemu qemuarm
@@ -0,0 +1,19 @@
MACHINE ??= "qemuarm"
DISTRO ?= "openbmc-phosphor"
PACKAGE_CLASSES ?= "package_ipk"
SANITY_TESTED_DISTROS:append ?= " *"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
HALT,${TMPDIR},100M,1K \
HALT,${DL_DIR},100M,1K \
HALT,${SSTATE_DIR},100M,1K \
HALT,/tmp,10M,1K"
CONF_VERSION = "2"
MACHINE_FEATURES_BACKFILL_CONSIDERED = "qemu-usermode"