diff options
author | Szymon Starzycki <sstar@google.com> | 2013-09-18 16:12:43 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2013-12-04 15:00:52 -0800 |
commit | 27ea99fb99153e3b2d45efd6fce9785538469e49 (patch) | |
tree | 79abb54c628ba63aae5b7c9ac6554c11fbc7b423 /fastbootd | |
parent | bc849f14533a4a1fad676d31d0353909fa9d94be (diff) | |
download | system_core-27ea99fb99153e3b2d45efd6fce9785538469e49.zip system_core-27ea99fb99153e3b2d45efd6fce9785538469e49.tar.gz system_core-27ea99fb99153e3b2d45efd6fce9785538469e49.tar.bz2 |
Fastbootd: auto ssh server start
Change-Id: I3e9c53c3d834726c3747e9ee0665ed027f55b08c
Diffstat (limited to 'fastbootd')
-rw-r--r-- | fastbootd/fastbootd.c | 2 | ||||
-rw-r--r-- | fastbootd/other/gptedit.c | 3 | ||||
-rw-r--r-- | fastbootd/utils.c | 6 | ||||
-rw-r--r-- | fastbootd/utils.h | 1 |
4 files changed, 8 insertions, 4 deletions
diff --git a/fastbootd/fastbootd.c b/fastbootd/fastbootd.c index 66f5fca..085cbfa 100644 --- a/fastbootd/fastbootd.c +++ b/fastbootd/fastbootd.c @@ -31,6 +31,7 @@ void usb_init(); void config_init(); int transport_socket_init(); int network_discovery_init(); +void ssh_server_start(); int main(int argc, char **argv) { @@ -77,6 +78,7 @@ int main(int argc, char **argv) usb_init(); if (!transport_socket_init()) exit(1); + ssh_server_start(); network_discovery_init(); while (1) { sleep(1); diff --git a/fastbootd/other/gptedit.c b/fastbootd/other/gptedit.c index 020b8ce..16d34a5 100644 --- a/fastbootd/other/gptedit.c +++ b/fastbootd/other/gptedit.c @@ -154,9 +154,6 @@ int main(int argc, char *argv[]) { return 1; } - fprintf(stderr, "entries %d, name %s\n", table->header->entries_count, (char *) table->header->signature); - - if (add_cmd) addGPT(table, new_partition, partition_guid, type_guid); if (del_cmd) diff --git a/fastbootd/utils.c b/fastbootd/utils.c index 22f5775..fe3f0f8 100644 --- a/fastbootd/utils.c +++ b/fastbootd/utils.c @@ -233,7 +233,7 @@ int service_start(const char *service_name) property_get(service_name, property_value, ""); if (strcmp("running", property_value) != 0) { - D(INFO, "Starting MDNSD"); + D(INFO, "Starting %s", service_name); property_set("ctl.start", service_name); if (wait_for_property(service_name, "running", 5)) result = -1; @@ -254,3 +254,7 @@ int service_stop(const char *service_name) return result; } +int ssh_server_start() +{ + return service_start("sshd"); +} diff --git a/fastbootd/utils.h b/fastbootd/utils.h index 40c17c1..3d98699 100644 --- a/fastbootd/utils.h +++ b/fastbootd/utils.h @@ -47,6 +47,7 @@ ssize_t bulk_read(int bulk_out, char *buf, size_t length); ssize_t bulk_write(int bulk_in, const char *buf, size_t length); int service_start(const char *service_name); int service_stop(const char *service_name); +int ssh_server_start(); #define ROUND_TO_PAGE(address,pagesize) ((address + pagesize - 1) & (~(pagesize - 1))) |