hdt: Bump version 0.2.1
authorErwan Velu <erwan.velu@free.fr>
Sun, 1 Mar 2009 10:15:59 +0000 (11:15 +0100)
committerErwan Velu <erwan.velu@free.fr>
Sun, 1 Mar 2009 10:15:59 +0000 (11:15 +0100)
Adding pxe menu in menu mode

com32/hdt/Makefile
com32/hdt/hdt-cli-dmi.c
com32/hdt/hdt-cli-kernel.c
com32/hdt/hdt-menu-pxe.c [new file with mode: 0644]
com32/hdt/hdt-menu.c
com32/hdt/hdt-menu.h
com32/hdt/hdt.h

index 15044d4..a8f87c9 100644 (file)
@@ -44,6 +44,7 @@ all:  hdt.c32 $(LIB)
 hdt.elf: hdt.o hdt-ata.o hdt-menu.o hdt-menu-pci.o hdt-menu-kernel.o \
         hdt-menu-disk.o hdt-menu-dmi.o hdt-menu-processor.o hdt-menu-syslinux.o hdt-menu-about.o \
         hdt-cli.o hdt-common.o hdt-cli-pci.o hdt-cli-dmi.o hdt-cli-cpu.o hdt-cli-pxe.o hdt-cli-kernel.o\
+        hdt-menu-pxe.o\
        $(com32)/modules/cpuid.o $(com32)/modules/dmi.o $(topdir)/menu/libmenu/libmenu.a $(LIB) $(C_LIBS)
        $(LD) $(LDFLAGS) -o $@ $^
 
