blob: 82c23932e766705f758c26affe99ff339e5dd2c9 [file] [log] [blame]
#include "config.h"
#include "flash.hpp"
#include "activation.hpp"
#include "images.hpp"
#include <experimental/filesystem>
namespace
{
constexpr auto PATH_INITRAMFS = "/run/initramfs";
} // namespace
namespace phosphor
{
namespace software
{
namespace updater
{
namespace fs = std::experimental::filesystem;
void Activation::flashWrite()
{
// For static layout code update, just put images in /run/initramfs.
// It expects user to trigger a reboot and an updater script will program
// the image to flash during reboot.
fs::path uploadDir(IMG_UPLOAD_DIR);
fs::path toPath(PATH_INITRAMFS);
for (auto& bmcImage : phosphor::software::image::bmcImages)
{
fs::copy_file(uploadDir / versionId / bmcImage, toPath / bmcImage,
fs::copy_options::overwrite_existing);
}
}
void Activation::onStateChanges(sdbusplus::message::message& /*msg*/)
{
// Empty
}
} // namespace updater
} // namespace software
} // namespace phosphor