From: Hugo Villeneuve Date: Tue, 9 Sep 2025 18:48:32 +0000 (-0400) Subject: swupdate: add script to provide runtime hardware revision X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=40fd877db287acf65a985f5f18d8b7e28ebbeb08;p=yocto%2Fmeta-hvmpd.git swupdate: add script to provide runtime hardware revision Signed-off-by: Hugo Villeneuve --- diff --git a/recipes-support/swupdate/swupdate/97-hwrevision-hardcoded.sh.in b/recipes-support/swupdate/swupdate/97-hwrevision-hardcoded.sh.in new file mode 100644 index 0000000..44bdf5d --- /dev/null +++ b/recipes-support/swupdate/swupdate/97-hwrevision-hardcoded.sh.in @@ -0,0 +1,12 @@ +#!/bin/sh + +# TODO: the revision should be read at bootup from an EEPROM or other means. +# For now, it is simply hardcoded. +HWREV="revA" + +DESTDIR="/var/run/swupdate" +DESTFILE="${DESTDIR}/hwrevision" + +mkdir -p ${DESTDIR} + +echo "@MACHINE@ ${HWREV}" > ${DESTFILE} diff --git a/recipes-support/swupdate/swupdate_%.bbappend b/recipes-support/swupdate/swupdate_%.bbappend new file mode 100644 index 0000000..a475262 --- /dev/null +++ b/recipes-support/swupdate/swupdate_%.bbappend @@ -0,0 +1,12 @@ +FILESEXTRAPATHS:prepend:hvmpd := "${THISDIR}/${PN}:" + +SRC_URI:append:hvmpd = " \ + file://97-hwrevision-hardcoded.sh.in \ +" + +do_install:append:hvmpd() { + sed -e s/@MACHINE@/${MACHINE}/ \ + ${WORKDIR}/97-hwrevision-hardcoded.sh.in > ${WORKDIR}/97-hwrevision-hardcoded.sh + install -d ${D}${libdir}/swupdate/conf.d/ + install -m 644 ${WORKDIR}/97-hwrevision-hardcoded.sh ${D}${libdir}/swupdate/conf.d/ +}