From 17202942967982adb3679bad68ea93538ba0d867 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Fri, 18 Mar 2011 21:49:38 +0100 Subject: hdt: Adding preliminary dump support This commit add the basics for doing a dump command. --- com32/hdt/hdt-common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'com32/hdt/hdt-common.h') diff --git a/com32/hdt/hdt-common.h b/com32/hdt/hdt-common.h index df7d2c98..c9923bfe 100644 --- a/com32/hdt/hdt-common.h +++ b/com32/hdt/hdt-common.h @@ -48,10 +48,11 @@ #include "cpuid.h" #include "dmi/dmi.h" #include "hdt-ata.h" -#include "../lib/sys/vesa/vesa.h" +#include #include #include #include +#include /* Declare a variable or data structure as unused. */ #define __unused __attribute__ (( unused )) @@ -80,6 +81,8 @@ #define MAX_CLI_LINES 20 #define MAX_VESA_CLI_LINES 24 +struct upload_backend *upload; + /* Defines if the cli is quiet*/ bool quiet; @@ -236,4 +239,5 @@ int detect_vesa(struct s_hardware *hardware); void detect_memory(struct s_hardware *hardware); void init_console(struct s_hardware *hardware); void detect_hardware(struct s_hardware *hardware); +void dump(struct s_hardware *hardware); #endif -- cgit v1.2.1 From 6826790fa50b948b1068e15269c64d4b4ee1c877 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Mon, 11 Apr 2011 21:10:11 +0200 Subject: hdt: Adding dump_mode & tftp_ip boot option dump_mode= give the user a chance to select a directory on the tftp server. tftp_ip= give the user a chance to select another tftp server for dumping data. By default, we use the tftp that serves the pxe booting. --- com32/hdt/hdt-common.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'com32/hdt/hdt-common.h') diff --git a/com32/hdt/hdt-common.h b/com32/hdt/hdt-common.h index c9923bfe..a84cbe7c 100644 --- a/com32/hdt/hdt-common.h +++ b/com32/hdt/hdt-common.h @@ -212,6 +212,8 @@ struct s_hardware { char modules_pcimap_path[255]; char modules_alias_path[255]; char pciids_path[255]; + char dump_path[255]; /* Dump path on the tftp server */ + char tftp_ip[255]; /* IP address of tftp server (dump mode) */ char memtest_label[255]; char auto_label[AUTO_COMMAND_SIZE]; char vesa_background[255]; -- cgit v1.2.1 From ef01e9deb12fbe3c6110bbb107adebc4e58e52a6 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Mon, 11 Apr 2011 22:02:52 +0200 Subject: 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 + 1 file changed, 1 insertion(+) (limited to 'com32/hdt/hdt-common.h') diff --git a/com32/hdt/hdt-common.h b/com32/hdt/hdt-common.h index a84cbe7c..3b638776 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 -- cgit v1.2.1 From dddbf87e6937b39ffc0986561298db7edfe5bd56 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Mon, 18 Apr 2011 22:37:15 +0200 Subject: hdt: Fixing automatic mode parsing Parsing of the auto='' mode was weak an non functionnal in many configuration like auto='dump' This is now fixed. --- com32/hdt/hdt-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'com32/hdt/hdt-common.h') diff --git a/com32/hdt/hdt-common.h b/com32/hdt/hdt-common.h index 3b638776..d37fcc8a 100644 --- a/com32/hdt/hdt-common.h +++ b/com32/hdt/hdt-common.h @@ -73,7 +73,7 @@ /* The char that separate two commands */ #define AUTO_SEPARATOR ";" /* The char that surround the list of commands */ -#define AUTO_DELIMITER "'" +#define AUTO_DELIMITER '\'' /* Graphic to load in background when using the vesa mode */ #define CLI_DEFAULT_BACKGROUND "backgnd.png" -- cgit v1.2.1 From 034b600107a72f30eef95ea9d7a62c25ff00f565 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Thu, 28 Apr 2011 20:26:24 +0200 Subject: hdt: Adding dump_filename= option This option allow the user to redefine the way filename is made-of. By default that's "mac_address+dmi_vendor_name+dmi_product_name" This can be overidded by the following syntax: dump_filename=your_filename Note that it's mandatory not to add "" or '' around your_filename. your_filename could be a regular filename but can also includes %{} directives as defined by : %{m} = mac address %{v} = vendor name of the machine %{p} = product name of the machine %{ba} = Asset tag of the base board %{bs} = Serial number of the base board %{ca} = Asset tag of the chassis %{cs} = Serial number of the chassis %{sk} = SKU number of the system %{ss} = Serial number of the system Here come a possible command line : APPEND nomenu auto='dump;' dump_path=hdt2 tftp_ip=192.168.1.254 dump_filename=%{m}+%{bs}+%{ba}+%{cs}+%{ca}+%{sk}+%{ss}+%{p}+%{v} --- com32/hdt/hdt-common.h | 1 + 1 file changed, 1 insertion(+) (limited to 'com32/hdt/hdt-common.h') diff --git a/com32/hdt/hdt-common.h b/com32/hdt/hdt-common.h index d37fcc8a..f007e72f 100644 --- a/com32/hdt/hdt-common.h +++ b/com32/hdt/hdt-common.h @@ -214,6 +214,7 @@ struct s_hardware { char modules_alias_path[255]; char pciids_path[255]; char dump_path[255]; /* Dump path on the tftp server */ + char dump_filename[255]; /* Dump filename on the tftp server */ char tftp_ip[255]; /* IP address of tftp server (dump mode) */ char memtest_label[255]; char auto_label[AUTO_COMMAND_SIZE]; -- cgit v1.2.1 From c0c25b4826950162517896c5039c6d62d07115be Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Sat, 17 Dec 2011 22:27:07 +0100 Subject: hdt: Adding postexec= option When HDT is exiting, you might need executing something else. This could be used in the following scenario : You start HDT, do an automatic command like 'dump; exit', but then after you might need to launch something else from syslinux. The postexec option will allow you to define what label you'd love running one HDT got terminated. Syntaxt is like the following: postexec='menu_label_to_run_once_hdt_got_exited' Note the quotes (') after the equal sign (=) This could looks like : APPEND auto='dump; exit' postexec='memtest' --- com32/hdt/hdt-common.h | 1 + 1 file changed, 1 insertion(+) (limited to 'com32/hdt/hdt-common.h') diff --git a/com32/hdt/hdt-common.h b/com32/hdt/hdt-common.h index f007e72f..8c85260b 100644 --- a/com32/hdt/hdt-common.h +++ b/com32/hdt/hdt-common.h @@ -219,6 +219,7 @@ struct s_hardware { char memtest_label[255]; char auto_label[AUTO_COMMAND_SIZE]; char vesa_background[255]; + char postexec[255]; }; void reset_more_printf(void); -- cgit v1.2.1 From c01a7e8a7c5cfb9967142343c2460116f03c08bd Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Mon, 10 Sep 2012 21:02:02 +0200 Subject: hdt: Adding Silent mode By using the "silent" option at the cmdline, HDT tries not displaying any boring message. This is particulary interesting with the "display" option. --- com32/hdt/hdt-common.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'com32/hdt/hdt-common.h') diff --git a/com32/hdt/hdt-common.h b/com32/hdt/hdt-common.h index 8c85260b..c2299b48 100644 --- a/com32/hdt/hdt-common.h +++ b/com32/hdt/hdt-common.h @@ -87,6 +87,9 @@ struct upload_backend *upload; /* Defines if the cli is quiet*/ bool quiet; +/* Defines if the cli is totally silent*/ +bool silent; + /* Defines if we must use the vesa mode */ bool vesamode; @@ -114,16 +117,18 @@ extern bool disable_more_printf; * one \n (and only one) */ #define more_printf(...) do {\ - if (__likely(!disable_more_printf)) {\ - if (display_line_nb == max_console_lines) {\ - display_line_nb=0;\ - printf("\n--More--");\ - get_key(stdin, 0);\ - printf("\033[2K\033[1G\033[1F");\ + if (__likely(!silent)) {\ + if (__likely(!disable_more_printf)) {\ + if (display_line_nb == max_console_lines) {\ + display_line_nb=0;\ + printf("\n--More--");\ + get_key(stdin, 0);\ + printf("\033[2K\033[1G\033[1F");\ + }\ + display_line_nb++;\ }\ - display_line_nb++;\ + printf(__VA_ARGS__);\ }\ - printf(__VA_ARGS__);\ } while (0); /* Display CPU registers for debugging purposes */ -- cgit v1.2.1