summaryrefslogtreecommitdiff
path: root/meta-phosphor/common/recipes-phosphor/flash
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2018-03-02 00:26:01 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-06-04 23:13:04 +0300
commit3d8b8403fcc3f78bcded10b8ce67aa2b6d37c2a5 (patch)
tree698dacbbb749c8b491adf39e0e5710d14c6806ae /meta-phosphor/common/recipes-phosphor/flash
parent8e7f3e7db748a563fce8f4cc88b511caecdd761a (diff)
downloadopenbmc-3d8b8403fcc3f78bcded10b8ce67aa2b6d37c2a5.tar.xz
obmc-flash-bmc: DeleteAll cleanup fixes for alt BMC
A DeleteAll request first deletes individual software D-Bus objects and their corresponding rofs and kernel UBI volumes, then it calls the cleanup service to remove UBI volumes that were not part of a D-Bus object. 1. Only delete the rofs volume during a cleanup, this is the volume used to create D-Bus objects. Don't delete the kernel volume because if the system has an alt BMC chip, the backup kernel volume is deleted as part of this step which is undesirable. 2. Call createenvbackup as part of the cleanup service, to update the alt environment variables to point to the currently running image, because DeleteAll will delete all other images so the alt environment should be updated to point to the remaining image. Change-Id: Ibde8f9ef275c0536573cf0625c8291096c6cdd6e Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/flash')
-rw-r--r--meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc4
-rw-r--r--meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-cleanup.service3
2 files changed, 4 insertions, 3 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 875a90fe2d..d14bcef7df 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
@@ -218,10 +218,10 @@ ubi_cleanup() {
grep /xyz/openbmc_project/software/ | tail -c 9)
if [[ -z "$activeVersion" ]]; then
- vols=$(ubinfo -a | grep -e "kernel-" -e "rofs-" | cut -c 14-)
+ vols=$(ubinfo -a | grep "rofs-" | cut -c 14-)
vols=(${vols})
else
- vols=$(ubinfo -a | grep -e "kernel-" -e "rofs-" | \
+ vols=$(ubinfo -a | grep "rofs-" | \
grep -v "$activeVersion" | cut -c 14-)
vols=(${vols})
fi
diff --git a/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-cleanup.service b/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-cleanup.service
index 41769a4dd8..f8c9135a16 100644
--- a/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-cleanup.service
+++ b/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-cleanup.service
@@ -1,8 +1,9 @@
[Unit]
-Description=Clean up UBI volumes unattached to a BMC version
+Description=Clean up UBI volumes unattached to a BMC version after DeleteAll
[Service]
Type=oneshot
RemainAfterExit=no
+ExecStartPre=/usr/bin/env obmc-flash-bmc createenvbackup
ExecStart=/usr/bin/env obmc-flash-bmc ubicleanup
SyslogIdentifier=obmc-flash-bmc