&cpu_mode,
&pci_mode,
&vesa_mode,
+ &disk_mode,
+ &vpd_mode,
+ NULL,
};
/*
snprintf(hdt_cli.prompt, sizeof(hdt_cli.prompt), "%s> ",
CLI_DMI);
break;
-
+ case DISK_MODE:
+ detect_disks(hardware);
+ hdt_cli.mode = mode;
+ snprintf(hdt_cli.prompt, sizeof(hdt_cli.prompt), "%s> ",
+ CLI_DISK);
+ break;
+ case VPD_MODE:
+ detect_vpd(hardware);
+ if (!hardware->is_vpd_valid) {
+ printf("No valid VPD table found, exiting.\n");
+ break;
+ }
+ hdt_cli.mode = mode;
+ snprintf(hdt_cli.prompt, sizeof(hdt_cli.prompt), "%s> ",
+ CLI_VPD);
+ break;
default:
/* Invalid mode */
- more_printf("Unknown mode, please choose among:\n");
- for (i = 0; i < MAX_MODES; i++)
- more_printf("\t%s\n", list_modes[i]->name);
+ printf("Unknown mode, please choose among:\n");
+ while (list_modes[i]) {
+ printf("\t%s\n", list_modes[i]->name);
+ i++;
+ }
}
find_cli_mode_descr(hdt_cli.mode, ¤t_mode);
KERNEL_MODE,
SYSLINUX_MODE,
VESA_MODE,
+ DISK_MODE,
+ VPD_MODE,
} cli_mode_t;
#define PROMPT_SIZE 32
struct cli_mode_descr cpu_mode;
struct cli_mode_descr pci_mode;
struct cli_mode_descr vesa_mode;
+struct cli_mode_descr disk_mode;
+ struct cli_mode_descr vpd_mode;
/* cli helpers */
void find_cli_mode_descr(cli_mode_t mode, struct cli_mode_descr **mode_found);
#include "../lib/sys/vesa/vesa.h"
#include "hdt-common.h"
#include "lib-ansi.h"
+#include <disk/util.h>
+ /* ISOlinux requires a 8.3 format */
+ void convert_isolinux_filename(char *filename, struct s_hardware *hardware) {
+ /* Exit if we are not running ISOLINUX */
+ if (hardware->sv->filesystem != SYSLINUX_FS_ISOLINUX) return;
+ /* Searching the dot */
+ char *dot=strchr(filename,'.');
+ /* Exiting if not dot exists in that string */
+ if (dot==NULL) return;
+ /* Exiting if the extension is 3 char or less */
+ if (strlen(dot)<=4) return;
+
+ /* We have an extension bigger than .blah
+ * so we have to shorten it to 3*/
+ dot[4]='\0';
+ }
+
void detect_parameters(const int argc, const char *argv[],
struct s_hardware *hardware)
{
struct s_hardware {
s_dmi dmi; /* DMI table */
s_cpu cpu; /* CPU information */
+ s_vpd vpd; /* VPD information */
struct pci_domain *pci_domain; /* PCI Devices */
- struct diskinfo disk_info[256]; /* Disk Information */
+ struct driveinfo disk_info[256]; /* Disk Information */
int disks_count; /* Number of detected disks */
struct s_pxe pxe;
struct s_vesa vesa;