summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-05-06 12:33:47 +0300
committerToomas Soome <tsoome@me.com>2019-05-20 16:00:53 +0300
commit3c562093c61e10c25f10f97c2985f09afd11223f (patch)
tree81a97a324acaf565524660c5cb9c4c5f7518cdf8
parentac2bf314e776a9dcb4faf4d3f88408ed942f0fae (diff)
downloadillumos-joyent-3c562093c61e10c25f10f97c2985f09afd11223f.tar.gz
10919 add DEFAULT_CONSOLE_COLOR build environment knob
Reviewed by: Andy Fiddaman <andy@omniosce.org> Reviewed by: Alexander Pyhalov <apyhalov@gmail.com> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/Makefile.master4
-rw-r--r--usr/src/boot/sys/boot/efi/libefi/Makefile.com1
-rw-r--r--usr/src/boot/sys/boot/efi/loader/Makefile.com2
-rw-r--r--usr/src/boot/sys/boot/i386/libi386/Makefile1
-rw-r--r--usr/src/boot/sys/boot/i386/loader/Makefile2
-rw-r--r--usr/src/boot/sys/sys/tem_impl.h2
-rw-r--r--usr/src/tools/env/illumos.sh13
-rw-r--r--usr/src/tools/scripts/bldenv.sh8
-rw-r--r--usr/src/tools/scripts/nightly.sh7
9 files changed, 40 insertions, 0 deletions
diff --git a/usr/src/Makefile.master b/usr/src/Makefile.master
index 01d9b57d06..fc7b94f315 100644
--- a/usr/src/Makefile.master
+++ b/usr/src/Makefile.master
@@ -223,6 +223,10 @@ ZIC= $(ONBLD_TOOLS)/bin/$(MACH)/zic
OPENSSL= /usr/bin/openssl
CPCGEN= $(ONBLD_TOOLS)/bin/$(MACH)/cpcgen
+DEFAULT_CONSOLE_COLOR= \
+ -DDEFAULT_ANSI_FOREGROUND=ANSI_COLOR_WHITE \
+ -DDEFAULT_ANSI_BACKGROUND=ANSI_COLOR_BLACK
+
FILEMODE= 644
DIRMODE= 755
diff --git a/usr/src/boot/sys/boot/efi/libefi/Makefile.com b/usr/src/boot/sys/boot/efi/libefi/Makefile.com
index 5345c31643..3e0219aa9a 100644
--- a/usr/src/boot/sys/boot/efi/libefi/Makefile.com
+++ b/usr/src/boot/sys/boot/efi/libefi/Makefile.com
@@ -47,6 +47,7 @@ CPPFLAGS += -I../../../../../lib/libstand
CPPFLAGS += -I$(ZFSSRC)
CPPFLAGS += -I../../../../cddl/boot/zfs
+gfx_fb.o := CPPFLAGS += $(DEFAULT_CONSOLE_COLOR)
pnglite.o := CPPFLAGS += -I$(ZLIB)
gfx_fb.o pnglite.o efi_console.o := CPPFLAGS += -I$(PNGLITE)
diff --git a/usr/src/boot/sys/boot/efi/loader/Makefile.com b/usr/src/boot/sys/boot/efi/loader/Makefile.com
index c7e1ccd62d..41fb776314 100644
--- a/usr/src/boot/sys/boot/efi/loader/Makefile.com
+++ b/usr/src/boot/sys/boot/efi/loader/Makefile.com
@@ -60,6 +60,8 @@ OBJS= \
tem.o \
vers.o
+tem.o := CPPFLAGS += $(DEFAULT_CONSOLE_COLOR)
+
CPPFLAGS += -I../../../../../include -I../../..../
CPPFLAGS += -I../../../../../lib/libstand
diff --git a/usr/src/boot/sys/boot/i386/libi386/Makefile b/usr/src/boot/sys/boot/i386/libi386/Makefile
index dc604cdf4b..35b98290aa 100644
--- a/usr/src/boot/sys/boot/i386/libi386/Makefile
+++ b/usr/src/boot/sys/boot/i386/libi386/Makefile
@@ -98,6 +98,7 @@ CPPFLAGS += -I$(PNGLITE)
SRCS += $(COMMON)/gfx_fb.c $(PNGLITE)/pnglite.c
OBJS += gfx_fb.o pnglite.o
+gfx_fb.o := CPPFLAGS += $(DEFAULT_CONSOLE_COLOR)
pnglite.o := CPPFLAGS += -I$(ZLIB)
SRCS += $(ZFSSRC)/devicename_stubs.c
diff --git a/usr/src/boot/sys/boot/i386/loader/Makefile b/usr/src/boot/sys/boot/i386/loader/Makefile
index e41fab4189..2ef0849bb1 100644
--- a/usr/src/boot/sys/boot/i386/loader/Makefile
+++ b/usr/src/boot/sys/boot/i386/loader/Makefile
@@ -60,6 +60,8 @@ SRCS += module.c linenoise.c multiboot2.c
SRCS += zfs_cmd.c
SRCS += font.c $(FONT).c list.c tem.c
+tem.o := CPPFLAGS += $(DEFAULT_CONSOLE_COLOR)
+
SRCS += load_elf32.c load_elf32_obj.c reloc_elf32.c
SRCS += load_elf64.c load_elf64_obj.c reloc_elf64.c
diff --git a/usr/src/boot/sys/sys/tem_impl.h b/usr/src/boot/sys/sys/tem_impl.h
index f3e1fd2239..d942aecdeb 100644
--- a/usr/src/boot/sys/sys/tem_impl.h
+++ b/usr/src/boot/sys/sys/tem_impl.h
@@ -120,8 +120,10 @@ typedef uint32_t tem_char_t; /* 32bit char to support UTF-8 */
* Default foreground/background color
*/
+#if !defined(DEFAULT_ANSI_FOREGROUND) && !defined(DEFAULT_ANSI_BACKGROUND)
#define DEFAULT_ANSI_FOREGROUND ANSI_COLOR_BLACK
#define DEFAULT_ANSI_BACKGROUND ANSI_COLOR_WHITE
+#endif
#define BUF_LEN 160 /* Two lines of data can be processed at a time */
diff --git a/usr/src/tools/env/illumos.sh b/usr/src/tools/env/illumos.sh
index 2be99e29e7..0c89ce3479 100644
--- a/usr/src/tools/env/illumos.sh
+++ b/usr/src/tools/env/illumos.sh
@@ -109,6 +109,19 @@ export ENABLE_SMB_PRINTING=
#export BUILDPY2='#'
#export BUILDPY3='#'
+# Set console color scheme either by build type:
+#
+#export RELEASE_CONSOLE_COLOR="-DDEFAULT_ANSI_FOREGROUND=ANSI_COLOR_BLACK \
+# -DDEFAULT_ANSI_BACKGROUND=ANSI_COLOR_WHITE"
+#
+#export DEBUG_CONSOLE_COLOR="-DDEFAULT_ANSI_FOREGROUND=ANSI_COLOR_RED \
+# -DDEFAULT_ANSI_BACKGROUND=ANSI_COLOR_WHITE"
+#
+# or just one for any build type:
+#
+#export DEFAULT_CONSOLE_COLOR="-DDEFAULT_ANSI_FOREGROUND=ANSI_COLOR_BLACK \
+# -DDEFAULT_ANSI_BACKGROUND=ANSI_COLOR_WHITE"
+
# Set if your distribution has different package versioning
#export PKGVERS_BRANCH=2018.0.0.17900
diff --git a/usr/src/tools/scripts/bldenv.sh b/usr/src/tools/scripts/bldenv.sh
index 4bcdea4964..43c5c56392 100644
--- a/usr/src/tools/scripts/bldenv.sh
+++ b/usr/src/tools/scripts/bldenv.sh
@@ -267,6 +267,10 @@ if ${flags.d} ; then
unset RELEASE_BUILD
unset EXTRA_OPTIONS
unset EXTRA_CFLAGS
+
+ if [ -n "$DEBUG_CONSOLE_COLOR" ]; then
+ export DEFAULT_CONSOLE_COLOR="$DEBUG_CONSOLE_COLOR"
+ fi
else
# default is a non-DEBUG build
print 'non-DEBUG'
@@ -274,6 +278,10 @@ else
export RELEASE_BUILD=
unset EXTRA_OPTIONS
unset EXTRA_CFLAGS
+
+ if [ -n "$RELEASE_CONSOLE_COLOR" ]; then
+ export DEFAULT_CONSOLE_COLOR="$RELEASE_CONSOLE_COLOR"
+ fi
fi
# update build-type variables
diff --git a/usr/src/tools/scripts/nightly.sh b/usr/src/tools/scripts/nightly.sh
index f650b5c94d..2ca5caff8c 100644
--- a/usr/src/tools/scripts/nightly.sh
+++ b/usr/src/tools/scripts/nightly.sh
@@ -541,12 +541,19 @@ function set_non_debug_build_flags {
export RELEASE_BUILD ; RELEASE_BUILD=
unset EXTRA_OPTIONS
unset EXTRA_CFLAGS
+ if [ -n "$RELEASE_CONSOLE_COLOR" ]; then
+ export DEFAULT_CONSOLE_COLOR="$RELEASE_CONSOLE_COLOR"
+ fi
}
function set_debug_build_flags {
unset RELEASE_BUILD
unset EXTRA_OPTIONS
unset EXTRA_CFLAGS
+
+ if [ -n "$DEBUG_CONSOLE_COLOR" ]; then
+ export DEFAULT_CONSOLE_COLOR="$DEBUG_CONSOLE_COLOR"
+ fi
}