index b3c486d..3981a8d 100644 (file)
@@ -271,7 +271,7 @@ void show_dmi_cpu(struct s_hardware *hardware) {
  more_printf(" Cpu Model          : %u\n",hardware->dmi.processor.signature.model);
  more_printf(" Cpu Stepping       : %u\n",hardware->dmi.processor.signature.stepping);
  more_printf(" Cpu Minor Stepping : %u\n",hardware->dmi.processor.signature.minor_stepping);
- //more_printf(" Voltage      %f\n",hardware->dmi.processor.voltage);
+// more_printf(" Voltage            : %f\n",hardware->dmi.processor.voltage);
  more_printf(" Status             : %s\n",hardware->dmi.processor.status);
  more_printf(" Upgrade            : %s\n",hardware->dmi.processor.upgrade);
  more_printf(" Cache L1 Handle    : %s\n",hardware->dmi.processor.cache1);
index 0485ca0..62ca537 100644 (file)
@@ -32,7 +32,6 @@
 #include <string.h>
 #include <stdlib.h>
 #include <errno.h>
-#include <syslinux/pxe.h>
 
 void main_show_kernel(struct s_hardware *hardware,struct s_cli_mode *cli_mode) {
  char buffer[1024];
diff --git a/com32/hdt/hdt-menu-pxe.c b/com32/hdt/hdt-menu-pxe.c
new file mode 100644 (file)
index 0000000..5ab3d8b
--- /dev/null
@@ -0,0 +1,99 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2009 Erwan Velu - All Rights Reserved
+ *
+ *   Permission is hereby granted, free of charge, to any person
+ *   obtaining a copy of this software and associated documentation
+ *   files (the "Software"), to deal in the Software without
+ *   restriction, including without limitation the rights to use,
+ *   copy, modify, merge, publish, distribute, sublicense, and/or
+ *   sell copies of the Software, and to permit persons to whom
+ *   the Software is furnished to do so, subject to the following
+ *   conditions:
+ *
+ *   The above copyright notice and this permission notice shall
+ *   be included in all copies or substantial portions of the Software.
+ *
+ *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *   OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * -----------------------------------------------------------------------
+*/
+
+#include "hdt-menu.h"
+
+/* Main Kernel Menu*/
+void compute_PXE(struct s_my_menu  *menu,struct s_hardware *hardware) {
+ char buffer[SUBMENULEN+1];
+ char infobar[STATLEN+1];
+
+ if (hardware->is_pxe_valid==false) return;
+
+ menu->menu = add_menu(" PXE ",-1);
+ menu->items_count=0;
+ set_menu_pos(SUBMENU_Y,SUBMENU_X);
+
+ struct s_pxe *p = &hardware->pxe;
+
+ if (hardware->pci_ids_return_code == -ENOPCIIDS) {
+   snprintf(buffer,sizeof buffer,  "PCI Vendor    : %d",p->vendor_id);
+   snprintf(infobar,sizeof infobar,"PCI Vendor    : %d",p->vendor_id);
+   add_item(buffer,infobar,OPT_INACTIVE,NULL,0);
+   menu->items_count++;
+
+   snprintf(buffer,sizeof buffer,  "PCI Product   : %d",p->vendor_id);
+   snprintf(infobar,sizeof infobar,"PCI Product   : %d",p->vendor_id);
+   add_item(buffer,infobar,OPT_INACTIVE,NULL,0);
+   menu->items_count++;
+
+   snprintf(buffer,sizeof buffer,  "PCI SubVendor  : %d",p->subvendor_id);
+   snprintf(infobar,sizeof infobar,"PCI SubVendor  : %d",p->subvendor_id);
+   add_item(buffer,infobar,OPT_INACTIVE,NULL,0);
+   menu->items_count++;
+
+   snprintf(buffer,sizeof buffer,  "PCI SubProduct : %d",p->subproduct_id);
+   snprintf(infobar,sizeof infobar,"PCI SubProduct : %d",p->subproduct_id);
+   add_item(buffer,infobar,OPT_INACTIVE,NULL,0);
+   menu->items_count++;
+
+   snprintf(buffer,sizeof buffer,  "PCI Revision   : %d",p->rev);
+   snprintf(infobar,sizeof infobar,"PCI Revision   : %d",p->rev);
+   add_item(buffer,infobar,OPT_INACTIVE,NULL,0);
+   menu->items_count++;
+
+   snprintf(buffer,sizeof buffer,  "PCI Bus Pos.   : %02x:%02x.%02x",p->pci_bus,p->pci_dev, p->pci_func);
+   snprintf(infobar,sizeof infobar,"PCI Bus Pos.   : %02x:%02x.%02x",p->pci_bus,p->pci_dev, p->pci_func);
+   add_item(buffer,infobar,OPT_INACTIVE,NULL,0);
+   menu->items_count++;
+
+ } else {
+
+   snprintf(buffer,sizeof buffer,  "Manufacturer : %s", p->pci_device->dev_info->vendor_name);
+   snprintf(infobar,sizeof infobar,"Manufacturer : %s", p->pci_device->dev_info->vendor_name);
+   add_item(buffer,infobar,OPT_INACTIVE,NULL,0);
+   menu->items_count++;
+
+   snprintf(buffer,sizeof buffer,  "Product      : %s", p->pci_device->dev_info->product_name);
+   snprintf(infobar,sizeof infobar,"Product      : %s", p->pci_device->dev_info->product_name);
+   add_item(buffer,infobar,OPT_INACTIVE,NULL,0);
+   menu->items_count++;
+ }
+
+ snprintf(buffer,sizeof buffer,  "MAC Address  : %s", p->mac_addr);
+ snprintf(infobar,sizeof infobar, "MAC Address  : %s", p->mac_addr);
+ add_item(buffer,infobar,OPT_INACTIVE,NULL,0);
+ menu->items_count++;
+
+ snprintf(buffer,sizeof buffer,  "IP Address   : %d.%d.%d.%d", p->ip_addr[0], p->ip_addr[1], p->ip_addr[2], p->ip_addr[3]);
+ snprintf(infobar,sizeof infobar, "IP Address   : %d.%d.%d.%d", p->ip_addr[0], p->ip_addr[1], p->ip_addr[2], p->ip_addr[3]);
+ add_item(buffer,infobar,OPT_INACTIVE,NULL,0);
+ menu->items_count++;
+
+ printf("MENU: PXE menu done (%d items)\n",menu->items_count);
+}
index 6512900..0c5bfe5 100644 (file)
@@ -140,6 +140,7 @@ void compute_submenus(struct s_hdt_menu *hdt_menu, struct s_hardware *hardware)
   compute_disks(hdt_menu,hardware->disk_info);
 #ifdef WITH_PCI
   compute_PCI(hdt_menu,hardware);
+  compute_PXE(&(hdt_menu->pxe_menu),hardware);
   compute_kernel(&(hdt_menu->kernel_menu),hardware);
 #endif
   compute_syslinuxmenu(&(hdt_menu->syslinux_menu));
@@ -205,9 +206,15 @@ if (hardware->is_dmi_valid) {
 }
   add_item("","",OPT_SEP,"",0);
 #ifdef WITH_PCI
-  add_item("<K>ernel Modules","Kernel Modules Menu",OPT_SUBMENU,NULL,hdt_menu->kernel_menu.menu);
-  hdt_menu->main_menu.items_count++;
+  if (hardware->modules_pcimap_return_code != -ENOMODULESPCIMAP) {
+   add_item("<K>ernel Modules","Kernel Modules Menu",OPT_SUBMENU,NULL,hdt_menu->kernel_menu.menu);
+   hdt_menu->main_menu.items_count++;
+  }
 #endif
+  if (hardware->is_pxe_valid == true) {
+   add_item("P<X>E","PXE Information Menu",OPT_SUBMENU,NULL,hdt_menu->pxe_menu.menu);
+   hdt_menu->main_menu.items_count++;
+  }
   add_item("<S>yslinux","Syslinux Information Menu",OPT_SUBMENU,NULL,hdt_menu->syslinux_menu.menu);
   hdt_menu->main_menu.items_count++;
   add_item("S<w>itch to CLI","Switch to Command Line",OPT_RUN,HDT_SWITCH_TO_CLI,0);
index 9c61459..725da45 100644 (file)
@@ -70,6 +70,7 @@ struct s_hdt_menu {
        struct s_my_menu battery_menu;
        struct s_my_menu syslinux_menu;
        struct s_my_menu about_menu;
+       struct s_my_menu pxe_menu;
        int total_menu_count; // sum of all menus we have
 };
 
@@ -105,6 +106,9 @@ void compute_syslinuxmenu(struct s_my_menu *menu);
 // About menu
 void compute_aboutmenu(struct s_my_menu *menu);
 
+//PXE menu
+void compute_PXE(struct s_my_menu  *menu,struct s_hardware *hardware);
+
 int start_menu_mode(struct s_hardware *hardware, char *version_string);
 void setup_menu(char *version);
 void compute_main_menu(struct s_hdt_menu *hdt_menu, struct s_hardware *hardware);
index a9436b1..ba847d5 100644 (file)
@@ -32,7 +32,7 @@
 #define PRODUCT_NAME "Hardware Detection Tool"
 #define AUTHOR "Erwan Velu"
 #define CONTACT "erwan(dot)velu(point)free(dot)fr"
-#define VERSION "0.2.0"
+#define VERSION "0.2.1"
 
 #define ATTR_PACKED __attribute__((packed))