Update RCS MAC address persistance in updater script to allow U-boot...

Update RCS MAC address persistance in updater script to allow U-boot environment changes across update files
parent 15f2c278
......@@ -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
......
......@@ -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 "
RDEPENDS_${PN}-inventory += " openpower-occ-control phosphor-cooling-type"
RDEPENDS_${PN}-extras += " procps obmc-ikvm bmcweb phosphor-webui"
RDEPENDS_${PN}-extras += " binary-block-editor procps obmc-ikvm bmcweb phosphor-webui"
......@@ -23,4 +23,7 @@ do_configure_prepend () {
do_install () {
install -d ${D}${bindir}
install -m 755 ${S}/src/bbe ${D}${bindir}/bbe
install -d ${STAGING_DIR}/bin
install -m 755 ${S}/src/bbe ${STAGING_DIR}/bin/bbe
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment