diff options
author | Michael Tritz <mtritz@us.ibm.com> | 2018-02-08 02:04:07 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-02-27 17:08:33 +0300 |
commit | 7e0cadfaefcd972fc2efeba533453022a18bb116 (patch) | |
tree | 688d18b0812a4505ab3d76c5fde2220a378e3399 | |
parent | 6288c9cfaef0a449606f3790d3e5bf17fdec1d1c (diff) | |
download | openbmc-7e0cadfaefcd972fc2efeba533453022a18bb116.tar.xz |
BMC firmware update: Dynamically size UBI volume to fit image
This commit improves the BMC firmware update process by dynamically
sizing the UBI volumes created to hold the read-only images.
Tested: Verified that a BMC update performed using this version of the
script resulted in UBI volumes sized for the corresponding read-only
images and rebooted successfully.
Resolves openbmc/openbmc#2888
Change-Id: Id1cf9eaace35af80ed1001f3276dad5ea0ad5569
Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc b/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc index b8a33aefb..90ed71d76 100644 --- a/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc +++ b/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc @@ -140,8 +140,15 @@ ubi_ro() { ubi_remove_volumes - # Create a static ubi volume - # TODO Get the actual image size openbmc/openbmc#1840 + if [ -z "${imgfile}" ]; then + echo "Unable to create read-only volume. Image file not specified." + return 1 + fi + + # Create a ubi volume, dynamically sized to fit BMC image if size unspecified + img="/tmp/images/${version}/${imgfile}" + imgsize="$(stat -c '%s' ${img})" + vol="$(findubi "${name}")" if [ ! -z "${vol}" ]; then # Allow a duplicate kernel volume on the alt mtd @@ -403,7 +410,6 @@ case "$1" in name="$3" version="$4" imgfile="image-rofs" - imgsize="16MiB" ubi_ro ubi_updatevol ubi_block @@ -414,7 +420,6 @@ case "$1" in name="$3" version="$4" imgfile="image-kernel" - imgsize="4MiB" ubi_ro ubi_updatevol create_vol_in_alt |