summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorSami Tolvanen <samitolvanen@google.com>2015-03-04 20:42:08 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-03-04 20:42:09 +0000
commit8ee42f9c50086830edb2cdf035ad5bedcf0fa6f1 (patch)
tree209de93500f3c2c64c1d2d07971e82af6fbe9291 /init
parenta88fb24ab43eec9710a0d4d15aedb6d4bc51a2ec (diff)
parent8ff0190835c89cf6d48221cca68d41a105f67a7b (diff)
downloadsystem_core-8ee42f9c50086830edb2cdf035ad5bedcf0fa6f1.zip
system_core-8ee42f9c50086830edb2cdf035ad5bedcf0fa6f1.tar.gz
system_core-8ee42f9c50086830edb2cdf035ad5bedcf0fa6f1.tar.bz2
Merge "Add init support for dm-verity logging mode"
Diffstat (limited to 'init')
-rw-r--r--init/builtins.cpp14
-rw-r--r--init/init_parser.cpp3
-rw-r--r--init/keywords.h2
3 files changed, 19 insertions, 0 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp
index 9f3dcc1..b4204d8 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -712,6 +712,20 @@ int do_sysclktz(int nargs, char **args)
return 0;
}
+int do_verity_load_state(int nargs, char **args) {
+ if (nargs == 1) {
+ int mode = -1;
+ int rc = fs_mgr_load_verity_state(&mode);
+
+ if (rc == 0 && mode == VERITY_MODE_LOGGING) {
+ action_for_each_trigger("verity-logging", action_add_queue_tail);
+ }
+
+ return rc;
+ }
+ return -1;
+}
+
int do_write(int nargs, char **args)
{
const char *path = args[1];
diff --git a/init/init_parser.cpp b/init/init_parser.cpp
index 61a5e0a..3932357 100644
--- a/init/init_parser.cpp
+++ b/init/init_parser.cpp
@@ -204,6 +204,9 @@ static int lookup_keyword(const char *s)
case 'u':
if (!strcmp(s, "ser")) return K_user;
break;
+ case 'v':
+ if (!strcmp(s, "erity_load_state")) return K_verity_load_state;
+ break;
case 'w':
if (!strcmp(s, "rite")) return K_write;
if (!strcmp(s, "ait")) return K_wait;
diff --git a/init/keywords.h b/init/keywords.h
index a8f29d1..60931f1 100644
--- a/init/keywords.h
+++ b/init/keywords.h
@@ -41,6 +41,7 @@ int do_chmod(int nargs, char **args);
int do_loglevel(int nargs, char **args);
int do_load_persist_props(int nargs, char **args);
int do_load_all_props(int nargs, char **args);
+int do_verity_load_state(int nargs, char **args);
int do_wait(int nargs, char **args);
#define __MAKE_KEYWORD_ENUM__
#define KEYWORD(symbol, flags, nargs, func) K_##symbol,
@@ -97,6 +98,7 @@ enum {
KEYWORD(symlink, COMMAND, 1, do_symlink)
KEYWORD(sysclktz, COMMAND, 1, do_sysclktz)
KEYWORD(user, OPTION, 0, 0)
+ KEYWORD(verity_load_state, COMMAND, 0, do_verity_load_state)
KEYWORD(wait, COMMAND, 1, do_wait)
KEYWORD(write, COMMAND, 2, do_write)
KEYWORD(copy, COMMAND, 2, do_copy)