[SeaBIOS] [PATCH v2 3/3] enable_vga_console(): print machine UUID under seabios version message

Laszlo Ersek lersek at redhat.com
Tue Dec 11 17:16:40 CET 2012


There are users who would like to see the UUID at startup, and it probably
won't bother others.

Related RHBZ: 876250.

Signed-off-by: Laszlo Ersek <lersek at redhat.com>
---
 src/bootsplash.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/src/bootsplash.c b/src/bootsplash.c
index 78023a5..a0fea61 100644
--- a/src/bootsplash.c
+++ b/src/bootsplash.c
@@ -12,6 +12,7 @@
 #include "jpeg.h" // splash
 #include "vbe.h" // struct vbe_info
 #include "bmp.h" // bmp_alloc
+#include "smbios.h" // smbios_locate_uuid
 
 
 /****************************************************************
@@ -33,6 +34,24 @@ call16_int10(struct bregs *br)
  * VGA text / graphics console
  ****************************************************************/
 
+static void
+print_hello(void)
+{
+    const u8 *uuid;
+    u8 empty_uuid[16] = { 0 };
+
+    printf("SeaBIOS (version %s)\n", VERSION);
+
+    uuid = smbios_locate_uuid(SMBiosAddr);
+    if (uuid != NULL && memcmp(uuid, empty_uuid, sizeof empty_uuid) != 0) {
+        char uuid_str[37];
+
+        format_uuid(uuid_str, uuid);
+        printf("Machine UUID %s\n", uuid_str);
+    }
+    printf("\n");
+}
+
 void
 enable_vga_console(void)
 {
@@ -45,7 +64,7 @@ enable_vga_console(void)
     call16_int10(&br);
 
     // Write to screen.
-    printf("SeaBIOS (version %s)\n\n", VERSION);
+    print_hello();
 }
 
 static int
-- 
1.7.1




More information about the SeaBIOS mailing list