]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[build] Canonicalise console type configuration
authorMichael Brown <mcb30@ipxe.org>
Fri, 16 Jan 2026 16:52:40 +0000 (16:52 +0000)
committerMichael Brown <mcb30@ipxe.org>
Fri, 16 Jan 2026 17:26:32 +0000 (17:26 +0000)
Move all console configuration from config/defaults/<platform>.h to
the top-level config/console.h, using indented conditional blocks to
clarify which console types are supported and enabled on each
platform.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/config/console.h
src/config/defaults/efi.h
src/config/defaults/linux.h
src/config/defaults/pcbios.h
src/config/defaults/sbi.h

index 028021fa290227f7e5f61e6823af643a97bd039f..40a325896530a8776cbf774d32fc2ffdddf650e2 100644 (file)
@@ -15,53 +15,77 @@ FILE_SECBOOT ( PERMITTED );
 
 #include <config/defaults.h>
 
-/*
- * Default console types
+/*****************************************************************************
  *
- * These are all enabled by default for the appropriate platforms.
- * You may disable them if needed.
+ * Console types
  *
  */
 
-//#undef       CONSOLE_PCBIOS          /* Default BIOS console */
-//#undef       CONSOLE_EFI             /* Default EFI console */
-//#undef       CONSOLE_LINUX           /* Default Linux console */
+/* Console types supported on all platforms */
+//#define CONSOLE_FRAMEBUFFER  /* Graphical framebuffer console */
+//#define CONSOLE_SYSLOG       /* Syslog console */
+//#define CONSOLE_SYSLOGS      /* Encrypted syslog console */
 
-/*
- * Additional console types
- *
- * These are not enabled by default, but may be useful in your
- * environment.
- *
- */
+/* Console types supported only on systems with serial ports */
+#if ! defined ( SERIAL_NULL )
+  //#define CONSOLE_SERIAL     /* Serial port console */
+#endif
+
+/* Console types supported only on BIOS platforms */
+#if defined ( PLATFORM_pcbios )
+  //#define CONSOLE_INT13      /* INT13 disk log console */
+  #define CONSOLE_PCBIOS       /* Default BIOS console */
+#endif
+
+/* Console types supported only on EFI platforms */
+#if defined ( PLATFORM_efi )
+  #define CONSOLE_EFI          /* Default EFI console */
+#endif
+
+/* Console types supported only on RISC-V SBI platforms */
+#if defined ( PLATFORM_sbi )
+  #define CONSOLE_SBI          /* RISC-V SBI debug console */
+#endif
+
+/* Console types supported only on Linux platforms */
+#if defined ( PLATFORM_linux )
+  #define CONSOLE_LINUX                /* Default Linux console */
+#endif
 
-//#define      CONSOLE_SERIAL          /* Serial port console */
-//#define      CONSOLE_FRAMEBUFFER     /* Graphical framebuffer console */
-//#define      CONSOLE_SYSLOG          /* Syslog console */
-//#define      CONSOLE_SYSLOGS         /* Encrypted syslog console */
-//#define      CONSOLE_VMWARE          /* VMware logfile console */
-//#define      CONSOLE_DEBUGCON        /* Bochs/QEMU/KVM debug port console */
-//#define      CONSOLE_INT13           /* INT13 disk log console */
-//#define      CONSOLE_SBI             /* RISC-V SBI debug console */
-
-/*
- * Very obscure console types
+/* Console types supported only on x86 CPUs */
+#if defined ( __i386__ ) || defined ( __x86_64__ )
+  //#define CONSOLE_DEBUGCON   /* Bochs/QEMU/KVM debug port console */
+  //#define CONSOLE_DIRECT_VGA /* Direct access to VGA card */
+  //#define CONSOLE_PC_KBD     /* Direct access to PC keyboard */
+  //#define CONSOLE_VMWARE     /* VMware logfile console */
+#endif
+
+/* Enable serial console on platforms that are typically headless */
+#if defined ( CONSOLE_SBI )
+  #define CONSOLE_SERIAL
+#endif
+
+/*****************************************************************************
  *
- * You almost certainly do not need to enable these.
+ * Keyboard maps
+ *
+ * See hci/keymap/keymap_*.c for available keyboard maps.
  *
  */
 
-//#define      CONSOLE_DIRECT_VGA      /* Direct access to VGA card */
-//#define      CONSOLE_PC_KBD          /* Direct access to PC keyboard */
-
-/* Keyboard map (available maps in hci/keymap/) */
-#define        KEYBOARD_MAP    us
+#define KEYBOARD_MAP   us      /* Default US keyboard map */
+//#define KEYBOARD_MAP dynamic /* Runtime selectable keyboard map */
 
-/* Control which syslog() messages are generated.
+/*****************************************************************************
+ *
+ * Log levels
+ *
+ * Control which syslog() messages are generated.  Note that this is
+ * not related in any way to CONSOLE_SYSLOG.
  *
- * Note that this is not related in any way to CONSOLE_SYSLOG.
  */
-#define        LOG_LEVEL       LOG_NONE
+
+#define LOG_LEVEL      LOG_NONE
 
 #include <config/named.h>
 #include NAMED_CONFIG(console.h)
index e16c51c2736510d301f979f5b6bf213c1c6e2c06..baacae4f95eba9c315cb69a9d415ef59c0f44a39 100644 (file)
@@ -14,7 +14,6 @@ FILE_SECBOOT ( PERMITTED );
 #define IOMAP_VIRT
 #define PCIAPI_EFI
 #define DMAAPI_OP
-#define CONSOLE_EFI
 #define TIMER_EFI
 #define UMALLOC_EFI
 #define MEMMAP_NULL
index b632793817601472966faf9e7fb272030f8ae294..9d8b217d37593f91271a1d2b8c2de5f02b6dfd3d 100644 (file)
@@ -9,7 +9,6 @@
 
 FILE_LICENCE ( GPL2_OR_LATER );
 
-#define CONSOLE_LINUX
 #define TIMER_LINUX
 #define UACCESS_LINUX
 #define UMALLOC_LINUX
index 6fb2ab0e9312d38bba530b135d101263a7a899dd..c4d3f7527f96f2fa3e052e890748066158ab7a56 100644 (file)
@@ -14,7 +14,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 #define PCIAPI_PCBIOS
 #define DMAAPI_FLAT
 #define TIMER_PCBIOS
-#define CONSOLE_PCBIOS
 #define NAP_PCBIOS
 #define UMALLOC_UHEAP
 #define MEMMAP_INT15
index fa995ddbad7e8bfc2faadd996db350161868640e..f9361c926363c504ea0fa5e84274ec031d7b3024 100644 (file)
@@ -23,8 +23,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 #endif
 
 #define FDT_SBI
-#define CONSOLE_SBI
-#define CONSOLE_SERIAL
 #define REBOOT_SBI
 #define UMALLOC_UHEAP
 #define MEMMAP_FDT