diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d2dc99ac1..6fb64498b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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 diff --git a/src/aktualizr_secondary/aktualizr_secondary_common.cc b/src/aktualizr_secondary/aktualizr_secondary_common.cc index 3121ebdea5..1bcde1cc81 100644 --- a/src/aktualizr_secondary/aktualizr_secondary_common.cc +++ b/src/aktualizr_secondary/aktualizr_secondary_common.cc @@ -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; } diff --git a/src/aktualizr_secondary/aktualizr_secondary_config.cc b/src/aktualizr_secondary/aktualizr_secondary_config.cc index c3ff1c109b..d6988af919 100644 --- a/src/aktualizr_secondary/aktualizr_secondary_config.cc +++ b/src/aktualizr_secondary/aktualizr_secondary_config.cc @@ -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 { @@ -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) { diff --git a/src/aktualizr_secondary/aktualizr_secondary_config.h b/src/aktualizr_secondary/aktualizr_secondary_config.h index 028d2439f4..b360b97536 100644 --- a/src/aktualizr_secondary/aktualizr_secondary_config.h +++ b/src/aktualizr_secondary/aktualizr_secondary_config.h @@ -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); diff --git a/src/libaktualizr/storage/invstorage.h b/src/libaktualizr/storage/invstorage.h index 80c4d4ec36..119d25094f 100644 --- a/src/libaktualizr/storage/invstorage.h +++ b/src/libaktualizr/storage/invstorage.h @@ -214,6 +214,7 @@ class INvStorage { bool loadPrimaryInstallationLog(std::vector* 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, @@ -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_;