summaryrefslogtreecommitdiffstats
path: root/meta-openbmc-machines/meta-openpower
diff options
context:
space:
mode:
authorSaqib Khan <khansa@us.ibm.com>2017-10-08 22:30:30 -0500
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-10-23 16:26:51 +0000
commitc9f33777b36db69850eaae1a1b7dcfe03c32b8ad (patch)
treee8565a17f5fccbc9c50e7052753d70776ae9fef3 /meta-openbmc-machines/meta-openpower
parentbe57f98f19d289b68748932318157a1f1db324ff (diff)
downloadtalos-openbmc-c9f33777b36db69850eaae1a1b7dcfe03c32b8ad.tar.gz
talos-openbmc-c9f33777b36db69850eaae1a1b7dcfe03c32b8ad.zip
Dynamically set size of pnor read-only partition
- The pnor read-only partition contains the contents of the squashfs image. Therefore the corresponding ubi volume should only be as big in size. - This would allow us to increase the number of active pnor version we can possibly store on pnor chip. Resolves openbmc/openbmc#1840 Change-Id: I5e35a0fcd62e947919f4c9489642188ae2fe49bb Signed-off-by: Saqib Khan <khansa@us.ibm.com>
Diffstat (limited to 'meta-openbmc-machines/meta-openpower')
-rw-r--r--meta-openbmc-machines/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios9
1 files changed, 4 insertions, 5 deletions
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios
index 6e4aa78cf..d92fad5d9 100644
--- a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/flash/openpower-software-manager/obmc-flash-bios
@@ -57,6 +57,8 @@ mount_squashfs() {
ubidev="/dev/ubi${pnormtd#mtd}"
mountdir="/media/${name}"
vol="$(findubi "${name}")"
+ img="/tmp/images/${version}/pnor.xz.squashfs"
+ filesize="$(ls -sh $img | awk -F " " {'print $1'})"
if is_mounted "${name}"; then
echo "${name} is already mounted."
@@ -71,10 +73,8 @@ mount_squashfs() {
mkdir "${mountdir}"
fi
- # Create a static ubi volume of arbitrary size 24MB,
- # the current pnor image is ~19MB
- # TODO Set size based on file size openbmc/openbmc#1840
- ubimkvol "${ubidev}" -N "${name}" -s 24MiB --type=static
+ # Set size of read-only partition equal to pnor.xz.squashfs
+ ubimkvol "${ubidev}" -N "${name}" -s "${filesize}"KiB --type=static
vol="$(findubi "${name}")"
if [ $? != 0 ]; then
@@ -83,7 +83,6 @@ mount_squashfs() {
fi
ubidevid="${vol#ubi}"
- img="/tmp/images/${version}/pnor.xz.squashfs"
ubiupdatevol "/dev/ubi${ubidevid}" "${img}"
if [ $? != 0 ]; then
OpenPOWER on IntegriCloud