From 3d8b8403fcc3f78bcded10b8ce67aa2b6d37c2a5 Mon Sep 17 00:00:00 2001 From: Adriana Kobylak Date: Thu, 1 Mar 2018 15:26:01 -0600 Subject: 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 --- .../recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc | 4 ++-- .../flash/phosphor-software-manager/obmc-flash-bmc-cleanup.service | 3 ++- 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 875a90fe2..d14bcef7d 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 41769a4dd..f8c9135a1 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 -- cgit v1.2.3