[syslinux:master] mboot: set boot loader name

syslinux-bot for H. Peter Anvin hpa at zytor.com
Mon Mar 29 13:27:31 PDT 2010


Commit-ID:  d474e4fc651971f13a21cd73bd7768c8be352456
Gitweb:     http://syslinux.zytor.com/commit/d474e4fc651971f13a21cd73bd7768c8be352456
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Mon, 29 Mar 2010 13:22:45 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Mon, 29 Mar 2010 13:22:45 -0700

mboot: set boot loader name

Set the boot loader name based on syslinux_version()->version_string.
Based on a prior patch by Sebastian Herbszt <herbszt at gmx.de>.

Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>


---
 com32/mboot/Makefile                              |    2 +-
 com32/mboot/mboot.c                               |    4 ++-
 com32/mboot/mboot.h                               |    6 ++++-
 com32/{lib/syslinux/config.c => mboot/syslinux.c} |   24 ++++++++++++--------
 4 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/com32/mboot/Makefile b/com32/mboot/Makefile
index c1ac76f..7e6c2e9 100644
--- a/com32/mboot/Makefile
+++ b/com32/mboot/Makefile
@@ -24,7 +24,7 @@ LNXLIBS	   = ../libutil/libutil_lnx.a
 MODULES	  = mboot.c32
 TESTFILES =
 
-OBJS = mboot.o map.o mem.o initvesa.o apm.o solaris.o
+OBJS = mboot.o map.o mem.o initvesa.o apm.o solaris.o syslinux.o
 
 all: $(MODULES) $(TESTFILES)
 
diff --git a/com32/mboot/mboot.c b/com32/mboot/mboot.c
index 8425e06..d008da0 100644
--- a/com32/mboot/mboot.c
+++ b/com32/mboot/mboot.c
@@ -1,7 +1,7 @@
 /* ----------------------------------------------------------------------- *
  *
  *   Copyright 2007-2008 H. Peter Anvin - All Rights Reserved
- *   Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ *   Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
  *
  *   Permission is hereby granted, free of charge, to any person
  *   obtaining a copy of this software and associated documentation
@@ -222,6 +222,8 @@ int main(int argc, char *argv[])
     /* Add auxilliary information */
     mboot_make_memmap();
     mboot_apm();
+    mboot_syslinux_info();
+
     if (opt.solaris)
 	mboot_solaris_dhcp_hack();
 
diff --git a/com32/mboot/mboot.h b/com32/mboot/mboot.h
index 993b31a..761ac87 100644
--- a/com32/mboot/mboot.h
+++ b/com32/mboot/mboot.h
@@ -1,7 +1,7 @@
 /* ----------------------------------------------------------------------- *
  *
  *   Copyright 2007-2008 H. Peter Anvin - All Rights Reserved
- *   Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ *   Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
  *
  *   Permission is hereby granted, free of charge, to any person
  *   obtaining a copy of this software and associated documentation
@@ -50,6 +50,7 @@
 #include <syslinux/loadfile.h>
 #include <syslinux/movebits.h>
 #include <syslinux/bootpm.h>
+#include <syslinux/config.h>
 
 #include "mb_header.h"
 #include "mb_info.h"
@@ -92,6 +93,9 @@ void mboot_apm(void);
 /* solaris.c */
 void mboot_solaris_dhcp_hack(void);
 
+/* syslinux.c */
+void mboot_syslinux_info(void);
+
 /* initvesa.c */
 void set_graphics_mode(const struct multiboot_header *mbh,
 		       struct multiboot_info *mbi);
diff --git a/com32/lib/syslinux/config.c b/com32/mboot/syslinux.c
similarity index 77%
copy from com32/lib/syslinux/config.c
copy to com32/mboot/syslinux.c
index b27aa82..7de3853 100644
--- a/com32/lib/syslinux/config.c
+++ b/com32/mboot/syslinux.c
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------- *
  *
- *   Copyright 2007-2008 H. Peter Anvin - All Rights Reserved
+ *   Copyright 2010 Intel Corporation; author: H. Peter Anvin
  *
  *   Permission is hereby granted, free of charge, to any person
  *   obtaining a copy of this software and associated documentation
@@ -25,17 +25,21 @@
  *
  * ----------------------------------------------------------------------- */
 
-#include <syslinux/config.h>
-#include <klibc/compiler.h>
-#include <com32.h>
+/*
+ * syslinux.c
+ *
+ * Syslinux-specific information for the kernel
+ */
 
-const char *__syslinux_config_file;
+#include <syslinux/config.h>
+#include "mboot.h"
 
-void __constructor __syslinux_get_config_file_name(void)
+void mboot_syslinux_info(void)
 {
-    static com32sys_t reg;
+    const struct syslinux_version *sv;
 
-    reg.eax.w[0] = 0x000e;
-    __intcall(0x22, &reg, &reg);
-    __syslinux_config_file = MK_PTR(reg.es, reg.ebx.w[0]);
+    sv = syslinux_version();
+    mbinfo.boot_loader_name = map_string(sv->version_string);
+    if (mbinfo.boot_loader_name)
+	mbinfo.flags |= MB_INFO_BOOT_LOADER_NAME;
 }



More information about the Syslinux-commits mailing list