[syslinux:master] hdt: Adding dump entry in the menu

syslinux-bot for Erwan Velu erwanaliasr1 at gmail.com
Mon Apr 25 15:28:57 PDT 2011


Commit-ID:  ef01e9deb12fbe3c6110bbb107adebc4e58e52a6
Gitweb:     http://syslinux.zytor.com/commit/ef01e9deb12fbe3c6110bbb107adebc4e58e52a6
Author:     Erwan Velu <erwanaliasr1 at gmail.com>
AuthorDate: Mon, 11 Apr 2011 22:02:52 +0200
Committer:  Erwan Velu <erwanaliasr1 at gmail.com>
CommitDate: Mon, 11 Apr 2011 22:02:52 +0200

hdt: Adding dump entry in the menu

If the PXE is enabled, let's show a dump menu at the main menu.


---
 com32/hdt/hdt-common.h |    1 +
 com32/hdt/hdt-dump.h   |    1 +
 com32/hdt/hdt-menu.c   |   12 ++++++++++++
 3 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/com32/hdt/hdt-common.h b/com32/hdt/hdt-common.h
index a84cbe7..3b63877 100644
--- a/com32/hdt/hdt-common.h
+++ b/com32/hdt/hdt-common.h
@@ -59,6 +59,7 @@
 
 /* This two values are used for switching for the menu to the CLI mode */
 #define HDT_SWITCH_TO_CLI "hdt_switch_to_cli"
+#define HDT_DUMP "hdt_dump"
 #define HDT_RETURN_TO_CLI 100
 #define MAX_VESA_MODES 255
 
diff --git a/com32/hdt/hdt-dump.h b/com32/hdt/hdt-dump.h
index 5ae8c65..f9669da 100644
--- a/com32/hdt/hdt-dump.h
+++ b/com32/hdt/hdt-dump.h
@@ -82,3 +82,4 @@ void dump_pci(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item)
 void dump_acpi(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item);
 void dump_kernel(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item);
 void dump_hdt(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item);
+void dump(struct s_hardware *hardware);
diff --git a/com32/hdt/hdt-menu.c b/com32/hdt/hdt-menu.c
index 0fdee03..50b3eaa 100644
--- a/com32/hdt/hdt-menu.c
+++ b/com32/hdt/hdt-menu.c
@@ -62,6 +62,12 @@ int start_menu_mode(struct s_hardware *hardware, char *version_string)
 		(curr->data, HDT_SWITCH_TO_CLI, sizeof(HDT_SWITCH_TO_CLI))) {
 		return HDT_RETURN_TO_CLI;
 	    }
+	    /* Tweak, we want to start the dump mode */
+	    if (!strncmp
+		(curr->data, HDT_DUMP, sizeof(HDT_DUMP))) {
+		    dump(hardware);
+	        return 0;
+	    }
 	    if (!strncmp
 		(curr->data, HDT_REBOOT, sizeof(HDT_REBOOT))) {
 		syslinux_reboot(1);
@@ -289,6 +295,12 @@ void compute_main_menu(struct s_hdt_menu *hdt_menu, struct s_hardware *hardware)
 
     add_item("S<w>itch to CLI", "Switch to Command Line", OPT_RUN,
 	     HDT_SWITCH_TO_CLI, 0);
+
+    if (hardware->is_pxe_valid == true) {
+    add_item("<D>ump to tftp", "Dump to tftp", OPT_RUN,
+	     HDT_DUMP, 0);
+    }
+
     add_item("<A>bout", "About Menu", OPT_SUBMENU, NULL,
 	     hdt_menu->about_menu.menu);
     add_item("<R>eboot", "Reboot", OPT_RUN, HDT_REBOOT, 0);



More information about the Syslinux-commits mailing list