Remove symlink creation during code update
- We have created a service file that updates the symlinks
based on lowest priority while HOST is powering on. This
prevents the case of someone mistakenly updating PNOR and
symlinks while the HOST is already powered on.
Resolves openbmc/openbmc#1847
Change-Id: Ib2f269e4be1ebb501aba9fa0c1c7204661a0afbf
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
diff --git a/activation.cpp b/activation.cpp
index fd54ccd..55ce08e 100755
--- a/activation.cpp
+++ b/activation.cpp
@@ -39,37 +39,6 @@
return;
}
-void Activation::createSymlinks()
-{
- if (!fs::is_directory(PNOR_ACTIVE_PATH))
- {
- fs::create_directories(PNOR_ACTIVE_PATH);
- }
-
- // If the RW or RO active links exist, remove them and create new
- // ones pointing to the active version.
- if (fs::is_symlink(PNOR_RO_ACTIVE_PATH))
- {
- fs::remove(PNOR_RO_ACTIVE_PATH);
- }
- fs::create_directory_symlink(PNOR_RO_PREFIX + versionId,
- PNOR_RO_ACTIVE_PATH);
- if (fs::is_symlink(PNOR_RW_ACTIVE_PATH))
- {
- fs::remove(PNOR_RW_ACTIVE_PATH);
- }
- fs::create_directory_symlink(PNOR_RW_PREFIX + versionId,
- PNOR_RW_ACTIVE_PATH);
-
- // There is only one preserved directory as it is not tied to a
- // version, so just create the link if it doesn't exist already
- if (!fs::is_symlink(PNOR_PRSV_ACTIVE_PATH))
- {
- fs::create_directory_symlink(PNOR_PRSV,
- PNOR_PRSV_ACTIVE_PATH);
- }
-}
-
void Activation::startActivation()
{
// Since the squashfs image has not yet been loaded to pnor and the
@@ -117,7 +86,6 @@
void Activation::finishActivation()
{
activationProgress->progress(90);
- createSymlinks();
// Set Redundancy Priority before setting to Active
if (!redundancyPriority)
@@ -213,14 +181,6 @@
uint8_t RedundancyPriority::priority(uint8_t value)
{
parent.parent.freePriority(value, parent.versionId);
-
- if(parent.parent.isLowestPriority(value))
- {
- // Need to update the symlinks to point to Software Version
- // with lowest priority.
- parent.createSymlinks();
- }
-
storeToFile(parent.versionId, value);
return softwareServer::RedundancyPriority::priority(value);
}
diff --git a/activation.hpp b/activation.hpp
index 96517ea..12e4f46 100755
--- a/activation.hpp
+++ b/activation.hpp
@@ -228,9 +228,6 @@
RequestedActivations requestedActivation(RequestedActivations value)
override;
- /** @brief Create symlinks for the current Software Version */
- void createSymlinks();
-
/** @brief Check if systemd state change is relevant to this object
*
* Instance specific interface to handle the detected systemd state