summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/classes
diff options
context:
space:
mode:
authorEd Tanous <ed.tanous@intel.com>2019-08-19 21:16:19 +0300
committerEd Tanous <ed@tanous.net>2019-08-20 18:56:17 +0300
commit35e295e2a161fcf146ea031de53431b2888521fa (patch)
treea0c78943fef5c085f371aaa840d46edecc1f2e95 /meta-openbmc-mods/meta-common/classes
parent9856ac69064742544fafad307d3ee4544385ffa2 (diff)
downloadopenbmc-35e295e2a161fcf146ea031de53431b2888521fa.tar.xz
Sync to internal 8-19-2019
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/classes')
-rw-r--r--meta-openbmc-mods/meta-common/classes/image_types_intel_pfr.bbclass3
-rw-r--r--meta-openbmc-mods/meta-common/classes/obmc-phosphor-image-common.bbclass2
-rw-r--r--meta-openbmc-mods/meta-common/classes/systemd-watchdog.bbclass27
3 files changed, 31 insertions, 1 deletions
diff --git a/meta-openbmc-mods/meta-common/classes/image_types_intel_pfr.bbclass b/meta-openbmc-mods/meta-common/classes/image_types_intel_pfr.bbclass
index 834c09229..9962e7df6 100644
--- a/meta-openbmc-mods/meta-common/classes/image_types_intel_pfr.bbclass
+++ b/meta-openbmc-mods/meta-common/classes/image_types_intel_pfr.bbclass
@@ -1,6 +1,7 @@
inherit obmc-phosphor-full-fitimage
+DEPENDS += "obmc-intel-pfr-image-native"
require recipes-core/os-release/version-vars.inc
@@ -38,7 +39,7 @@ do_image_pfr () {
cd "${PFR_IMAGES_DIR}"
# python script that does the creating PFM, BMC compressed and unsigned images from BMC 128MB raw binary file.
- python ${PFR_STAGING_DIR}/pfr_image.py ${PFR_STAGING_DIR}/pfr_image-manifest.json ${DEPLOY_DIR_IMAGE}/image-mtd ${build_version} ${build_number} ${build_hash}
+ python ${PFR_STAGING_DIR}/pfr_image.py ${PFR_STAGING_DIR}/pfr_manifest.json ${DEPLOY_DIR_IMAGE}/image-mtd ${build_version} ${build_number} ${build_hash}
# sign the PFM region
${PFR_STAGING_DIR}/blocksign -c ${PFR_STAGING_DIR}/pfm_config.xml -o ${PFR_IMAGES_DIR}/pfm_signed.bin ${PFR_IMAGES_DIR}/pfm.bin
diff --git a/meta-openbmc-mods/meta-common/classes/obmc-phosphor-image-common.bbclass b/meta-openbmc-mods/meta-common/classes/obmc-phosphor-image-common.bbclass
index a495b76fa..6a3ad73d7 100644
--- a/meta-openbmc-mods/meta-common/classes/obmc-phosphor-image-common.bbclass
+++ b/meta-openbmc-mods/meta-common/classes/obmc-phosphor-image-common.bbclass
@@ -1,4 +1,5 @@
inherit obmc-phosphor-image
+inherit systemd-watchdog
IMAGE_INSTALL_append = " \
bmcweb \
@@ -33,6 +34,7 @@ IMAGE_INSTALL_append = " \
phosphor-u-boot-mgr \
prov-mode-mgr \
ac-boot-check \
+ beepcode-mgr \
"
# this package was flagged as a security risk
diff --git a/meta-openbmc-mods/meta-common/classes/systemd-watchdog.bbclass b/meta-openbmc-mods/meta-common/classes/systemd-watchdog.bbclass
new file mode 100644
index 000000000..4cc3845c6
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/classes/systemd-watchdog.bbclass
@@ -0,0 +1,27 @@
+add_watchdog_confs() {
+
+ interval=10 # minutes
+ count=5 # allowed reboots
+
+ for service in $(ls $D/lib/systemd/system | grep -o ".*service"); do
+ if [[ $service == *"mapper-wait"* ]]; then
+ continue
+ fi
+
+ if cat $D/lib/systemd/system/${service} | grep oneshot > /dev/null; then
+ continue
+ fi
+
+ folder="$D/etc/systemd/system/${service}.d"
+ mkdir -p "${folder}"
+ fname="${folder}/watchdog.conf"
+ echo "[Unit]" > ${fname}
+ echo "OnFailure=watchdog-reset.service" >> ${fname}
+ echo "[Service]" >> "${fname}"
+ echo "StartLimitInterval=${interval}min" >> "${fname}"
+ echo "StartLimitBurst=${count}" >> "${fname}"
+ done
+
+}
+
+ROOTFS_POSTINSTALL_COMMAND += "add_watchdog_confs"