diff options
Diffstat (limited to 'init/builtins.c')
-rw-r--r-- | init/builtins.c | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/init/builtins.c b/init/builtins.c index e2932d5..b32981e 100644 --- a/init/builtins.c +++ b/init/builtins.c @@ -33,7 +33,6 @@ #include <linux/loop.h> #include <cutils/partition_utils.h> #include <cutils/android_reboot.h> -#include <sys/system_properties.h> #include <fs_mgr.h> #include <selinux/selinux.h> @@ -196,6 +195,8 @@ static void service_start_if_not_disabled(struct service *svc) { if (!(svc->flags & SVC_DISABLED)) { service_start(svc, NULL); + } else { + svc->flags |= SVC_DISABLED_START; } } @@ -238,6 +239,21 @@ int do_domainname(int nargs, char **args) return write_file("/proc/sys/kernel/domainname", args[1]); } +int do_enable(int nargs, char **args) +{ + struct service *svc; + svc = service_find_by_name(args[1]); + if (svc) { + svc->flags &= ~(SVC_DISABLED | SVC_RC_DISABLED); + if (svc->flags & SVC_DISABLED_START) { + service_start(svc, NULL); + } + } else { + return -1; + } + return 0; +} + int do_exec(int nargs, char **args) { return -1; @@ -846,11 +862,24 @@ int do_setsebool(int nargs, char **args) { } int do_loglevel(int nargs, char **args) { - if (nargs == 2) { - klog_set_level(atoi(args[1])); - return 0; + int log_level; + char log_level_str[PROP_VALUE_MAX] = ""; + if (nargs != 2) { + ERROR("loglevel: missing argument\n"); + return -EINVAL; } - return -1; + + if (expand_props(log_level_str, args[1], sizeof(log_level_str))) { + ERROR("loglevel: cannot expand '%s'\n", args[1]); + return -EINVAL; + } + log_level = atoi(log_level_str); + if (log_level < KLOG_ERROR_LEVEL || log_level > KLOG_DEBUG_LEVEL) { + ERROR("loglevel: invalid log level'%d'\n", log_level); + return -EINVAL; + } + klog_set_level(log_level); + return 0; } int do_load_persist_props(int nargs, char **args) { @@ -861,6 +890,14 @@ int do_load_persist_props(int nargs, char **args) { return -1; } +int do_load_all_props(int nargs, char **args) { + if (nargs == 1) { + load_all_props(); + return 0; + } + return -1; +} + int do_wait(int nargs, char **args) { if (nargs == 2) { |