Re: hidden string Kconfig ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 15, 2018 at 07:44:53PM +0100, Ulf Magnusson wrote:
> I'd go for the more manual version though. I wonder if this is
> significant/common enough to warrant a Kconfig feature, and it can be
> handled in other ways.


Here is something I came up with a couple weeks ago. It greps the config for an
option, then if it exists it will print something. I added coloring to allow me
to make the message red. I could formalize this more, and it might be useful for
other message people may want to print.


diff --git a/init/Kconfig b/init/Kconfig
index b59e856511e1..70fad5e142e5 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1842,6 +1842,14 @@ config CMDLINE_OVERRIDE
 	  This is used to work around broken boot loaders.  This should
 	  be set to 'N' under normal conditions.
 
+# If you have the old style CONFIG_CMDLINE inside your config you will lose these options
+# This serves as a warning to let you know that you are losing these options.
+m1 := 
You appear to have the legacy option CONFIG_CMDLINE in your config.
+m2 := Be aware this option will be removed, and you will lose the contents
+m3 := unless you move to the new CONFIG_CMDLINE_PREPEND, CONFIG_CMDLINE_APPEND
+m4 := options.
+$(warning-if,$(success, grep -e "CONFIG_CMDLINE=\".\+\"" $(PWD)/$(O)/$(KCONFIG_CONFIG)), $(red, $(m1)$(m2)$(m3)$(m4)))
+
 endif
 
 endmenu		# General setup
diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include
index dad5583451af..7de7505388b7 100644
--- a/scripts/Kconfig.include
+++ b/scripts/Kconfig.include
@@ -28,3 +28,22 @@ ld-option = $(success,$(LD) -v $(1))
 
 # gcc version including patch level
 gcc-version := $(shell,$(srctree)/scripts/gcc-version.sh -p $(CC) | sed 's/^0*//')
+
+# Color sequences
+red        = $(1)
+black      = $(1)
+green      = $(1)
+yellow     = $(1)
+blue       = $(1)
+magenta    = $(1)
+cyan       = $(1)
+white      = $(1)
+default    = $(1)
+
+# Text properties
+bold        = $(1)
+#bold 		= $(1)
+underlined 	= $(1)
+blinking 	= $(1)
+reset 		= $(1)
+




[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux