Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
OLPSUP-8795: Import a hash of an initially installed version from the…
Browse files Browse the repository at this point in the history
… file prepared by the bitbake process

Signed-off-by: Mykhaylo Sul <myk.sul@gmail.com>
  • Loading branch information
mike-sul committed Dec 12, 2019
1 parent 7a68cd5 commit 3399758
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/aktualizr_secondary/aktualizr_secondary_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,7 @@ bool AktualizrSecondaryCommon::uptaneInitialize() {
ecu_serial_ = ecu_serials[0].first;
hardware_id_ = ecu_serials[0].second;

storage_->importInstalledVersions(config_.import.base_path);

return true;
}
2 changes: 2 additions & 0 deletions src/aktualizr_secondary/aktualizr_secondary_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ void AktualizrSecondaryConfig::updateFromPropertyTree(const boost::property_tree
CopySubtreeFromConfig(p11, "p11", pt);
CopySubtreeFromConfig(pacman, "pacman", pt);
CopySubtreeFromConfig(storage, "storage", pt);
CopySubtreeFromConfig(import, "import", pt);
}

void AktualizrSecondaryConfig::writeToStream(std::ostream& sink) const {
Expand All @@ -107,6 +108,7 @@ void AktualizrSecondaryConfig::writeToStream(std::ostream& sink) const {
WriteSectionToStream(p11, "p11", sink);
WriteSectionToStream(pacman, "pacman", sink);
WriteSectionToStream(storage, "storage", sink);
WriteSectionToStream(import, "import", sink);
}

std::ostream& operator<<(std::ostream& os, const AktualizrSecondaryConfig& cfg) {
Expand Down
1 change: 1 addition & 0 deletions src/aktualizr_secondary/aktualizr_secondary_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class AktualizrSecondaryConfig : public BaseConfig {
PackageConfig pacman;
BootloaderConfig bootloader;
StorageConfig storage;
ImportConfig import;

private:
void updateFromCommandLine(const boost::program_options::variables_map& cmd);
Expand Down
2 changes: 1 addition & 1 deletion src/libaktualizr/storage/invstorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ class INvStorage {
bool loadPrimaryInstallationLog(std::vector<Uptane::Target>* log, bool only_installed) {
return loadInstallationLog("", log, only_installed);
}
void importInstalledVersions(const boost::filesystem::path& base_path);

private:
void importSimple(const boost::filesystem::path& base_path, store_data_t store_func, load_data_t load_func,
Expand All @@ -222,7 +223,6 @@ class INvStorage {
const BasedPath& imported_data_path);
void importPrimaryKeys(const boost::filesystem::path& base_path, const BasedPath& import_pubkey_path,
const BasedPath& import_privkey_path);
void importInstalledVersions(const boost::filesystem::path& base_path);

protected:
const StorageConfig config_;
Expand Down

0 comments on commit 3399758

Please sign in to comment.