summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaptor Engineering Development Team <support@raptorengineering.com>2020-02-12 02:15:13 +0000
committerRaptor Engineering Development Team <support@raptorengineering.com>2020-02-13 01:44:43 +0000
commitc0dc3d36d09c8172223bcb680cbda08846a0bf0e (patch)
tree4e03dc5d8e48a00d754081d818f191956d688cee
parentb54ef11d83b714a5cd3d87c9aa46e96e3c2c808e (diff)
downloadtalos-openbmc-c0dc3d36d09c8172223bcb680cbda08846a0bf0e.tar.gz
talos-openbmc-c0dc3d36d09c8172223bcb680cbda08846a0bf0e.zip
Save and restore BMC MAC address in U-Boot environment during BMC firmware updates
-rw-r--r--meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed_2016.07.bb5
-rw-r--r--meta-nuvoton/recipes-bsp/u-boot/u-boot-fw-utils-nuvoton_git.bb5
-rwxr-xr-xmeta-phosphor/recipes-phosphor/initrdscripts/files/obmc-update.sh11
-rw-r--r--meta-phosphor/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bb12
-rw-r--r--poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2019.01.bb5
5 files changed, 37 insertions, 1 deletions
diff --git a/meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed_2016.07.bb b/meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed_2016.07.bb
index e9f724df2..4c73670e6 100644
--- a/meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed_2016.07.bb
+++ b/meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed_2016.07.bb
@@ -28,6 +28,11 @@ do_install () {
install -d ${D}${sysconfdir}
install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
install -m 644 ${WORKDIR}/alt_fw_env.config ${D}${sysconfdir}/alt_fw_env.config
+
+ install -d ${STAGING_DIR}/bin
+ install -m 755 ${S}/tools/env/fw_printenv ${STAGING_DIR}/bin/fw_printenv
+ install -m 755 ${S}/tools/env/fw_printenv ${STAGING_DIR}/bin/fw_setenv
+ install -m 644 ${WORKDIR}/fw_env.config ${STAGING_DIR}/fw_env.config
}
do_install_class-cross () {
diff --git a/meta-nuvoton/recipes-bsp/u-boot/u-boot-fw-utils-nuvoton_git.bb b/meta-nuvoton/recipes-bsp/u-boot/u-boot-fw-utils-nuvoton_git.bb
index 42bc7a306..71e7a9d2a 100644
--- a/meta-nuvoton/recipes-bsp/u-boot/u-boot-fw-utils-nuvoton_git.bb
+++ b/meta-nuvoton/recipes-bsp/u-boot/u-boot-fw-utils-nuvoton_git.bb
@@ -23,6 +23,11 @@ do_install () {
install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
install -m 0644 ${S}/tools/env/fw_env.config ${D}${sysconfdir}/fw_env.config
+
+ install -d ${STAGING_DIR}/bin
+ install -m 755 ${S}/tools/env/fw_printenv ${STAGING_DIR}/bin/fw_printenv
+ install -m 755 ${S}/tools/env/fw_printenv ${STAGING_DIR}/bin/fw_setenv
+ install -m 644 ${WORKDIR}/fw_env.config ${STAGING_DIR}/fw_env.config
}
do_install_class-cross () {
diff --git a/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-update.sh b/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-update.sh
index 278cd41d7..efe47cfe8 100755
--- a/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-update.sh
+++ b/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-update.sh
@@ -232,6 +232,11 @@ done
if test -n "$doflash"
then
+ mkdir -p /var/lock
+
+ BMC_MAC_ADDRESS=$(fw_printenv -n ethaddr)
+ echo "Detected RCS BMC MAC address $BMC_MAC_ADDRESS"
+
for f in $imglist
do
if test ! -s $f
@@ -244,6 +249,12 @@ then
echo "Updating ${f#$image}..."
flashcp -v $f /dev/$m && rm $f
done
+
+ echo "Restoring RCS BMC MAC address..."
+ fw_setenv ethaddr $BMC_MAC_ADDRESS
+ fw_setenv eth1addr $BMC_MAC_ADDRESS
+ fw_setenv rptaddr
+ fw_setenv rpt1addr
fi
if test -d $save -a "x$toram" = xy
diff --git a/meta-phosphor/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bb b/meta-phosphor/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bb
index ab2c38e90..da03cc7f9 100644
--- a/meta-phosphor/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bb
+++ b/meta-phosphor/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bb
@@ -5,7 +5,10 @@ LIC_FILES_CHKSUM = "file://${PHOSPHORBASE}/COPYING.apache-2.0;md5=34400b68072d71
PR = "r1"
-inherit allarch
+INSANE_SKIP_${PN} += "already-stripped"
+
+DEPENDS += "${@d.getVar('PREFERRED_PROVIDER_u-boot', True) or 'u-boot'}"
+DEPENDS += "${@d.getVar('PREFERRED_PROVIDER_u-boot-fw-utils', True) or 'u-boot-fw-utils'}"
RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_base-utils}"
@@ -29,7 +32,14 @@ do_install() {
install -m 0644 ${WORKDIR}/whitelist ${D}/whitelist
install -d ${D}/dev
mknod -m 622 ${D}/dev/console c 5 1
+
+ install -d ${D}/etc
+ install -m 0644 ${STAGING_DIR}/fw_env.config ${D}/etc/fw_env.config
+ install -d ${D}/bin
+ install -m 0755 ${STAGING_DIR}/bin/fw_printenv ${D}/bin/fw_printenv
+ install -m 0755 ${STAGING_DIR}/bin/fw_setenv ${D}/bin/fw_setenv
}
FILES_${PN} += " /init /shutdown /update /whitelist /dev "
FILES_${PN} += " /init-options /init-download-url "
+FILES_${PN} += " /bin/fw_printenv /bin/fw_setenv "
diff --git a/poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2019.01.bb b/poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2019.01.bb
index b5ce56847..0ba983072 100644
--- a/poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2019.01.bb
+++ b/poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2019.01.bb
@@ -20,6 +20,11 @@ do_install () {
install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
install -m 0644 ${S}/tools/env/fw_env.config ${D}${sysconfdir}/fw_env.config
+
+ install -d ${STAGING_DIR}/bin
+ install -m 755 ${S}/tools/env/fw_printenv ${STAGING_DIR}/bin/fw_printenv
+ install -m 755 ${S}/tools/env/fw_printenv ${STAGING_DIR}/bin/fw_setenv
+ install -m 644 ${WORKDIR}/fw_env.config ${STAGING_DIR}/fw_env.config
}
do_install_class-cross () {
OpenPOWER on IntegriCloud