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

Commit

Permalink
Merge pull request #1485 from advancedtelematic/fix/OLPSUP-8795/incor…
Browse files Browse the repository at this point in the history
…rect-hash-reported

OLPSUP-8795: Import the initial hash from file for IP Secondary
  • Loading branch information
pattivacek authored Dec 12, 2019
2 parents 7a68cd5 + 4cef29e commit 6633d0d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Our versioning scheme is `YEAR.N` where `N` is incremented whenever a new releas

## [??? (unreleased)]

## [2019.11] - 2019-12-11
## [2019.11] - 2019-12-12

### Added

Expand All @@ -25,6 +25,7 @@ Our versioning scheme is `YEAR.N` where `N` is incremented whenever a new releas
- Removed bogus warning at boot when using OStree: [PR](https://github.com/advancedtelematic/aktualizr/pull/1466)
- Updated the docker-app package manager to work with docker-app v0.8: [PR](https://github.com/advancedtelematic/aktualizr/pull/1468)
- Overriding of log level when using the docker-app package manager: [PR](https://github.com/advancedtelematic/aktualizr/pull/1478)
- Report correct hash of the currently installed version on IP Secondary:: [PR](https://github.com/advancedtelematic/aktualizr/pull/1485)

## [2019.10] - 2019-11-15

Expand Down
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 6633d0d

Please sign in to comment.