diff options
Diffstat (limited to 'meta-phosphor/recipes-phosphor')
-rwxr-xr-x | meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-update.sh | 34 | ||||
-rw-r--r-- | meta-phosphor/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bb | 3 |
2 files changed, 29 insertions, 8 deletions
diff --git a/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-update.sh b/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-update.sh index efe47cfe8..c342e504d 100755 --- a/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-update.sh +++ b/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-update.sh @@ -235,7 +235,10 @@ then mkdir -p /var/lock BMC_MAC_ADDRESS=$(fw_printenv -n ethaddr) - echo "Detected RCS BMC MAC address $BMC_MAC_ADDRESS" + if test -n "$BMC_MAC_ADDRESS" + then + echo "Detected RCS BMC MAC address $BMC_MAC_ADDRESS" + fi for f in $imglist do @@ -245,16 +248,33 @@ then rm $f continue fi + + UPDATE_IMAGE_MAC=0 + if test -n "$BMC_MAC_ADDRESS" + then + if test "${f#$image}" = "bmc" + then + UPDATE_IMAGE_MAC=1 + fi + if test "${f#$image}" = "u-boot" + then + UPDATE_IMAGE_MAC=1 + fi + fi + + if test $UPDATE_IMAGE_MAC -eq 1 + then + echo "Restoring RCS BMC MAC address..." + bbe -e "s/rptaddr=01:23:45:67:89:ab/ethaddr=${BMC_MAC_ADDRESS}/" -o /run/initramfs/${f#$image}.modified $f + rm $f + bbe -e "s/rpt1addr=01:23:45:67:89:ab/eth1addr=${BMC_MAC_ADDRESS}/" -o $f /run/initramfs/${f#$image}.modified + rm /run/initramfs/${f#$image}.modified + fi + m=$(findmtd ${f#$image}) 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 da03cc7f9..3903321db 100644 --- a/meta-phosphor/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bb +++ b/meta-phosphor/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bb @@ -38,8 +38,9 @@ do_install() { 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 + install -m 0755 ${STAGING_DIR}/bin/bbe ${D}/bin/bbe } FILES_${PN} += " /init /shutdown /update /whitelist /dev " FILES_${PN} += " /init-options /init-download-url " -FILES_${PN} += " /bin/fw_printenv /bin/fw_setenv " +FILES_${PN} += " /bin/fw_printenv /bin/fw_setenv /bin/bbe " |