[syslinux:master] hdt: Adding VPD to dump feature

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


Commit-ID:  f872017d2e677214f67bd85457999c4c3da26dcd
Gitweb:     http://syslinux.zytor.com/commit/f872017d2e677214f67bd85457999c4c3da26dcd
Author:     Erwan Velu <erwanaliasr1 at gmail.com>
AuthorDate: Wed, 23 Mar 2011 21:02:51 +0100
Committer:  Erwan Velu <erwanaliasr1 at gmail.com>
CommitDate: Wed, 23 Mar 2011 21:02:51 +0100

hdt: Adding VPD to dump feature



---
 com32/hdt/{hdt-dump-syslinux.c => hdt-dump-vpd.c} |   23 ++++++++++++--------
 com32/hdt/hdt-dump.c                              |    1 +
 com32/hdt/hdt-dump.h                              |    2 +
 3 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/com32/hdt/hdt-dump-syslinux.c b/com32/hdt/hdt-dump-vpd.c
similarity index 74%
copy from com32/hdt/hdt-dump-syslinux.c
copy to com32/hdt/hdt-dump-vpd.c
index 843ebaf..9e4a78e 100644
--- a/com32/hdt/hdt-dump-syslinux.c
+++ b/com32/hdt/hdt-dump-vpd.c
@@ -28,15 +28,20 @@
 
 #include "hdt-common.h"
 #include "hdt-dump.h"
-#include <syslinux/config.h>
 
-void dump_syslinux(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item) {
+void dump_vpd(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item) {
 
-        *item = zzjson_create_object(config, NULL); /* empty object */
-	add_hs(syslinux_fs);
-	add_hs(sv->version_string);
-	add_hi(sv->version);
-	add_hi(sv->max_api);
-	add_hs(sv->copyright_string);
-	flush("syslinux",config,item);
+        
+	*item = zzjson_create_object(config, NULL); /* empty object */
+	add_hb(is_vpd_valid);
+    	if (hardware->is_vpd_valid) {
+		add_hs(vpd.bios_build_id);
+		add_hs(vpd.bios_release_date);
+		add_hs(vpd.bios_version);
+		add_hs(vpd.default_flash_filename);
+		add_hs(vpd.box_serial_number);
+		add_hs(vpd.motherboard_serial_number);
+		add_hs(vpd.machine_type_model);
+	}
+	flush("vpd",config,item);
 }
diff --git a/com32/hdt/hdt-dump.c b/com32/hdt/hdt-dump.c
index 429902d..55ef907 100644
--- a/com32/hdt/hdt-dump.c
+++ b/com32/hdt/hdt-dump.c
@@ -117,6 +117,7 @@ void dump(struct s_hardware *hardware)
     dump_cpu(hardware, &config, &json);
     dump_pxe(hardware, &config, &json);
     dump_syslinux(hardware, &config, &json);
+    dump_vpd(hardware, &config, &json);
 
     /* We close & flush the file to send */
     cpio_close(upload);
diff --git a/com32/hdt/hdt-dump.h b/com32/hdt/hdt-dump.h
index 0f1f817..8a2e410 100644
--- a/com32/hdt/hdt-dump.h
+++ b/com32/hdt/hdt-dump.h
@@ -41,6 +41,7 @@
 #define add_hi(value) add_i(#value,hardware->value)
 #define add_hs(value) add_s(#value,(char *)hardware->value)
 #define add_b(name,value) if (value==true) {add_bool_true((char *)name);} else {add_bool_false((char *)name);}
+#define add_hb(value) add_b(#value,hardware->value)
 
 extern struct print_buf p_buf;
 
@@ -51,3 +52,4 @@ void flush (char *filename, ZZJSON_CONFIG *config, ZZJSON ** item);
 void dump_cpu(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item);
 void dump_pxe(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item);
 void dump_syslinux(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item);
+void dump_vpd(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item);



More information about the Syslinux-commits mailing list