Skip to content

Commit

Permalink
Move hardware and boot_control implementation to libupdate_engine.
Browse files Browse the repository at this point in the history
The implementations of the BootControlInterface and HardwareInterface
are specific to the platform and use case. The delta_generator uses the
DeltaPerformer in the libpayload_consumer to apply a payload to a set
of partitions defined as local files, for example.

This patch move the platform implementations, not available when
building for the host back to the libupdate_engine.

Bug: 24619596
TEST=mma

Change-Id: I16ab06c2e53dfd046e693bdb7310ec26a2d69054
  • Loading branch information
deymo committed Dec 11, 2015
1 parent b09305e commit 1b03f9f
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 25 deletions.
7 changes: 2 additions & 5 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,11 @@ ue_libpayload_consumer_exported_static_libraries := \
update_metadata-protos \
libxz \
libbz \
libfs_mgr \
$(ue_update_metadata_protos_exported_static_libraries)
ue_libpayload_consumer_exported_shared_libraries := \
libcrypto \
libcurl \
libssl \
libhardware \
libcutils \
$(ue_update_metadata_protos_exported_shared_libraries)

include $(CLEAR_VARS)
Expand All @@ -157,12 +154,10 @@ LOCAL_SHARED_LIBRARIES := \
$(ue_update_metadata_protos_exported_shared_libraries)
LOCAL_SRC_FILES := \
common/action_processor.cc \
common/boot_control_android.cc \
common/boot_control_stub.cc \
common/certificate_checker.cc \
common/clock.cc \
common/constants.cc \
common/hardware_android.cc \
common/hash_calculator.cc \
common/http_common.cc \
common/http_fetcher.cc \
Expand Down Expand Up @@ -246,10 +241,12 @@ LOCAL_SHARED_LIBRARIES := \
$(ue_libpayload_consumer_exported_shared_libraries) \
$(ue_update_metadata_protos_exported_shared_libraries)
LOCAL_SRC_FILES := \
boot_control_android.cc \
chrome_browser_proxy_resolver.cc \
connection_manager.cc \
daemon.cc \
dbus_service.cc \
hardware_android.cc \
image_properties_android.cc \
libcros_proxy.cc \
metrics.cc \
Expand Down
2 changes: 1 addition & 1 deletion common/boot_control_android.cc → boot_control_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// limitations under the License.
//

#include "update_engine/common/boot_control_android.h"
#include "update_engine/boot_control_android.h"

#include <base/bind.h>
#include <base/files/file_util.h>
Expand Down
6 changes: 3 additions & 3 deletions common/boot_control_android.h → boot_control_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
// limitations under the License.
//

#ifndef UPDATE_ENGINE_COMMON_BOOT_CONTROL_ANDROID_H_
#define UPDATE_ENGINE_COMMON_BOOT_CONTROL_ANDROID_H_
#ifndef UPDATE_ENGINE_BOOT_CONTROL_ANDROID_H_
#define UPDATE_ENGINE_BOOT_CONTROL_ANDROID_H_

#include <string>

Expand Down Expand Up @@ -58,4 +58,4 @@ class BootControlAndroid : public BootControlInterface {

} // namespace chromeos_update_engine

#endif // UPDATE_ENGINE_COMMON_BOOT_CONTROL_ANDROID_H_
#endif // UPDATE_ENGINE_BOOT_CONTROL_ANDROID_H_
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// limitations under the License.
//

#include "update_engine/common/boot_control_chromeos.h"
#include "update_engine/boot_control_chromeos.h"

#include <string>

Expand Down
6 changes: 3 additions & 3 deletions common/boot_control_chromeos.h → boot_control_chromeos.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
// limitations under the License.
//

