Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e11087f authored by Marcin Chojnacki's avatar Marcin Chojnacki Committed by Gerrit Code Review
Browse files

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
parent dfe600ec
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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),)
+12 −0
Original line number Diff line number Diff line
@@ -46,6 +46,10 @@

#include <sys/system_properties.h>

#ifndef INITLOGO
#include <linux/kd.h>
#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;
}

+2 −0
Original line number Diff line number Diff line
@@ -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;
+0 −2
Original line number Diff line number Diff line
@@ -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: