Initial commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
SUMMARY = "Remote BIOS Configuration via BMC"
|
||||
DESCRIPTION = "Provides ability for the user to view and modify the BIOS setup \
|
||||
configuration parameters remotely via BMC at any Host state. \
|
||||
Modifications to the parameters take place upon the next system \
|
||||
reboot or immediate based on the host firmware."
|
||||
HOMEPAGE = "https://github.com/openbmc/bios-settings-mgr"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=bcd9ada3a943f58551867d72893cc9ab"
|
||||
DEPENDS = " boost \
|
||||
openssl \
|
||||
phosphor-dbus-interfaces \
|
||||
phosphor-logging \
|
||||
sdbusplus \
|
||||
systemd \
|
||||
nlohmann-json "
|
||||
SRCREV = "9ace6ac55b6cad569ddf8bf02edc1504ddf7677f"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/bios-settings-mgr;branch=master;protocol=https"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
SYSTEMD_SERVICE:${PN} = "xyz.openbmc_project.biosconfig_manager.service"
|
||||
|
||||
inherit meson pkgconfig systemd
|
||||
@@ -0,0 +1,37 @@
|
||||
SUMMARY = "Phosphor Certificate Manager"
|
||||
DESCRIPTION = "Manages client and server certificates"
|
||||
HOMEPAGE = "https://github.com/openbmc/phosphor-certificate-manager"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
|
||||
DEPENDS = " \
|
||||
cli11 \
|
||||
openssl \
|
||||
phosphor-dbus-interfaces \
|
||||
phosphor-logging \
|
||||
sdbusplus \
|
||||
sdeventplus \
|
||||
"
|
||||
SRCREV = "23778dd40421d6cfe73c4774442e901f66d44b33"
|
||||
PACKAGECONFIG ??= "bmcweb-cert nslcd-authority-cert"
|
||||
PACKAGECONFIG[ibm-hypervisor-cert] = "-Dca-cert-extension=enabled,-Dca-cert-extension=disabled"
|
||||
PACKAGECONFIG[bmcweb-cert] = "-Dconfig-bmcweb=enabled,-Dconfig-bmcweb=disabled"
|
||||
PACKAGECONFIG[nslcd-authority-cert] = "-Dconfig-nslcd=enabled,-Dconfig-nslcd=disabled"
|
||||
PV = "0.1+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/phosphor-certificate-manager;branch=master;protocol=https"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
SYSTEMD_SERVICE:${PN} = "phosphor-certificate-manager@.service"
|
||||
SYSTEMD_SERVICE:${PN} = " \
|
||||
phosphor-certificate-manager@.service \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'ibm-hypervisor-cert', 'bmc-vmi-ca-manager.service', '', d)} \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'nslcd-authority-cert', 'phosphor-certificate-manager@authority.service', '', d)} \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'bmcweb', 'phosphor-certificate-manager@bmcweb.service', '', d)} \
|
||||
"
|
||||
|
||||
inherit meson pkgconfig systemd
|
||||
|
||||
EXTRA_OEMESON += "-Dtests=disabled"
|
||||
|
||||
FILES:${PN}:append = " ${systemd_system_unitdir}/* ${datadir}/dbus-1"
|
||||
@@ -0,0 +1,15 @@
|
||||
SUMMARY = "Enables reboots on host failures"
|
||||
DESCRIPTION = "Manages the settings entry that controls reboots \
|
||||
on host failures"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
PR = "r1"
|
||||
|
||||
SYSTEMD_SERVICE:${PN} += "${TMPL}"
|
||||
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'LINK_FMT', 'OBMC_HOST_INSTANCES')}"
|
||||
|
||||
inherit obmc-phosphor-systemd
|
||||
|
||||
TMPL = "host-failure-reboots@.service"
|
||||
INSTFMT = "host-failure-reboots@{0}.service"
|
||||
LINK_FMT = "${TMPL}:${INSTFMT}"
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Enable reboot on host failures
|
||||
Wants=mapper-wait@-xyz-openbmc_project-control-host0-auto_reboot.service
|
||||
After=mapper-wait@-xyz-openbmc_project-control-host0-auto_reboot.service
|
||||
|
||||
[Service]
|
||||
ExecStart = /bin/sh -c "busctl set-property `mapper get-service /xyz/openbmc_project/control/host0/auto_reboot` /xyz/openbmc_project/control/host0/auto_reboot xyz.openbmc_project.Control.Boot.RebootPolicy AutoReboot b true"
|
||||
ExecStop = /bin/sh -c "busctl set-property `mapper get-service /xyz/openbmc_project/control/host0/auto_reboot` /xyz/openbmc_project/control/host0/auto_reboot xyz.openbmc_project.Control.Boot.RebootPolicy AutoReboot b false"
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,43 @@
|
||||
SUMMARY = "OpenBMC Buttons"
|
||||
DESCRIPTION = "OpenBMC All buttons"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
|
||||
DEPENDS += " \
|
||||
systemd \
|
||||
sdbusplus \
|
||||
sdeventplus \
|
||||
phosphor-dbus-interfaces \
|
||||
phosphor-logging \
|
||||
"
|
||||
SRCREV = "9456ffc9f21c92f890266be54a151bf59b413411"
|
||||
PACKAGECONFIG ??= "signals handler"
|
||||
PACKAGECONFIG[signals] = ",,gpioplus nlohmann-json,"
|
||||
PACKAGECONFIG[handler] = ",,,${VIRTUAL-RUNTIME_obmc-host-state-manager} ${VIRTUAL-RUNTIME_obmc-chassis-state-manager}"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/phosphor-buttons.git;branch=master;protocol=https"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
SYSTEMD_PACKAGES = "${BUTTON_PACKAGES}"
|
||||
SYSTEMD_SERVICE:${PN}-signals = "xyz.openbmc_project.Chassis.Buttons.service"
|
||||
SYSTEMD_SERVICE:${PN}-handler = "phosphor-button-handler.service"
|
||||
|
||||
inherit meson pkgconfig systemd
|
||||
|
||||
FILES:${PN}-signals = "${bindir}/buttons"
|
||||
FILES:${PN}-handler = "${bindir}/button-handler"
|
||||
|
||||
ALLOW_EMPTY:${PN} = "1"
|
||||
|
||||
BUTTON_PACKAGES = "${PN}-signals ${PN}-handler"
|
||||
|
||||
PACKAGE_BEFORE_PN += "${BUTTON_PACKAGES}"
|
||||
|
||||
do_install:append() {
|
||||
if [ -e "${WORKDIR}/gpio_defs.json" ]; then
|
||||
install -m 0755 -d ${D}/etc/default/obmc/gpio
|
||||
install -m 0644 -D ${WORKDIR}/gpio_defs.json \
|
||||
${D}/etc/default/obmc/gpio
|
||||
fi
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
SUMMARY = "Chassis Power Control"
|
||||
HOMEPAGE = "https://github.com/openbmc/phosphor-power-control"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
|
||||
DEPENDS += "phosphor-logging"
|
||||
DEPENDS += "nlohmann-json"
|
||||
DEPENDS += "gpioplus"
|
||||
SRCREV = "09fdcb592a9320b9363fb1c7fec872a69ac95189"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/phosphor-power-control;branch=master;protocol=https"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit meson pkgconfig
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
POLL_INTERVAL="3000"
|
||||
PGOOD_TIMEOUT="10"
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Phosphor Power%i Control
|
||||
|
||||
[Service]
|
||||
EnvironmentFile={envfiledir}/obmc/power_control
|
||||
Restart=always
|
||||
ExecStart=/usr/bin/env power_control.exe $POLL_INTERVAL $PGOOD_TIMEOUT
|
||||
SyslogIdentifier=power_control.exe
|
||||
Type=dbus
|
||||
BusName={BUSNAME}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=Wait for Power%i to turn off
|
||||
Before=obmc-power-off@%i.target
|
||||
Wants=obmc-power-stop@%i.target
|
||||
Before=obmc-power-stop@%i.target
|
||||
Wants=obmc-power-stop-pre@%i.target
|
||||
After=obmc-power-stop-pre@%i.target
|
||||
Wants=mapper-wait@-org-openbmc-control-power%i.service
|
||||
After=mapper-wait@-org-openbmc-control-power%i.service
|
||||
Conflicts=obmc-chassis-poweron@%i.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/bin/env pgood_wait /org/openbmc/control/power%i off
|
||||
SyslogIdentifier=pgood_wait
|
||||
ExecStart=/bin/rm -f /run/openbmc/host@%i-request
|
||||
ExecStart=/bin/rm -f /run/openbmc/mpreboot@%i
|
||||
|
||||
[Install]
|
||||
# Installation of templated services occur in bitbake recipes
|
||||
# Leave it commented out here for documentation purposes
|
||||
#WantedBy=obmc-host-stop@%i.target
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=Wait for Power%i to turn on
|
||||
Wants=obmc-power-start-pre@%i.target
|
||||
After=obmc-power-start-pre@%i.target
|
||||
Wants=obmc-power-start@%i.target
|
||||
Before=obmc-power-start@%i.target
|
||||
Wants=mapper-wait@-org-openbmc-control-power%i.service
|
||||
After=mapper-wait@-org-openbmc-control-power%i.service
|
||||
After=obmc-power-start@%i.service
|
||||
Conflicts=obmc-chassis-poweroff@%i.target
|
||||
ConditionPathExists=!/run/openbmc/chassis@%i-on
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/bin/env pgood_wait /org/openbmc/control/power%i on
|
||||
SyslogIdentifier=pgood_wait
|
||||
TimeoutSec=30
|
||||
|
||||
[Install]
|
||||
# Installation of templated services occur in bitbake recipes
|
||||
# Leave it commented out here for documentation purposes
|
||||
#WantedBy=obmc-host-start@%i.target
|
||||
@@ -0,0 +1,39 @@
|
||||
SUMMARY = "org.openbmc.control.Power implementation for OpenBMC"
|
||||
DESCRIPTION = "A power control implementation suitable for OpenBMC systems."
|
||||
PR = "r1"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
|
||||
inherit skeleton-gdbus
|
||||
inherit obmc-phosphor-dbus-service
|
||||
inherit pkgconfig
|
||||
|
||||
DEPENDS += "libmapper systemd"
|
||||
|
||||
SKELETON_DIR = "op-pwrctl"
|
||||
|
||||
DBUS_SERVICE:${PN} += "org.openbmc.control.Power@.service"
|
||||
OBMC_CONTROL_INST = "org.openbmc.control.Power@{0}.service"
|
||||
OBMC_CONTROL_SVC = "org.openbmc.control.Power@.service"
|
||||
OBMC_CONTROL_FMT = "../${OBMC_CONTROL_SVC}:multi-user.target.wants/${OBMC_CONTROL_INST}"
|
||||
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'OBMC_CONTROL_FMT', 'OBMC_POWER_INSTANCES')}"
|
||||
|
||||
SYSTEMD_SERVICE:${PN} += " \
|
||||
phosphor-wait-power-on@.service \
|
||||
phosphor-wait-power-off@.service \
|
||||
"
|
||||
|
||||
SYSTEMD_ENVIRONMENT_FILE:${PN} += "obmc/power_control"
|
||||
|
||||
START_TGTFMT = "obmc-chassis-poweron@{1}.target"
|
||||
ON_TMPL = "phosphor-wait-power-on@.service"
|
||||
ON_INSTFMT = "phosphor-wait-power-on@{0}.service"
|
||||
ON_FMT = "../${ON_TMPL}:${START_TGTFMT}.requires/${ON_INSTFMT}"
|
||||
|
||||
STOP_TGTFMT = "obmc-chassis-poweroff@{1}.target"
|
||||
OFF_TMPL = "phosphor-wait-power-off@.service"
|
||||
OFF_INSTFMT = "phosphor-wait-power-off@{0}.service"
|
||||
OFF_FMT = "../${OFF_TMPL}:${STOP_TGTFMT}.requires/${OFF_INSTFMT}"
|
||||
|
||||
# Build up requires relationship for START_TGTFMT and STOP_TGTFMT
|
||||
SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
|
||||
SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'OFF_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
|
||||
@@ -0,0 +1,8 @@
|
||||
SUMMARY = "Clear boot-once variables"
|
||||
DESCRIPTION = "Clear u-boot variables used for one-time boot flow"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
|
||||
inherit obmc-phosphor-systemd
|
||||
|
||||
RDEPENDS:${PN} = "${@d.getVar('PREFERRED_PROVIDER_u-boot-fw-utils', True) or 'u-boot-fw-utils'}"
|
||||
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Clear one time boot overrides
|
||||
|
||||
ConditionFileNotEmpty=/etc/fw_env.config
|
||||
RequiresMountsFor=/run /sbin /etc
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
|
||||
# It took 7 seconds to erase and write flash, be conservative
|
||||
TimeoutStartSec=60
|
||||
Restart=no
|
||||
|
||||
ExecStart=/sbin/fw_setenv openbmconce
|
||||
ExecStart=/sbin/fw_setenv openbmconce
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"buses": []
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"buses": [100, 101, 110, 111, 112, 113, 114, 115, 202, 203, 210, 211, 214, 215, 216, 217, 300, 301, 310, 311, 312, 313, 314, 315, 402, 403, 410, 411, 414, 415, 416, 417]
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"buses": [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214]
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
SUMMARY = "Entity Manager"
|
||||
DESCRIPTION = "Entity Manager provides d-bus configuration data \
|
||||
and configures system sensors"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENCE;md5=a6a4edad4aed50f39a66d098d74b265b"
|
||||
DEPENDS = "boost \
|
||||
dbus \
|
||||
nlohmann-json \
|
||||
sdbusplus \
|
||||
valijson \
|
||||
${PYTHON_PN}-jsonschema-native \
|
||||
"
|
||||
SRCREV = "4c94ed9f9ae0c3e81582154aff0b40d1d223a448"
|
||||
PACKAGECONFIG ??= "ipmi-fru"
|
||||
PACKAGECONFIG[ipmi-fru] = "-Dfru-device=true, -Dfru-device=false, i2c-tools,"
|
||||
PV = "0.1+git${SRCPV}"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/entity-manager.git;branch=master;protocol=https \
|
||||
file://blocklist.json \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
SYSTEMD_PACKAGES = "${PN} ${EXTRA_ENTITY_MANAGER_PACKAGES}"
|
||||
SYSTEMD_SERVICE:${PN} = "xyz.openbmc_project.EntityManager.service"
|
||||
SYSTEMD_SERVICE:fru-device = "xyz.openbmc_project.FruDevice.service"
|
||||
SYSTEMD_AUTO_ENABLE:fru-device:ibm-power-cpu = "disable"
|
||||
|
||||
inherit pkgconfig meson systemd python3native
|
||||
|
||||
EXTRA_OEMESON = "-Dtests=disabled"
|
||||
EXTRA_ENTITY_MANAGER_PACKAGES = " \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'ipmi-fru', 'fru-device', '', d)} \
|
||||
"
|
||||
|
||||
do_install:append() {
|
||||
install -D ${WORKDIR}/blocklist.json ${D}${datadir}/${BPN}/blacklist.json
|
||||
}
|
||||
|
||||
FILES:${PN} += " \
|
||||
${datadir}/dbus-1/system-services/xyz.openbmc_project.EntityManager.service \
|
||||
"
|
||||
FILES:fru-device = "${bindir}/fru-device ${datadir}/${BPN}/blacklist.json"
|
||||
|
||||
PACKAGE_BEFORE_PN = "${EXTRA_ENTITY_MANAGER_PACKAGES}"
|
||||
@@ -0,0 +1,2 @@
|
||||
DROPBEAR_EXTRA_ARGS=" -B -G hostconsole"
|
||||
DROPBEAR_RSAKEY_DIR=/etc/dropbear
|
||||
@@ -0,0 +1,2 @@
|
||||
lpc-address = 0x3f8
|
||||
sirq = 4
|
||||
@@ -0,0 +1,82 @@
|
||||
SUMMARY = "OpenBMC console daemon"
|
||||
DESCRIPTION = "Daemon to handle UART console connections"
|
||||
HOMEPAGE = "http://github.com/openbmc/obmc-console"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"
|
||||
DEPENDS += "autoconf-archive-native \
|
||||
systemd \
|
||||
"
|
||||
SRCREV = "dfda5afb4ff7c76c4df3ebebbf496fdbda0fbbae"
|
||||
PACKAGECONFIG ??= "udev"
|
||||
PACKAGECONFIG[udev] = "-Dudev=enabled,-Dudev=disabled,udev"
|
||||
PACKAGECONFIG[concurrent-servers] = "-Dconcurrent-servers=true,-Dconcurrent-servers=false,"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/obmc-console;branch=master;protocol=https"
|
||||
SRC_URI += "file://${BPN}.conf"
|
||||
SRC_URI += "file://dropbear.env"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
SYSTEMD_SERVICE:${PN} += "obmc-console-ssh@.service \
|
||||
obmc-console-ssh.socket \
|
||||
obmc-console@.service \
|
||||
"
|
||||
|
||||
inherit meson pkgconfig
|
||||
inherit obmc-phosphor-discovery-service
|
||||
inherit systemd
|
||||
|
||||
do_install:append() {
|
||||
# Install the server configuration
|
||||
install -m 0755 -d ${D}${sysconfdir}/${BPN}
|
||||
|
||||
install -m 0644 ${WORKDIR}/dropbear.env ${D}${sysconfdir}/${BPN}/
|
||||
|
||||
# If the OBMC_CONSOLE_TTYS variable is used without the default OBMC_CONSOLE_HOST_TTY
|
||||
# the port specific config file should be provided. If it is just OBMC_CONSOLE_HOST_TTY,
|
||||
# use the old style which supports both port specific or obmc-console.conf method.
|
||||
if [ "${OBMC_CONSOLE_TTYS}" != "${OBMC_CONSOLE_HOST_TTY}" ]; then
|
||||
rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf
|
||||
for CONSOLE in ${OBMC_CONSOLE_TTYS}
|
||||
do
|
||||
if test -f "${WORKDIR}/server.${CONSOLE}.conf" ; then
|
||||
install -m 0644 ${WORKDIR}/server.${CONSOLE}.conf ${D}${sysconfdir}/${BPN}/
|
||||
else
|
||||
bberror "Must provide port specific config files when using OBMC_CONSOLE_TTYS" \
|
||||
"Missing server.${CONSOLE}.conf"
|
||||
fi
|
||||
done
|
||||
else
|
||||
# Port specific config file is prioritized over generic conf file.
|
||||
# If port specific config file is not present and generic "obmc-console.conf"
|
||||
# exists, it will be used.
|
||||
if test -f "${WORKDIR}/server.${OBMC_CONSOLE_TTYS}.conf" ; then
|
||||
# Remove the upstream-provided server configuration
|
||||
rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf
|
||||
# Install the package-provided new-style configuration
|
||||
install -m 0644 ${WORKDIR}/server.${OBMC_CONSOLE_TTYS}.conf ${D}${sysconfdir}/${BPN}/
|
||||
elif test -f "${WORKDIR}/${BPN}.conf"; then
|
||||
# Remove the upstream-provided server configuration
|
||||
rm -f ${D}${sysconfdir}/${BPN}/server.ttyVUART0.conf
|
||||
# Install the old-style server configuration
|
||||
install -m 0644 ${WORKDIR}/${BPN}.conf ${D}${sysconfdir}/
|
||||
# Link the custom configuration to the required location
|
||||
ln -sr ${D}${sysconfdir}/${BPN}.conf ${D}${sysconfdir}/${BPN}/server.${OBMC_CONSOLE_TTYS}.conf
|
||||
else
|
||||
# Otherwise, remove console-id from the shipped configuration to
|
||||
# align with the lack of a client configuration file
|
||||
sed -ri '/^console-id =/d' ${D}${sysconfdir}/${BPN}/server.${OBMC_CONSOLE_TTYS}.conf
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
FILES:${PN} += "${systemd_system_unitdir}"
|
||||
|
||||
TARGET_CFLAGS += "-fpic -O2"
|
||||
|
||||
REGISTERED_SERVICES:${PN} += "obmc_console:tcp:2200:"
|
||||
OBMC_CONSOLE_HOST_TTY ?= "ttyVUART0"
|
||||
# Support multiple TTY ports using space separated list.
|
||||
# Ex. OBMC_CONSOLE_TTYS = "ttyS1 ttyS2"
|
||||
OBMC_CONSOLE_TTYS ?= "${OBMC_CONSOLE_HOST_TTY}"
|
||||
@@ -0,0 +1,28 @@
|
||||
SUMMARY = "Phosphor Time Manager daemon"
|
||||
DESCRIPTION = "Daemon to cater to BMC and HOST time management"
|
||||
HOMEPAGE = "http://github.com/openbmc/phosphor-time-manager"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
|
||||
DEPENDS += "systemd"
|
||||
DEPENDS += "sdbusplus"
|
||||
DEPENDS += "${PYTHON_PN}-sdbus++-native"
|
||||
DEPENDS += "phosphor-logging"
|
||||
DEPENDS += "phosphor-dbus-interfaces"
|
||||
SRCREV = "83a3bfe79dcd3da706cfbf4964a1ebeda1c6355c"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/phosphor-time-manager;branch=master;protocol=https"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit meson pkgconfig python3native
|
||||
inherit obmc-phosphor-dbus-service
|
||||
|
||||
EXTRA_OEMESON = " -Dtests=disabled"
|
||||
|
||||
RDEPENDS:${PN} += "phosphor-settings-manager"
|
||||
RDEPENDS:${PN} += "phosphor-network"
|
||||
RDEPENDS:${PN} += "phosphor-objmgr"
|
||||
|
||||
DBUS_SERVICE:${PN} += "xyz.openbmc_project.Time.Manager.service"
|
||||
@@ -0,0 +1,19 @@
|
||||
HOMEPAGE = "http://github.com/openbmc/dbus-top"
|
||||
PR = "r1"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/dbus-top;protocol=https;branch=main"
|
||||
SRCREV = "471703e7fc1ffd9a10ab8ece813f277de26012bc"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
inherit meson pkgconfig
|
||||
|
||||
SUMMARY = "DBus-Top"
|
||||
DESCRIPTION = "A top-like tool for DBus."
|
||||
|
||||
DEPENDS += "systemd"
|
||||
DEPENDS += "sdbusplus"
|
||||
DEPENDS += "ncurses"
|
||||
@@ -0,0 +1,19 @@
|
||||
SUMMARY = "Phosphor OpenBMC DBUS Permissions"
|
||||
DESCRIPTION = "Phosphor OpenBMC DBUS Permissions."
|
||||
HOMEPAGE = "http://github.com/openbmc/"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI += "file://org.openbmc.conf"
|
||||
|
||||
inherit allarch
|
||||
inherit dbus-dir
|
||||
|
||||
do_install:append() {
|
||||
install -d ${D}${dbus_system_confdir}
|
||||
install -m 0644 ${WORKDIR}/org.openbmc.conf \
|
||||
${D}${dbus_system_confdir}
|
||||
}
|
||||
|
||||
FILES:${PN}:append = " ${dbus_system_confdir}"
|
||||
@@ -0,0 +1,8 @@
|
||||
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||
<busconfig>
|
||||
<policy context="default">
|
||||
<allow own="*"/>
|
||||
<allow send_destination="*"/>
|
||||
</policy>
|
||||
</busconfig>
|
||||
@@ -0,0 +1,42 @@
|
||||
SUMMARY = "Phosphor DBus Interfaces"
|
||||
DESCRIPTION = "Generated bindings, using sdbus++, for the phosphor YAML"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
|
||||
DEPENDS += " \
|
||||
${PYTHON_PN}-sdbus++-native \
|
||||
sdbusplus \
|
||||
systemd \
|
||||
"
|
||||
SRCREV = "402dc6a5beee58ee1e6514a425c542a0d879954c"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/phosphor-dbus-interfaces;branch=master;protocol=https"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit pkgconfig meson
|
||||
inherit obmc-phosphor-utils
|
||||
inherit phosphor-dbus-yaml
|
||||
inherit python3native
|
||||
|
||||
# Markdown files are installed into /usr/share/phosphor-dbus-interfaces so
|
||||
# add them to the 'doc' subpackage.
|
||||
FILES:${PN}-doc += "${datadir}/${BPN}"
|
||||
|
||||
# Process OBMC_ORG_YAML_SUBDIRS to create Meson config options.
|
||||
# ex. xyz/openbmc_project -> -Ddata_xyz_openbmc_project=true
|
||||
def pdi_meson_config(d):
|
||||
return ' '.join([
|
||||
'-Ddata_' + x.replace('/', '_') + '=true' \
|
||||
for x in listvar_to_list(d, 'OBMC_ORG_YAML_SUBDIRS')
|
||||
])
|
||||
pdi_meson_config[vardeps] = "OBMC_ORG_YAML_SUBDIRS"
|
||||
EXTRA_OEMESON += "${@pdi_meson_config(d)}"
|
||||
# Remove all schemas by default regardless of the meson_options.txt config
|
||||
do_write_config:append() {
|
||||
for intf in $(grep "^option('data_" ${S}/meson_options.txt | sed "s,^.*\(data_[^']*\).*$,\1,"); do
|
||||
sed -i "/^\[built-in options\]\$/a$intf = false" ${WORKDIR}/meson.cross
|
||||
done
|
||||
}
|
||||
do_write_config[deptask] += "do_unpack"
|
||||
@@ -0,0 +1,20 @@
|
||||
# To add additional config files, create a recipe in your layer,
|
||||
# and add it to PHOSPHOR_DBUS_MONITOR_CONFIGS with a bbappend to this recipe.
|
||||
SUMMARY = "Phosphor DBus Monitor Configuration"
|
||||
DESCRIPTION = "Meta-recipe, pulling in non-native recipes that wish to add \
|
||||
configuration files to the /usr/share/phosphor-dbus-monitor filesystem."
|
||||
HOMEPAGE = "http://github.com/openbmc/phosphor-dbus-monitor"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
DEPENDS += "${PHOSPHOR_DBUS_MONITOR_CONFIGS}"
|
||||
PR = "r1"
|
||||
|
||||
inherit phosphor-dbus-monitor
|
||||
|
||||
do_install() {
|
||||
mkdir -p ${D}${config_dir}
|
||||
}
|
||||
|
||||
FILES:${PN} += "${config_dir}"
|
||||
|
||||
PHOSPHOR_DBUS_MONITOR_CONFIGS ??= ""
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Phosphor DBus Monitor
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
ExecStart=/usr/bin/env phosphor-dbus-monitor
|
||||
SyslogIdentifier=phosphor-dbus-monitor
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Phosphor MSL Verification
|
||||
After=mapper-wait@-xyz-openbmc_project-inventory.service
|
||||
Wants=mapper-wait@-xyz-openbmc_project-inventory.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/bin/env phosphor-msl-verify
|
||||
SyslogIdentifier=phosphor-msl-verify
|
||||
@@ -0,0 +1,41 @@
|
||||
SUMMARY = "Phosphor DBus Monitor"
|
||||
DESCRIPTION = "Phosphor DBus Monitor is a general purpose DBus application \
|
||||
that watches DBus traffic for events and takes actions based on those events."
|
||||
HOMEPAGE = "http://github.com/openbmc/phosphor-dbus-monitor"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
|
||||
DEPENDS += " \
|
||||
${PN}-config \
|
||||
phosphor-logging \
|
||||
${PYTHON_PN}-sdbus++-native \
|
||||
sdeventplus \
|
||||
gtest \
|
||||
phosphor-snmp \
|
||||
${PYTHON_PN}-native \
|
||||
${PYTHON_PN}-pyyaml-native \
|
||||
${PYTHON_PN}-setuptools-native \
|
||||
${PYTHON_PN}-mako-native \
|
||||
"
|
||||
SRCREV = "5875d5630998ace8472c5fe5b5d7e1bcecd4f287"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/phosphor-dbus-monitor;branch=master;protocol=https"
|
||||
|
||||
SYSTEMD_PACKAGES = "${PN} phosphor-msl-verify"
|
||||
SYSTEMD_SERVICE:phosphor-msl-verify = "phosphor-msl-verify.service"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit meson \
|
||||
pkgconfig \
|
||||
python3native \
|
||||
phosphor-dbus-monitor \
|
||||
obmc-phosphor-systemd
|
||||
|
||||
EXTRA_OEMESON = " \
|
||||
-DYAML_PATH=${STAGING_DIR_HOST}${config_dir} \
|
||||
"
|
||||
|
||||
FILES:phosphor-msl-verify = "${bindir}/phosphor-msl-verify"
|
||||
|
||||
PACKAGE_BEFORE_PN = "phosphor-msl-verify"
|
||||
@@ -0,0 +1,35 @@
|
||||
SUMMARY = "Phosphor DBUS Object Manager"
|
||||
DESCRIPTION = "Phosphor DBUS object manager."
|
||||
HOMEPAGE = "http://github.com/openbmc/phosphor-objmgr"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"
|
||||
DEPENDS += "systemd"
|
||||
DEPENDS += "boost"
|
||||
DEPENDS += "libtinyxml2"
|
||||
DEPENDS += "sdbusplus"
|
||||
DEPENDS += "phosphor-logging"
|
||||
DEPENDS += "cli11"
|
||||
SRCREV = "26ed98050e64e76892be5d5c2416b8a0044e3d9d"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/phosphor-objmgr;branch=master;protocol=https"
|
||||
|
||||
PACKAGECONFIG ??= ""
|
||||
PACKAGECONFIG[unit-failure-monitor] = "-Dunit-failure-monitor=enabled,-Dunit-failure-monitor=disabled,,"
|
||||
|
||||
SYSTEMD_SERVICE:${PN} += " \
|
||||
mapper-wait@.service \
|
||||
mapper-subtree-remove@.service \
|
||||
xyz.openbmc_project.ObjectMapper.service \
|
||||
"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit meson pkgconfig systemd
|
||||
|
||||
EXTRA_OEMESON += "-Dtests=disabled"
|
||||
|
||||
PROVIDES += "libmapper"
|
||||
PACKAGE_BEFORE_PN += "libmapper"
|
||||
FILES:libmapper = "${libdir}/lib*.so*"
|
||||
FILES:${PN} += "${datadir}/dbus-1"
|
||||
@@ -0,0 +1,34 @@
|
||||
SUMMARY = "Debug trigger"
|
||||
DESCRIPTION = "Forcibly crash an unresponsive system to collect debug data"
|
||||
HOMEPAGE = "https://github.com/openbmc/debug-trigger"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/debug-trigger;branch=master;protocol=https"
|
||||
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit meson
|
||||
inherit pkgconfig
|
||||
inherit systemd
|
||||
|
||||
PR = "r1"
|
||||
PV = "0.1+git${SRCPV}"
|
||||
SRCREV = "1161642d2288f71549f0c9f89d09807ca251b58f"
|
||||
|
||||
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
|
||||
|
||||
DEBUG_TRIGGERS ?= ""
|
||||
|
||||
PACKAGECONFIG[systemd] = " \
|
||||
-Dsystemd=true, \
|
||||
-Dsystemd=false, \
|
||||
systemd"
|
||||
|
||||
PACKAGECONFIG[triggers] = " \
|
||||
-Dtriggers=${DEBUG_TRIGGERS}, \
|
||||
-Dtriggers=[], \
|
||||
systemd udev"
|
||||
|
||||
SYSTEMD_SERVICE:${PN} += "debug-trigger@.service"
|
||||
@@ -0,0 +1,5 @@
|
||||
HOMEPAGE = "https://github.com/openbmc/phosphor-debug-collector"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
|
||||
SRC_URI += "git://github.com/openbmc/phosphor-debug-collector;branch=master;protocol=https"
|
||||
SRCREV = "05ef81639c1fb7fc2fc78b29ca7e7486a86ddfb2"
|
||||
@@ -0,0 +1,8 @@
|
||||
# This configuration file will help in
|
||||
# removing all the hidden files in the
|
||||
# coredump folder at boot time.
|
||||
#
|
||||
# See tmpfiles.d for more details
|
||||
|
||||
R! /var/lib/systemd/coredump/.[^.] - - - -
|
||||
R! /var/lib/systemd/coredump/.??* - - - -
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Phosphor Dump core monitor.
|
||||
ConditionPathExists=/var/lib/systemd/coredump
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/env phosphor-dump-monitor
|
||||
SyslogIdentifier=phosphor-dump-monitor
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Ramoops monitor.
|
||||
ConditionPathExistsGlob=/var/lib/systemd/pstore/dmesg-ramoops-*
|
||||
After=xyz.openbmc_project.Dump.Manager.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/phosphor-ramoops-monitor
|
||||
SyslogIdentifier=ramoops-monitor
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Phosphor Dump Manager
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/bin/sh -c 'mkdir -p {BMC_DUMP_PATH}'
|
||||
ExecStart=/usr/bin/env phosphor-dump-manager
|
||||
SyslogIdentifier=phosphor-dump-manager
|
||||
Restart=always
|
||||
Type=dbus
|
||||
BusName={BUSNAME}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,179 @@
|
||||
SUMMARY = "Phosphor Debug Collector"
|
||||
DESCRIPTION = "Phosphor Debug Collector provides mechanisms \
|
||||
to collect various log files and system parameters. \
|
||||
This will be helpful for troubleshooting the problems in OpenBMC \
|
||||
based systems."
|
||||
DEPENDS += " \
|
||||
phosphor-dbus-interfaces \
|
||||
phosphor-logging \
|
||||
sdbusplus \
|
||||
${PYTHON_PN}-sdbus++-native \
|
||||
autoconf-archive-native \
|
||||
virtual/phosphor-debug-errors \
|
||||
${PYTHON_PN}-native \
|
||||
${PYTHON_PN}-pyyaml-native \
|
||||
${PYTHON_PN}-setuptools-native \
|
||||
${PYTHON_PN}-mako-native \
|
||||
fmt \
|
||||
"
|
||||
PACKAGECONFIG ??= "${@bb.utils.contains_any('DISTRO_FEATURES', \
|
||||
'obmc-ubi-fs phosphor-mmc obmc-static-norootfs', '', 'jffs-workaround', d)}"
|
||||
PACKAGECONFIG[jffs-workaround] = "-Djffs-workaround=enabled, \
|
||||
-Djffs-workaround=disabled"
|
||||
PACKAGECONFIG[host-dump-transport-pldm] = " \
|
||||
-Dhost-transport=pldm,, \
|
||||
libpldm \
|
||||
"
|
||||
PACKAGECONFIG[openpower-dumps-extension] = " \
|
||||
-Dopenpower-dumps-extension=enabled, \
|
||||
-Dopenpower-dumps-extension=disabled \
|
||||
"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI += "file://coretemp.conf"
|
||||
|
||||
SYSTEMD_PACKAGES = "${PN}-monitor"
|
||||
SYSTEMD_SUBSTITUTIONS += "BMC_DUMP_PATH:${bmc_dump_path}:${MGR_SVC}"
|
||||
SYSTEMD_SERVICE:${PN}-monitor += "obmc-dump-monitor.service"
|
||||
SYSTEMD_SERVICE:${PN}-monitor += "ramoops-monitor.service"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit pkgconfig meson \
|
||||
obmc-phosphor-dbus-service \
|
||||
python3native \
|
||||
phosphor-debug-collector
|
||||
|
||||
EXTRA_OEMESON = " \
|
||||
-DBMC_DUMP_PATH=${bmc_dump_path} \
|
||||
-DERROR_MAP_YAML=${STAGING_DIR_NATIVE}/${datadir}/dump/errors_watch.yaml \
|
||||
"
|
||||
|
||||
do_install:append() {
|
||||
install -d ${D}${exec_prefix}/lib/tmpfiles.d
|
||||
install -m 644 ${WORKDIR}/coretemp.conf ${D}${exec_prefix}/lib/tmpfiles.d/
|
||||
}
|
||||
do_install[postfuncs] += "install_dreport"
|
||||
do_install[postfuncs] += "install_dreport_conf_file"
|
||||
do_install[postfuncs] += "install_dreport_plugins_scripts"
|
||||
do_install[postfuncs] += "install_dreport_include_scripts"
|
||||
do_install[postfuncs] += "install_dreport_user_scripts"
|
||||
|
||||
RDEPENDS:${PN}-manager += " \
|
||||
${PN}-dreport \
|
||||
"
|
||||
RDEPENDS:${PN}-dreport += " \
|
||||
systemd \
|
||||
${VIRTUAL-RUNTIME_base-utils} \
|
||||
bash \
|
||||
xz \
|
||||
"
|
||||
RDEPENDS:${PN}-scripts += " \
|
||||
bash \
|
||||
"
|
||||
|
||||
FILES:${PN}-manager += " \
|
||||
${bindir}/phosphor-dump-manager \
|
||||
${bindir}/phosphor-offload-handler \
|
||||
${exec_prefix}/lib/tmpfiles.d/coretemp.conf \
|
||||
${datadir}/dump/ \
|
||||
"
|
||||
FILES:${PN}-monitor += "${bindir}/phosphor-dump-monitor"
|
||||
FILES:${PN}-monitor += "${bindir}/phosphor-ramoops-monitor"
|
||||
FILES:${PN}-dreport += "${bindir}/dreport"
|
||||
FILES:${PN}-scripts += "${dreport_dir}"
|
||||
|
||||
require phosphor-debug-collector.inc
|
||||
|
||||
ALLOW_EMPTY:${PN} = "1"
|
||||
|
||||
DEBUG_COLLECTOR_PKGS = " \
|
||||
${PN}-manager \
|
||||
${PN}-monitor \
|
||||
${PN}-dreport \
|
||||
${PN}-scripts \
|
||||
"
|
||||
PACKAGE_BEFORE_PN += "${DEBUG_COLLECTOR_PKGS}"
|
||||
DBUS_PACKAGES = "${PN}-manager"
|
||||
MGR_SVC ?= "xyz.openbmc_project.Dump.Manager.service"
|
||||
DBUS_SERVICE:${PN}-manager += "${MGR_SVC}"
|
||||
# Install dreport script
|
||||
# From tools/dreport.d/dreport to /usr/bin/dreport
|
||||
install_dreport() {
|
||||
install -d ${D}${bindir}
|
||||
install -m 0755 ${S}/tools/dreport.d/dreport \
|
||||
${D}${bindir}/dreport
|
||||
}
|
||||
# Install dreport sample configuration file
|
||||
# From tools/dreport.d/sample.conf
|
||||
# to /usr/share/dreport.d/conf.d/dreport.conf
|
||||
install_dreport_conf_file() {
|
||||
install -d ${D}${dreport_conf_dir}
|
||||
install -m 0644 ${S}/tools/dreport.d/sample.conf \
|
||||
${D}${dreport_conf_dir}/dreport.conf
|
||||
}
|
||||
# Install dreport plugins
|
||||
# From tools/dreport.d/plugins.d to /usr/share/dreport.d/plugins.d
|
||||
install_dreport_plugins_scripts() {
|
||||
install -d ${D}${dreport_plugin_dir}
|
||||
install -m 0755 ${S}/tools/dreport.d/plugins.d/* ${D}${dreport_plugin_dir}/
|
||||
}
|
||||
# Install dreport utility functions
|
||||
# From tools/dreport.d/include.d to /usr/share/dreport.d/include.d
|
||||
install_dreport_include_scripts() {
|
||||
install -d ${D}${dreport_include_dir}
|
||||
install -m 0755 ${S}/tools/dreport.d/include.d/* \
|
||||
${D}${dreport_include_dir}/
|
||||
}
|
||||
# Make the links for a single user plugin script
|
||||
# Create user directories based on the dump type value in the config section
|
||||
# Create softlinks for the base scripts in the user directories
|
||||
def install_dreport_user_script(script_path, d):
|
||||
import re
|
||||
import configparser
|
||||
#Read the user types from the dreport.conf file
|
||||
configure = configparser.ConfigParser()
|
||||
conf_dir = d.getVar('D', True) + d.getVar('dreport_conf_dir', True)
|
||||
confsource = os.path.join(conf_dir, "dreport.conf")
|
||||
configure.read(confsource)
|
||||
config = ("config:")
|
||||
section = "DumpType"
|
||||
dreport_dir = d.getVar('D', True) + d.getVar('dreport_dir', True)
|
||||
script = os.path.basename(script_path)
|
||||
srclink = os.path.join(d.getVar('dreport_plugin_dir', True), script)
|
||||
file = open(script_path, "r")
|
||||
for line in file:
|
||||
if not config in line:
|
||||
continue
|
||||
revalue = re.search('[0-9]+.[0-9]+', line)
|
||||
if not revalue:
|
||||
bb.warn("Invalid format for config value =%s" % line)
|
||||
continue
|
||||
parse_value = revalue.group(0)
|
||||
config_values = re.split(r'\W+', parse_value, 1)
|
||||
if(len(config_values) != 2):
|
||||
bb.warn("Invalid config value=%s" % parse_value)
|
||||
break;
|
||||
priority = config_values[1]
|
||||
types = [int(d) for d in str(config_values[0])]
|
||||
for type in types:
|
||||
if not configure.has_option(section, str(type)):
|
||||
bb.warn("Invalid dump type id =%s" % (str(type)))
|
||||
continue
|
||||
typestr = configure.get(section, str(type))
|
||||
destdir = os.path.join(dreport_dir, ("pl_" + typestr + ".d"))
|
||||
if not os.path.exists(destdir):
|
||||
os.makedirs(destdir)
|
||||
linkname = "E" + priority + script
|
||||
destlink = os.path.join(destdir, linkname)
|
||||
os.symlink(srclink, destlink)
|
||||
file.close()
|
||||
#Make the links for all the plugins
|
||||
python install_dreport_user_scripts() {
|
||||
source = d.getVar('S', True)
|
||||
source_path = os.path.join(source, "tools", "dreport.d", "plugins.d")
|
||||
scripts = os.listdir(source_path)
|
||||
for script in scripts:
|
||||
srcname = os.path.join(source_path, script)
|
||||
install_dreport_user_script(srcname, d)
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
SUMMARY = "Debug collector error watch config file"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
PROVIDES += "virtual/phosphor-debug-errors"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI += "file://errors_watch.yaml"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
inherit native
|
||||
|
||||
do_install:append() {
|
||||
DEST=${D}${datadir}/dump
|
||||
install -d ${DEST}
|
||||
install errors_watch.yaml ${DEST}/
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
elog:
|
||||
- xyz.openbmc_project.Common.Error.InternalFailure
|
||||
@@ -0,0 +1,21 @@
|
||||
SUMMARY = "Phosphor BMC Memory ECC Logging"
|
||||
DESCRIPTION = "Daemon to monitor and report the BMC memory ECC"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
DEPENDS += "sdbusplus"
|
||||
DEPENDS += "phosphor-dbus-interfaces"
|
||||
DEPENDS += "sdeventplus"
|
||||
DEPENDS += "phosphor-logging"
|
||||
SRCREV = "9a31e9a4a4cbab1dbf9f18b2607de3d877900241"
|
||||
PV = "0.1+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/phosphor-ecc.git;branch=master;protocol=https"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
SYSTEMD_SERVICE:${PN} = " ${PN}.service"
|
||||
|
||||
inherit meson pkgconfig
|
||||
inherit systemd
|
||||
|
||||
RDEPENDS:${PN} += "phosphor-sel-logger"
|
||||
@@ -0,0 +1,17 @@
|
||||
SUMMARY = "Phosphor zone events definition default data"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "file://events.yaml"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
inherit allarch
|
||||
inherit phosphor-fan
|
||||
|
||||
do_install() {
|
||||
install -D events.yaml ${D}${control_datadir}/events.yaml
|
||||
}
|
||||
|
||||
FILES:${PN} += "${control_datadir}/events.yaml"
|
||||
@@ -0,0 +1,2 @@
|
||||
#Default zone events definition YAML - empty.
|
||||
#For format, see documentation in fan control code repository example yaml.
|
||||
@@ -0,0 +1,23 @@
|
||||
SUMMARY = "Generate fan control YAML from the MRW"
|
||||
LICENSE = "Apache-2.0"
|
||||
DEPENDS = "mrw-native mrw-perl-tools-native"
|
||||
PROVIDES += "virtual/phosphor-fan-control-fan-config"
|
||||
PR = "r1"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
inherit allarch
|
||||
inherit phosphor-fan
|
||||
inherit mrw-xml
|
||||
|
||||
do_compile() {
|
||||
${bindir}/perl-native/perl \
|
||||
${bindir}/gen_fan_zone_yaml.pl \
|
||||
-i ${STAGING_DIR_NATIVE}${mrw_datadir}/${MRW_XML} \
|
||||
-o fans.yaml
|
||||
}
|
||||
do_install() {
|
||||
install -D fans.yaml ${D}${control_datadir}/fans.yaml
|
||||
}
|
||||
|
||||
FILES:${PN} += "${control_datadir}/fans.yaml"
|
||||
@@ -0,0 +1,18 @@
|
||||
SUMMARY = "Phosphor fan definition example data"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
PROVIDES += "virtual/phosphor-fan-control-fan-config"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "file://fans.yaml"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
inherit allarch
|
||||
inherit phosphor-fan
|
||||
|
||||
do_install() {
|
||||
install -D fans.yaml ${D}${control_datadir}/fans.yaml
|
||||
}
|
||||
|
||||
FILES:${PN} += "${control_datadir}/fans.yaml"
|
||||
@@ -0,0 +1,2 @@
|
||||
#Default fan definition YAML - empty.
|
||||
#For format, see documentation in fan control code repository example yaml.
|
||||
@@ -0,0 +1,17 @@
|
||||
SUMMARY = "Phosphor zone conditions definition default data"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "file://zone_conditions.yaml"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
inherit allarch
|
||||
inherit phosphor-fan
|
||||
|
||||
do_install() {
|
||||
install -D zone_conditions.yaml ${D}${control_datadir}/zone_conditions.yaml
|
||||
}
|
||||
|
||||
FILES:${PN} += "${control_datadir}/zone_conditions.yaml"
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
#Default zone conditions definition YAML - empty.
|
||||
#For format, see documentation in fan control code repository example yaml.
|
||||
@@ -0,0 +1,17 @@
|
||||
SUMMARY = "Phosphor fan zone definition default data"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "file://zones.yaml"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
inherit allarch
|
||||
inherit phosphor-fan
|
||||
|
||||
do_install() {
|
||||
install -D zones.yaml ${D}${control_datadir}/zones.yaml
|
||||
}
|
||||
|
||||
FILES:${PN} += "${control_datadir}/zones.yaml"
|
||||
@@ -0,0 +1,2 @@
|
||||
#Default fan zone definition YAML - empty.
|
||||
#For format, see documentation in fan control code repository example yaml.
|
||||
@@ -0,0 +1,18 @@
|
||||
SUMMARY = "Phosphor fan monitor definition default data"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "file://monitor.yaml"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
inherit allarch
|
||||
inherit phosphor-fan
|
||||
|
||||
do_install() {
|
||||
DEST=${D}${monitor_datadir}
|
||||
install -D monitor.yaml ${D}${monitor_datadir}/monitor.yaml
|
||||
}
|
||||
|
||||
FILES:${PN} += "${monitor_datadir}/monitor.yaml"
|
||||
@@ -0,0 +1,2 @@
|
||||
#Default fan monitor definition YAML - empty.
|
||||
#For format, see documentation in fan monitor code repository example yaml.
|
||||
@@ -0,0 +1,23 @@
|
||||
# Provides the config file for the phosphor-fan-presence application.
|
||||
# The default config file is empty. To provide a real one,
|
||||
# append this recipe in a layer, add:
|
||||
# FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
|
||||
# and provide a config file.
|
||||
SUMMARY = "Config file for phosphor-fan-presence"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
PROVIDES += "virtual/phosphor-fan-presence-config"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "file://config.yaml"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
inherit allarch
|
||||
inherit phosphor-fan
|
||||
|
||||
do_install() {
|
||||
install -D config.yaml ${D}${presence_datadir}/config.yaml
|
||||
}
|
||||
|
||||
FILES:${PN} += "${presence_datadir}/config.yaml"
|
||||
@@ -0,0 +1,3 @@
|
||||
# This file is a stub. Consult
|
||||
# https://github.com/openbmc/phosphor-fan-presence
|
||||
# for file format description and examples.
|
||||
@@ -0,0 +1,22 @@
|
||||
SUMMARY = "Generate fan presence YAML from the MRW"
|
||||
LICENSE = "Apache-2.0"
|
||||
DEPENDS = "mrw-native mrw-perl-tools-native"
|
||||
PROVIDES += "virtual/phosphor-fan-presence-config"
|
||||
PR = "r1"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
inherit allarch
|
||||
inherit phosphor-fan
|
||||
inherit mrw-xml
|
||||
|
||||
do_install() {
|
||||
DEST=${D}${presence_datadir}
|
||||
install -d ${DEST}
|
||||
${bindir}/perl-native/perl \
|
||||
${bindir}/gen_presence_yaml.pl \
|
||||
-i ${STAGING_DIR_NATIVE}${mrw_datadir}/${MRW_XML} \
|
||||
-o ${DEST}/config.yaml
|
||||
}
|
||||
|
||||
FILES:${PN} += "${presence_datadir}/config.yaml"
|
||||
@@ -0,0 +1,5 @@
|
||||
HOMEPAGE = "https://github.com/openbmc/phosphor-fan-presence"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
|
||||
SRC_URI += "git://github.com/openbmc/phosphor-fan-presence;branch=master;protocol=https"
|
||||
SRCREV = "fc4be0d60af0567942b93f74dd26ddb4add9e262"
|
||||
@@ -0,0 +1,156 @@
|
||||
SUMMARY = "Phosphor Fan"
|
||||
DESCRIPTION = "Phosphor fan provides a set of fan monitoring and \
|
||||
control applications."
|
||||
# Common build dependencies
|
||||
DEPENDS += "${PYTHON_PN}-pyyaml-native"
|
||||
DEPENDS += "${PYTHON_PN}-mako-native"
|
||||
DEPENDS += "sdbusplus"
|
||||
DEPENDS += "${PYTHON_PN}-sdbus++-native"
|
||||
DEPENDS += "sdeventplus"
|
||||
DEPENDS += "gpioplus"
|
||||
DEPENDS += "phosphor-logging"
|
||||
DEPENDS += "libevdev"
|
||||
DEPENDS += "nlohmann-json"
|
||||
DEPENDS += "cli11"
|
||||
PACKAGECONFIG ?= "presence control monitor sensor-monitor"
|
||||
# The control, monitor, and presence apps can either be JSON or YAML driven.
|
||||
PACKAGECONFIG[json] = "-Djson-config=enabled, -Djson-config=disabled"
|
||||
# --------------------------------------
|
||||
# ${PN}-presence-tach specific configuration
|
||||
PACKAGECONFIG[presence] = "-Dpresence-service=enabled \
|
||||
-Dmachine-name=${PKG_DEFAULT_MACHINE} \
|
||||
-Dpresence-config=${STAGING_DIR_HOST}${presence_datadir}/config.yaml, \
|
||||
-Dpresence-service=disabled, \
|
||||
virtual/phosphor-fan-presence-config \
|
||||
, \
|
||||
"
|
||||
# --------------------------------------
|
||||
# ${PN}-control specific configuration
|
||||
PACKAGECONFIG[control] = "-Dcontrol-service=enabled \
|
||||
-Dmachine-name=${PKG_DEFAULT_MACHINE} \
|
||||
-Dfan-def-yaml-file=${STAGING_DIR_HOST}${control_datadir}/fans.yaml \
|
||||
-Dfan-zone-yaml-file=${STAGING_DIR_HOST}${control_datadir}/zones.yaml \
|
||||
-Dzone-events-yaml-file=${STAGING_DIR_HOST}${control_datadir}/events.yaml \
|
||||
-Dzone-conditions-yaml-file=${STAGING_DIR_HOST}${control_datadir}/zone_conditions.yaml, \
|
||||
-Dcontrol-service=disabled, \
|
||||
virtual/phosphor-fan-control-fan-config \
|
||||
phosphor-fan-control-zone-config \
|
||||
phosphor-fan-control-events-config \
|
||||
phosphor-fan-control-zone-conditions-config \
|
||||
, \
|
||||
"
|
||||
# --------------------------------------
|
||||
# ${PN}-monitor specific configuration
|
||||
PACKAGECONFIG[monitor] = "-Dmonitor-service=enabled \
|
||||
-Dmachine-name=${PKG_DEFAULT_MACHINE} \
|
||||
-Dfan-monitor-yaml-file=${STAGING_DIR_HOST}${monitor_datadir}/monitor.yaml, \
|
||||
-Dmonitor-service=disabled, \
|
||||
phosphor-fan-monitor-config \
|
||||
, \
|
||||
"
|
||||
# --------------------------------------
|
||||
# phosphor-cooling-type specific configuration
|
||||
PACKAGECONFIG[cooling-type] = "-Dcooling-type-service=enabled,-Dcooling-type-service=disabled,,"
|
||||
# --------------------------------------
|
||||
# ${PN}-sensor-monitor specific configuration
|
||||
PACKAGECONFIG[sensor-monitor] = "-Dsensor-monitor-service=enabled,-Dsensor-monitor-service=disabled"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
# OBMC_CHASSIS_ZERO_ONLY: hacky way to fix the templates until
|
||||
# openbmc/phosphor-fan-presence#26 is resolved. This should likely be
|
||||
# returned to OBMC_CHASSIS_INSTANCES.
|
||||
OBMC_CHASSIS_ZERO_ONLY = "0"
|
||||
|
||||
SYSTEMD_PACKAGES = "${FAN_PACKAGES}"
|
||||
SYSTEMD_SERVICE:${PN}-presence-tach += "${TMPL_TACH}"
|
||||
SYSTEMD_LINK:${PN}-presence-tach += "${@compose_list(d, 'FMT_TACH', 'OBMC_CHASSIS_ZERO_ONLY')}"
|
||||
# JSON mode also gets linked into multi-user
|
||||
SYSTEMD_LINK:${PN}-presence-tach += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
|
||||
compose_list(d, 'FMT_TACH_MUSR', 'OBMC_CHASSIS_ZERO_ONLY'), '', d)}"
|
||||
SYSTEMD_SERVICE:${PN}-control += "${TMPL_CONTROL}"
|
||||
SYSTEMD_SERVICE:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', '', '${TMPL_CONTROL_INIT}', d)}"
|
||||
# JSON: Linked to multi-user and poweron
|
||||
# YAML: Linked to fans-ready and fan control-init poweron
|
||||
SYSTEMD_LINK:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
|
||||
compose_list(d, 'FMT_CONTROL_MUSR', 'OBMC_CHASSIS_ZERO_ONLY'), \
|
||||
compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_ZERO_ONLY'), d)}"
|
||||
SYSTEMD_LINK:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
|
||||
compose_list(d, 'FMT_CONTROL_PWRON', 'OBMC_CHASSIS_ZERO_ONLY'), \
|
||||
compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_ZERO_ONLY'), d)}"
|
||||
SYSTEMD_SERVICE:${PN}-monitor += "${TMPL_MONITOR}"
|
||||
SYSTEMD_SERVICE:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', '', '${TMPL_MONITOR_INIT}', d)}"
|
||||
|
||||
# JSON: power on and multi-user links. YAML: fans-ready and fan monitor init links
|
||||
SYSTEMD_LINK:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
|
||||
compose_list(d, 'FMT_MONITOR_PWRON', 'OBMC_CHASSIS_ZERO_ONLY'), \
|
||||
compose_list(d, 'FMT_MONITOR_FANSREADY', 'OBMC_CHASSIS_ZERO_ONLY'), d)}"
|
||||
SYSTEMD_LINK:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
|
||||
compose_list(d, 'FMT_MONITOR_MUSR', 'OBMC_CHASSIS_ZERO_ONLY'), \
|
||||
compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_ZERO_ONLY'), d)}"
|
||||
SYSTEMD_SERVICE:sensor-monitor += "sensor-monitor.service"
|
||||
SYSTEMD_LINK:sensor-monitor += "../sensor-monitor.service:${MULTI_USR_TGT}.wants/sensor-monitor.service"
|
||||
|
||||
inherit meson pkgconfig python3native
|
||||
inherit obmc-phosphor-systemd
|
||||
inherit phosphor-fan
|
||||
|
||||
EXTRA_OEMESON:append = " -Dtests=disabled"
|
||||
|
||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||
|
||||
FILES:${PN}-presence-tach = "${bindir}/phosphor-fan-presence-tach"
|
||||
# Package the JSON config files installed from the repo
|
||||
FILES:${PN}-presence-tach += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
|
||||
'${datadir}/phosphor-fan-presence/presence/*', '', d)}"
|
||||
FILES:${PN}-control = "${bindir}/phosphor-fan-control"
|
||||
FILES:${PN}-control += "${bindir}/fanctl"
|
||||
# Package the JSON config files installed from the repo
|
||||
FILES:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
|
||||
'${datadir}/phosphor-fan-presence/control/*', '', d)}"
|
||||
FILES:${PN}-monitor = "${bindir}/phosphor-fan-monitor"
|
||||
# Package the JSON config files installed from the repo
|
||||
FILES:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
|
||||
'${datadir}/phosphor-fan-presence/monitor/*', '', d)}"
|
||||
FILES:sensor-monitor += " ${bindir}/sensor-monitor"
|
||||
|
||||
require ${BPN}.inc
|
||||
|
||||
ALLOW_EMPTY:${PN} = "1"
|
||||
|
||||
PKG_DEFAULT_MACHINE ??= "${MACHINE}"
|
||||
|
||||
# Package configuration
|
||||
FAN_PACKAGES = " \
|
||||
${PN}-presence-tach \
|
||||
${PN}-control \
|
||||
${PN}-monitor \
|
||||
${PN}-sensor-monitor \
|
||||
"
|
||||
PACKAGE_BEFORE_PN += "${FAN_PACKAGES}"
|
||||
MULTI_USR_TGT = "multi-user.target"
|
||||
TMPL_TACH = "phosphor-fan-presence-tach@.service"
|
||||
INSTFMT_TACH = "phosphor-fan-presence-tach@{0}.service"
|
||||
POWERON_TGT = "obmc-chassis-poweron@{0}.target"
|
||||
FMT_TACH = "../${TMPL_TACH}:${POWERON_TGT}.wants/${INSTFMT_TACH}"
|
||||
FMT_TACH_MUSR = "../${TMPL_TACH}:${MULTI_USR_TGT}.wants/${INSTFMT_TACH}"
|
||||
FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target"
|
||||
TMPL_CONTROL = "phosphor-fan-control@.service"
|
||||
INSTFMT_CONTROL = "phosphor-fan-control@{0}.service"
|
||||
FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}"
|
||||
FMT_CONTROL_MUSR = "../${TMPL_CONTROL}:${MULTI_USR_TGT}.wants/${INSTFMT_CONTROL}"
|
||||
FMT_CONTROL_PWRON = "../${TMPL_CONTROL}:${POWERON_TGT}.wants/${INSTFMT_CONTROL}"
|
||||
TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service"
|
||||
INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service"
|
||||
FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.wants/${INSTFMT_CONTROL_INIT}"
|
||||
TMPL_MONITOR = "phosphor-fan-monitor@.service"
|
||||
INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service"
|
||||
FMT_MONITOR_FANSREADY = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}"
|
||||
FMT_MONITOR_PWRON = "../${TMPL_MONITOR}:${POWERON_TGT}.wants/${INSTFMT_MONITOR}"
|
||||
FMT_MONITOR_MUSR = "../${TMPL_MONITOR}:${MULTI_USR_TGT}.wants/${INSTFMT_MONITOR}"
|
||||
TMPL_MONITOR_INIT = "phosphor-fan-monitor-init@.service"
|
||||
INSTFMT_MONITOR_INIT = "phosphor-fan-monitor-init@{0}.service"
|
||||
FMT_MONITOR_INIT = "../${TMPL_MONITOR_INIT}:${POWERON_TGT}.wants/${INSTFMT_MONITOR_INIT}"
|
||||
FAN_PACKAGES:append = "${@bb.utils.contains('PACKAGECONFIG', 'sensor-monitor', ' sensor-monitor', '', d)}"
|
||||
@@ -0,0 +1,51 @@
|
||||
# Each platform will need a service file that starts
|
||||
# at an appropriate time per system. For instance, if
|
||||
# your system relies on passive dbus for fans or other
|
||||
# sensors then it may be prudent to wait for all of them.
|
||||
SUMMARY = "Phosphor PID Fan Control"
|
||||
DESCRIPTION = "Fan Control"
|
||||
HOMEPAGE = "github.com/openbmc/phosphor-pid-control"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
|
||||
DEPENDS += "autoconf-archive-native"
|
||||
DEPENDS += "sdbusplus"
|
||||
DEPENDS += "phosphor-dbus-interfaces"
|
||||
DEPENDS += "phosphor-logging"
|
||||
DEPENDS += "libevdev"
|
||||
DEPENDS += "nlohmann-json"
|
||||
DEPENDS += "cli11"
|
||||
DEPENDS += "boost"
|
||||
# We depend on this to be built first so we can build our providers.
|
||||
DEPENDS += "phosphor-ipmi-host"
|
||||
SRCREV = "796f06dc6f0e8161ee9ecf085443c1ae0dc45216"
|
||||
PV = "0.1+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/phosphor-pid-control;branch=master;protocol=https"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
SERVICE_FILE = "phosphor-pid-control.service"
|
||||
SYSTEMD_PACKAGES = "${PN}"
|
||||
SYSTEMD_SERVICE:${PN} = "${SERVICE_FILE}"
|
||||
|
||||
inherit meson pkgconfig
|
||||
inherit obmc-phosphor-ipmiprovider-symlink
|
||||
inherit systemd
|
||||
|
||||
EXTRA_OEMESON = " \
|
||||
-Dtests=disabled \
|
||||
-Dsystemd_target="multi-user.target" \
|
||||
"
|
||||
|
||||
FILES:${PN} = "${bindir}/swampd ${bindir}/setsensor"
|
||||
# The following installs the OEM IPMI handler for the fan controls.
|
||||
FILES:${PN}:append = " ${libdir}/ipmid-providers/lib*${SOLIBS}"
|
||||
FILES:${PN}:append = " ${libdir}/host-ipmid/lib*${SOLIBS}"
|
||||
FILES:${PN}:append = " ${libdir}/net-ipmid/lib*${SOLIBS}"
|
||||
FILES:${PN}-dev:append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la"
|
||||
|
||||
HOSTIPMI_PROVIDER_LIBRARY += "libmanualcmds.so"
|
||||
config_datadir = "${datadir}/swampd/"
|
||||
# config_path is the location swampd expects to find a json configuration.
|
||||
# the file is expected to be named config.json
|
||||
config_path = "${config_datadir}config.json"
|
||||
@@ -0,0 +1,16 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAPvSDLu6slkP1gri
|
||||
PaeQXL9ysD69J/HjbBCIQ0RPfeWBb75US1tRTjPP0Ub8CtH8ExVf8iF1ulsZA78B
|
||||
zIjBYZVp9pyD6LbpZ/hjV7rIH6dTNhoVpdA+F8LzmQ7cyhHG8l2JMvdunwF2uX5k
|
||||
D4WDcZt/ITKZNQNavPtmIyD5HprdAgMBAAECgYEAuQkTSi5ZNpAoWz76xtGRFSwU
|
||||
zUT4wQi3Mz6tDtjKTYXasiQGa0dHC1M9F8fDu6BZ9W7W4Dc9hArRcdzEighuxoI/
|
||||
nZI/0uL89iUEywnDEIHuS6D5JlZaj86/nx9YvQnO8F/seM+MX0EAWVrd5wC7aAF1
|
||||
h6Fu7ykZB4ggUjQAWwECQQD+AUiDOEO+8btLJ135dQfSGc5VFcZiequnKWVm6uXt
|
||||
rX771hEYjYMjLqWGFg9G4gE3GuABM5chMINuQQUivy8tAkEA/cxfy19XkjtqcMgE
|
||||
x/UDt6Nr+Ky/tk+4Y65WxPRDas0uxFOPk/vEjgVmz1k/TAy9G4giisluTvtmltr5
|
||||
DCLocQJBAJnRHx9PiD7uVhRJz6/L/iNuOzPtTsi+Loq5F83+O6T15qsM1CeBMsOw
|
||||
cM5FN5UeMcwz+yjfHAsePMkcmMaU7jUCQHlg9+N8upXuIo7Dqj2zOU7nMmkgvSNE
|
||||
5yuNImRZabC3ZolwaTdd7nf5r1y1Eyec5Ag5yENV6JKPe1Xkbb1XKJECQDngA0h4
|
||||
6ATvfP1Vrx4CbP11eKXbCsZ9OGPHSgyvVjn68oY5ZP3uPsIattoN7dE2BRfuJm7m
|
||||
F0nIdUAhR0yTfKM=
|
||||
-----END PRIVATE KEY-----
|
||||
@@ -0,0 +1,22 @@
|
||||
DESCRIPTION = "phosphor-ipmi-flash config to update without verifying the image"
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||
|
||||
SRC_URI += "file://noverify-bmc-update.service"
|
||||
SRC_URI += "file://noverify-bmc-verify.service"
|
||||
SRC_URI += "file://config-bmc.json"
|
||||
|
||||
SYSTEMD_SERVICE:${PN} += "noverify-bmc-update.service"
|
||||
SYSTEMD_SERVICE:${PN} += "noverify-bmc-verify.service"
|
||||
|
||||
inherit systemd
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${datadir}/phosphor-ipmi-flash
|
||||
install -m 0644 ${WORKDIR}/config-bmc.json ${D}${datadir}/phosphor-ipmi-flash
|
||||
install -d ${D}${systemd_system_unitdir}
|
||||
install -m 0644 ${WORKDIR}/noverify-bmc-update.service ${D}${systemd_system_unitdir}
|
||||
install -m 0644 ${WORKDIR}/noverify-bmc-verify.service ${D}${systemd_system_unitdir}
|
||||
}
|
||||
|
||||
FILES:${PN} += "${datadir}/phosphor-ipmi-flash/config-bmc.json"
|
||||
@@ -0,0 +1,20 @@
|
||||
[{
|
||||
"blob": "/flash/image",
|
||||
"handler": {
|
||||
"type": "file",
|
||||
"path": "/run/initramfs/bmc-image"
|
||||
},
|
||||
"actions": {
|
||||
"preparation": {
|
||||
"type": "skip"
|
||||
},
|
||||
"verification": {
|
||||
"type": "systemd",
|
||||
"unit": "noverify-bmc-verify.service"
|
||||
},
|
||||
"update": {
|
||||
"type": "systemd",
|
||||
"unit": "noverify-bmc-update.service"
|
||||
}
|
||||
}
|
||||
}]
|
||||
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Commit image for update and reboot
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/mv /run/initramfs/bmc-image-verified /run/initramfs/image-bmc
|
||||
# This command is intentionally blocking to ensure this unit doesn't complete
|
||||
# before the BMC reboots.
|
||||
ExecStart=/usr/bin/systemctl start --job-mode=replace-irreversibly reboot.target
|
||||
@@ -0,0 +1,6 @@
|
||||
[Unit]
|
||||
Description=Don't verify the image, just stage it for update
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/mv /run/initramfs/bmc-image /run/initramfs/bmc-image-verified
|
||||
@@ -0,0 +1,28 @@
|
||||
SUMMARY = "Provides a host firmware image"
|
||||
DESCRIPTION = "Use a bbappend to add the image files"
|
||||
LICENSE = "${HOSTFW_LICENSE}"
|
||||
LIC_FILES_CHKSUM = "${HOSTFW_LIC_FILES_CHKSUM}"
|
||||
PR = "r1"
|
||||
|
||||
inherit allarch
|
||||
inherit deploy
|
||||
|
||||
do_compile() {
|
||||
# The image directory can be used as the source to create a filesystem to
|
||||
# add to the BMC image.
|
||||
install -d ${B}/image
|
||||
# Install an image-hostfw file in the update directory to be included in
|
||||
# the code update tarball.
|
||||
install -d ${B}/update
|
||||
}
|
||||
|
||||
addtask deploy before do_build after do_compile
|
||||
|
||||
HOSTFW_LICENSE ?= "Apache-2.0"
|
||||
HOSTFW_LIC_FILES_CHKSUM ?= "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
do_deploy() {
|
||||
install -d ${DEPLOYDIR}/hostfw/image
|
||||
install -d ${DEPLOYDIR}/hostfw/update
|
||||
cp -R --no-dereference --preserve=mode,links ${B}/image/ ${DEPLOYDIR}/hostfw/
|
||||
cp -R --no-dereference --preserve=mode,links ${B}/update/ ${DEPLOYDIR}/hostfw/
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
SUMMARY = "OpenBMC image signing public key"
|
||||
DESCRIPTION = "Public key information to be included in images for image verification."
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
DEPENDS += "openssl-native"
|
||||
DEPENDS += "${@oe.utils.conditional('INSECURE_KEY', 'True', 'phosphor-insecure-signing-key-native', '', d)}"
|
||||
PR = "r1"
|
||||
|
||||
SIGNING_PUBLIC_KEY ?= ""
|
||||
SIGNING_PUBLIC_KEY_TYPE = "${@os.path.splitext(os.path.basename('${SIGNING_PUBLIC_KEY}'))[0]}"
|
||||
SIGNING_KEY ?= "${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv"
|
||||
SIGNING_KEY_TYPE = "${@os.path.splitext(os.path.basename('${SIGNING_KEY}'))[0]}"
|
||||
SYSROOT_DIRS:append = " ${sysconfdir}"
|
||||
|
||||
inherit allarch
|
||||
|
||||
do_install() {
|
||||
signing_key="${SIGNING_KEY}"
|
||||
if [ "${INSECURE_KEY}" = "True" ] && [ -n "${SIGNING_PUBLIC_KEY}" ]; then
|
||||
echo "Using SIGNING_PUBLIC_KEY"
|
||||
signing_key=""
|
||||
fi
|
||||
if [ -n "${signing_key}" ] && [ -n "${SIGNING_PUBLIC_KEY}" ]; then
|
||||
echo "Both SIGNING_KEY and SIGNING_PUBLIC_KEY are defined, expecting only one"
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "${signing_key}" ]; then
|
||||
openssl pkey -in "${signing_key}" -pubout -out ${WORKDIR}/publickey
|
||||
idir="${D}${sysconfdir}/activationdata/${SIGNING_KEY_TYPE}"
|
||||
elif [ -n "${SIGNING_PUBLIC_KEY}" ]; then
|
||||
cp "${SIGNING_PUBLIC_KEY}" ${WORKDIR}/publickey
|
||||
idir="${D}${sysconfdir}/activationdata/${SIGNING_PUBLIC_KEY_TYPE}"
|
||||
else
|
||||
echo "No SIGNING_KEY or SIGNING_PUBLIC_KEY defined, expecting one"
|
||||
exit 1
|
||||
fi
|
||||
echo HashType=RSA-SHA256 > "${WORKDIR}/hashfunc"
|
||||
install -d ${idir}
|
||||
install -m 644 ${WORKDIR}/publickey ${idir}
|
||||
install -m 644 ${WORKDIR}/hashfunc ${idir}
|
||||
}
|
||||
|
||||
FILES:${PN} += "${sysconfdir}/activationdata/"
|
||||
|
||||
INSECURE_KEY = "${@'${SIGNING_KEY}' == '${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv'}"
|
||||
@@ -0,0 +1,16 @@
|
||||
SUMMARY = "Insecure private key for testing and development"
|
||||
DESCRIPTION = "Do not use this key to sign images."
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI += "file://OpenBMC.priv"
|
||||
|
||||
inherit allarch
|
||||
inherit native
|
||||
|
||||
do_install() {
|
||||
bbplain "Using an insecure image signing key!"
|
||||
install -d ${D}${datadir}
|
||||
install -m 400 ${WORKDIR}/OpenBMC.priv ${D}${datadir}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
SUMMARY = "phosphor-software-manager: install phosphor-logging yaml"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit phosphor-logging-yaml-provider
|
||||
|
||||
require phosphor-software-manager.inc
|
||||
@@ -0,0 +1,5 @@
|
||||
HOMEPAGE = "https://github.com/openbmc/phosphor-bmc-code-mgmt"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
|
||||
SRC_URI += "git://github.com/openbmc/phosphor-bmc-code-mgmt;branch=master;protocol=https"
|
||||
SRCREV = "b9ecb2bcda1292649968c15d227c32dc4209b844"
|
||||
@@ -0,0 +1,121 @@
|
||||
SUMMARY = "Phosphor Software Management"
|
||||
DESCRIPTION = "Phosphor Software Manager provides a set of system software \
|
||||
management daemons. It is suitable for use on a wide variety of OpenBMC \
|
||||
platforms."
|
||||
DEPENDS += " \
|
||||
openssl \
|
||||
phosphor-dbus-interfaces \
|
||||
phosphor-logging \
|
||||
${PYTHON_PN}-sdbus++-native \
|
||||
sdbusplus \
|
||||
"
|
||||
PACKAGECONFIG[verify_signature] = " \
|
||||
-Dverify-full-signature=enabled, \
|
||||
-Dverify-full-signature=disabled"
|
||||
PACKAGECONFIG[sync_bmc_files] = "-Dsync-bmc-files=enabled, -Dsync-bmc-files=disabled"
|
||||
PACKAGECONFIG[usb_code_update] = "-Dusb-code-update=enabled, -Dusb-code-update=disabled, cli11"
|
||||
PACKAGECONFIG[side_switch_on_boot] = "-Dside-switch-on-boot=enabled, -Dside-switch-on-boot=disabled, cli11"
|
||||
PACKAGECONFIG[ubifs_layout] = "-Dbmc-layout=ubi"
|
||||
PACKAGECONFIG[mmc_layout] = "-Dbmc-layout=mmc"
|
||||
PACKAGECONFIG[flash_bios] = "-Dhost-bios-upgrade=enabled, -Dhost-bios-upgrade=disabled"
|
||||
PACKAGECONFIG[static-dual-image] = "-Dbmc-static-dual-image=enabled, -Dbmc-static-dual-image=disabled"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SOFTWARE_MGR_PACKAGES = " \
|
||||
${PN}-version \
|
||||
${PN}-download-mgr \
|
||||
${PN}-updater \
|
||||
${PN}-updater-ubi \
|
||||
${PN}-updater-mmc \
|
||||
${PN}-sync \
|
||||
${PN}-usb \
|
||||
${PN}-side-switch \
|
||||
"
|
||||
# Set SYSTEMD_PACKAGES to empty because we do not want ${PN} and DBUS_PACKAGES
|
||||
# handles the rest.
|
||||
SYSTEMD_PACKAGES = ""
|
||||
SYSTEMD_SERVICE:${PN}-updater += " \
|
||||
force-reboot.service \
|
||||
obmc-flash-bmc-setenv@.service \
|
||||
reboot-guard-disable.service \
|
||||
reboot-guard-enable.service \
|
||||
usr-local.mount \
|
||||
"
|
||||
SYSTEMD_SERVICE:${PN}-updater += "${@bb.utils.contains('PACKAGECONFIG', 'flash_bios', 'obmc-flash-host-bios@.service', '', d)}"
|
||||
SYSTEMD_SERVICE:${PN}-usb += "${@bb.utils.contains('PACKAGECONFIG', 'usb_code_update', 'usb-code-update@.service', '', d)}"
|
||||
SYSTEMD_SERVICE:${PN}-side-switch += "${@bb.utils.contains('PACKAGECONFIG', 'side_switch_on_boot', 'phosphor-bmc-side-switch.service', '', d)}"
|
||||
SYSTEMD_SERVICE:${PN}-updater += "${@bb.utils.contains('PACKAGECONFIG', 'static-dual-image', 'obmc-flash-bmc-alt@.service', '', d)}"
|
||||
SYSTEMD_SERVICE:${PN}-updater += "${@bb.utils.contains('PACKAGECONFIG', 'static-dual-image', 'obmc-flash-bmc-static-mount-alt.service', '', d)}"
|
||||
SYSTEMD_SERVICE:${PN}-updater += "${@bb.utils.contains('PACKAGECONFIG', 'static-dual-image', 'obmc-flash-bmc-prepare-for-sync.service', '', d)}"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit meson pkgconfig
|
||||
inherit obmc-phosphor-dbus-service
|
||||
inherit python3native
|
||||
inherit ${@bb.utils.contains('DISTRO_FEATURES', 'obmc-ubi-fs', 'phosphor-software-manager-ubi-fs', '', d)}
|
||||
inherit ${@bb.utils.contains('DISTRO_FEATURES', 'phosphor-mmc', 'phosphor-software-manager-mmc', '', d)}
|
||||
|
||||
EXTRA_OEMESON:append = " -Dtests=disabled"
|
||||
|
||||
do_install:append() {
|
||||
install -d ${D}/usr/local
|
||||
}
|
||||
|
||||
# The repo installs several scripts that depends on bash
|
||||
RDEPENDS:${PN} += " bash"
|
||||
RDEPENDS:${PN}-updater += " \
|
||||
bash \
|
||||
virtual-obmc-image-manager \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'verify_signature', 'phosphor-image-signing', '', d)} \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'mmc_layout', 'e2fsprogs-e2fsck', '', d)} \
|
||||
"
|
||||
|
||||
RPROVIDES:${PN}-version += " \
|
||||
virtual-obmc-image-manager \
|
||||
"
|
||||
|
||||
FILES:${PN}-version += "${bindir}/phosphor-version-software-manager ${exec_prefix}/lib/tmpfiles.d/software.conf"
|
||||
FILES:${PN}-download-mgr += "${bindir}/phosphor-download-manager"
|
||||
FILES:${PN}-updater += " \
|
||||
${bindir}/phosphor-image-updater \
|
||||
${bindir}/obmc-flash-bmc \
|
||||
/usr/local \
|
||||
"
|
||||
FILES:${PN}-sync += " \
|
||||
${bindir}/phosphor-sync-software-manager \
|
||||
${sysconfdir}/synclist \
|
||||
"
|
||||
FILES:${PN}-usb += "\
|
||||
${base_libdir}/udev/rules.d/70-bmc-usb.rules \
|
||||
${bindir}/phosphor-usb-code-update \
|
||||
"
|
||||
FILES:${PN}-side-switch += "\
|
||||
${bindir}/phosphor-bmc-side-switch \
|
||||
"
|
||||
|
||||
require ${BPN}.inc
|
||||
|
||||
ALLOW_EMPTY:${PN} = "1"
|
||||
|
||||
PACKAGE_BEFORE_PN += "${SOFTWARE_MGR_PACKAGES}"
|
||||
DBUS_PACKAGES = "${SOFTWARE_MGR_PACKAGES}"
|
||||
DBUS_SERVICE:${PN}-version += "xyz.openbmc_project.Software.Version.service"
|
||||
DBUS_SERVICE:${PN}-download-mgr += "xyz.openbmc_project.Software.Download.service"
|
||||
DBUS_SERVICE:${PN}-updater += "xyz.openbmc_project.Software.BMC.Updater.service"
|
||||
DBUS_SERVICE:${PN}-sync += "xyz.openbmc_project.Software.Sync.service"
|
||||
|
||||
pkg_postinst:${PN}-side-switch() {
|
||||
if ${@bb.utils.contains('PACKAGECONFIG', 'side_switch_on_boot', 'true', 'false', d)} ; then
|
||||
mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@0.target.wants
|
||||
LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/phosphor-bmc-side-switch.service"
|
||||
TARGET="../phosphor-bmc-side-switch.service"
|
||||
ln -s $TARGET $LINK
|
||||
fi
|
||||
}
|
||||
pkg_prerm:${PN}-side-switch() {
|
||||
if ${@bb.utils.contains('PACKAGECONFIG', 'side_switch_on_boot', 'true', 'false', d)} ; then
|
||||
LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/phosphor-bmc-side-switch.service"
|
||||
rm $LINK
|
||||
fi
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
SUMMARY = "Phosphor GPIO monitor application"
|
||||
DESCRIPTION = "Application to monitor gpio assertions"
|
||||
HOMEPAGE = "http://github.com/openbmc/phosphor-gpio-monitor"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
|
||||
DEPENDS += "sdbusplus"
|
||||
DEPENDS += "phosphor-dbus-interfaces"
|
||||
DEPENDS += "libevdev"
|
||||
DEPENDS += "phosphor-logging"
|
||||
DEPENDS += "systemd"
|
||||
DEPENDS += "boost"
|
||||
DEPENDS += "libgpiod"
|
||||
DEPENDS += "cli11"
|
||||
DEPENDS += "nlohmann-json"
|
||||
SRCREV = "c78e23d6a61c863a57a516e6cbc197b59260c723"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/phosphor-gpio-monitor;branch=master;protocol=https"
|
||||
|
||||
SYSTEMD_PACKAGES = "${GPIO_PACKAGES}"
|
||||
SYSTEMD_SERVICE:${PN}-monitor += "phosphor-multi-gpio-monitor.service"
|
||||
SYSTEMD_SERVICE:${PN}-monitor += "phosphor-gpio-monitor@.service"
|
||||
SYSTEMD_SERVICE:${PN}-presence += "phosphor-gpio-presence@.service"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit meson pkgconfig
|
||||
inherit obmc-phosphor-dbus-service
|
||||
|
||||
EXTRA_OEMESON:append = " -Dtests=disabled"
|
||||
|
||||
FILES:${PN}-monitor += "${bindir}/phosphor-gpio-monitor"
|
||||
FILES:${PN}-monitor += "${bindir}/phosphor-multi-gpio-monitor"
|
||||
FILES:${PN}-monitor += "${bindir}/phosphor-gpio-util"
|
||||
FILES:${PN}-monitor += "${nonarch_base_libdir}/udev/rules.d/99-gpio-keys.rules"
|
||||
FILES:${PN}-presence += "${bindir}/phosphor-gpio-presence"
|
||||
|
||||
ALLOW_EMPTY:${PN} = "1"
|
||||
|
||||
GPIO_PACKAGES = " \
|
||||
${PN}-monitor \
|
||||
${PN}-presence \
|
||||
"
|
||||
PACKAGE_BEFORE_PN += "${GPIO_PACKAGES}"
|
||||
@@ -0,0 +1,28 @@
|
||||
SUMMARY = "BMC Health Monitoring"
|
||||
DESCRIPTION = "Daemon to collect and monitor bmc health statistics"
|
||||
HOMEPAGE = "https://github.com/openbmc/phosphor-health-monitor"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=9e69ba356fa59848ffd865152a3ccc13"
|
||||
DEPENDS += "sdbusplus"
|
||||
DEPENDS += "phosphor-dbus-interfaces"
|
||||
DEPENDS += "sdeventplus"
|
||||
DEPENDS += "phosphor-logging"
|
||||
DEPENDS += "nlohmann-json"
|
||||
SRCREV = "0b7a9147d69d89025d99487a397e76e88f6a7295"
|
||||
PV = "0.1+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/phosphor-health-monitor.git;protocol=https;branch=master"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
SYSTEMD_SERVICE:${PN} = "phosphor-health-monitor.service"
|
||||
|
||||
inherit meson pkgconfig
|
||||
inherit systemd
|
||||
|
||||
do_install:append() {
|
||||
if [ -e "${WORKDIR}/bmc_health_config.json" ]; then
|
||||
install -d ${D}${sysconfdir}/healthMon
|
||||
install -m 0644 ${WORKDIR}/bmc_health_config.json ${D}${sysconfdir}/healthMon
|
||||
fi
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
[Unit]
|
||||
Description=Start Host%i
|
||||
After=obmc-host-start-pre@%i.target
|
||||
Wants=obmc-host-starting@%i.target
|
||||
Before=obmc-host-starting@%i.target
|
||||
Before=obmc-host-started@%i.target
|
||||
Wants=obmc-power-on@%i.target
|
||||
After=obmc-power-on@%i.target
|
||||
Wants=mapper-wait@-org-openbmc-control-host%i.service
|
||||
After=mapper-wait@-org-openbmc-control-host%i.service
|
||||
Conflicts=obmc-host-stop@%i.target
|
||||
ConditionPathExists=!/run/openbmc/host@%i-on
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/bin/sh -c "busctl call `mapper get-service /org/openbmc/control/host%i` /org/openbmc/control/host%i org.openbmc.control.Host boot"
|
||||
SyslogIdentifier=op-start-host
|
||||
|
||||
[Install]
|
||||
WantedBy=obmc-host-start@%i.target
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=OpenPOWER Host%i Control
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
ExecStart=/usr/bin/env control_host.exe
|
||||
SyslogIdentifier=control_host.exe
|
||||
Type=dbus
|
||||
BusName={BUSNAME}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,27 @@
|
||||
SUMMARY = "org.openbmc.control.Host implementation for OpenPOWER"
|
||||
DESCRIPTION = "A host control implementation suitable for OpenPOWER systems."
|
||||
PROVIDES += "virtual/obmc-host-ctl"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SKELETON_DIR = "op-hostctl"
|
||||
SYSTEMD_SERVICE:${PN} = " \
|
||||
op-start-host@.service \
|
||||
"
|
||||
START_TMPL = "op-start-host@.service"
|
||||
START_TGTFMT = "obmc-host-startmin@{1}.target"
|
||||
START_INSTFMT = "op-start-host@{0}.service"
|
||||
START_FMT = "../${START_TMPL}:${START_TGTFMT}.requires/${START_INSTFMT}"
|
||||
SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'START_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
|
||||
|
||||
inherit skeleton-gdbus
|
||||
inherit obmc-phosphor-dbus-service
|
||||
inherit pkgconfig
|
||||
|
||||
RPROVIDES:${PN} += "virtual-obmc-host-ctl"
|
||||
|
||||
DBUS_SERVICE:${PN} += "org.openbmc.control.Host@.service"
|
||||
OBMC_CONTROL_INST = "org.openbmc.control.Host@{0}.service"
|
||||
OBMC_CONTROL_SVC = "org.openbmc.control.Host@.service"
|
||||
OBMC_CONTROL_FMT = "../${OBMC_CONTROL_SVC}:multi-user.target.wants/${OBMC_CONTROL_INST}"
|
||||
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'OBMC_CONTROL_FMT', 'OBMC_HOST_INSTANCES')}"
|
||||
@@ -0,0 +1,42 @@
|
||||
SUMMARY = "Phosphor OpenBMC Post Code Daemon"
|
||||
DESCRIPTION = "Phosphor OpenBMC Post Code Daemon"
|
||||
HOMEPAGE = "http://github.com/openbmc/phosphor-host-postd"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
|
||||
DEPENDS += "sdbusplus"
|
||||
DEPENDS += "sdeventplus"
|
||||
DEPENDS += "phosphor-dbus-interfaces"
|
||||
DEPENDS += "systemd"
|
||||
DEPENDS += "libgpiod"
|
||||
SRCREV = "42c2b56851c12ddc4cea22226ce5d628c02cdd7c"
|
||||
PACKAGECONFIG ?= ""
|
||||
PACKAGECONFIG[7seg] = "-D7seg=enabled,-D7seg=disabled,,udev"
|
||||
PV = "0.1+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/phosphor-host-postd;branch=master;protocol=https"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
SNOOP_DEVICE ?= "aspeed-lpc-snoop0"
|
||||
SERVICE_FILE = "lpcsnoop.service"
|
||||
SYSTEMD_PACKAGES = "${PN}"
|
||||
SYSTEMD_SERVICE:${PN} += "${SERVICE_FILE}"
|
||||
SERVICE_FILE_7SEG = " \
|
||||
postcode-7seg@.service \
|
||||
postcode-7seg@${POSTCODE_SEVENSEG_DEVICE}.service \
|
||||
"
|
||||
SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', '7seg', '${SERVICE_FILE_7SEG}', '', d)}"
|
||||
|
||||
inherit meson
|
||||
inherit pkgconfig
|
||||
inherit systemd
|
||||
|
||||
EXTRA_OEMESON:append = " \
|
||||
-Dsnoop-device=${SNOOP_DEVICE} \
|
||||
-Dpost-code-bytes=${POST_CODE_BYTES} \
|
||||
-Dtests=disabled \
|
||||
"
|
||||
|
||||
POST_CODE_BYTES ?= "1"
|
||||
7SEG_GPIO ?= "0"
|
||||
POSTCODE_SEVENSEG_DEVICE ?= "seven_seg_disp_val"
|
||||
@@ -0,0 +1,3 @@
|
||||
DESCRIPTION = "Debug tools tarball for use with OpenBMC Phosphor"
|
||||
|
||||
inherit obmc-phosphor-debug-tarball
|
||||
@@ -0,0 +1,10 @@
|
||||
DESCRIPTION = "A basic OpenBMC image with no features enabled."
|
||||
LICENSE = "Apache-2.0"
|
||||
|
||||
inherit obmc-phosphor-image
|
||||
|
||||
# The /etc/version file is misleading and not useful. Remove it.
|
||||
# Users should instead rely on /etc/os-release.
|
||||
ROOTFS_POSTPROCESS_COMMAND += "remove_etc_version ; "
|
||||
|
||||
IMAGE_LINGUAS = ""
|
||||
@@ -0,0 +1,64 @@
|
||||
DESCRIPTION = "Image with Phosphor, a software stack for hardware management \
|
||||
in devices with baseboard management controllers. The image supports the \
|
||||
full OpenBMC feature set for devices of all types."
|
||||
LICENSE = "Apache-2.0"
|
||||
|
||||
inherit obmc-phosphor-image
|
||||
|
||||
# The /etc/version file is misleading and not useful. Remove it.
|
||||
# Users should instead rely on /etc/os-release.
|
||||
ROOTFS_POSTPROCESS_COMMAND += "remove_etc_version ; "
|
||||
|
||||
IMAGE_LINGUAS = ""
|
||||
IMAGE_FEATURES += " \
|
||||
obmc-bmc-state-mgmt \
|
||||
obmc-bmcweb \
|
||||
obmc-chassis-mgmt \
|
||||
obmc-chassis-state-mgmt \
|
||||
obmc-console \
|
||||
obmc-devtools \
|
||||
obmc-fan-control \
|
||||
obmc-fan-mgmt \
|
||||
obmc-flash-mgmt \
|
||||
obmc-fru-ipmi \
|
||||
obmc-health-monitor \
|
||||
obmc-host-ctl \
|
||||
obmc-host-ipmi \
|
||||
obmc-host-state-mgmt \
|
||||
obmc-ikvm \
|
||||
obmc-inventory \
|
||||
obmc-leds \
|
||||
obmc-logging-mgmt \
|
||||
obmc-remote-logging-mgmt \
|
||||
obmc-rng \
|
||||
obmc-net-ipmi \
|
||||
obmc-sensors \
|
||||
obmc-software \
|
||||
obmc-system-mgmt \
|
||||
obmc-user-mgmt \
|
||||
obmc-user-mgmt-ldap \
|
||||
${@bb.utils.contains_any('DISTRO_FEATURES', \
|
||||
'obmc-ubi-fs phosphor-mmc obmc-static-norootfs', \
|
||||
'read-only-rootfs overlayfs-etc', '', d)} \
|
||||
ssh-server-dropbear \
|
||||
obmc-debug-collector \
|
||||
obmc-network-mgmt \
|
||||
obmc-settings-mgmt \
|
||||
obmc-telemetry \
|
||||
obmc-dmtf-pmci \
|
||||
"
|
||||
# The shadow recipe provides the binaries(like useradd, usermod) needed by the
|
||||
# phosphor-user-manager.
|
||||
ROOTFS_RO_UNNEEDED:remove = "shadow"
|
||||
|
||||
# We need to set overlayfs-etc so that the dropbear/openssh keys don't end up
|
||||
# in a volatile file system, but we always have our own init that sets these
|
||||
# up. Add enough bogus values here that rootfs-postcommands.bbclass does what
|
||||
# we want without overlayfs-etc.bbclass messing things up.
|
||||
OVERLAYFS_ETC_USE_ORIG_INIT_NAME="0"
|
||||
OVERLAYFS_ETC_MOUNT_POINT = "/this/is/unused"
|
||||
OVERLAYFS_ETC_FSTYPE = "not_a_fs_type"
|
||||
OVERLAYFS_ETC_DEVICE = "/dev/null"
|
||||
python create_overlayfs_etc_preinit:append() {
|
||||
os.unlink(preinitPath)
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
DESCRIPTION = "Small image capable of booting a device. The kernel includes \
|
||||
the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
|
||||
first 'init' program more efficiently."
|
||||
LICENSE = "MIT"
|
||||
# Needed for the set_user_group functions to succeed
|
||||
DEPENDS += "shadow-native"
|
||||
|
||||
inherit core-image
|
||||
|
||||
export IMAGE_BASENAME = "obmc-phosphor-initramfs"
|
||||
|
||||
BAD_RECOMMENDATIONS += "busybox-syslog"
|
||||
|
||||
PACKAGE_INSTALL = "${VIRTUAL-RUNTIME_base-utils} base-passwd ${ROOTFS_BOOTSTRAP_INSTALL} ${INIT_PACKAGE}"
|
||||
PACKAGE_INSTALL:remove = "shadow"
|
||||
|
||||
# Init scripts
|
||||
INIT_PACKAGE = "obmc-phosphor-initfs"
|
||||
INIT_PACKAGE:df-phosphor-mmc = "phosphor-mmc-init"
|
||||
# Do not pollute the initrd image with rootfs features
|
||||
IMAGE_FEATURES = "read-only-rootfs"
|
||||
IMAGE_LINGUAS = ""
|
||||
IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
|
||||
IMAGE_ROOTFS_SIZE = "8192"
|
||||
IMAGE_ROOTFS_EXTRA_SPACE = "0"
|
||||
PACKAGE_EXCLUDE = "shadow"
|
||||
@@ -0,0 +1,453 @@
|
||||
#!/bin/sh
|
||||
|
||||
fslist="proc sys dev run"
|
||||
rodir=run/initramfs/ro
|
||||
rwdir=run/initramfs/rw
|
||||
upper=$rwdir/cow
|
||||
work=$rwdir/work
|
||||
|
||||
cd /
|
||||
# shellcheck disable=SC2086
|
||||
mkdir -p $fslist
|
||||
mount dev dev -tdevtmpfs
|
||||
mount sys sys -tsysfs
|
||||
mount proc proc -tproc
|
||||
if ! grep run proc/mounts
|
||||
then
|
||||
mount tmpfs run -t tmpfs -o mode=755,nodev
|
||||
fi
|
||||
|
||||
mkdir -p $rodir $rwdir
|
||||
|
||||
cp -rp init shutdown update whitelist bin sbin usr lib etc var run/initramfs
|
||||
|
||||
# To start a interactive shell with job control at this point, run
|
||||
# getty 38400 ttyS4
|
||||
|
||||
findmtd() {
|
||||
m=$(grep -xl "$1" /sys/class/mtd/*/name)
|
||||
m=${m%/name}
|
||||
m=${m##*/}
|
||||
echo "$m"
|
||||
}
|
||||
|
||||
blkid_fs_type() {
|
||||
# Emulate util-linux's `blkid -s TYPE -o value $1`
|
||||
# Example busybox blkid output:
|
||||
# # blkid /dev/mtdblock5
|
||||
# /dev/mtdblock5: TYPE="squashfs"
|
||||
# Process output to extract TYPE value "squashfs".
|
||||
blkid "$1" | sed -e 's/^.*TYPE="//' -e 's/".*$//'
|
||||
}
|
||||
|
||||
probe_fs_type() {
|
||||
fst=$(blkid_fs_type "$1")
|
||||
echo "${fst:=jffs2}"
|
||||
}
|
||||
|
||||
# This fw_get_env_var is a possibly broken version of fw_printenv that
|
||||
# does not check the crc or flag byte.
|
||||
# The u-boot environment starts with a crc32, followed by a flag byte
|
||||
# when a redundannt environment is configured, followed by var=value\0 sets.
|
||||
# The flag byte for nand is a 1 byte counter; for nor it is a 1 or 0 byte.
|
||||
|
||||
get_fw_env_var() {
|
||||
# do we have 1 or 2 copies of the environment?
|
||||
# count non-blank non-comment lines
|
||||
# copies=$(grep -v ^# /etc/fw_env.config | grep -c [::alnum::])
|
||||
# ... we could if we had the fw_env.config in the initramfs
|
||||
copies=2
|
||||
|
||||
# * Change \n to \r and \0 to \n
|
||||
# * Skip to the 5th byte to skip over crc
|
||||
# * then skip to the first or 2nd byte to skip over flag if it exists
|
||||
# * stop parsing at first empty line corresponding to the
|
||||
# double \0 at the end of the environment.
|
||||
# * print the value of the variable name passed as argument
|
||||
|
||||
envdev=$(findmtd u-boot-env)
|
||||
if test -n "$envdev"
|
||||
then
|
||||
tr '\n\000' '\r\n' < "/dev/$envdev" |
|
||||
tail -c +5 | tail -c +${copies-1} |
|
||||
sed -ne '/^$/,$d' -e "s/^$1=//p"
|
||||
fi
|
||||
}
|
||||
|
||||
setup_resolv() {
|
||||
runresolv=/run/systemd/resolve/resolv.conf
|
||||
etcresolv=/etc/resolv.conf
|
||||
|
||||
if test ! -e $etcresolv -a ! -L $etcresolv
|
||||
then
|
||||
mkdir -p ${runresolv%/*}
|
||||
ln -s $runresolv $etcresolv
|
||||
fi
|
||||
if test ! -f $runresolv
|
||||
then
|
||||
cat /proc/net/pnp > $runresolv
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
try_tftp() {
|
||||
# split into tftp:// host:port/ path/on/remote
|
||||
# then spilt off / and then :port from the end of host:port/
|
||||
# and : from the beginning of port
|
||||
|
||||
rest="${1#tftp://}"
|
||||
path=${rest#*/}
|
||||
host=${rest%"$path"}
|
||||
host="${host%/}"
|
||||
port="${host#"${host%:*}"}"
|
||||
host="${host%"$port"}"
|
||||
port="${port#:}"
|
||||
|
||||
setup_resolv
|
||||
|
||||
if test -z "$host" -o -z "$path"
|
||||
then
|
||||
debug_takeover "Invalid tftp download url '$url'."
|
||||
elif echo "Downloading '$url' from $host ..." &&
|
||||
! tftp -g -r "$path" -l /run/image-rofs "$host" ${port+"$port"}
|
||||
then
|
||||
debug_takeover "Download of '$url' failed."
|
||||
fi
|
||||
}
|
||||
|
||||
try_wget() {
|
||||
setup_resolv
|
||||
|
||||
echo "Downloading '$1' ..."
|
||||
if ! wget -O /run/image-rofs "$1"
|
||||
then
|
||||
debug_takeover "Download of '$url' failed."
|
||||
fi
|
||||
}
|
||||
|
||||
debug_takeover() {
|
||||
echo "$@"
|
||||
|
||||
if ! grep -w enable-initrd-debug-sh "$optfile"
|
||||
then
|
||||
echo "Fatal error, triggering kernel panic!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
test -n "$@" && echo Try to manually fix.
|
||||
cat << HERE
|
||||
After fixing run exit to continue this script, or reboot -f to retry, or
|
||||
touch /takeover and exit to become PID 1 allowing editing of this script.
|
||||
HERE
|
||||
|
||||
while ! /bin/sh && ! test -f /takeover
|
||||
do
|
||||
echo /bin/sh failed, retrying
|
||||
done
|
||||
|
||||
# Touch /takeover in the above shell to become pid 1
|
||||
if test -e /takeover
|
||||
then
|
||||
cat << HERE
|
||||
|
||||
Takeover of init requested. Executing /bin/sh as PID 1.
|
||||
When finished exec new init or cleanup and run reboot -f.
|
||||
|
||||
Warning: No job control! Shell exit will panic the system!
|
||||
HERE
|
||||
export PS1=init#\
|
||||
exec /bin/sh
|
||||
fi
|
||||
}
|
||||
|
||||
rofs=$(findmtd rofs)
|
||||
rwfs=$(findmtd rwfs)
|
||||
|
||||
rodev=/dev/mtdblock${rofs#mtd}
|
||||
rwdev=/dev/mtdblock${rwfs#mtd}
|
||||
|
||||
# Set to y for yes, anything else for no.
|
||||
force_rwfst_jffs2=y
|
||||
flash_images_before_init=n
|
||||
consider_download_files=y
|
||||
consider_download_tftp=y
|
||||
consider_download_http=y
|
||||
consider_download_ftp=y
|
||||
|
||||
rofst=squashfs
|
||||
rwfst=$(probe_fs_type "$rwdev")
|
||||
roopts=ro
|
||||
rwopts=rw
|
||||
|
||||
image=/run/initramfs/image-
|
||||
trigger=${image}rwfs
|
||||
|
||||
init=/sbin/init
|
||||
fsckbase=/sbin/fsck.
|
||||
fsck=$fsckbase$rwfst
|
||||
fsckopts=-a
|
||||
optfile=/run/initramfs/init-options
|
||||
optbase=/run/initramfs/init-options-base
|
||||
urlfile=/run/initramfs/init-download-url
|
||||
update=/run/initramfs/update
|
||||
|
||||
if test -e /${optfile##*/}
|
||||
then
|
||||
cp /${optfile##*/} $optfile
|
||||
fi
|
||||
|
||||
if test -e /${optbase##*/}
|
||||
then
|
||||
cp /${optbase##*/} $optbase
|
||||
else
|
||||
touch $optbase
|
||||
fi
|
||||
|
||||
if test ! -f $optfile
|
||||
then
|
||||
cat /proc/cmdline $optbase > $optfile
|
||||
get_fw_env_var openbmcinit >> $optfile
|
||||
get_fw_env_var openbmconce >> $optfile
|
||||
fi
|
||||
|
||||
echo "rofs = $rofs $rofst rwfs = $rwfs $rwfst"
|
||||
|
||||
if grep -w debug-init-sh $optfile
|
||||
then
|
||||
if grep -w enable-initrd-debug-sh "$optfile"
|
||||
then
|
||||
debug_takeover "Debug initial shell requested by command line."
|
||||
else
|
||||
echo "Need to also add enable-initrd-debug-sh for debug shell."
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$consider_download_files" = "y" &&
|
||||
grep -w openbmc-init-download-files $optfile
|
||||
then
|
||||
if test -f ${urlfile##*/}
|
||||
then
|
||||
cp ${urlfile##*/} $urlfile
|
||||
fi
|
||||
if test ! -f $urlfile
|
||||
then
|
||||
get_fw_env_var openbmcinitdownloadurl > $urlfile
|
||||
fi
|
||||
url="$(cat $urlfile)"
|
||||
rest="${url#*://}"
|
||||
proto="${url%"$rest"}"
|
||||
|
||||
if test -z "$url"
|
||||
then
|
||||
echo "Download url empty. Ignoring download request."
|
||||
elif test -z "$proto"
|
||||
then
|
||||
echo "Download failed."
|
||||
elif test "$proto" = tftp://
|
||||
then
|
||||
if test "$consider_download_tftp" = "y"
|
||||
then
|
||||
try_tftp "$url"
|
||||
else
|
||||
echo "Download failed."
|
||||
fi
|
||||
elif test "$proto" = http://
|
||||
then
|
||||
if test "$consider_download_http" = "y"
|
||||
then
|
||||
try_wget "$url"
|
||||
else
|
||||
echo "Download failed."
|
||||
fi
|
||||
elif test "$proto" = ftp://
|
||||
then
|
||||
if test "$consider_download_ftp" = "y"
|
||||
then
|
||||
try_wget "$url"
|
||||
else
|
||||
echo "Download failed."
|
||||
fi
|
||||
else
|
||||
echo "Download failed."
|
||||
fi
|
||||
fi
|
||||
|
||||
# If there are images in root move them to /run/initramfs/ or /run/ now.
|
||||
imagebasename=${image##*/}
|
||||
if test -n "${imagebasename}" && ls /"${imagebasename}"* > /dev/null 2>&1
|
||||
then
|
||||
if test "$flash_images_before_init" = "y"
|
||||
then
|
||||
echo "Flash images found, will update before starting init."
|
||||
mv /"${imagebasename}"* ${image%"$imagebasename"}
|
||||
else
|
||||
echo "Flash images found, will use but deferring flash update."
|
||||
mv /"${imagebasename}"* /run/
|
||||
fi
|
||||
fi
|
||||
|
||||
if grep -w clean-rwfs-filesystem $optfile
|
||||
then
|
||||
echo "Cleaning of read-write overlay filesystem requested."
|
||||
touch $trigger
|
||||
fi
|
||||
|
||||
if grep -w factory-reset $optfile
|
||||
then
|
||||
echo "Factory reset requested."
|
||||
touch $trigger
|
||||
do_save=--no-save-files
|
||||
else
|
||||
do_save=--save-files
|
||||
fi
|
||||
|
||||
if test "$force_rwfst_jffs2" = "y" -a "$rwfst" != jffs2 -a ! -f $trigger
|
||||
then
|
||||
echo "Converting read-write overlay filesystem to jffs2 forced."
|
||||
touch $trigger
|
||||
fi
|
||||
|
||||
if ls $image* > /dev/null 2>&1
|
||||
then
|
||||
if ! test -x $update
|
||||
then
|
||||
debug_takeover "Flash update requested but $update missing!"
|
||||
elif test -f $trigger -a ! -s $trigger
|
||||
then
|
||||
if [ $do_save = "--save-files" ]
|
||||
then
|
||||
echo "Saving selected files from read-write overlay filesystem."
|
||||
else
|
||||
echo "No files will be selected for save."
|
||||
fi
|
||||
$update --no-restore-files $do_save
|
||||
echo "Clearing read-write overlay filesystem."
|
||||
flash_eraseall "/dev/$rwfs"
|
||||
echo "Restoring saved files to read-write overlay filesystem."
|
||||
touch $trigger
|
||||
$update --no-save-files --clean-saved-files
|
||||
else
|
||||
$update --clean-saved-files $do_save
|
||||
fi
|
||||
|
||||
rwfst=$(probe_fs_type "$rwdev")
|
||||
fsck=$fsckbase$rwfst
|
||||
fi
|
||||
|
||||
if grep -w overlay-filesystem-in-ram $optfile
|
||||
then
|
||||
rwfst=none
|
||||
fi
|
||||
|
||||
copyfiles=
|
||||
if grep -w copy-files-to-ram $optfile
|
||||
then
|
||||
rwfst=none
|
||||
copyfiles=y
|
||||
fi
|
||||
|
||||
# It would be nice to do this after fsck but that mean rofs is mounted
|
||||
# which triggers the mtd is mounted check
|
||||
if test "$rwfst$copyfiles" = noney
|
||||
then
|
||||
touch $trigger
|
||||
$update --copy-files --clean-saved-files --no-restore-files
|
||||
fi
|
||||
|
||||
if grep -w copy-base-filesystem-to-ram $optfile &&
|
||||
test ! -e /run/image-rofs && ! cp "$rodev" /run/image-rofs
|
||||
then
|
||||
# Remove any partial copy to avoid attempted usage later
|
||||
if test -e /run/image-rofs
|
||||
then
|
||||
ls -l /run/image-rofs
|
||||
rm -f /run/image-rofs
|
||||
fi
|
||||
debug_takeover "Copying $rodev to /run/image-rofs failed."
|
||||
fi
|
||||
|
||||
if test -s /run/image-rofs
|
||||
then
|
||||
rodev=/run/image-rofs
|
||||
roopts=$roopts,loop
|
||||
fi
|
||||
|
||||
mount "$rodev" $rodir -t $rofst -o $roopts
|
||||
|
||||
if test -x "$rodir$fsck"
|
||||
then
|
||||
for fs in $fslist
|
||||
do
|
||||
mount --bind "$fs" "$rodir/$fs"
|
||||
done
|
||||
chroot $rodir "$fsck" $fsckopts "$rwdev"
|
||||
rc=$?
|
||||
for fs in $fslist
|
||||
do
|
||||
umount "$rodir/$fs"
|
||||
done
|
||||
if test $rc -gt 1
|
||||
then
|
||||
debug_takeover "fsck of read-write fs on $rwdev failed (rc=$rc)"
|
||||
fi
|
||||
elif test "$rwfst" != jffs2 -a "$rwfst" != none
|
||||
then
|
||||
echo "No '$fsck' in read only fs, skipping fsck."
|
||||
fi
|
||||
|
||||
if test "$rwfst" = none
|
||||
then
|
||||
echo "Running with read-write overlay in RAM for this boot."
|
||||
echo "No state will be preserved unless flash update performed."
|
||||
elif ! mount "$rwdev" $rwdir -t "$rwfst" -o $rwopts
|
||||
then
|
||||
msg="$(cat)" << HERE
|
||||
|
||||
Mounting read-write $rwdev filesystem failed. Please fix and run
|
||||
mount $rwdev $rwdir -t $rwfst -o $rwopts
|
||||
or perform a factory reset with the clean-rwfs-filesystem option.
|
||||
HERE
|
||||
debug_takeover "$msg"
|
||||
fi
|
||||
|
||||
# Empty workdir; do not remove workdir itself for it will fail to recreate it if
|
||||
# RWFS is full
|
||||
if [ -d $work ]
|
||||
then
|
||||
find $work -maxdepth 1 -mindepth 1 -exec rm -rf '{}' +
|
||||
fi
|
||||
|
||||
mkdir -p $upper $work
|
||||
|
||||
# Opportunisticly set a sane BMC date based on a file that gets
|
||||
# written right before rebooting or powercycling. If none exists,
|
||||
# use the image build date.
|
||||
files="$upper/var/lib/systemd/random-seed $rodir/etc/os-release"
|
||||
# shellcheck disable=SC2086
|
||||
time=$(find $files -exec stat -c %Y {} \; | sort -n | tail -n 1)
|
||||
# Allow RTC coordinated time to supersede this setting
|
||||
if [ "$(date +%s)" -lt "$time" ]; then
|
||||
date -s @$((time + 5)) || true
|
||||
fi
|
||||
|
||||
mount -t overlay -o lowerdir=$rodir,upperdir=$upper,workdir=$work cow /root
|
||||
|
||||
while ! chroot /root /bin/sh -c "test -x '$init' -a -s '$init'"
|
||||
do
|
||||
msg="$(cat)" << HERE
|
||||
|
||||
Unable to confirm /sbin/init is an executable non-empty file
|
||||
in merged file system mounted at /root.
|
||||
|
||||
Change Root test failed!
|
||||
HERE
|
||||
debug_takeover "$msg"
|
||||
done
|
||||
|
||||
for f in $fslist
|
||||
do
|
||||
mount --move "$f" "root/$f"
|
||||
done
|
||||
|
||||
exec switch_root /root $init
|
||||
@@ -0,0 +1,103 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo shutdown: "$@"
|
||||
|
||||
export PS1="shutdown-sh# "
|
||||
# exec bin/sh
|
||||
|
||||
cd /
|
||||
if [ ! -e /proc/mounts ]
|
||||
then
|
||||
mkdir -p /proc
|
||||
mount proc /proc -tproc
|
||||
umount_proc=1
|
||||
else
|
||||
umount_proc=
|
||||
fi
|
||||
|
||||
# Remove an empty oldroot, that means we are not invoked from systemd-shutdown
|
||||
rmdir /oldroot 2>/dev/null
|
||||
|
||||
# Move /oldroot/run to /mnt in case it has the underlying rofs loop mounted.
|
||||
# Ordered before /oldroot the overlay is unmounted before the loop mount
|
||||
mkdir -p /mnt
|
||||
mount --move /oldroot/run /mnt
|
||||
|
||||
set -x
|
||||
awk '/oldroot|mnt/ { print $2 }' < /proc/mounts | sort -r | while IFS= read -r f
|
||||
do
|
||||
umount "$f"
|
||||
done
|
||||
set +x
|
||||
|
||||
update=/run/initramfs/update
|
||||
image=/run/initramfs/image-
|
||||
|
||||
wdt="-t 1 -T 5"
|
||||
wdrst="-T 15"
|
||||
|
||||
if ls $image* > /dev/null 2>&1
|
||||
then
|
||||
if test -x $update
|
||||
then
|
||||
if test -c /dev/watchdog
|
||||
then
|
||||
echo Pinging watchdog ${wdt+with args $wdt}
|
||||
# shellcheck disable=SC2086
|
||||
watchdog $wdt -F /dev/watchdog &
|
||||
wd=$!
|
||||
else
|
||||
wd=
|
||||
fi
|
||||
$update --clean-saved-files
|
||||
remaining=$(ls $image*)
|
||||
if test -n "$remaining"
|
||||
then
|
||||
echo 1>&2 "Flash update failed to flash these images:"
|
||||
echo 1>&2 "$remaining"
|
||||
else
|
||||
echo "Flash update completed."
|
||||
fi
|
||||
|
||||
if test -n "$wd"
|
||||
then
|
||||
kill -9 $wd
|
||||
if test -n "$wdrst"
|
||||
then
|
||||
echo "Resetting watchdog timeouts to $wdrst"
|
||||
watchdog "$wdrst" -F /dev/watchdog &
|
||||
sleep 1
|
||||
# Kill the watchdog daemon, setting a timeout
|
||||
# for the remaining shutdown work
|
||||
kill -9 $!
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo 1>&2 "Flash update requested but $update program missing!"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo Remaining mounts:
|
||||
cat /proc/mounts
|
||||
|
||||
test "$umount_proc" && umount /proc && rmdir /proc
|
||||
|
||||
# tcsattr(tty, TIOCDRAIN, mode) to drain tty messages to console
|
||||
test -t 1 && stty cooked 0<&1
|
||||
|
||||
# Execute the command systemd told us to ...
|
||||
if test -d /oldroot && test "$1"
|
||||
then
|
||||
if test "$1" = kexec
|
||||
then
|
||||
$1 -f -e
|
||||
else
|
||||
$1 -f
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
echo "Execute ${1-reboot} -f if all unmounted ok, or exec /init"
|
||||
|
||||
export PS1=shutdown-sh#\
|
||||
exec /bin/sh
|
||||
@@ -0,0 +1,274 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo update: "$@"
|
||||
|
||||
echoerr() {
|
||||
echo 1>&2 "ERROR: $*"
|
||||
}
|
||||
|
||||
cd /
|
||||
if ! test -r /proc/mounts || ! test -f /proc/mounts
|
||||
then
|
||||
mkdir -p /proc
|
||||
mount -t proc proc proc
|
||||
fi
|
||||
if ! test -d /sys/class
|
||||
then
|
||||
mkdir -p /sys
|
||||
mount -t sysfs sys sys
|
||||
fi
|
||||
if ! test -c /dev/null
|
||||
then
|
||||
mkdir -p /dev
|
||||
mount -t devtmpfs dev dev
|
||||
fi
|
||||
|
||||
# mtd number N with mtd name Name can be mounted via mtdN, or mtd:Name
|
||||
# (with a mtd aware fs) or by /dev/mtdblockN (with a mtd or block fs).
|
||||
mtdismounted() {
|
||||
m=${1##mtd}
|
||||
if grep -s "mtdblock$m " /proc/mounts || grep -s "mtd$m " /proc/mounts
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
n=$(cat "/sys/class/mtd/mtd$m/name")
|
||||
if test -n "$n" && grep -s "mtd:$n " /proc/mounts
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
# Detect child partitions when the whole flash is to be updated.
|
||||
# Ignore mtdNro and mtdblockN names in the class subsystem directory.
|
||||
childmtds() {
|
||||
for m in "/sys/class/mtd/$1/mtd"*
|
||||
do
|
||||
m=${m##*/}
|
||||
if test "${m%ro}" = "${m#mtdblock}"
|
||||
then
|
||||
echo "$m"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
toobig() {
|
||||
if test "$(stat -L -c "%s" "$1")" -gt "$(cat "/sys/class/mtd/$2/size")"
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
findmtd() {
|
||||
m=$(grep -xl "$1" /sys/class/mtd/*/name)
|
||||
m=${m%/name}
|
||||
m=${m##*/}
|
||||
echo "$m"
|
||||
}
|
||||
|
||||
blkid_fs_type() {
|
||||
# Emulate util-linux's `blkid -s TYPE -o value $1`
|
||||
# Example busybox blkid output:
|
||||
# # blkid /dev/mtdblock5
|
||||
# /dev/mtdblock5: TYPE="squashfs"
|
||||
# Process output to extract TYPE value "squashfs".
|
||||
blkid "$1" | sed -e 's/^.*TYPE="//' -e 's/".*$//'
|
||||
}
|
||||
|
||||
probe_fs_type() {
|
||||
fst=$(blkid_fs_type "$1")
|
||||
echo "${fst:=jffs2}"
|
||||
}
|
||||
|
||||
rwfs=$(findmtd rwfs)
|
||||
|
||||
rwdev=/dev/mtdblock${rwfs#mtd}
|
||||
rwopts=rw
|
||||
rorwopts=ro${rwopts#rw}
|
||||
|
||||
rwdir=/run/initramfs/rw
|
||||
upper=$rwdir/cow
|
||||
save=/run/save/${upper##*/}
|
||||
|
||||
mounted=
|
||||
doflash=y
|
||||
doclean=
|
||||
dosave=y
|
||||
dorestore=y
|
||||
toram=
|
||||
checksize=y
|
||||
checkmount=y
|
||||
|
||||
whitelist=/run/initramfs/whitelist
|
||||
image=/run/initramfs/image-
|
||||
imglist=
|
||||
|
||||
while test "$1" != "${1#-}"
|
||||
do
|
||||
case "$1" in
|
||||
--help)
|
||||
cat <<HERE
|
||||
Usage: $0 [options] -- Write images in /run/initramfs to flash (/dev/mtd*)
|
||||
--help Show this message
|
||||
--no-flash Don't attempt to write images to flash
|
||||
--ignore-size Don't compare image size to mtd device size
|
||||
--ignore-mount Don't check if destination is mounted
|
||||
--save-files Copy whitelisted files to save directory in RAM
|
||||
--no-save-files Don't copy whitelisted files to save directory
|
||||
--copy-files Copy files from save directory to rwfs mountpoint
|
||||
--restore-files Restore files from save directory to rwfs layer
|
||||
--no-restore-files Don't restore saved files from ram to rwfs layer
|
||||
--clean-saved-files Delete saved whitelisted files from RAM
|
||||
--no-clean-saved-files Retain saved whitelisted files in RAM
|
||||
HERE
|
||||
|
||||
exit 0 ;;
|
||||
|
||||
--no-clean-saved-files)
|
||||
doclean=
|
||||
shift ;;
|
||||
--clean-saved-files)
|
||||
doclean=y
|
||||
shift ;;
|
||||
--no-save-files)
|
||||
dosave=
|
||||
shift ;;
|
||||
--save-files)
|
||||
dosave=y
|
||||
shift ;;
|
||||
--no-restore-files)
|
||||
dorestore=
|
||||
shift ;;
|
||||
--restore-files)
|
||||
dorestore=y
|
||||
shift ;;
|
||||
--no-flash)
|
||||
doflash=
|
||||
shift ;;
|
||||
--ignore-size)
|
||||
checksize=
|
||||
shift ;;
|
||||
--ignore-mount)
|
||||
checkmount=
|
||||
doflash=
|
||||
shift ;;
|
||||
--copy-files)
|
||||
toram=y
|
||||
shift ;;
|
||||
*)
|
||||
echoerr "Unknown option $1. Try $0 --help."
|
||||
exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test "$dosave" = "y"
|
||||
then
|
||||
if test ! -d $upper -a -n "$rwfs"
|
||||
then
|
||||
mkdir -p $rwdir
|
||||
mount "$rwdev" $rwdir -t "$(probe_fs_type "$rwdev")" -o "$rorwopts"
|
||||
mounted=$rwdir
|
||||
fi
|
||||
|
||||
while read -r f
|
||||
do
|
||||
# Entries shall start with /, no trailing /.. or embedded /../
|
||||
if test "/${f#/}" != "$f" -o "${f%/..}" != "${f#*/../}"
|
||||
then
|
||||
echo 1>&2 "WARNING: Skipping bad whitelist entry $f."
|
||||
continue
|
||||
fi
|
||||
if ! test -e "$upper/$f"
|
||||
then
|
||||
continue
|
||||
fi
|
||||
d="$save/$f"
|
||||
while test "${d%/}" != "${d%/.}"
|
||||
do
|
||||
d="${d%/.}"
|
||||
d="${d%/}"
|
||||
done
|
||||
mkdir -p "${d%/*}"
|
||||
cp -rp "$upper/$f" "${d%/*}/"
|
||||
done < $whitelist
|
||||
|
||||
if test -n "$mounted"
|
||||
then
|
||||
umount $mounted
|
||||
fi
|
||||
fi
|
||||
|
||||
imglist=$(echo $image*)
|
||||
if test "$imglist" = "$image*" -a ! -e "$imglist"
|
||||
then
|
||||
# shell didn't expand the wildcard, so no files exist
|
||||
echo "No images found to update."
|
||||
imglist=
|
||||
fi
|
||||
|
||||
for f in $imglist
|
||||
do
|
||||
m=$(findmtd "${f#"$image"}")
|
||||
if test -z "$m"
|
||||
then
|
||||
echoerr "Unable to find mtd partition for ${f##*/}."
|
||||
exit 1
|
||||
fi
|
||||
if test -n "$checksize" && toobig "$f" "$m"
|
||||
then
|
||||
echoerr "Image ${f##*/} too big for $m."
|
||||
exit 1
|
||||
fi
|
||||
for s in $m $(childmtds "$m")
|
||||
do
|
||||
if test -n "$checkmount" && mtdismounted "$s"
|
||||
then
|
||||
echoerr "Device $s is mounted, ${f##*/} is busy."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
if test -n "$doflash"
|
||||
then
|
||||
for f in $imglist
|
||||
do
|
||||
if test ! -s "$f"
|
||||
then
|
||||
echo "Skipping empty update of ${f#"$image"}."
|
||||
rm "$f"
|
||||
continue
|
||||
fi
|
||||
m=$(findmtd "${f#"$image"}")
|
||||
echo "Updating ${f#"$image"}..."
|
||||
flashcp -v "$f" "/dev/$m" && rm "$f"
|
||||
done
|
||||
fi
|
||||
|
||||
if test -d "$save" -a "$toram" = "y"
|
||||
then
|
||||
mkdir -p $upper
|
||||
cp -rp "$save/." "$upper/"
|
||||
fi
|
||||
|
||||
if test -d "$save" -a "$dorestore" = "y"
|
||||
then
|
||||
odir=$rwdir
|
||||
rwdir=/run/rw
|
||||
upper=$rwdir${upper#"$odir"}
|
||||
|
||||
mkdir -p $rwdir
|
||||
mount "$rwdev" $rwdir -t "$(probe_fs_type "$rwdev")" -o $rwopts
|
||||
mkdir -p "$upper"
|
||||
cp -rp "$save/." "$upper/"
|
||||
umount $rwdir
|
||||
rmdir $rwdir
|
||||
fi
|
||||
|
||||
if test "$doclean" = "y"
|
||||
then
|
||||
rm -rf "$save"
|
||||
fi
|
||||
|
||||
exit
|
||||
@@ -0,0 +1,14 @@
|
||||
/etc/dropbear/dropbear_rsa_host_key
|
||||
/etc/group
|
||||
/etc/gshadow
|
||||
/etc/ipmi_pass
|
||||
/etc/machine-id
|
||||
/etc/passwd
|
||||
/etc/resolv.conf
|
||||
/etc/shadow
|
||||
/etc/systemd/network
|
||||
/var/cache/obmc
|
||||
/var/lib/obmc
|
||||
/var/lib/phosphor-inventory-manager
|
||||
/var/lib/phosphor-settings-manager
|
||||
/var/lib/phosphor-state-manager
|
||||
@@ -0,0 +1,35 @@
|
||||
SUMMARY = "Phosphor OpenBMC pre-init scripts"
|
||||
DESCRIPTION = "Phosphor OpenBMC filesystem mount reference implementation."
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI += "file://obmc-init.sh"
|
||||
SRC_URI += "file://obmc-shutdown.sh"
|
||||
SRC_URI += "file://obmc-update.sh"
|
||||
SRC_URI += "file://whitelist"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
inherit allarch
|
||||
|
||||
do_install() {
|
||||
for f in init-download-url init-options
|
||||
do
|
||||
if test -e $f
|
||||
then
|
||||
install -m 0755 ${WORKDIR}/$f ${D}/$f
|
||||
fi
|
||||
done
|
||||
install -m 0755 ${WORKDIR}/obmc-init.sh ${D}/init
|
||||
install -m 0755 ${WORKDIR}/obmc-shutdown.sh ${D}/shutdown
|
||||
install -m 0755 ${WORKDIR}/obmc-update.sh ${D}/update
|
||||
install -m 0644 ${WORKDIR}/whitelist ${D}/whitelist
|
||||
install -d ${D}/dev
|
||||
mknod -m 622 ${D}/dev/console c 5 1
|
||||
}
|
||||
|
||||
RDEPENDS:${PN} += "${VIRTUAL-RUNTIME_base-utils}"
|
||||
|
||||
FILES:${PN} += " /init /shutdown /update /whitelist /dev "
|
||||
FILES:${PN} += " /init-options /init-download-url "
|
||||
@@ -0,0 +1,30 @@
|
||||
SUMMARY = "Phosphor OpenBMC pre-init scripts for mmc"
|
||||
DESCRIPTION = "Phosphor OpenBMC filesystem mount implementation for mmc."
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI += "file://mmc-init.sh"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
inherit allarch
|
||||
|
||||
do_install() {
|
||||
install -m 0755 ${WORKDIR}/mmc-init.sh ${D}/init
|
||||
install -d ${D}/dev
|
||||
mknod -m 622 ${D}/dev/console c 5 1
|
||||
}
|
||||
|
||||
RDEPENDS:${PN} += " \
|
||||
${@d.getVar('PREFERRED_PROVIDER_u-boot-fw-utils', True) or 'u-boot-fw-utils'} \
|
||||
${VIRTUAL-RUNTIME_base-utils} \
|
||||
e2fsprogs-e2fsck \
|
||||
e2fsprogs-mke2fs \
|
||||
gptfdisk \
|
||||
libgpiod-tools \
|
||||
parted \
|
||||
udev \
|
||||
"
|
||||
|
||||
FILES:${PN} += " /init /dev "
|
||||
@@ -0,0 +1,112 @@
|
||||
#!/bin/sh
|
||||
|
||||
kgetopt ()
|
||||
{
|
||||
_cmdline="$(cat /proc/cmdline)"
|
||||
_optname="$1"
|
||||
_optval="$2"
|
||||
for _opt in $_cmdline
|
||||
do
|
||||
case "$_opt" in
|
||||
"${_optname}"=*)
|
||||
_optval="${_opt##"${_optname}"=}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
[ -n "$_optval" ] && echo "$_optval"
|
||||
}
|
||||
|
||||
fslist="proc sys dev run"
|
||||
rodir=/mnt/rofs
|
||||
mmcdev="/dev/mmcblk0"
|
||||
rwfsdev="/dev/disk/by-partlabel/rwfs"
|
||||
|
||||
cd /
|
||||
|
||||
# We want to make all the directories in $fslist, not one directory named by
|
||||
# concatonating the names with spaces
|
||||
#
|
||||
# shellcheck disable=SC2086
|
||||
mkdir -p $fslist
|
||||
|
||||
mount dev dev -tdevtmpfs
|
||||
mount sys sys -tsysfs
|
||||
mount proc proc -tproc
|
||||
mount tmpfs run -t tmpfs -o mode=755,nodev
|
||||
|
||||
# Wait up to 5s for the mmc device to appear. Continue even if the count is
|
||||
# exceeded. A failure will be caught later like in the mount command.
|
||||
count=0
|
||||
while [ $count -lt 5 ]; do
|
||||
if [ -e "${mmcdev}" ]; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
count=$((count + 1))
|
||||
done
|
||||
|
||||
# Move the secondary GPT to the end of the device if needed. Look for the GPT
|
||||
# header signature "EFI PART" located 512 bytes from the end of the device.
|
||||
if ! tail -c 512 "${mmcdev}" | hexdump -C -n 8 | grep -q "EFI PART"; then
|
||||
sgdisk -e "${mmcdev}"
|
||||
partprobe
|
||||
fi
|
||||
|
||||
# There eMMC GPT labels for the rootfs are rofs-a and rofs-b, and the label for
|
||||
# the read-write partition is rwfs. Run udev to make the partition labels show
|
||||
# up. Mounting by label allows for partition numbers to change if needed.
|
||||
udevd --daemon
|
||||
udevadm trigger --type=devices --action=add
|
||||
udevadm settle --timeout=10
|
||||
|
||||
mkdir -p $rodir
|
||||
if ! mount /dev/disk/by-partlabel/"$(kgetopt root=PARTLABEL)" $rodir -t ext4 -o ro; then
|
||||
/bin/sh
|
||||
fi
|
||||
|
||||
# Determine if a factory reset has been requested
|
||||
mkdir -p /var/lock
|
||||
resetval=$(fw_printenv -n rwreset 2>/dev/null)
|
||||
if gpiopresent=$(gpiofind factory-reset-toggle) ; then
|
||||
# gpiopresent contains both the gpiochip and line number as
|
||||
# separate words, and gpioget needs to see them as such.
|
||||
# shellcheck disable=SC2086
|
||||
gpioval=$(gpioget $gpiopresent)
|
||||
else
|
||||
gpioval=""
|
||||
fi
|
||||
# Prevent unnecessary resets on first boot
|
||||
if [ -n "$gpioval" ] && [ -z "$resetval" ]; then
|
||||
fw_setenv rwreset "$gpioval"
|
||||
resetval=$gpioval
|
||||
fi
|
||||
if [ "$resetval" = "true" ] || [ -n "$gpioval" ] && [ "$resetval" != "$gpioval" ]; then
|
||||
echo "Factory reset requested."
|
||||
if ! mkfs.ext4 -F "${rwfsdev}"; then
|
||||
echo "Reformat for factory reset failed."
|
||||
/bin/sh
|
||||
else
|
||||
# gpioval will be an empty string if factory-reset-toggle was not found
|
||||
fw_setenv rwreset "$gpioval"
|
||||
echo "rwfs has been formatted."
|
||||
fi
|
||||
fi
|
||||
|
||||
fsck.ext4 -p "${rwfsdev}"
|
||||
if ! mount "${rwfsdev}" $rodir/var -t ext4 -o rw; then
|
||||
/bin/sh
|
||||
fi
|
||||
|
||||
rm -rf $rodir/var/persist/etc-work/
|
||||
mkdir -p $rodir/var/persist/etc $rodir/var/persist/etc-work $rodir/var/persist/home/root
|
||||
mount overlay $rodir/etc -t overlay -o lowerdir=$rodir/etc,upperdir=$rodir/var/persist/etc,workdir=$rodir/var/persist/etc-work
|
||||
|
||||
init="$(kgetopt init /sbin/init)"
|
||||
|
||||
for f in $fslist; do
|
||||
mount --move "$f" "$rodir/$f"
|
||||
done
|
||||
|
||||
exec switch_root $rodir "$init"
|
||||
@@ -0,0 +1,50 @@
|
||||
SUMMARY = "Phosphor OpenBMC pre-init scripts for static-norootfs layout"
|
||||
DESCRIPTION = "Phosphor OpenBMC filesystem mount implementation for static-norootfs"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
PR = "r1"
|
||||
|
||||
SOURCE_FILES = "\
|
||||
init \
|
||||
10-early-mounts \
|
||||
20-udev \
|
||||
21-factory-reset \
|
||||
30-ubiattach-or-format \
|
||||
50-mount-persistent \
|
||||
"
|
||||
SRC_URI += "\
|
||||
${@' '.join(\
|
||||
[ 'file://' + x for x in d.getVar('SOURCE_FILES', True).split()])} \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
inherit allarch
|
||||
inherit update-alternatives
|
||||
|
||||
PKG_INSTALL_DIR="${libexecdir}/${BPN}"
|
||||
FILES:${PN} += "${PKG_INSTALL_DIR}"
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${PKG_INSTALL_DIR}
|
||||
|
||||
for f in ${SOURCE_FILES} ; do
|
||||
install -m 0755 ${S}/$f ${D}${PKG_INSTALL_DIR}/$f
|
||||
done
|
||||
}
|
||||
|
||||
RDEPENDS:${PN} += " \
|
||||
${@d.getVar('PREFERRED_PROVIDER_u-boot-fw-utils', True) or \
|
||||
'u-boot-fw-utils'} \
|
||||
${VIRTUAL-RUNTIME_base-utils} \
|
||||
mtd-utils-ubifs \
|
||||
udev \
|
||||
"
|
||||
|
||||
ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
|
||||
# Use a number higher than the systemd init alternative so that
|
||||
# ours is enabled instead.
|
||||
ALTERNATIVE_PRIORITY[init] ?= "400"
|
||||
|
||||
ALTERNATIVE:${PN} = "init"
|
||||
ALTERNATIVE_TARGET[init] = "${PKG_INSTALL_DIR}/init"
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
mount dev dev -tdevtmpfs
|
||||
mount sys sys -tsysfs
|
||||
mount proc proc -tproc
|
||||
mount tmpfs run -t tmpfs -o mode=755,nodev
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
# We need to run udevd in order to get the /dev/mtd volumes to show up.
|
||||
if udevd --daemon; then
|
||||
udevadm trigger --type=devices --action=add && \
|
||||
udevadm settle --timeout=10
|
||||
|
||||
udevadm control --exit
|
||||
fi
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ ! -x /sbin/fw_printenv ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Need to create /run/lock so fw_printenv can create lockfile.
|
||||
mkdir /run/lock
|
||||
|
||||
# Check uboot keys for 'factory-reset'
|
||||
if /sbin/fw_printenv openbmcinit openbmconce | grep -q factory-reset ; then
|
||||
echo "factory-reset" >> /run/format-persist
|
||||
fi
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ ! -e /dev/mtd/rwfs ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -e /run/format-persist ]; then
|
||||
if ! ubiattach -p /dev/mtd/rwfs > /dev/null ; then
|
||||
echo "unformatted-ubi" >> /run/format-persist
|
||||
fi
|
||||
|
||||
if ! ubinfo /dev/ubi0 -N rwfs > /dev/null ; then
|
||||
# ubi device attached, but volume not exist
|
||||
ubidetach -p /dev/mtd/rwfs
|
||||
echo "missing-ubi-volume" >> /run/format-persist
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -e /run/format-persist ]; then
|
||||
echo "Formatting persistent volume: "
|
||||
cat /run/format-persist
|
||||
|
||||
if ! ubiformat --yes /dev/mtd/rwfs ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! ubiattach -p /dev/mtd/rwfs ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! ubimkvol /dev/ubi0 -N rwfs -m ; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p /run/mnt-persist
|
||||
mount -t ubifs ubi0:rwfs /run/mnt-persist -o sync,compr=zstd
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
PERSIST=/run/mnt-persist
|
||||
|
||||
if [ ! -d $PERSIST ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for m in var etc home/root; do
|
||||
if [ ! -d $PERSIST/$m-data ]; then
|
||||
mkdir -p $PERSIST/$m-data
|
||||
fi
|
||||
|
||||
if [ ! -d $PERSIST/$m-work ]; then
|
||||
mkdir -p $PERSIST/$m-work
|
||||
fi
|
||||
|
||||
mount overlay /$m -t overlay -o \
|
||||
lowerdir=/$m,upperdir=$PERSIST/$m-data,workdir=$PERSIST/$m-work
|
||||
done
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd /
|
||||
|
||||
for f in /usr/libexec/phosphor-static-norootfs-init/*; do
|
||||
if [ "$(basename "$f")" = "init" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
$f
|
||||
done
|
||||
|
||||
exec /lib/systemd/systemd
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
for i in test/*_test; do
|
||||
if $i ; then
|
||||
echo "PASS: $i"
|
||||
else
|
||||
echo "FAIL: $i"
|
||||
fi
|
||||
done
|
||||
@@ -0,0 +1,56 @@
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=175792518e4ac015ab6696d16c4f607e"
|
||||
DEPENDS = " \
|
||||
openssl \
|
||||
zlib \
|
||||
boost \
|
||||
libpam \
|
||||
sdbusplus \
|
||||
gtest \
|
||||
nlohmann-json \
|
||||
libtinyxml2 \
|
||||
nghttp2 \
|
||||
${@bb.utils.contains('PTEST_ENABLED', '1', 'gtest', '', d)} \
|
||||
${@bb.utils.contains('PTEST_ENABLED', '1', 'gmock', '', d)} \
|
||||
"
|
||||
SRCREV = "e01d0c36af115ed46d54b5dbbacfe3ad92226bd3"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/bmcweb.git;branch=master;protocol=https"
|
||||
SRC_URI += " \
|
||||
file://run-ptest \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
SYSTEMD_SERVICE:${PN} += "bmcweb.service bmcweb.socket"
|
||||
|
||||
inherit systemd
|
||||
inherit useradd
|
||||
inherit pkgconfig meson ptest
|
||||
|
||||
PACKAGECONFIG ??= ""
|
||||
PACKAGECONFIG[insecure-redfish-expand]="-Dinsecure-enable-redfish-query=enabled"
|
||||
|
||||
EXTRA_OEMESON = " \
|
||||
--buildtype=minsize \
|
||||
-Dtests=${@bb.utils.contains('PTEST_ENABLED', '1', 'enabled', 'disabled', d)} \
|
||||
"
|
||||
|
||||
do_install_ptest() {
|
||||
install -d ${D}${PTEST_PATH}/test
|
||||
cp -rf ${B}/*_test ${D}${PTEST_PATH}/test/
|
||||
}
|
||||
|
||||
RDEPENDS:${PN} += " \
|
||||
jsnbd \
|
||||
phosphor-objmgr \
|
||||
"
|
||||
|
||||
FILES:${PN} += "${datadir}/** "
|
||||
|
||||
USERADD_PACKAGES = "${PN}"
|
||||
# add a user called httpd for the server to assume
|
||||
USERADD_PARAM:${PN} = "-r -s /sbin/nologin bmcweb"
|
||||
|
||||
GROUPADD_PARAM:${PN} = "web; redfish; hostconsole"
|
||||
FULL_OPTIMIZATION:append = " -Os"
|
||||
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Lightweight SLP Server
|
||||
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/slpd
|
||||
SyslogIdentifier=slpd
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,18 @@
|
||||
SUMMARY = "Lightweight SLP Server"
|
||||
DESCRIPTION = "Lightweight Unicast-only SLP Server"
|
||||
HOMEPAGE = "http://github.com/openbmc/slpd-lite"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
|
||||
DEPENDS += "systemd"
|
||||
DEPENDS += "autoconf-archive-native"
|
||||
SRCREV = "77350e12ef03d23d89d5d37808622106d549769e"
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "git://github.com/openbmc/slpd-lite;branch=master;protocol=https"
|
||||
|
||||
SYSTEMD_SERVICE:${PN} += "slpd-lite.service"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit meson pkgconfig
|
||||
inherit obmc-phosphor-systemd
|
||||
@@ -0,0 +1,18 @@
|
||||
SUMMARY = "Recipe to create AssetTag property in inventory manager"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
PROVIDES += "virtual/phosphor-inventory-manager-assettag"
|
||||
PR = "r1"
|
||||
|
||||
SRC_URI = "file://assettag.yaml"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
inherit allarch
|
||||
inherit phosphor-inventory-manager
|
||||
|
||||
do_install() {
|
||||
install -D assettag.yaml ${D}${base_datadir}/events.d/assettag.yaml
|
||||
}
|
||||
|
||||
FILES:${PN} += "${base_datadir}/events.d/assettag.yaml"
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
events:
|
||||
- name: Creating AssetTag at startup
|
||||
description: >
|
||||
Create /system at startup and populate the AssetTag property with
|
||||
empty string.
|
||||
type: startup
|
||||
actions:
|
||||
- name: createObjects
|
||||
objs:
|
||||
/system:
|
||||
xyz.openbmc_project.Inventory.Decorator.AssetTag:
|
||||
AssetTag:
|
||||
value: ""
|
||||
type: string
|
||||
@@ -0,0 +1,5 @@
|
||||
HOMEPAGE = "http://github.com/openbmc/phosphor-inventory-manager"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
|
||||
SRC_URI = "git://github.com/openbmc/phosphor-inventory-manager;branch=master;protocol=https"
|
||||
SRCREV = "c3eb3879fec881ff26ca167dce33897c702b3b7e"
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Phosphor Inventory Manager
|
||||
Before=mapper-wait@-xyz-openbmc_project-inventory.service
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
Type=dbus
|
||||
ExecStart=/usr/bin/phosphor-inventory
|
||||
BusName={BUSNAME}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user