#ifndef UPDATE_ENGINE_COMMON_BOOT_CONTROL_CHROMEOS_H_
#define UPDATE_ENGINE_COMMON_BOOT_CONTROL_CHROMEOS_H_
#ifndef UPDATE_ENGINE_BOOT_CONTROL_CHROMEOS_H_
#define UPDATE_ENGINE_BOOT_CONTROL_CHROMEOS_H_

#include <string>

Expand Down Expand Up @@ -82,4 +82,4 @@ class BootControlChromeOS : public BootControlInterface {

} // namespace chromeos_update_engine

#endif // UPDATE_ENGINE_COMMON_BOOT_CONTROL_CHROMEOS_H_
#endif // UPDATE_ENGINE_BOOT_CONTROL_CHROMEOS_H_
2 changes: 1 addition & 1 deletion common/hardware_android.cc → hardware_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// limitations under the License.
//

#include "update_engine/common/hardware_android.h"
#include "update_engine/hardware_android.h"

#include <base/files/file_util.h>
#include <brillo/make_unique_ptr.h>
Expand Down
6 changes: 3 additions & 3 deletions common/hardware_android.h → hardware_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
// limitations under the License.
//

#ifndef UPDATE_ENGINE_COMMON_HARDWARE_ANDROID_H_
#define UPDATE_ENGINE_COMMON_HARDWARE_ANDROID_H_
#ifndef UPDATE_ENGINE_HARDWARE_ANDROID_H_
#define UPDATE_ENGINE_HARDWARE_ANDROID_H_

#include <string>

Expand Down Expand Up @@ -50,4 +50,4 @@ class HardwareAndroid final : public HardwareInterface {

} // namespace chromeos_update_engine

#endif // UPDATE_ENGINE_COMMON_HARDWARE_ANDROID_H_
#endif // UPDATE_ENGINE_HARDWARE_ANDROID_H_
2 changes: 1 addition & 1 deletion common/hardware_chromeos.cc → hardware_chromeos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// limitations under the License.
//

#include "update_engine/common/hardware_chromeos.h"
#include "update_engine/hardware_chromeos.h"

#include <base/files/file_util.h>
#include <base/logging.h>
Expand Down
6 changes: 3 additions & 3 deletions common/hardware_chromeos.h → hardware_chromeos.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
// limitations under the License.
//

#ifndef UPDATE_ENGINE_COMMON_HARDWARE_CHROMEOS_H_
#define UPDATE_ENGINE_COMMON_HARDWARE_CHROMEOS_H_
#ifndef UPDATE_ENGINE_HARDWARE_CHROMEOS_H_
#define UPDATE_ENGINE_HARDWARE_CHROMEOS_H_

#include <string>
#include <vector>
Expand Down Expand Up @@ -51,4 +51,4 @@ class HardwareChromeOS final : public HardwareInterface {

} // namespace chromeos_update_engine

#endif // UPDATE_ENGINE_COMMON_HARDWARE_CHROMEOS_H_
#endif // UPDATE_ENGINE_HARDWARE_CHROMEOS_H_
6 changes: 2 additions & 4 deletions update_engine.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,15 @@
},
'libraries': [
'-lbz2',
'-lrootdev',
'-lrt',
'-lvboot_host',
],
},
'sources': [
'common/action_processor.cc',
'common/boot_control_chromeos.cc',
'common/boot_control_stub.cc',
'common/certificate_checker.cc',
'common/clock.cc',
'common/constants.cc',
'common/hardware_chromeos.cc',
'common/hash_calculator.cc',
'common/http_common.cc',
'common/http_fetcher.cc',
Expand Down Expand Up @@ -242,10 +238,12 @@
],
},
'sources': [
'boot_control_chromeos.cc',
'chrome_browser_proxy_resolver.cc',
'connection_manager.cc',
'daemon.cc',
'dbus_service.cc',
'hardware_chromeos.cc',
'image_properties_chromeos.cc',
'libcros_proxy.cc',
'metrics.cc',
Expand Down

0 comments on commit 1b03f9f

Please sign in to comment.