From 0e11087f61c4cc678f69722e7293dcfbf0f1db8a Mon Sep 17 00:00:00 2001 From: Marcin Chojnacki Date: Fri, 13 Sep 2013 17:01:45 +0200 Subject: [PATCH] init: Do not build logo.c when initlogo is disabled For now, logo.c was build even if TARGET_NO_INITLOGO was true. Changing tty to KD_GRAPHICS is now done in init.c as it should be, when the logo is not present. Change-Id: Ifabd9aebc9c0ad8d6903e963dfac031a6dac32e1 --- init/Android.mk | 6 +++--- init/init.c | 12 ++++++++++++ init/init.h | 2 ++ init/logo.c | 2 -- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/init/Android.mk b/init/Android.mk index 135c0157cf0..f3bb7d6fb82 100644 --- a/init/Android.mk +++ b/init/Android.mk @@ -10,7 +10,6 @@ LOCAL_SRC_FILES:= \ property_service.c \ util.c \ parser.c \ - logo.c \ keychords.c \ signal_handler.c \ init_parser.c \ @@ -27,8 +26,9 @@ ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) LOCAL_CFLAGS += -DALLOW_LOCAL_PROP_OVERRIDE=1 endif -ifeq ($(TARGET_NO_INITLOGO),true) -LOCAL_CFLAGS += -DNO_INITLOGO +ifneq ($(TARGET_NO_INITLOGO),true) +LOCAL_SRC_FILES += logo.c +LOCAL_CFLAGS += -DINITLOGO endif ifneq ($(TARGET_NR_SVC_SUPP_GIDS),) diff --git a/init/init.c b/init/init.c index 901c531653b..405d9540401 100755 --- a/init/init.c +++ b/init/init.c @@ -46,6 +46,10 @@ #include +#ifndef INITLOGO +#include +#endif + #include "devices.h" #include "init.h" #include "log.h" @@ -650,6 +654,7 @@ static int console_init_action(int nargs, char **args) have_console = 1; close(fd); +#ifdef INITLOGO if( load_565rle_image(INIT_IMAGE_FILE) ) { fd = open("/dev/tty0", O_WRONLY); if (fd >= 0) { @@ -673,6 +678,13 @@ static int console_init_action(int nargs, char **args) close(fd); } } +#else + fd = open("/dev/tty0", O_RDWR | O_SYNC); + if (fd >= 0) { + ioctl(fd, KDSETMODE, KD_GRAPHICS); + close(fd); + } +#endif return 0; } diff --git a/init/init.h b/init/init.h index 3abcf2b6875..9a3aec5d29b 100644 --- a/init/init.h +++ b/init/init.h @@ -133,9 +133,11 @@ void service_reset(struct service *svc); void service_start(struct service *svc, const char *dynamic_args); void property_changed(const char *name, const char *value); +#ifdef INITLOGO #define INIT_IMAGE_FILE "/initlogo.rle" int load_565rle_image( char *file_name ); +#endif extern struct selabel_handle *sehandle; extern struct selabel_handle *sehandle_prop; diff --git a/init/logo.c b/init/logo.c index 1b12f330561..614224c461a 100644 --- a/init/logo.c +++ b/init/logo.c @@ -113,7 +113,6 @@ int load_565rle_image(char *fn) if (vt_set_mode(1)) return -1; -#ifndef NO_INITLOGO fd = open(fn, O_RDONLY); if (fd < 0) { ERROR("cannot open '%s'\n", fn); @@ -151,7 +150,6 @@ int load_565rle_image(char *fn) fb_close(&fb); close(fd); unlink(fn); -#endif return 0; fail_unmap_data: