From 33997584fb8ce43bae79b4367b01b635dd38db36 Mon Sep 17 00:00:00 2001 From: Mykhaylo Sul Date: Wed, 11 Dec 2019 12:48:27 +0200 Subject: [PATCH 1/2] OLPSUP-8795: Import a hash of an initially installed version from the file prepared by the bitbake process Signed-off-by: Mykhaylo Sul --- src/aktualizr_secondary/aktualizr_secondary_common.cc | 2 ++ src/aktualizr_secondary/aktualizr_secondary_config.cc | 2 ++ src/aktualizr_secondary/aktualizr_secondary_config.h | 1 + src/libaktualizr/storage/invstorage.h | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) 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_; From 4cef29e814c3db504052951f030b34246541384d Mon Sep 17 00:00:00 2001 From: Mykhaylo Sul Date: Thu, 12 Dec 2019 11:41:48 +0200 Subject: [PATCH 2/2] Update CHANGELOG before next release Signed-off-by: Mykhaylo Sul --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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