Compile update_engine_sideload as a static recovery program.
This patch converts update_engine_sideload to a statically linked
program and installs it in the recovery image. The resulting program
uses a statically linked boot_control HAL instead of relying in
libhardware to dynamically load it.
The static library or libraries needed for the boot_control HAL need to
be specified by the product with the new make variable
PRODUCT_STATIC_BOOT_CONTROL_HAL. Otherwise, a stub implementation is
included and update_engine_sideload will fail at runtime.
Bug: 27178350
TEST=`make dist` builds a recovery image with update_engine_sideload in it.
Change-Id: I1f624ecd29220ac2237e42da0a636ea0a015a78e
diff --git a/boot_control_recovery_stub.cc b/boot_control_recovery_stub.cc
new file mode 100644
index 0000000..129c5d0
--- /dev/null
+++ b/boot_control_recovery_stub.cc
@@ -0,0 +1,21 @@
+//
+// Copyright (C) 2016 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <hardware/hardware.h>
+
+hw_module_t HAL_MODULE_INFO_SYM = {
+ .id = "stub",
+};