summaryrefslogtreecommitdiffstats
path: root/updater/updater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'updater/updater.cpp')
-rw-r--r--updater/updater.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/updater/updater.cpp b/updater/updater.cpp
index 0f22e6d04..0497d6a85 100644
--- a/updater/updater.cpp
+++ b/updater/updater.cpp
@@ -25,6 +25,10 @@
#include "blockimg.h"
#include "minzip/Zip.h"
#include "minzip/SysUtil.h"
+#include "config.h"
+
+#include <selinux/label.h>
+#include <selinux/selinux.h>
// Generated by the makefile, this function defines the
// RegisterDeviceExtensions() function, which calls all the
@@ -35,6 +39,8 @@
// (Note it's "updateR-script", not the older "update-script".)
#define SCRIPT_NAME "META-INF/com/google/android/updater-script"
+extern bool have_eio_error;
+
struct selabel_handle *sehandle;
int main(int argc, char** argv) {
@@ -82,6 +88,7 @@ int main(int argc, char** argv) {
argv[3], strerror(err));
return 3;
}
+ ota_io_init(&za);
const ZipEntry* script_entry = mzFindZipEntry(&za, SCRIPT_NAME);
if (script_entry == NULL) {
@@ -139,6 +146,11 @@ int main(int argc, char** argv) {
state.errmsg = NULL;
char* result = Evaluate(&state, root);
+
+ if (have_eio_error) {
+ fprintf(cmd_pipe, "retry_update\n");
+ }
+
if (result == NULL) {
if (state.errmsg == NULL) {
printf("script aborted (no error message)\n");