author | Tanguy Pruvot <tanguy.pruvot@gmail.com> | 2011-08-28 20:42:01 (GMT) |
---|---|---|
committer | Tanguy Pruvot <tanguy.pruvot@gmail.com> | 2011-08-28 20:42:01 (GMT) |
commit | d0b802581eb4f83e81b652f0b59b8b9b98105e66 (patch) | |
tree | 94da0de5e47612a1b7329496fbcd898418dc8479 | |
parent | 87b92a797bc393a3f42cc0541e66eb599d764522 (diff) | |
download | busybox-d0b802581eb4f83e81b652f0b59b8b9b98105e66.zip busybox-d0b802581eb4f83e81b652f0b59b8b9b98105e66.tar.gz busybox-d0b802581eb4f83e81b652f0b59b8b9b98105e66.tar.bz2 |
use system libreboot in busybox full
-rw-r--r-- | Android.mk | 5 | ||||
-rw-r--r-- | init/halt.c | 27 |
2 files changed, 23 insertions, 9 deletions
@@ -11,8 +11,6 @@ LOCAL_C_INCLUDES := \ external/clearsilver/util/regex include $(BUILD_STATIC_LIBRARY) - - # Execute make clean, make prepare and copy profiles required for normal & static busybox (recovery) include $(CLEAR_VARS) @@ -28,6 +26,7 @@ $(BUSYBOX_CONFIG): cp $(LOCAL_PATH)/include/*.h $(LOCAL_PATH)/include-$@/ @rm $(LOCAL_PATH)/include/usage_compressed.h @rm -f $(LOCAL_PATH)/.config-old + @cp $(ANDROID_BUILD_TOP)/system/core/toolbox/reboot.c $(LOCAL_PATH)/android/reboot.c busybox_prepare: $(BUSYBOX_CONFIG) LOCAL_MODULE := busybox_prepare @@ -107,6 +106,8 @@ LOCAL_MODULE := busybox LOCAL_MODULE_TAGS := eng LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) LOCAL_STATIC_LIBRARIES += busybox_prepare libclearsilverregex +LOCAL_STATIC_LIBRARIES += libreboot +LOCAL_CFLAGS += -DCYANOGEN_LIBREBOOT include $(BUILD_EXECUTABLE) BUSYBOX_LINKS := $(shell cat $(LOCAL_PATH)/busybox-$(BUSYBOX_CONFIG).links) diff --git a/init/halt.c b/init/halt.c index 7c92d5e..7f1bebb 100644 --- a/init/halt.c +++ b/init/halt.c @@ -135,15 +135,28 @@ int halt_main(int argc UNUSED_PARAM, char **argv) sync(); #ifdef __BIONIC__ - char *mode[3]; - mode[0] = argv[0]; - mode[1] = mode[2] = NULL; - if (which == 0) { + char *mode[4]; + int c = 1; + mode[0] = strdup("reboot"); + mode[1] = mode[2] = mode[3] = NULL; + switch (which) { + case 0: + case 1: //-p for halt - mode[1] = "-p"; - argc=2; + mode[1] = strdup("-p"); + c=2; + break; + case 2: + //reboot + #ifdef CYANOGEN_LIBREBOOT + if (argc > 1) { + mode[1] = strdup(argv[1]); + c = 2; + } + #endif + break; } - return reboot_main(argc, mode); + return reboot_main(c, mode); #endif /* Perform action. */ |