summaryrefslogtreecommitdiff
path: root/com32/hdt/hdt-common.c
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-11-04 22:58:09 -0800
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-11-04 22:58:09 -0800
commita0d6887d5f04118069705e3d18bc55b04027ffc4 (patch)
tree4b2342dc3d13af60adcf91a1bf34ef33c3428107 /com32/hdt/hdt-common.c
parent2b733a8ab4386ec7374dc45dc9b11a54f4200b02 (diff)
downloadsyslinux-a0d6887d5f04118069705e3d18bc55b04027ffc4.tar.gz
hdt: add debug option
Pass 'debug' on the kernel command line for the output to be more verbose. Making hdt quiet is really helpful in auto mode, when a lot of information is flowing. This fixes #21. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Diffstat (limited to 'com32/hdt/hdt-common.c')
-rw-r--r--com32/hdt/hdt-common.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/com32/hdt/hdt-common.c b/com32/hdt/hdt-common.c
index 509aac70..c5433e2f 100644
--- a/com32/hdt/hdt-common.c
+++ b/com32/hdt/hdt-common.c
@@ -55,8 +55,13 @@ void convert_isolinux_filename(char *filename, struct s_hardware *hardware) {
void detect_parameters(const int argc, const char *argv[],
struct s_hardware *hardware)
{
+ /* Debug mode - make the output more verbose */
+ debug = false;
+
for (int i = 1; i < argc; i++) {
- if (!strncmp(argv[i], "modules_pcimap=", 15)) {
+ if (!strncmp(argv[i], "debug", 5)) {
+ debug = true;
+ } else if (!strncmp(argv[i], "modules_pcimap=", 15)) {
strncpy(hardware->modules_pcimap_path, argv[i] + 15,
sizeof(hardware->modules_pcimap_path));
convert_isolinux_filename(hardware->modules_pcimap_path,hardware);
@@ -478,19 +483,23 @@ void detect_pci(struct s_hardware *hardware)
hardware->nb_pci_devices++;
}
- printf("PCI: %d devices detected\n", hardware->nb_pci_devices);
- printf("PCI: Resolving names\n");
+ if (debug) {
+ more_printf("PCI: %d devices detected\n", hardware->nb_pci_devices);
+ more_printf("PCI: Resolving names\n");
+ }
/* Assigning product & vendor name for each device */
hardware->pci_ids_return_code =
get_name_from_pci_ids(hardware->pci_domain, hardware->pciids_path);
- printf("PCI: Resolving class names\n");
+ if (debug)
+ more_printf("PCI: Resolving class names\n");
/* Assigning class name for each device */
hardware->pci_ids_return_code =
get_class_name_from_pci_ids(hardware->pci_domain,
hardware->pciids_path);
- printf("PCI: Resolving module names\n");
+ if (debug)
+ more_printf("PCI: Resolving module names\n");
/* Detecting which kernel module should match each device using modules.pcimap*/
hardware->modules_pcimap_return_code =
get_module_name_from_pcimap(hardware->pci_domain,