AU: Many minor cleanup changes
postinstall: Run postinst twice, once for pre-commit (ie, before we
mark the install partition bootable in the partition table), and
post-commit (for after we do). This behavior is needed for specific
types of firmware update.
download action: flush caches, as we found was necessary in
memento_updater.sh
omaha request prep action: update the names of keys we look for in
lsb-release, also get the AU server url from a file, rather than
hard-code it.
set bootable flag action: GPT support.
also, some misc utility functions.
BUG=None
TEST=attached unittests
Review URL: http://codereview.chromium.org/1881001
diff --git a/postinstall_runner_action.h b/postinstall_runner_action.h
index 00478cc..1169af9 100644
--- a/postinstall_runner_action.h
+++ b/postinstall_runner_action.h
@@ -7,6 +7,7 @@
#include <string>
#include "update_engine/action.h"
+#include "update_engine/install_plan.h"
// The Postinstall Runner Action is responsible for running the postinstall
// script of a successfully downloaded update.
@@ -20,14 +21,14 @@
class ActionTraits<PostinstallRunnerAction> {
public:
// Takes the device path as input
- typedef std::string InputObjectType;
+ typedef InstallPlan InputObjectType;
// Passes the device path as output
- typedef std::string OutputObjectType;
+ typedef InstallPlan OutputObjectType;
};
class PostinstallRunnerAction : public Action<PostinstallRunnerAction> {
public:
- PostinstallRunnerAction() {}
+ explicit PostinstallRunnerAction(bool precommit) : precommit_(precommit) {}
typedef ActionTraits<PostinstallRunnerAction>::InputObjectType
InputObjectType;
typedef ActionTraits<PostinstallRunnerAction>::OutputObjectType
@@ -43,6 +44,10 @@
std::string Type() const { return StaticType(); }
private:
+ // If true, this action runs before we've committed to the new update
+ // (by marking it as bootable in the partition table).
+ bool precommit_;
+
DISALLOW_COPY_AND_ASSIGN(PostinstallRunnerAction);
};