diff options
author | Saqib Khan <khansa@us.ibm.com> | 2017-08-31 11:04:17 -0500 |
---|---|---|
committer | Saqib Khan <khansa@us.ibm.com> | 2017-09-06 12:05:50 -0500 |
commit | 1e0aa5c91bcba3cc2b3d567cc6e1ad1b28ff5418 (patch) | |
tree | d7e2153a6ee8306fcb4c234e30801deace44399d | |
parent | fe075368fd0b76fd491267732db3a8ebc5cc763a (diff) | |
download | openpower-pnor-code-mgmt-1e0aa5c91bcba3cc2b3d567cc6e1ad1b28ff5418.tar.gz openpower-pnor-code-mgmt-1e0aa5c91bcba3cc2b3d567cc6e1ad1b28ff5418.zip |
Combine the creation of ro and rw partition in one service file
- Use the combine ubimount service file that creates both
rw and ro partition.
Change-Id: I40438bc16ac4f5734a749b7bf218ea5c6f628339
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
-rwxr-xr-x | activation.cpp | 40 | ||||
-rwxr-xr-x | activation.hpp | 10 | ||||
-rw-r--r-- | item_updater.cpp | 2 | ||||
-rwxr-xr-x | item_updater.hpp | 2 |
4 files changed, 13 insertions, 41 deletions
diff --git a/activation.cpp b/activation.cpp index 5b54571c0..f7cfd1a0b 100755 --- a/activation.cpp +++ b/activation.cpp @@ -57,22 +57,10 @@ void Activation::startActivation() std::make_unique<ActivationBlocksTransition>(bus, path); } - constexpr auto squashfsMountService = - "obmc-flash-bios-squashfsmount@"; - auto squashfsMountServiceFile = std::string(squashfsMountService) + - versionId + ".service"; - auto method = bus.new_method_call( - SYSTEMD_BUSNAME, - SYSTEMD_PATH, - SYSTEMD_INTERFACE, - "StartUnit"); - method.append(squashfsMountServiceFile, "replace"); - bus.call_noreply(method); - constexpr auto ubimountService = "obmc-flash-bios-ubimount@"; auto ubimountServiceFile = std::string(ubimountService) + versionId + ".service"; - method = bus.new_method_call( + auto method = bus.new_method_call( SYSTEMD_BUSNAME, SYSTEMD_PATH, SYSTEMD_INTERFACE, @@ -99,8 +87,7 @@ void Activation::finishActivation() activationBlocksTransition.reset(nullptr); activationProgress.reset(nullptr); - squashfsLoaded = false; - rwVolumesCreated = false; + ubiVolumesCreated = false; Activation::unsubscribeFromSystemdSignals(); // Create active association parent.createActiveAssociation(path); @@ -120,12 +107,12 @@ auto Activation::activation(Activations value) -> parent.freeSpace(); softwareServer::Activation::activation(value); - if (squashfsLoaded == false && rwVolumesCreated == false) + if (ubiVolumesCreated == false) { Activation::startActivation(); return softwareServer::Activation::activation(value); } - else if (squashfsLoaded == true && rwVolumesCreated == true) + else if (ubiVolumesCreated == true) { // Only when the squashfs image is finished loading AND the RW // volumes have been created do we proceed with activation. To @@ -161,8 +148,7 @@ auto Activation::activation(Activations value) -> auto Activation::requestedActivation(RequestedActivations value) -> RequestedActivations { - squashfsLoaded = false; - rwVolumesCreated = false; + ubiVolumesCreated = false; if ((value == softwareServer::Activation::RequestedActivations::Active) && (softwareServer::Activation::requestedActivation() != @@ -198,32 +184,22 @@ void Activation::unitStateChange(sdbusplus::message::message& msg) //Read the msg and populate each variable msg.read(newStateID, newStateObjPath, newStateUnit, newStateResult); - auto squashfsMountServiceFile = - "obmc-flash-bios-squashfsmount@" + versionId + ".service"; - auto ubimountServiceFile = "obmc-flash-bios-ubimount@" + versionId + ".service"; - if(newStateUnit == squashfsMountServiceFile && newStateResult == "done") - { - squashfsLoaded = true; - activationProgress->progress(activationProgress->progress() + 20); - } - if(newStateUnit == ubimountServiceFile && newStateResult == "done") { - rwVolumesCreated = true; + ubiVolumesCreated = true; activationProgress->progress(activationProgress->progress() + 50); } - if(squashfsLoaded && rwVolumesCreated) + if(ubiVolumesCreated) { Activation::activation( softwareServer::Activation::Activations::Activating); } - if((newStateUnit == squashfsMountServiceFile || - newStateUnit == ubimountServiceFile) && + if((newStateUnit == ubimountServiceFile) && (newStateResult == "failed" || newStateResult == "dependency")) { Activation::activation(softwareServer::Activation::Activations::Failed); diff --git a/activation.hpp b/activation.hpp index fa27086b0..3fcb6220a 100755 --- a/activation.hpp +++ b/activation.hpp @@ -294,13 +294,9 @@ class Activation : public ActivationInherit /** @brief Used to subscribe to dbus systemd signals **/ sdbusplus::bus::match_t systemdSignals; - /** @brief Tracks whether the squashfs image has been loaded as part of - * the activation process. **/ - bool squashfsLoaded = false; - - /** @brief Tracks whether the read-write volumes have been created as - * part of the activation process. **/ - bool rwVolumesCreated = false; + /** @brief Tracks whether the read-only & read-write volumes have been + *created as part of the activation process. **/ + bool ubiVolumesCreated = false; /** @brief activation status property get function * diff --git a/item_updater.cpp b/item_updater.cpp index 6df57ac9c..101bc0098 100644 --- a/item_updater.cpp +++ b/item_updater.cpp @@ -344,7 +344,7 @@ void ItemUpdater::erase(std::string entryId) // Remove priority persistence file removeFile(entryId); - // Removing partitions + // Removing read-only and read-write partitions removeReadWritePartition(entryId); removeReadOnlyPartition(entryId); diff --git a/item_updater.hpp b/item_updater.hpp index affbe5372..812c9fe26 100755 --- a/item_updater.hpp +++ b/item_updater.hpp @@ -141,7 +141,7 @@ class ItemUpdater : public ItemUpdaterInherit /** @brief Clears read write PNOR partition for * given Activation dbus object * - * @param[in] versionId - The id of the rw partition to remove. + * @param[in] versionId - The id of the rw partition to remove. */ void removeReadWritePartition(std::string versionId); |