start update handler impl
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
This commit is contained in:
parent
05adc91f94
commit
b3275d015f
@ -1,6 +1,7 @@
|
||||
#include "CoreController.h"
|
||||
|
||||
#include <fsfw/events/EventManager.h>
|
||||
#include <fsfw/filesystem/HasFileSystemIF.h>
|
||||
#include <fsfw/ipc/QueueFactory.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
@ -200,6 +201,24 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
|
||||
return HasActionsIF::EXECUTION_FINISHED;
|
||||
}
|
||||
case (OBSW_UPDATE_FROM_SD_0): {
|
||||
using namespace std;
|
||||
using namespace std::filesystem;
|
||||
// At the very least, chip and copy ID need to be included in the command
|
||||
if (size < 2) {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
}
|
||||
path archivePath =
|
||||
path(config::SD_0_MOUNT_POINT) / path(config::OBSW_UPDATE_ARCHIVE_FILE_NAME);
|
||||
if (not exists(archivePath)) {
|
||||
return HasFileSystemIF::FILE_DOES_NOT_EXIST;
|
||||
}
|
||||
std::ostringstream cmd("tar -xJvf");
|
||||
cmd << " " << archivePath;
|
||||
int result = std::system(cmd.str().c_str());
|
||||
if (result != 0) {
|
||||
utility::handleSystemError(result,
|
||||
"CoreController::executeAction: SW Update Decompression");
|
||||
}
|
||||
return HasActionsIF::EXECUTION_FINISHED;
|
||||
}
|
||||
case (SWITCH_IMG_LOCK): {
|
||||
|
@ -54,7 +54,6 @@ class CoreController : public ExtendedControllerBase {
|
||||
|
||||
static constexpr char CONF_FOLDER[] = "conf";
|
||||
|
||||
static constexpr char OBSW_VERSION_FILE_NAME[] = "obsw_version.txt";
|
||||
static constexpr char VERSION_FILE_NAME[] = "version.txt";
|
||||
static constexpr char REBOOT_FILE_NAME[] = "reboot.txt";
|
||||
static constexpr char TIME_FILE_NAME[] = "time.txt";
|
||||
|
@ -10,6 +10,7 @@ static constexpr char SD_1_MOUNT_POINT[] = "/mnt/sd1";
|
||||
|
||||
static constexpr char OBSW_UPDATE_ARCHIVE_FILE_NAME[] = "eive-sw-update.tar.xz";
|
||||
static constexpr char STRIPPED_OBSW_BINARY_FILE_NAME[] = "eive-obsw-stripped";
|
||||
static constexpr char OBSW_VERSION_FILE_NAME[] = "obsw_version.txt";
|
||||
|
||||
static constexpr uint16_t EIVE_PUS_APID = 0x65;
|
||||
static constexpr uint16_t EIVE_CFDP_APID = 0x66;
|
||||
|
Loading…
Reference in New Issue
Block a user