diff options
Diffstat (limited to 'meta-ibm/meta-witherspoon/recipes-phosphor/mboxd')
3 files changed, 41 insertions, 0 deletions
diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/mboxd/mboxd.bbappend b/meta-ibm/meta-witherspoon/recipes-phosphor/mboxd/mboxd.bbappend new file mode 100644 index 000000000..ac35ae9b4 --- /dev/null +++ b/meta-ibm/meta-witherspoon/recipes-phosphor/mboxd/mboxd.bbappend @@ -0,0 +1,12 @@ +MBOXD_FLASH_SIZE = "64M" + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SYSTEMD_SERVICE_${PN} += "check-pnor-format.service" + +SRC_URI += "file://check_pnor_format.sh" + +do_install_append() { + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/check_pnor_format.sh ${D}${bindir}/check_pnor_format.sh +} diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/mboxd/mboxd/check-pnor-format.service b/meta-ibm/meta-witherspoon/recipes-phosphor/mboxd/mboxd/check-pnor-format.service new file mode 100644 index 000000000..88bf0ad39 --- /dev/null +++ b/meta-ibm/meta-witherspoon/recipes-phosphor/mboxd/mboxd/check-pnor-format.service @@ -0,0 +1,11 @@ +[Unit] +Description=Check PNOR UBI format +Before=mboxd.service + +[Service] +ExecStart={bindir}/check_pnor_format.sh +Type=oneshot +RemainAfterExit=yes + +[Install] +RequiredBy=mboxd.service diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/mboxd/mboxd/check_pnor_format.sh b/meta-ibm/meta-witherspoon/recipes-phosphor/mboxd/mboxd/check_pnor_format.sh new file mode 100644 index 000000000..ec043eaf9 --- /dev/null +++ b/meta-ibm/meta-witherspoon/recipes-phosphor/mboxd/mboxd/check_pnor_format.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# Get the mtd device number (mtdX) +findmtd() { + m="$(grep -xl "$1" /sys/class/mtd/*/name)" + m="${m%/name}" + m="${m##*/}" + echo "${m}" +} + +pnormtd="$(findmtd pnor)" +pnor="${pnormtd#mtd}" +pnordev="/dev/mtd${pnor}" + +if [[ ! "$(dd if=${pnordev} bs=1 count=3 2> /dev/null)" = "UBI" ]]; then + echo "${pnordev} is not formatted UBI" + exit 1 +fi |