Jelajahi Sumber

rework VGA and serial output

The Linux kernel can output messages to serial devices and
vga devices in parallel. The latest console= entry decides which
console output is used for init via /dev/console character device.

Let the developer configure what he wants. If you use f.e. Kodi,
be sure output/input is used for VGA, other wise kodi startsup,
but you end up with a black screen.
Waldemar Brodkorb 9 tahun lalu
induk
melakukan
5dce6450cf
2 mengubah file dengan 49 tambahan dan 6 penghapusan
  1. 12 4
      target/Makefile
  2. 37 2
      target/config/Config.in.runtime

+ 12 - 4
target/Makefile

@@ -36,12 +36,20 @@ config-prepare: $(ADK_TOPDIR)/.config
 		echo "no miniconfig found for target system"; \
 		exit 1; \
 	fi
-ifneq ($(ADK_RUNTIME_CONSOLE_SERIAL_DEVICE),)
+ifeq ($(ADK_RUNTIME_VERBOSE_KERNEL_VGA_ONLY),y)
+	$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 console=$(ADK_RUNTIME_CONSOLE_VGA_DEVICE) consoleblank=0"#' \
+		$(BUILD_DIR)/.kernelconfig.board
+endif
+ifeq ($(ADK_RUNTIME_VERBOSE_KERNEL_SERIAL_ONLY),y)
 	$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 console=$(ADK_RUNTIME_CONSOLE_SERIAL_DEVICE),$(ADK_RUNTIME_CONSOLE_SERIAL_SPEED)"#' \
 		$(BUILD_DIR)/.kernelconfig.board
 endif
-ifneq ($(ADK_RUNTIME_CONSOLE_VGA_DEVICE),)
-	$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 console=$(ADK_RUNTIME_CONSOLE_VGA_DEVICE)" consoleblank=0#' \
+ifeq ($(ADK_RUNTIME_VERBOSE_KERNEL_VGA_SERIAL),y)
+	$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 console=$(ADK_RUNTIME_CONSOLE_VGA_DEVICE) consoleblank=0 console=$(ADK_RUNTIME_CONSOLE_SERIAL_DEVICE),$(ADK_RUNTIME_CONSOLE_SERIAL_SPEED)"#' \
+		$(BUILD_DIR)/.kernelconfig.board
+endif
+ifeq ($(ADK_RUNTIME_VERBOSE_KERNEL_SERIAL_VGA),y)
+	$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 console=$(ADK_RUNTIME_CONSOLE_SERIAL_DEVICE),$(ADK_RUNTIME_CONSOLE_SERIAL_SPEED) console=$(ADK_RUNTIME_CONSOLE_VGA_DEVICE) consoleblank=0"#' \
 		$(BUILD_DIR)/.kernelconfig.board
 endif
 ifeq ($(ADK_TARGET_SYSTEM_QEMU_M68K),y)
@@ -70,7 +78,7 @@ ifeq ($(ADK_RUNTIME_QUIET_INIT),y)
 	@$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 rcquiet=1"#' \
 		$(BUILD_DIR)/.kernelconfig.board
 endif
-ifeq ($(ADK_QUIET_KERNEL),y)
+ifeq ($(ADK_RUNTIME_QUIET_KERNEL),y)
 	@$(SED) 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 quiet loglevel=2 vt.global_cursor_default=0"#' \
 		$(BUILD_DIR)/.kernelconfig.board
 endif

+ 37 - 2
target/config/Config.in.runtime

@@ -50,11 +50,40 @@ config ADK_RUNTIME_TIMEZONE
 	help
 	  Predefine the timezone for the embedded system.
 
-config ADK_QUIET_KERNEL
-	bool "make bootup quiet without messages from the kernel"
+choice
+prompt "bootup messages from kernel"
+
+config ADK_RUNTIME_VERBOSE_KERNEL_VGA_ONLY
+	bool "output via VGA only"
+	depends on ADK_TARGET_WITH_VGA
+
+config ADK_RUNTIME_VERBOSE_KERNEL_SERIAL_ONLY
+	bool "output via serial console only"
+	depends on ADK_TARGET_WITH_SERIAL
+
+config ADK_RUNTIME_VERBOSE_KERNEL_VGA_SERIAL
+	bool "output via VGA and serial console"
+	depends on ADK_TARGET_WITH_SERIAL && \
+		   ADK_TARGET_WITH_VGA
+	help
+	  Output is via VGA and serial console. 
+	  Init can use only serial via /dev/console.
+
+config ADK_RUNTIME_VERBOSE_KERNEL_SERIAL_VGA
+	bool "output via serial console and VGA"
+	depends on ADK_TARGET_WITH_SERIAL && \
+		   ADK_TARGET_WITH_VGA
+	help
+	  Output is via serial console and VGA. 
+	  Init can use only VGA via /dev/console.
+
+config ADK_RUNTIME_QUIET_KERNEL
+	bool "no output from the kernel"
 	help
 	  Make bootup quiet without messages from the kernel.
 
+endchoice
+
 choice
 prompt "bootup messages from initscripts"
 default ADK_RUNTIME_VERBOSE_INIT_VGA if ADK_TARGET_WITH_VGA
@@ -63,10 +92,16 @@ default ADK_RUNTIME_VERBOSE_INIT_SERIAL
 config ADK_RUNTIME_VERBOSE_INIT_VGA
 	bool "output via VGA"
 	depends on ADK_TARGET_WITH_VGA
+	depends on ADK_RUNTIME_VERBOSE_KERNEL_SERIAL_VGA || \
+		   ADK_RUNTIME_VERBOSE_KERNEL_SERIAL_ONLY || \
+		   ADK_RUNTIME_QUIET_KERNEL
 
 config ADK_RUNTIME_VERBOSE_INIT_SERIAL
 	bool "output via serial"
 	depends on ADK_TARGET_WITH_SERIAL
+	depends on ADK_RUNTIME_VERBOSE_KERNEL_VGA_SERIAL || \
+		   ADK_RUNTIME_VERBOSE_KERNEL_SERIAL_ONLY || \
+		   ADK_RUNTIME_QUIET_KERNEL
 
 config ADK_RUNTIME_QUIET_INIT
 	bool "no output"